UK wave 2: national fiscal/benefit source packages (#133) - #139
UK wave 2: national fiscal/benefit source packages (#133)#139juaristi22 wants to merge 5 commits into
Conversation
…icyEngine#133) Wave-2 batch 1: policyengine-uk-data's OBR calibration surface from publisher truth. obr-efo-receipts-march-2026 (63 facts: income tax and NIC classes from sheet 3.4 accrued, NI total/VAT/fuel duties/CGT/SDLT from the cash-basis current-receipts sheet 3.8) and obr-efo-expenditure-march-2026 (133 facts: council tax by nation plus total from 4.1, 13 welfare lines with UC in/outside cap disambiguated by row from 4.9, BBC licence fee from 4.19). 196 source_projection facts, fiscal_year periods 2024-2030 storing the opening year, GBP billion value_scale 1e9, all rows table_record_kind total (each line is a total over its program population). Artifacts fetched directly from obr.uk (residential passes the 403 wall that forces uk-data's committed fallback and forced CBO's curated-CSV compromise), double-fetched byte-identical. Explicit per-year record sets rather than {year} templating so the full forecast surface lands in every build (PolicyEngine#135 year handling). Excluded as uk-data-computed: salary-sacrifice uprated series (SPP-PDF base values become their own package); private_school_students is ISC data in wave-1 scope. Registers both aliases and updates bundle expectations to the measured post-publication truth (39,415 facts, 62 packages, 22 periods, source obr=196, 57 tables). Consumer export awaits ledger publish-raw. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…icyEngine#133) Wave-2 batch 2. ons-savings-interest-income: UKEA HAXV annual observations 2018-2025 (GBP million, value_scale 1e6, 30-06-2026 release); policyengine-uk-data's flat-fill of the last actual through 2029 is a computed extension the facts-only ADR excludes. ons-families-households-2025: Table 7 household counts by type, 10 types x 2018-2025 (thousands, value_scale 1e3), LFS-derived so provenance_class survey_aggregate with survey_instrument named; row guards are exact cell text including indentation and note markers. Deliberately not ported: ons_tenure England totals (the SPREE workbook is LA-grain only; uk-data sums ~300 LA rows in code, and Ledger stores only publisher-emitted aggregation levels - the workbook becomes the wave-3 LA package). Salary sacrifice moves to batch 3: uk-data's pinned asset now returns status gone (its runtime download fails silently); current asset is media/6a673e0e5e87122783093901 (Private pension statistics, 2026-07-30). Bundle expectations re-measured with all four wave-2 packages: 39,503 facts, 64 packages, 24 periods, ons 1,334, obr 196, 59 tables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Batch 2 pushed — and this PR now carries wave 2 as consolidated batches rather than the separate-PRs plan in the opening description: parallel drafts off main would all conflict pairwise on New in batch 2
Spot checks byte-exact (HAXV 2023 = £86.04bn; couple-no-children 2023 = 7,956k). Both suites + Fidelity notes surfaced by this batch
Batch 3 next: HMRC (salary sacrifice, CGT) + DWP first-print set. SPI follows once the ODS parser lands ( 🤖 Generated with Claude Code |
…licyEngine#133) Wave-2 batch 3. Six facts from the Private pension statistics tidy CSV (updated 2026-07-30): income tax relief on salary sacrificed pension contributions, total and by rate band, plus Class 1 employee and employer NICs relief. tax_year period 2024 (opening year). Six guard cells per row; [z]-suppressed by-rate NICs splits not ported. policyengine-uk-data's pinned asset for these tables returns status gone, so its runtime download silently drops the targets today, and its 3 percent p.a. uprating from the old 2023-24 base is a computed series the facts-only ADR excludes either way. Correction recorded on the PR: the resolve_pending first-print lane referenced in earlier issue comments does not exist in this repo; hand-transcribed uk-data families will be packaged from their actual publication files. HMRC CGT scoped: Table 1 is ODS, so CGT joins SPI behind the ods_used_range parser (next infrastructure item). Bundle expectations: 39,509 facts, 65 packages, hmrc 199, 60 tables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Batch 3: Fidelity notes:
Scoping from this batch:
🤖 Generated with Claude Code |
…consumer (PolicyEngine#133) Wave-2 batch 4. hmrc-cgt-statistics-2025: the full published Table 1 history, 37 disposal years (1987-88 to 2023-24) x 9 measures = 333 facts - taxpayer counts (thousands), chargeable gains and tax liabilities (GBP million), each for individuals, trusts, and the publisher's own Total columns. tax_year periods store the opening year; 2023-24 is provisional per the publication notes; percentage columns are derivable and not ported. Correction recorded on the PR: the ods_used_range lane already existed (dispatch + repeat-aware reader) with zero consumers - the earlier 'missing ODS parser' scoping mistook no-usage for no-capability. This package proves the lane end to end; SPI and the ODS-format DWP tables were never parser-blocked. Fidelity: policyengine-uk-data's hardcoded 378k taxpayers / GBP 65.9bn gains are exactly the publisher's Total columns for 2023-24 (verbatim); its AEA gating and PE-parameter uprating are populace-side measurement semantics. populace's native UK_CGT_TARGET_SPECS single-homes onto this package in populace#622. Bundle expectations: 39,842 facts, 66 packages, 59 periods, hmrc 532, 61 tables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Batch 4: Correction: the ODS parser already existedBatch 3's comment (and the #133 scoping) claimed the parser registry had no ODS lane. Wrong: The packageFull published history from CGT statistics Table 1 (2025 release, ODS): 37 disposal years (1987-88 → 2023-24) × 9 measures = 333 facts — taxpayer counts (thousands, ×1e3), chargeable gains and tax liabilities (£m, ×1e6), each for individuals, trusts, and the publisher's own Total columns. Fidelity: policyengine-uk-data's hardcoded constants (378k taxpayers, £65.9bn gains, "2023-24 outturn") are exactly the publisher's Total columns — a verbatim port, with the individuals/trusts split now available alongside. The AEA gating and PE-parameter uprating in Spot checks byte-exact (ty2023 totals 378,000 / £65,937m / individuals £62,921m; ty1987 individuals 135,000). All gates green under the disclosed, reverted R2 sandbox; alias registered; bundle constants re-measured. PR totals: 6 packages, 623 facts. Next: DWP publication-file packages + SPI collated ODS (both now unblocked), then VOA/NTS/ScotGov/land, 🤖 Generated with Claude Code |
…ngine#133) Wave-2 batch 5, both on the ods_used_range lane. hmrc-spi-income-bands-2023: SPI collated tables 2023-24, Tables 3.6 and 3.7 - 13 total-income bands x 7 income types, counts (thousands) and amounts (GBP million), 182 facts at tax_year 2023. survey_aggregate with the Survey of Personal Incomes named as instrument. Numeric ODS band cells make numeric row-header guards workable here. uk-data's 1.9x property-income scale and its uprated projections are populace-side adjustments; means are derivable and not ported. Same artifact populace's national HMRC stage parses. dwp-benefit-cap-november-2025: benefit-cap tables to November 2025, Table 4 point-in-time - UC households capped at Nov-2025, GB Total (110,637) plus the 13 amount-capped bands, 15 facts at month 2025-11 (first UK month-period facts; first dwp source). uk-data's 110,637 is exactly this GB Total; its GBP 320.9m annualized reduction is a computed band-midpoint construction, excluded - populace can declare its own annualization over the ported distribution. Stat-Xplore families (UC by children, Scotland UC) stay parked pending an API key; two-child limit, PIP and DWP benefit-statistics publications are the next batch. Bundle expectations: 40,039 facts, 68 packages, 60 periods, 31 sources, hmrc 714, dwp 15, geography 1,054, 63 tables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Batch 5: SPI + benefit cap — both on the
Remaining DWP scope: two-child limit (Apr-2025), PIP (Jan-2026) and DWP benefit statistics (Feb-2026) publication tables next batch; the Stat-Xplore families (UC by children ×5, Scotland UC child-under-1) stay parked until someone holds a free Stat-Xplore API key. After that: VOA/NTS/ScotGov/land, then the 🤖 Generated with Claude Code |
Part of #133 (wave 2, batch 1 of ~5: the OBR EFO anchor; HMRC, DWP, ONS-misc and the
uk_nationalprofile follow in separate PRs per the one-publication-per-package cadence).Lane:
ledger-source-ingestor(.github/ledger-agents.yml) — judgesledger-source-fidelity+ledger-boundary.What
Two packages porting policyengine-uk-data's OBR EFO calibration surface (
targets/sources/obr.py, ~28 realized targets) from publisher truth — 196source_projectionfacts at fiscal-year periods 2024–2030:obr-efo-receipts-march-2026efo_receipts.xlsxobr-efo-expenditure-march-2026efo_expenditure.xlsxValues are GBP billion in the workbooks (
value_scale: 1e9); all rows aretable_record_kind: total(each line is a total over its program population). Fiscal-year periods store the opening year (FY2024-25 → 2024), matching thehmrc/vat_firm_targets_2024_25precedent. Row headers are exact cell text including OBR's footnote markers (Incapacity benefits2,Total net council tax receipts1) — the drift that truncated startswith-matching hides.Provenance notes for review
fetch-artifact) with byte-identical sha256s: receiptsf65b6cb7…766a28, expenditure700bfd70…d9a1.{year}withcolumn_by_year, which emits only the bundle-year's facts (the UK enablement tooling: source-inventory de-hardcode, UK consumer-artifact suite, legacy ETL cleanup #135 year-handling wart). These packages materialize explicit per-year record sets instead, so the full 2024–2030 forecast surface lands in every build.obr/salary_sacrifice_*series are uk-data-computed uprating (3%/2.4% growth applied to base values from the 2025 SPP Review PDF) — the facts-only ADR excludes computed series; the PDF base values become their own small package later in wave 2.obr/private_school_studentsis ISC census data (wave-1 scope, see UK source packages, wave 1: the production 149-target national surface (ONS SNPP, SLC, OBR) #132).2024-25FY labels, guardable as non-digit strings).Gates
validate-packageclean for both;build-suite+agent_acceptancegreen end to end (under the disclosed, reverted localstorage.r2sandbox, as in UK wave 1: ONS mid-2023 population estimate source packages, UK countries + England regions (#132) #137); seven facts spot-verified byte-exact against the workbooks (×1e9 scaling included).SOURCE_PACKAGE_ALIASESregistered; bundle-test constants updated to the post-publication truth measured by a full local bundle build.uv run ledger publish-raw --root db/databy a credentialed maintainer (two artifacts), same as UK wave 1: ONS mid-2023 population estimate source packages, UK countries + England regions (#132) #137. Committed manifests are upload-truthful.SOURCE_PACKAGE_ALIASESand the bundle-test constants; whichever merges second re-measures (two-minute mechanical fix).🤖 Generated with Claude Code