Repository navigation
Add UK high-value housing sources: OBR surcharge costing, ONS house prices by constituency, and Price Paid, UK HPI and NSPL registrations - #349
Conversation
Automated review pass (Claude Code, high effort), round 1 at
|
chronicle#343 sections 3 and 5. obr-hvcts-costing-april-2026 ports Tables 1.1, 1.2 and 1.5 of the OBR's 2 April 2026 costing of the high value council tax surcharge and three parameters stated in paragraph 1.13, as source projections for England (63 facts). ons-hpssa-pcon24-year-ending-march-2026 ports sales counts and median price paid by July 2024 constituency and property type for the years ending March 2023 to 2026 (22,940 facts). scripts/build_uk_high_value_housing_packages.py writes both from the pinned bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chronicle#343 sections 1, 2 and 4. HM Land Registry Price Paid Data (August 2026 release: the 32 yearly files and the monthly change file), the UK House Price Index full file (July 2026) and the National Statistics Postcode Lookup (August 2026) are pinned by sha256 and archived in R2, with no package, alias or bundle entry. None of their bytes is committed. Price Paid's address fields carry Royal Mail and Ordnance Survey terms that limit them to non-commercial use, the NSPL zip is above GitHub's file limit, and each monthly UK HPI full file revises the last. The yearly Price Paid files stand in for pp-complete.csv, which wrangler's 300 MiB object-put cap keeps out of publish-raw. hmlr joins the UK R2 publishers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Field contracts, licences and parity for the raw releases go in docs/data-sources/uk-high-value-housing.md, and the source checklist gains a section. The default bundle grows by 23,003 facts and two packages, with one new publisher-wording warning (semi-detached). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mark R2-only bytes with storage.local: false. inventory-artifacts and publish-raw accept such an entry without a local copy (they still check and upload the bytes when present), so both stay valid over db/data on a fresh clone; an R2-only entry without an R2 location is an error. - Keep the UK HPI full file in R2 only, like Price Paid and the NSPL; its header test skips when the bytes are absent. - Give the UK HPI its prescribed attribution, add sections for the OBR note and the ONS workbook, flag the Isles of Scilly's missing HPI series, and correct the changelog's Price Paid wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66c47b5 to
f41cb29
Compare
|
Thanks Vahid. I rebased onto main (at
While checking the NSPL text I also confirmed one claim the doc made. For all 2,413,799 England and Wales postcodes, live and terminated, NSPL's Tests after the rebase and this round:
I didn't rerun the hour-long bundle test after the rebase. It only composes pins, and CI's 🤖 Generated with Claude Code |
Automated review pass (Claude Code, high effort), round 2 at
|
PolicyEngine/chronicle#349 lands the inputs microcosm#1240 needs: the OBR April 2026 costing note for the High Value Council Tax Surcharge (63 rows), the ONS house price statistics for small areas by 2024 constituency to the year ending March 2026 (22,940 rows), and three raw-only registrations (the HM Land Registry Price Paid yearly files, the UK HPI full file and the NSPL) that carry no facts and are read by the stock builder against their registered sha256 pins. The feed grows from 927,239 to 950,242 rows; no existing package moves, so no compiled target changes and the vendored facts only carry the new provenance header. The OBR note is vendored for the benchmarks gate (`obr_hvcts_costing_facts.json`), the national references and the spine parity fixture sources are regenerated on the new pin, and the re-pin doc records the move. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PolicyEngine/chronicle#349 lands the inputs microcosm#1240 needs: the OBR April 2026 costing note for the High Value Council Tax Surcharge (63 rows), the ONS house price statistics for small areas by 2024 constituency to the year ending March 2026 (22,940 rows), and three raw-only registrations (the HM Land Registry Price Paid yearly files, the UK HPI full file and the NSPL) that carry no facts and are read by the stock builder against their registered sha256 pins. The feed grows from 927,239 to 950,242 rows; no existing package moves, so no compiled target changes and the vendored facts only carry the new provenance header. The OBR note is vendored for the benchmarks gate (`obr_hvcts_costing_facts.json`), the national references and the spine parity fixture sources are regenerated on the new pin, and the re-pin doc records the move. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PolicyEngine/chronicle#349 lands the inputs microcosm#1240 needs: the OBR April 2026 costing note for the High Value Council Tax Surcharge (63 rows), the ONS house price statistics for small areas by 2024 constituency to the year ending March 2026 (22,940 rows), and three raw-only registrations (the HM Land Registry Price Paid yearly files, the UK HPI full file and the NSPL) that carry no facts and are read by the stock builder against their registered sha256 pins. The feed grows from 927,239 to 950,242 rows; no existing package moves, so no compiled target changes and the vendored facts only carry the new provenance header. The OBR note is vendored for the benchmarks gate (`obr_hvcts_costing_facts.json`), the national references and the spine parity fixture sources are regenerated on the new pin, and the re-pin doc records the move. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PolicyEngine/chronicle#349 lands the inputs microcosm#1240 needs: the OBR April 2026 costing note for the High Value Council Tax Surcharge (63 rows), the ONS house price statistics for small areas by 2024 constituency to the year ending March 2026 (22,940 rows), and three raw-only registrations (the HM Land Registry Price Paid yearly files, the UK HPI full file and the NSPL) that carry no facts and are read by the stock builder against their registered sha256 pins. The feed grows from 927,239 to 950,242 rows; no existing package moves, so no compiled target changes and the vendored facts only carry the new provenance header. The OBR note is vendored for the benchmarks gate (`obr_hvcts_costing_facts.json`), the national references and the spine parity fixture sources are regenerated on the new pin, and the re-pin doc records the move. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PolicyEngine/chronicle#349 lands the inputs microcosm#1240 needs: the OBR April 2026 costing note for the High Value Council Tax Surcharge (63 rows), the ONS house price statistics for small areas by 2024 constituency to the year ending March 2026 (22,940 rows), and three raw-only registrations (the HM Land Registry Price Paid yearly files, the UK HPI full file and the NSPL) that carry no facts and are read by the stock builder against their registered sha256 pins. The feed grows from 927,239 to 950,242 rows; no existing package moves, so no compiled target changes and the vendored facts only carry the new provenance header. The OBR note is vendored for the benchmarks gate (`obr_hvcts_costing_facts.json`), the national references and the spine parity fixture sources are regenerated on the new pin, and the re-pin doc records the move. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Summary
Adds the published sources #343 asks for, so Microcosm can build local targets for high-value owner-occupied homes. There are two fact packages (23,003 facts) and four raw-only registrations. Field contracts, licences and parity are in
docs/data-sources/uk-high-value-housing.md.Fact packages
obr-hvcts-costing-april-2026: 63 facts for England, typedmodel_output/source_projection.household_net_income < 30000.ons-hpssa-pcon24-year-ending-march-2026: 22,940 facts.ons-oa21-pcon-jul2024-lookup.Raw-only registrations. These follow the precedent of #269 and the UK local rents (
registration_kind: raw_only): there is no package, alias or bundle entry, and nothing is parsed into facts. None of their bytes is committed: each file entry is markedstorage.local: false, and R2 holds the bytes.hmlr-price-paid-data-yearly-august-2026: HM Land Registry Price Paid Data, August 2026 release (published 29 September 2026). It is the 32 yearly files,pp-1995.csvtopp-2026.csv, keyed by year in one manifest.hmlr-price-paid-data-monthly-update-august-2026: the same release's change file, with record status A/C/D.hmlr-uk-hpi-full-file-july-2026: the UK House Price Index full file. It has index (January 2023 = 100), average price and sales by area, month and breakdown. The 317 England and Wales local authorities run from January 1995 to July 2026.ons-nspl-august-2026: the National Statistics Postcode Lookup. It covers 2,729,090 current and terminated postcodes and maps each tooa21cd,lad26cdandpcon24cd, among other geographies.Code:
hmlrjoins the UK publishers inR2_COUNTRY_PUBLISHERS, so its keys sit underraw/uk/.chronicle/artifacts.pyreads the newstorage.local: falsemarker.inventory-artifactsandpublish-rawaccept an R2-only entry without a local copy, so both stay valid overdb/dataon a fresh clone. They still check (andpublish-rawuploads) the bytes when a local copy is present.verify-rawchecks the R2 object. An entry marked R2-only with no R2 location is an error. Inventory counts gainr2_only_count, and publish counts gainskipped_count.scripts/build_uk_high_value_housing_packages.pywrites both packages from the pinned bytes, and every selector it emits is matched against publisher text.Fixes #343.
Review notes
Representation: the issue asked Chronicle to confirm these.
pp-complete.csv.publish-rawuploads throughwrangler r2 object put, which refuses files above 300 MiB (MAX_UPLOAD_SIZEin wrangler's source). The complete file is 5,525,539,417 bytes; the largest yearly file (pp-2002.csv) is 239,344,429 bytes.pp-complete.csv(31,610,742 rows).E06000053) have no HPI series, which the doc flags for Microcosm's uprating join.[x]emit no fact.Storage and licences:
.gitignoreentries and thestorage.local: falsemarker.ledger-rawbucket holds the bytes for provenance; nothing is redistributed.publish-rawuploaded all 37 new artifacts toledger-rawin the PolicyEngine account.verify-rawthen fetched each one back and matched its sha256 and size: 37 of 37 verified.Parity (all public aggregates):
Price Paid rows by year of transfer for this release are tabled in the doc. Every row has 16 fields; record status is
Athroughout the yearly files, andCandDappear only in the change file.pp-2024.csvhas 931,453 rows in this release (763,905 category A). That is not the 881,757 the issue quotes, which matches neither.The ONS seat sums against this release's category A sales of D/S/T/F, by year ending March:
The gap grows towards the latest year, which fits registrations lodged after ONS's extract.
The ONS workbook has no England and Wales total row, so the issue's in-file parity check cannot run. The tests pin the seat sums instead, and check that the four property types partition each seat-year.
Chronicle Governance
ledger-source-ingestorfor the packages and registrations.ledger-contract-maintainerfor thestorage.localmanifest field and its handling inchronicle/artifacts.py.chronicle/artifacts.py,chronicle/source_package.pyandchronicle/bundle.py(registration, as every package PR does, plus the marker);db/data/**;scripts/build_uk_high_value_housing_packages.py;docs/data-sources/uk-high-value-housing.md,docs/pe-uk-source-checklist.md,changelog.d/343.added.md,.gitattributesand.gitignore;tests/test_issue_343_uk_high_value_housing.pyandtests/test_chronicle_artifacts.py;README.mdanddocs/agent-source-package-harness.md(the marker).validate-packageandbuild-suitefor both packages: valid, with 0 agent-acceptance errors and lineage coverage 1.0.tests/test_chronicle_bundle.pyis re-pinned.property_type=semi_detached.db/datawithout any git-ignored bytes),inventory-artifactsoverdb/datais valid: 408 entries, 0 missing, 35 R2-only.publish-rawskips the 35 R2-only entries. A test checks the same on copies of the four manifests.verify-rawconfirms all 37 new R2 objects against their pins..gitignorecovers every uncommitted file, and a test checks it.ledger-source-fidelity: pending specialist review. Every fact is a publisher cell, guarded by its line text, table title or column header. The tests pin the published values.ledger-contract: pending specialist review. No fact, consumer-contract or identity change. The manifest gains an optionalstorage.localboolean, and the R2 routing gains a publisher.ledger-boundary: pending specialist review. The OBR values are publisher projections. De-duplication, category filtering, uprating, the owner-occupier adjustment, threshold counts and target binding all stay in Microcosm, as the issue's "Out of scope" lists.Tests
uv run pytest -q(the full suite, run as two parts) on Python 3.13, before the rebase:tests/test_chronicle_bundle.py: 25 passed;tests/test_issue_343_uk_high_value_housing.pyandtests/test_chronicle_artifacts.py: 63 passed, 1 skipped (the opt-in large-bytes check). WithLEDGER_VERIFY_LARGE_RAW=1, all 64 pass.tests/test_chronicle_source_package.py,test_uk_atomic_area_raw_sources.py,test_chronicle_uk_local_2025.py,test_chronicle_boundaries.pyandtest_chronicle_governance.py: 215 passed.Chronicle bundleruns it.tests/test_issue_343_uk_high_value_housing.py(18 tests) covers:ons-oa21-pcon-jul2024-lookup;storage.local: falsemarker;LEDGER_VERIFY_LARGE_RAW=1it also hashes the uncommitted bytes against their pins. That passes locally on all 35 uncommitted files, 5.8 GB.tests/test_chronicle_artifacts.pyadds six tests for the marker:uv run ruff check chronicle policyengine_chronicle db scripts tests: passed.ruff format --checkpasses on the new Python files.git diff --check: clean.🤖 Generated with Claude Code