Skip to content

Add UK raw-source and local-geography parity#156

Draft
MaxGhenis wants to merge 3 commits into
mainfrom
codex/uk-assigned-local-20260619
Draft

Add UK raw-source and local-geography parity#156
MaxGhenis wants to merge 3 commits into
mainfrom
codex/uk-assigned-local-20260619

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR moves the UK replacement build closer to full Populace ownership by adding a raw-source parity contract and the long local-geography path needed to replace the legacy matrix workflow.

  • Add a packaged UK source-stage manifest covering FRS, WAS, LCFS, ETB, NHS, SPI, FRS-only fill, capital gains, salary sacrifice, SLC student loans, national/local calibration, rail public-service calibration, road fuel/energy scaling, and row-wise OA/LA/constituency geography.
  • Move UK stage order, donor citations, and structural-stage grouping out of Python lists and into source_stages.json; Python now derives UK_STAGE_NAMES, UK_DONORS, and UK_STRUCTURAL_SOURCE_STAGES from the manifest.
  • Declare UK national and local calibration as Ledger-backed stages: read ledger_consumer_facts, compile uk_national_calibration / uk_local_geography target profiles, then calibrate weights against household metric tables.
  • Add assigned long local-geography matrix/solver/runner support so local weights export as (area_type, area_code, household_id, weight) rows rather than preserving the dense area-by-household matrix artifact.
  • Extend UK SPI support surfaces and tests for the SPI support channel and FRS-only fill variables.

Validation

  • uv run ruff check .
  • uv run --package populace-build --group dev python -m pytest packages/populace-build/tests/test_uk_source_manifest.py -q
  • uv run --package populace-build --group dev python -m pytest packages/populace-build/tests -q
  • python3 -m json.tool packages/populace-build/src/populace/build/uk/source_stages.json >/dev/null
  • git diff --check
  • Manifest source URL scan: all unique URLs returned HTTP 200, including https://github.com/PolicyEngine/arch-data
  • Incumbent/eFRS reference scan over touched UK/docs/test surfaces: no matches
  • Review cycle: independent read-only subagent review loop ended with no actionable findings remaining

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