Skip to content

OBR policy measures database, March 2026 edition, as an edition delta - #185

Merged
MaxGhenis merged 1 commit into
mainfrom
w6/pmd-march-2026
Oct 16, 2026
Merged

MaxGhenis merged 1 commit into
mainfrom
w6/pmd-march-2026

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Stacked on #175. Merge #175 first, then this with a merge commit.

Draft until CI passes and an independent review agrees. Built on a Subfleet lane and salvaged after its wall-time limit. After the rebase onto #175, the main session re-validated it:

  • 1,868 tests passed.
  • After a from-scratch DB build, export_populations reproduced every committed export; only the dates changed, and those were restored.
  • tests/test_export_populations.py, test_harvest_ingest.py and test_build_chain.py pass against the fresh DB.

Add the March 2026 OBR Policy measures database as an edition delta while preserving every existing November claim and replay source pointer. The full March harvest is reproducible from locked workbook bytes; only 246 new cells are ingested and published in a new compact event archive.

The workbook explicitly lists Spring Forecast 2026: 19 distinct measure titles, 41 measure/head rows (14 tax, 27 spending), and 246 original-scorecard cells (84 tax, 162 spending). This PR reports that event and stores its external claims with a source-only pre-measures baseline. Its replay registry is a separate follow-up; no registry or pipeline/build_uk_event_registry.py changes.

Edition comparison Cells
Identical 24,302
Changed 0
New 246
Removed 2
November total 24,304
March total 24,548

All additions belong to Spring Forecast 2026. Budget 2016 has 680 identical cells and two removed cells: "Further government decisions", FY 2015-16, PSCE in RDEL −£400m and PSGI in CDEL +£400m. March Spending Measures!J501/J502 are blank. Those November claims remain intact. Every other November event is fully identical; full per-event accounting and source pointers are in sources/obr-pmd-march-2026/edition_diff.json and NOTES.md.

Both exact Wayback id_ captures (20260410184123, 20260423164140) returned identical 1,650,665-byte workbooks. Fetches used policyengine-scorecard-research/1.0, were sequential and 75 seconds apart, and succeeded on their first attempts. No direct publisher request or save-page-now. The earlier capture is the launch candidate, with classification unknown: first-release byte equivalence remains unverified. Workbook properties: created 2021-03-26T18:16:26Z, modified 2026-03-25T11:22:45Z.

Evidence SHA-256
Both workbooks 1364c625a62daab8ec9b97a81ca5f93044a067fdf471e1645a62d73fdfa498f6
Edition receipt 129cc10bb54dfb0d532275bf40f69a25e6dc1c6d4b783f48a124894423abf62d
Earlier capture receipt 2de05c83332ee63e06ae884025b8ab2764f21327b25268641390f45ab6708b65
Later capture receipt 32d7357ac68c7f1e93786c1502e82c1b0e307cde84befaf98e252d31093cfa91
Uncompressed staged JSONL 52ea1b089d7c1dc175599394b9fd3d2309b23b56c7feb4738088b4bdd4c60eb6

Invariants:

  • November harvest bytes, obr_pmd_nov2025 source-row IDs, claim IDs, conditions, reforms, publications and results remain unchanged. Every existing replay registry remains sourced from November, including the five frozen registries and Autumn Budget 2025.
  • Exact event/title/head/table/FY keys retain duplicate occurrences. Equal numeric values match first; unmatched occurrences pair in workbook order. Identical + changed + removed = 24,304; identical + changed + new = 24,548.
  • Only new/changed cells receive March claims. Changed cells retain their November counterpart and receive distinct edition/source-row identity (zero actual changed cells; synthetic coverage verifies the path). Removed cells never delete November claims.
  • Every added claim carries edition, workbook/receipt digests, exact replay, physical workbook coordinate, staged line and line hashes. Pinned source digests and embedded provenance must agree before ingest.
  • Original-scorecard cells only; solid FFE1E9EE extensions excluded. Tax uses revenue_change; spending retains proposed exchequer_impact and positive gain-to-Exchequer sign. GBP millions ×1e6, fiscal-year labels and verbatim values retained; DB periods use FY end-year.
  • No replay registry, certified population, lane status or microsimulation is created. Existing exported rows stay equal; the new archive and corresponding counts are the only substantive export additions.
  • Workbooks remain outside the repository, following November precedent. Receipt --check is offline and does not reconstruct uncommitted bytes. Reproduction with retained locked bytes is separately verified.

