Add council-tax nation-total and CTR-cost source packages (Scotland, Wales, England) - #189
Merged
Conversation
Scottish Government council tax collection statistics publication tables (2025-26 and 2024-25), Scottish Local Government Finance Statistics 2024-25 publication tables, Welsh Government council tax collection rates workbooks (2025-26 and 2024-25) and Council Tax Reduction Scheme annual report PDFs (2025-26 and 2024-25), and MHCLG's council tax levels 2025-26 Tables 1-9 (revised) and collection rates 2025-26 Table 5, each with a manifest carrying the canonical publisher URL, sha256 and the declared ledger-raw R2 location. gov.wales and gov.scot binaries were fetched with browser headers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Nine UK packages (341 facts) for the nation-level council tax billed and collectable totals and council tax reduction costs that the policyengine-uk-data#448 diagnosis compared the model against: - scotgov-council-tax-collection-2025-26 / -2024-25: CTRR Figure 1 net amount billed, received, uncollected and percentage received by year billed, Scotland, two vintages. - scotgov-slgfs-council-tax-2024-25: Table 2.11 CTR funding and reduction in liability, Tables 2.8/2.6 council tax income after CTR, Chart 2.7 potential yield by band, Table 2.10 average bill before and after CTR. - welshgov-council-tax-collection-2025-26 / -2024-25: Table 2 Total Wales net collectable debit, amounts collected and written off, arrears. - welshgov-ctrs-annual-report-2025-26 / -2024-25: PDF Table 2 total value of CTRS awards in Wales (pdf_text_numbers). - mhclg-council-tax-levels-england-summary-2025-26: Table 1 requirement, parish precepts, taxbase and average Band D, 2021-22 to 2025-26. - mhclg-council-tax-collection-england-2025-26: Table 5 net collectable debit and amount collected in year, 2021-22 to 2025-26. Every fact is a publisher cell times its declared value_scale with exact header guards read from the pinned bytes; within each selected table only cells the publisher labels as arithmetic over other cells are excluded. Registers the aliases and the curated UK bundle entries, documents the packages in the UK source checklist and harness doc, and pins every headline oracle in tests/test_chronicle_council_tax_nation_totals.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The nine council-tax packages add 341 facts (155,689 -> 156,030) across 143 source packages, 138 source tables and 117 semantic duplicate keys (the two Scottish CTRR vintages restate 1999-00 to 2024-25; the Welsh CTRS 2024-25 value is printed in both annual reports). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
August 23, 2026 13:45
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Nine UK source packages carrying the nation-level council tax billed/collectable totals and council tax reduction (CTR) costs that the policyengine-uk-data#448 council-tax diagnosis compared the model against. Chronicle's seven existing council-tax packages are levels, Band D rates and band stocks; none carried a billed or collectable total or a CTR cost. Every fact is a publisher cell (stored value × declared
value_scale) with exact row/column header guards read from the pinned bytes.scotgov-council-tax-collection-2025-26scotgov-council-tax-collection-2024-25scotgov-slgfs-council-tax-2024-25welshgov-council-tax-collection-2025-26welshgov-council-tax-collection-2024-25welshgov-ctrs-annual-report-2025-26welshgov-ctrs-annual-report-2024-25mhclg-council-tax-levels-england-summary-2025-26mhclg-council-tax-collection-england-2025-26Headline values (stored cell × scale; the diagnosis quoted the rounded display values of the same cells):
Conventions
db/data/…withmanifest.yaml(canonical publishersource_url, sha256,storage.r2location). The nine raw files are uploaded to the privateledger-rawbucket at those keys (chronicle publish-raw, 2026-08-23; three spot-checked by re-download and sha256). gov.wales 403s a plain fetch; the workbooks and PDFs were retrieved with browser headers.#,##0formats; SLGFS stores £351,000 thousand as350999.99999999977).value_scaleis 1000 for £ thousand tables and 1,000,000 for £ million tables; the Scottish percentage received is the publisher's fraction (unit: share).fiscal_yearwith the opening year (2025-26→ 2025), one record set per year because a period is not a measure; geography is the nation each table covers (S92000003 / W92000004 / E92000001); amounts carrygovernment/billing_authority(the Welsh levels precedent) and per-dwelling averages and the taxbase carrydwelling/chargeable_dwelling.5=(1+2-3-4),8=(7/6),10=(6-7-9),11=(10+5),12=(11-1); MHCLG/SLGFS "percentage change" rows and columns); out-of-scope rows and tables (per-authority rows, non-domestic rates, caseload and percentage tables) are named per package.pdf_text_numbersparser (LIHEAP/ISC/PIP precedent), guarded by page, line, number text and the table-title line.duplicate_semantic_fact_keywarnings (the designed "consumers select bysource_table" path; the golden count moves from 12 to 117: 104 from the Scottish vintages and one from the CTRS 2024-25 value printed in both reports).chronicle/source_package.py), curated UK bundle (chronicle/bundle.py), harness-doc command block, a new "Beyond parity" section indocs/pe-uk-source-checklist.md, focused tests intests/test_chronicle_council_tax_nation_totals.py, and the merged-bundle goldens.Not ported (documented, not invented)
_uk-defects-452-448/measure/COMPARATORS.md: the "CTR ≈ £389m (2024-25)" row cites the gov.scot news release, which carries no CTR amount (its only "389" is "£3.389 billion"); the figure is SLGFS 2024-25 Table 2.11, Scotland row, £389,010 thousand — now a Chronicle fact.Activation in Microcosm (decided 2026-08-23 with a fable + sol cross-family review; follow-up PRs open)
scotgov.council_tax_stock.*holds, regenerated against the byte-identical feed vintage (chronicle1cab809, sha226358e7…); membership moves by exactly those nine targets (388 → 397 active).obr.council_tax_*/obr.domestic_ratesholds are activated (see below).obr.council_taxUK total (row 19, £50.925bn) is the three nation rows (£49.569bn) plus NI domestic rates (£0.494bn) plus an accruals adjustment (£0.862bn) with no household counterpart, so activating the decomposition beside it would be jointly infeasible. CTR under-simulation (Scotland £249m modelled vs £389m; Wales ~£10m vs £323m) is the lever to fix first.Original analysis, kept for the record:
These packages do not by themselves activate anything. At microcosm
2aa96795the held idsobr.council_tax_{england,scotland,wales}andobr.domestic_ratesselectsource_name: obrand Chronicle already emits their facts (obr-efo-expenditure-march-2026, FY2024–FY2030); they are held becausetools/generate_uk_target_references.py::_geography_id_for_targetpins them to the nation (E92000001 / S92000003 / W92000004 / N92000002) while the OBR rows are stampedK02000001, andgeography_idis part of the merged selector (target_reference_authoring.py:248) matched againstfact.geography.id(ledger_targets.py:1422). The same pin logic sendsscotgov.council_tax_stock.*to K02000001 ("scotgov" does not contain "scotland") while the CTAXBASE facts carry S92000003. The reader workflow reproduced every held status with the real code and computed the counterfactuals (pin K02000001 or no pin → active, resolving to the FY2025source_projectionvalues). Paths, each a microcosm- or chronicle-side change:_selector_pinsgeography overrides for those ids (activates on the existing feed, resolving to the FY2025source_projectionOBR values underallow_source_projection); orobr.council_tax_*selectors at these packages (source_name: scotgov|welshgov|mhclg, the concepts above), noting that a 2024 target period would see both Scottish vintages (multi_factunlesssource_tableis pinned) and that the OBR basis (accruals receipts) differs from the billed/collectable and requirement bases; orChronicle governance
ledger-source-ingestor(thechronicle/source_package.pyandchronicle/bundle.pyedits are the alias/bundle registration the drift guards require, as in UK source packages, wave 3: back the uk_local_geography profile (constituency + local authority) #134).validate-packageandbuild-suitefor all nine packages (agent acceptance valid, 341 facts, R2 pointers and source-cell lineage on every fact);uv run ruff check chronicle policyengine_chronicle db scripts tests;uv run pytest -q(merged-bundle goldens regenerated).ledger-source-fidelity: two adversarial workflow rounds re-read every built fact from the raw bytes round 1: seven per-package refuters re-derived all 333 facts then in scope from the raw bytes (independent openpyxl/XML/ODS parses) and every header and guard string — zero value mismatches; their documentation findings (copied cell examples, an overstated Welsh Table 1 reason, stale date wording) are fixed in this revision; round 2: the two CTRS PDF packages verified CLEAN (151 checks, including an independent pypdf extraction and a parser re-run), the revised SLGFS package re-verified 71/71 values, and a docs refuter caught the Welsh CTRS omission and a wrong issue link, both fixed.ledger-target-profile: n/a (no profiles touched).ledger-contract: n/a (no schema change).ledger-boundary: PASS — publisher cells only; no reconciliation, aging, imputation or activation decisions (the activation note above is a decision for microcosm).Tests
tests/test_chronicle_council_tax_nation_totals.py: every headline oracle above pinned to the stored cell, fact counts, geography/entity/period/unit shape per package, the Chart 2.7 gross-row identity, the income-after-CTR series across Tables 2.6/2.8, and the two-vintage restatement property.tests/test_chronicle_bundle.py: merged-bundle goldens updated fact_count 155,689 → 156,030, source_package_count 134 → 143, semantic_duplicate_key_count 12 → 117, by_source mhclg 2,672 → 2,712 / scotgov 2,504 → 2,787 / welshgov 198 → 216, by_source_table 129 → 138, plus per-table pins for the nine new tables.tests/test_source_package_alias_drift.py: UK bundle/alias parity.Draft — holding for Max's go.
🤖 Generated with Claude Code