Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4c4c94c
Sign the #762 binding adjudications and the two micro-LA support excl…
juaristi22 Sep 2, 2026
c33b54f
Sign the Welsh council-tax deferral: no Wales country control in the …
juaristi22 Sep 2, 2026
dc234cb
Sign the band-H and support-floor deferrals (#762 A14, PR B) and star…
juaristi22 Sep 2, 2026
e463c15
Receipts R6-R7: Runs U and G at K=10 on spine-m (#762 PR B)
juaristi22 Sep 2, 2026
ebb873a
Receipts R8: stretch bound 100/20/10 under both rules (#762 A3 measur…
juaristi22 Sep 2, 2026
f8dee03
Receipts R9: K=15 at bound 10 under both rules (#762 measured escalat…
juaristi22 Sep 3, 2026
61a418b
Receipts R10 + health audit: 512 vs 1500 epochs at K=15, bound 10 (#762)
juaristi22 Sep 3, 2026
cf146c8
Receipts R11: single-block engine resolution at K=15 fits in 10.2 GB …
juaristi22 Sep 3, 2026
73f1da2
UK local doctrine: bound 10, grain_equal, K=15, 1500 epochs; A15 ladd…
juaristi22 Sep 3, 2026
d639edb
Receipts R13: first release-candidate run; battery attests the releas…
juaristi22 Sep 3, 2026
fe4bf33
Receipts R14: score the release candidate against the incumbent; rece…
juaristi22 Sep 3, 2026
caecedc
Erratum R15: land rows were mis-measured by per-block engine resoluti…
juaristi22 Sep 3, 2026
116ca4c
A17: uprate census-vintage tenure cells with the ladder rows; release…
juaristi22 Sep 3, 2026
d0cb16d
Dense line release path: contract branch, signed local report verific…
juaristi22 Sep 3, 2026
a95dab1
Receipts R16: release-candidate re-run after A17 — tenure 99.2 percen…
juaristi22 Sep 3, 2026
23e2ae7
Re-sign scoped gate reports with the gate battery's canonical form; p…
juaristi22 Sep 3, 2026
9a17908
Seam test verifies the re-signed report with the gate battery's canon…
juaristi22 Sep 3, 2026
9f5b782
Receipts R17: release-candidate re-run on the fixed re-signer (byte-i…
juaristi22 Sep 3, 2026
10d64fe
Evaluate the candidate on the incumbent's target surface, every grain…
juaristi22 Sep 4, 2026
cc2ffdb
Read a written rowwise artifact back: load_uk_rowwise_dataset undoes …
juaristi22 Sep 4, 2026
c3e74a2
Evaluator: build the national constraint matrix over the resolver's p…
juaristi22 Sep 4, 2026
75b36f5
Evaluator: roll the frame up by region for the incumbent's regional r…
juaristi22 Sep 4, 2026
9e832c9
Receipt R18: the candidate on the incumbent's target surface, signed …
juaristi22 Sep 4, 2026
4d37328
Format the two test files merged during the re-stack onto PR A 8be32d…
juaristi22 Sep 4, 2026
ae23260
Vahid's residuals from the PR A approval: end-to-end releasable under…
juaristi22 Sep 4, 2026
105cae5
Vahid's PR B review round 1: bind the signed report to the attempt, p…
juaristi22 Sep 7, 2026
4828c2d
Pin the band-H rationale at its K=15 wording (#762 PR B)
juaristi22 Sep 7, 2026
3740391
Fix issues from review: enforce UK dense release quality and provenance
juaristi22 Sep 7, 2026
3516100
Format resolved UK target generator expression
juaristi22 Sep 7, 2026
74e7d8c
Declare the six release-blocking local gates where CI still pinned th…
juaristi22 Sep 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/870-review-fixes.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make UK dense candidate quality gates release-blocking, authenticate and validate the complete incumbent target-surface evaluation, require measured clean code and current measure-exclusion approvals, and distinguish holdout weighting from fitted scores. Record tenure hold attempts and skipped vintages.
146 changes: 146 additions & 0 deletions docs/uk-dense-release-assembly-runbook-762.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# UK dense line release assembly runbook (#762)

The dense line `microcosm-uk-2024-25-dense` is the spine cloned K=15 times
through the OA geography ladder and calibrated to the national and local
target surfaces in one solve (`tools/build_uk_rowwise_candidate.py`). It ships
on the **inspect lane only**: a constant release id, an immutable per-cut tag,
`dataset_role: non_default_local_area`, an empty `default_datasets` map, and
`--no-latest` at publication, so it can never displace the default artifact.
It is registered as `("uk", 2025, "dense")` in the private repo
`policyengine/populace-uk-private`. Publication is a separate human step.

The R16/R17 release verdicts recorded in the historical receipts used the
previous gate policy. They do not satisfy the current contract: four quality
gates now block release, and the incumbent-surface evaluation is mandatory.
No historical run was re-signed or recalibrated by the PR #870 review fixes.

## Prerequisites

- The four pins the run stood on (`spine`, `ladder`, `facts`, `manifest`) and
the signing key in `MICROCOSM_UK_TERMINAL_GATE_SIGNING_KEY` (base64, 32 bytes).
- The Ledger consumer artifact, the spine H5 with its sidecar, the OA ladder.
- The incumbent extraction (`tools/extract_uk_local_incumbent_surface.py`) for
the head-to-head score.

## 1. Pre-flight the environment

```bash
uv run --no-sync python tools/preflight_uk_local_release_candidate.py --env \
--pins <pins.txt> --spine-h5 <spine.h5> --ladder build/uk/uk_oa_ladder_2021.npz \
--ledger-facts <chronicle-uk-artifact-dir>
```

Fails closed and by name on a missing or malformed key, a missing pin, a
digest mismatch, or doctrine constants that are not the ruled ones.

## 2. Run the release candidate

```bash
uv run --no-sync python tools/build_uk_rowwise_candidate.py --release-candidate \
--input-h5 <spine.h5> --input-sha256 <spine> \
--ladder build/uk/uk_oa_ladder_2021.npz --ladder-sha256 <ladder> \
--ledger-facts <chronicle-uk-artifact-dir> --ledger-facts-sha256 <facts> \
--ledger-manifest-sha256 <manifest> --seed 42 \
--logbook-prev-row-digest <previous row> --out <candidate-dir>
```

`--release-candidate` pins the doctrine (bound 10, `grain_equal`, K=15, 1500
epochs), resolves the engine in a single block, and runs the rotated holdout.
Expect about 3.5 hours and 10 GB at K=15.

## 3. Pre-flight the finished run, then score it

```bash
uv run --no-sync python tools/preflight_uk_local_release_candidate.py --candidate-dir <candidate-dir>
uv run --no-sync python tools/score_uk_local_candidate.py ... --output-json <candidate-dir>/score_vs_incumbent.json
```

The pre-flight checks the manifest and the signed gate report for everything
the contract will demand: release posture attested, shippable, every
release-blocking gate passed, single-block engine, the doctrine values, the
A15/A17 uprating, the measure exclusions and their windows, the holdout, the
Logbook row, the artifact digest.

Measure the full pinned incumbent surface before assembly:

```bash
uv run --no-sync python tools/evaluate_uk_incumbent_surface.py \
--candidate-h5 <candidate-dir>/microcosm_uk_2025_local.h5 \
--candidate-manifest <candidate-dir>/rowwise_candidate_manifest.json \
--ledger-facts <chronicle-uk-artifact-dir> --ledger-facts-sha256 <facts> \
--ledger-manifest-sha256 <manifest> --engine-blocks 1 \
--incumbent-manifest <incumbent-dir>/incumbent_local_surface_manifest.json \
--incumbent-metrics-csv <incumbent-dir>/household_metrics.csv \
--incumbent-weights-csv <incumbent-dir>/wide_weights.csv \
--out-json <candidate-dir>/incumbent_surface_evaluation.json \
--out-md <candidate-dir>/incumbent_surface_evaluation.md
```

Use the actual metrics and weights filenames from the extraction manifest.
The evaluator remains diagnostic: missing optional incumbent inputs and poor
fit produce a failed assessment, not permission to publish. Only one engine
block is accepted. Assembly requires the complete authenticated evaluation,
including finite candidate measurements on every national and local row and
finite realized incumbent estimates on every local row. National comparisons
use the pinned incumbent targets; they do not claim realized incumbent fit.
Signed deferrals stay in this evaluation. A missing or unmeasurable row blocks
release until its measurement is supplied.

The same existing absolute quality limits apply to this surface: every row
within 25%, and at least half each family's rows within 25% when the family
has at least five rows. The within-10% family share remains diagnostic.
The candidate's fitted score uses uniform rows on its active local surface.
Its holdout uses the separately recorded weighting rule over held local
grains. Their shared cap does not make the losses directly comparable; no
ranking of fitted versus holdout losses is reported.

## 4. Assemble the release directory

```bash
uv run --no-sync python tools/assemble_uk_dense_release_dir.py \
--candidate-dir <candidate-dir> --spine-h5 <spine.h5> \
--incumbent-manifest <incumbent-dir>/incumbent_local_surface_manifest.json \
--out-dir releases
```

Assembly verifies the hash join (every manifest output against its bytes, the
spine against its pin, the gate report against the Logbook build id), re-runs
the candidate pre-flight, mints the cut tag
`microcosm-uk-2024-25-dense-<YYYYMMDDTHHMMSSZ>-<uuid8>` from the run's attempt
id, clones the H5 beside itself as `microcosm_uk_2025_dense.h5`, stages
`build_manifest.json`, `release_manifest.json`, `calibration_diagnostics.json`,
`gate_summary.json`, `uk_source_coverage.json`, the signed `uk_local_gates.json`,
`score_vs_incumbent.json`, `incumbent_surface_evaluation.json`, the original
`rowwise_candidate_manifest.json`, `source_calibration_diagnostics.json`,
`incumbent_manifest.json`, and `sha256sums.txt`, validates the directory with
`microcosm.data.contract.validate_release_dir`, and only then renames it into
`releases/microcosm-uk-2024-25-dense/`. Re-assembling requires removing the
previous directory first. The JSON summary prints the publication command.

Assembly and every later directory validation require measured clean code
(`code.git_dirty` exactly `false`) and full measure-exclusion provenance.
Approval and expiry dates must be valid ISO dates and in force on the current
validation date; expiry-day validation is allowed, the following day is not.
The upload path invokes this validator again before uploading bytes. Separate support
and binding adjudications keep their own policies. The gate thresholds and
existing approvals have not been widened or renewed.

## 5. Publish for inspection (human step)

Run the printed command. Its shape is:

```bash
uv run python -m microcosm.data.publish_cli releases/microcosm-uk-2024-25-dense \
--repo-id policyengine/populace-uk-private --artifact-root <candidate-dir> \
--no-latest --tag-name microcosm-uk-2024-25-dense-<timestamp>-<uuid8>
```

`--no-latest` is mandatory and enforced: publication refuses to move
`latest.json` for a non-default role. The artifact is reachable by its tag and
by the registry key `("uk", 2025, "dense")` only.

## Promotion is a separate change

Making the dense line (or a sparse successor via the L0 penalty, #762 I10) a
default dataset is a registry and contract change with its own review; nothing
in this runbook promotes anything.
Loading
Loading