Validation:

  • Shared Python environment only: /Users/maxghenis/PolicyEngine/policyengine-scorecard/.claude/worktrees/suspicious-wright-b02e85/.venv-tests/bin/python; PYTHONPATH=. on module/test commands.
  • python -m scorecard_db.collect_obr_pmd --scratch-dir /tmp/obr-pmd-march-2026: both captures obtained.
  • python -m scorecard_db.collect_obr_pmd --check: passed.
  • python -m scorecard_db.stage_obr_pmd --workbook /tmp/obr-pmd-march-2026/1364c625a62daab8ec9b97a81ca5f93044a067fdf471e1645a62d73fdfa498f6.workbook --receipt sources/obr-pmd-march-2026/receipt.json --output-dir sources/obr-pmd-march-2026: 24,548 original cells, 48,902 excluded extensions.
  • python -m scorecard_db.obr_pmd_diff sources/harvest-uk-2026-08-02/uk_obr/claims_staged.jsonl.gz sources/obr-pmd-march-2026/claims_staged.jsonl.gz --output sources/obr-pmd-march-2026/edition_diff.json: accounting above.
  • November parser parity audit: all 24,304 existing staged PMD rows reproduced exactly after excluding new edition/provenance metadata.
  • Receipt/staging tests: 21 passed. Additive-ingest tests cover changed/new partition, unchanged existing claims/results/exports, rollback, idempotence, digest refusal and actual event size.
  • Deleted the derived database, then python -m scorecard_db.build_db data/scorecard.db: passed; logical content hash 072478d3295b22ee1f6656791722ab0146a506877a496ab0c33bea1f3f59f407.
  • python -m scorecard_db.export_populations data/scorecard.db: passed; 29,629 exported claims, 5,631 initial rows, 85 event archives. Regenerated deployment copies committed. Date-only fields restored.
  • Export audit against bfd6442: all 5,631 existing initial rows equal; all 84 existing archive files and their deployment copies byte-identical; one new 246-claim archive; lanes byte-identical. PMD claims total 24,550 because the two November-only cells remain.
  • Actual locked-byte restaging into scratch reproduced the committed gzip, manifest and staging accounting byte-for-byte.
  • uvx ruff format --check be nz scorecard_db tests pipeline: passed, 182 files already formatted (writable scratch cache/tool directories supplied through environment variables).
  • Full python -m pytest -n 4 tests/ (main session, after rebasing onto Replay Autumn Budget 2025 as the sixth event #175): 1,868 passed, 15 skipped.

Not verified: equivalence to the original publication-day workbook, or a runnable Spring Forecast 2026 replay. No microsimulation run.

axiom: n/a: scorecard DB ingest of OBR costings; no policy encoding.

🤖 Generated with Claude Code

The March 2026 edition is locked from two identical Wayback id_ captures
(20260410184123, 20260423164140; workbook SHA-256 1364c625...), staged
reproducibly from the locked bytes into sources/obr-pmd-march-2026/, and
diffed cell by cell against the November 2025 edition: 24,302 identical,
0 changed, 246 new, 2 removed (Budget 2016 "Further government decisions",
FY2015-16, blank in March). Only the 246 new cells are ingested, all from
Spring Forecast 2026 (19 measures, 41 measure/head rows), each with its
edition, receipt digests and workbook coordinates. Every November claim,
source-row id, replay registry and published export row is unchanged; the
new event gets its own archive. A Spring Forecast 2026 replay registry is a
separate follow-up.

Built on a Subfleet lane (Sol, 20261015-154342-w6-pmd-march-2026); salvaged
after the lane's wall-time limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
policyengine-scorecard Ready Ready Preview Oct 16, 2026 2:59am UTC

Request Review

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merge audit (W6), head b1f82eb.

  • CI: gh pr checks 185 exits 0 at b1f82eb. GitHub reports it MERGEABLE against main, with no CHANGES_REQUESTED.
  • Independent review (Opus 5.5; no Codex lane could dispatch): approved b1f82eb, with no blocking findings. The reviewer:
    • recomputed the receipt digests and ran --check with the network blocked by sandbox-exec;
    • showed --check refuses changed digests, non-id_ and http replays, swapped captures, a launch label and size mismatches;
    • checked all 24,302 identical cell pairs field for field against November, and the 2 removed Budget 2016 cells;
    • built both DBs from scratch: every table is row for row identical except +1 baseline and +246 March claims, and the exports match except date fields.
  • Non-blocking findings, going to a follow-up PR:
    • 13 surviving test mutants: the changed-cell and existing-identity ingest paths, provenance-drift checks, and receipt checks for retrieval order, pacing, attempt URLs, the locked capture and same-length tampering;
    • a committed-data parser-parity test;
    • one manifest writer instead of two;
    • a cited publication date;
    • the baseline wording for a forecast-only event;
    • the uk_relationship gate instead of a hard-coded value;
    • stale lane text;
    • slug uniqueness and staging-accounting checks.
  • Built on a Subfleet lane and salvaged. The main session re-validated it after the rebase.
  • Axiom: n/a (scorecard DB ingest).

🤖 Generated with Claude Code

@MaxGhenis
MaxGhenis marked this pull request as ready for review October 16, 2026 03:24
@MaxGhenis
MaxGhenis merged commit e3a8278 into main Oct 16, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — b1f82eb0 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant