Assemble the certified UK national candidate into a publishable release (#806) - #812
Assemble the certified UK national candidate into a publishable release (#806)#812juaristi22 wants to merge 4 commits into
Conversation
72836c8 to
aac61f6
Compare
|
Automated review pass (Claude Code, high effort, diff only — no execution). Draft, so nits are skipped. Four findings, and three of them are the publication gate failing open rather than closed — which matters more here than anywhere else in the lane, since this is the step where an artifact stops being a candidate and starts being something people use. 1.
|
…ring Vahid's #812 review, findings 2-4 (finding 1 is answered on the PR: the id-keyed required-files rule landed in #793 and refuses both omissions by name). A present-but-non-string artifact revision now fails the contract instead of sliding past the isinstance guard, and the publish guards no longer go vacuous on an empty revision set: unreadable pins refuse naming the artifacts, an empty set refuses outright, and the create-tag and uniformity requirements apply unconditionally. The national per-cut revision suffix is validated against the same <YYYYMMDDTHHMMSSZ>-<uuid8> grammar the assembler mints, on both sides: the contract rejects hand-edited suffixes and the --cut-tag override may re-tag a cut but never leave the grammar. The assembler refuses to write the calibration NPZ when the candidate and spine household axes are misaligned - equal ids in equal order, checked before the pairing is digested. A digest over mis-paired bytes authenticates the bytes, not the pairing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Review round addressed in ba2d73d. Dispositions: 1. Id-keyed required-files rule — no change needed; the rule already exists. 2. Empty/unreadable revision sets — fixed, both layers. The contract now fails a present-but-non-string revision instead of letting it slide past the 3. Revision suffix grammar — fixed, both sides. The contract validates the national suffix against the same 4. NPZ pairing — fixed. The assembler asserts equal household counts and identical Verification: assembler suite 9/9, contract + release suites green (incl. 4 new revision cases and 2 new publish refusals), certification/pins/seam-driver suites green, ruff clean. |
…se (#806) The release-cut certification decided shippability but nothing packaged it: no UK tool wrote the two release manifests, the constant national id escaped the contract's UK-keyed checks, and the id ruling collided with the tag-equals-release-id revision scheme. This closes all three for the inspect lane (publication stays --no-latest until the loader/pointer follow-up). tools/assemble_uk_release_dir.py verifies the certification's closed identity join against the measured bytes before writing anything, mints the calibration weight NPZ (household_weight + initial_household_weight, the warm-start shape), writes build_manifest.json and release_manifest.json with uniform per-cut artifact revisions, copies the signed evidence byte-for-byte, validates its own output, and prints the exact publish command. The contract now applies the UK diagnostics block and the policyengine-uk model pin to microcosm-uk-2024-25-national (the June legacy release keeps its exclusion) and accepts that id's per-cut artifact revisions (release-id-prefixed, non-empty suffix). publish_release's tag guards generalize from release-id-pinned revisions to any pinned revisions: a tag must be created and every declared revision must equal the tag being created, so a forgotten --tag-name or a typo refuses instead of publishing dangling revision pins. The green-certification test machinery moves to a shared fixture module used by the certification and assembler suites. The runbook documents the calibrate -> certify -> assemble -> inspect-publish sequence, the stranded release-staging branch recovery, and why promotion waits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The wheels lane runs the suite from installed wheels in a clean venv without pytables, and the assembler fixture writes UK national frames through pandas HDF. Guard the fixture with the same importorskip the UK national-frame tests use, so the wheels battery skips instead of erroring six times. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ring Vahid's #812 review, findings 2-4 (finding 1 is answered on the PR: the id-keyed required-files rule landed in #793 and refuses both omissions by name). A present-but-non-string artifact revision now fails the contract instead of sliding past the isinstance guard, and the publish guards no longer go vacuous on an empty revision set: unreadable pins refuse naming the artifacts, an empty set refuses outright, and the create-tag and uniformity requirements apply unconditionally. The national per-cut revision suffix is validated against the same <YYYYMMDDTHHMMSSZ>-<uuid8> grammar the assembler mints, on both sides: the contract rejects hand-edited suffixes and the --cut-tag override may re-tag a cut but never leave the grammar. The assembler refuses to write the calibration NPZ when the candidate and spine household axes are misaligned - equal ids in equal order, checked before the pairing is digested. A digest over mis-paired bytes authenticates the bytes, not the pairing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rebasing the fixture extraction over #795 took our side of test_uk_release_certification.py wholesale, which lost main's one semantic change among the rewraps: run_uk_release_cut_battery grew a required local_ledger_registries argument with the local-contracts join. Restore it at the only call site. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ba2d73d to
82fabe9
Compare
Program ReviewSource Documents
Branch StatusThe PR head is 4 commits ahead of and 13 commits behind current Critical (Must Fix)
Should Address
SuggestionsNone. PDF Audit Summary
No PDF audit applied to this release-tooling PR. Validation Summary
Review Severity: REQUEST_CHANGESNext StepsClose the four fail-open release-integrity paths and add the cited negative tests before merge. Then rerun this review against the updated head. To auto-fix issues, run the fix-pr workflow for this PR. |
Closes the packaging gap in #806's plumbing: the certification decided shippability, but nothing produced the release directory, the constant national id escaped the contract's UK-keyed checks, and the id ruling collided with the tag-equals-release-id revision scheme.
What this adds
tools/assemble_uk_release_dir.py— verifies the certification's closed identity join against measured bytes before writing anything (candidate, diagnostics, all three part reports, score receipt, spine H5), mints the calibration NPZ (household_weight+initial_household_weight, the warm-start shape), writesbuild_manifest.json+release_manifest.jsonwith uniform per-cut artifact revisions, copies signed evidence byte-for-byte, runsvalidate_release_diron its own output, and prints the exact inspect-lane publish command.microcosm-uk-2024-25-national— theuk_diagnosticsblock validation and thepolicyengine-ukmodel pin now apply to the national id (the June legacy release keeps its exclusion); artifact revisions may be the release id or a release-id-prefixed per-cut tag.--tag-nameor a typo refuses instead of publishing dangling revision pins.uk_certification_fixtures.py) used by the certification and assembler suites; runbookdocs/uk-national-release-assembly-runbook-806.mdfor the calibrate → certify → assemble → inspect-publish sequence.Scope
Inspect lane only (
--no-latest): promotion needs the loader/pointer extension (the certified loader fetches the manifest at a tag named exactly the release id and assertsrevision == release_id) — follow-up issue to come.Verification
test_contract.py,test_release.py,test_uk_release_assembler.py,test_uk_release_certification.py,test_gate_battery_contract_pins.py)ruff check .clean;tools/ci_test_groups.py --verifyok (new test routed tospine-uk+uk)🤖 Generated with Claude Code