Repository navigation
Show US version 2 staging runs' reform validation - #326
Merged
Merged
Conversation
… reform validation A US fiscal refresh build's staging run as the version 2 writer stages it (PolicyEngine/microcosm#1135): version 3 documents and result files under artifacts/, each declared in the run manifest with its SHA-256. The list entry, detail and calibration tests pass already; the two reform validation tests fail: the dashboard reads reform_validation.json only at the run folder's top level, so a version 2 run shows none from artifacts/reform_validation.json and shows a top-level copy it never wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A version 2 or 3 staging run writes its reform validation as artifacts/reform_validation.json and declares it, with its SHA-256, in its run manifest (PolicyEngine/microcosm#1135). The Candidate tab now reads that copy for such a run, and shows it only when the run manifest declares a reform_validation artifact with the copy's digest. A version 1 run's reform validation is still its top-level reform_validation.json, which a version 2 or 3 run never reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anth-volk
added a commit
to PolicyEngine/microcosm-collector
that referenced
this pull request
Nov 26, 2026
The collector copies the files the dashboard reads by their path in the run folder, and copies reform_validation.json only from the top level. Microcosm's version 2 writer puts it at artifacts/reform_validation.json. The new tests: the reconcile command copies a US version 2 run's artifacts/reform_validation.json; the package's publish command accepts that name and loadCopiedStagingRun returns it; a declared copy whose digest differs from its declaration reads as absent, in the copied-run reader and in the Hugging Face reader, as the dashboard's reader takes it (PolicyEngine/calibration-diagnostics#326). Two of them already pass and fix behaviour that must stay: an index naming files a reader does not know is still read without them, which lets the dashboard's 0.1.5 read the new index, and the Hugging Face reader's digest check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 1: a version 2 run whose copies hold progress but no run manifest shows no reform validation, and the calibration and Build progress readers, which read shorter document lists, never read the run's reform validation copy. Both pass on the change; they add coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 1: the artifacts/ path of the run's reform validation is built from its logical name in one place, and the reader's comment says a version 2 or 3 run's declared copy is what the package's 0.1.5 Hugging Face reader does not read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 2: the collector records a run whose run manifest copy isn't a JSON object as a problem with no version in its summary, while its progress and events are still version 3. The reader takes the version from the summary, so it shows such a run's top-level reform_validation.json, which no version 2 or 3 run writes. The test fails on that assertion. The fake store can now set summary fields apart from the run's documents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 2: a run whose index summary records no version but whose documents are version 2 or 3 shows no top-level reform_validation.json, which no version 2 or 3 run writes. The module header now says where it differs from the package's 0.1.5 Hugging Face reader, and the US version 2 fixture's header says what it leaves out of what the writer stages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added a commit
to PolicyEngine/microcosm-collector
that referenced
this pull request
Nov 27, 2026
A low-priority bug: a run with no readable run manifest is taken as schema 1 whatever its progress says, so a run whose progress is version 2 or 3 still takes its top-level build and release manifests and reform validation, in the tree build and the package's readers, where the dashboard's reader (PolicyEngine/calibration-diagnostics#326) takes none. Also from the review: a schema-1 run's parent build manifest reaching the worker is tested again (the replaced staged-dataset test was the only staging test of it), and the step that stores missing copies is tested in a dry run on a version 2 run's undeclared top-level files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 27, 2026 15:08
This was referenced Nov 27, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #325. Tracker task 5a · 7 of "1. Collector/Emitter".
Why
US fiscal refresh builds move to the version 2 staging writer in PolicyEngine/microcosm#1135 (tracker task 5a · 8, draft PolicyEngine/microcosm#1771). Version 2 writes a run's result files under
runs/<run_id>/artifacts/and declares each one in the run manifest with its SHA-256. A US version 2 run declaresreform_validation(kindvalidation_summary) atartifacts/reform_validation.json, andbuild_manifest,release_manifestandcalibration_diagnosticsunderartifacts/as well. The Candidate tab readreform_validation.jsononly at the run folder's top level, so a US version 2 run would show no reform validation.What changes
copiedRunDocuments(frontend/lib/microcosm/stored-staging.ts) picks the reform validation copy by the run's document version:reform_validation.json, as before.artifacts/reform_validation.json. It is shown only when the run manifest declares areform_validationartifact at that path, and only when the declared SHA-256 equals the copy's. The same rule already applies to a staged bundle's receipt.reform_validation.json. That includes a run whose summary records no version or version 1 while its parsed documents are version 2 or 3. Such a run's top-level copy is read and then not shown.docs/calibration-tree-artifacts.mdsays the same.Nothing else changes for a US version 2 run:
artifacts/.Not yet in this PR
@policyengine/calibration-tree0.1.5 doesn't nameartifacts/reform_validation.jsonamong the copied files (StagingRunFileName), sostored-staging.tswidens the type locally (CopiedFileName), and the test store does the same (FakeStagingRunFileName). Once 5a · 6 publishes its new version, this PR raises the pin and drops both.Decisions
Anthony, 2026-11-27: "The naming conventions for US version 2 runs should be the same as the UK". This settles both questions:
artifacts/staged_dataset.json; this run's copy isartifacts/reform_validation.json. It is shown only when the run manifest declares it with a matching digest, as the UK staged bundle receipt is. This PR implements that.Tests
frontend/app/api/microcosm/us-version-2-staging-run.test.tsruns the Staging routes' own handlers against the fake collector store with a US version 2 run built as the version 2 writer builds it (frontend/lib/microcosm/test-support/us-version-2-staging-run.ts: version 3 documents, declared artifacts with their digests). It covers:artifacts/reform_validation.json;Red-green:
7f88991adds the tests. Run by file, the four for the list entry, detail, calibration and version 1 run passed againstmain's code. The two reform validation tests failed on assertions: no reform validation fromartifacts/, and a top-level copy shown for a version 2 run.1740603makes them pass.tsc --noEmitpasses.f433b9aadds two tests from review round 1, which pass on the change: a version 2 run with progress but no run manifest copy shows no reform validation; the calibration and Build progress readers never read the reform validation copy.f261b36names the declared path once and notes, in the reader's comment, where it differs from the package's 0.1.5 Hugging Face reader.b511888adds a failing test from review round 2. A run whose index summary records no version, but whose documents are version 3, showed a top-levelreform_validation.json. The collector records a run whose run manifest copy isn't a JSON object that way. Run by name, it failed on its assertion.2ccc14fmakes it pass: the version comes from the run's documents as well as the summary. It also corrects the module and fixture header comments.The calibration test's stored tree holds copies of the run's build and release manifests, as the collector will make them once 5a · 6 is deployed. 5a · 6's completed state includes building a version 2 run's tree from
artifacts/build_manifest.jsonandartifacts/release_manifest.json. Until then, the collector builds a version 2 run's tree without them.Review
calibration-diagnostics-326-review-round1-2026-11-26.md, at1740603): 0 high, 1 medium, 0 low.maindoesn't make for a version 2 run. No change here: 5a · 6's completed state covers building the tree from theartifacts/manifests, and the test describes the collector after that change, as noted above.f433b9a), the doubled path and the reader's comment (f261b36).calibration-diagnostics-326-review-round2-2026-11-27.md, atf261b36): 0 high, 0 medium, 1 low.b511888and2ccc14f.artifacts/reform_validation.jsonchanges nothing here.calibration-diagnostics-326-review-round3-2026-11-27.md, at2ccc14f): no bugs (0 high, 0 medium, 0 low).b511888(8 pass, 1 fail) and2ccc14f(9 pass).Bugs left: none.
What the merge waits for
done: the collector change deployed and its new@policyengine/calibration-treeversion on npm, pinned here. The live dashboard keeps reading the collector's index on 0.1.5 only while 5a · 6 keeps the index at schema version 1.🤖 Generated with Claude Code