Skip to content

Add Arch-backed UK target provider#1

Draft
MaxGhenis wants to merge 22 commits into
mainfrom
codex/uk-target-parity
Draft

Add Arch-backed UK target provider#1
MaxGhenis wants to merge 22 commits into
mainfrom
codex/uk-target-parity

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented May 22, 2026

Summary

  • add a UK Arch consumer-fact JSONL target provider
  • map OBR receipt/expenditure concepts, HMRC salary-sacrifice employee-count and relief facts/projections, HMRC SPI income-band targets, ISC private-school pupil counts, SLC student-loan/support targets, ONS/NRS demographic counts, ONS savings interest, ONS dwelling-tenure and household-type targets, Scottish Child Payment spend, regional council-tax band counts, DWP claimant/benefit-cap/UC payment-distribution/two-child-limit targets, NTS household vehicle-availability targets, and the EHS/PRHI housing rent targets into canonical microplex target specs
  • preserve Arch source lineage, geography, concepts, source filters, source names, and component lineage for repayment, benefit-cap, and projection targets in target metadata
  • normalize UK country and region GSS codes to PolicyEngine enum values and support PE-specific fiscal-year labeling where needed
  • apply PE target-profile construction choices explicitly where they are not source facts, including the 1.9 property-income scale on HMRC SPI amount targets, the 3% annual HMRC salary-sacrifice relief uprating from the 2024 base, the NRS live-birth proxy for Scotland babies-under-1, the DWP benefit-cap monthly-band midpoint annualization/flooring, the NTS share-times-household-base conversion, the EHS weekly-social-rent-times-52-times-UK-social-renter-base conversion, the PRHI monthly-private-rent-times-12-times-UK-private-renter-base conversion, and the ONS National Balance Sheet 2024 total-land rounding/2020 sector-share split/hold-forward profile while preserving source details in target metadata
  • map ONS household-type rows to PE household-type count profiles, including child-count, head-age, household-person-count, and household-benefit-unit filters where PE uses those profile definitions
  • map DWP UC monthly payment-band facts to PE annual UC filters and family-type filters; the open-ended top band preserves PE name parity with the current nan_to_nan label while retaining a truthful lower-bound filter
  • map DWP two-child-limit publication rows selectively to the 15 PE 2026 target profiles, leaving Arch-only unsupported breakdown rows unmapped
  • support tax-year/fiscal-year/monthly/calendar-year consumer facts such as 2022-23, 2023-24, 2025-05, 2025-11, 2026, and 2024 NTS shares and align the Python floor/lockfile with the shared microplex dependency
  • verifies Arch local-authority council-tax facts map to PE voa/council_tax/{LA}/{band} target names and local_authority filters without changing production mapping code

Verification

  • uv run --extra dev ruff check src/microplex_uk/targets/arch.py tests/targets/test_arch.py
  • uv run --extra dev pytest tests/targets/test_arch.py -q -> 24 passed
  • uv run --extra dev --with tables pytest -q -> 49 passed
  • real HMRC salary-sacrifice relief 2024 suite smoke check: projected all 6 PE HMRC relief targets for 2025 and 2026 with matching names and values under PE's 3% annual growth rule
  • real SLC borrower forecast 2026 suite smoke check: built 4 valid consumer facts and matched all 4 PE 2026 borrower target names and values
  • real EHS suite smoke check: built 1 valid consumer fact and matched PE housing/rent_social for 2025 name, source, unit, variable, and value (£30.68bn)
  • real ONS PRHI private-rent 2026 suite smoke check: built 1 valid consumer fact and matched PE housing/rent_private for 2025 name, source, unit, variable, and value (£89.0352bn)
  • real ONS Families and Households 2024 suite smoke check: built 10 valid consumer facts and matched all 10 PE 2024 household-type target names and values
  • real ONS National Balance Sheet 2024 suite smoke check: built 5 valid consumer facts and matched PE ons/household_land_value, ons/corporate_land_value, and ons/land_value for 2024, 2025, and 2026
  • refreshed PE parity gap count with land suite included: 2025 covered 278 of 3,157 PE targets; 2026 covered 28 of 975 PE targets
  • real VOA + Scottish Government council-tax 2025 combined suite smoke check: 2,662 / 2,662 PE voa/council_tax target names covered with 0 missing names and 0 value mismatches, including 2,563 local-authority band targets
  • uv run --extra dev ruff check src/microplex_uk/targets/arch.py tests/targets/test_arch.py
  • uv run --extra dev pytest tests/targets/test_arch.py -q -> 24 passed
  • uv run --extra dev --with tables pytest -q -> 49 passed

Source smoke checks

  • built Arch OBR expenditure 2025 suite: 19 valid consumer facts
  • built Arch HMRC salary-sacrifice reform 2025 suite: 3 valid consumer facts
  • built Arch HMRC salary-sacrifice relief 2024 suite: 6 valid consumer facts mapped to 6 PE 2024 relief targets and projected to all 6 PE 2025/2026 relief targets
  • built Arch HMRC SPI income-band 2023 suite: 156 valid consumer facts mapped to 156 2023 income-band targets with total-income filters and positive-income count filters
  • built Arch ONS UK population projection 2025 suite: 13 valid consumer facts mapped to UK total and gender-age targets
  • built Arch ONS Families and Households 2024 suite: 10 valid household-type count facts mapped to all 10 PE 2024 ONS household-type target names with matching values
  • built Arch ONS National Balance Sheet 2024 suite: 5 valid land-value facts; the total-economy fact maps to PE national total, household, and corporate land targets using explicit rounding, split, and hold-forward metadata
  • built Arch NRS mid-year population 2024 and vital-events 2024 suites: Scotland under-16 and babies-under-1 proxy targets mapped
  • built Arch ONS dwelling-tenure 2024 suite: 5 valid consumer facts mapped to 5 England tenure targets, with social rent represented as the PE council-or-HA tenure union
  • built Arch MHCLG EHS rented-sectors 2024 suite: 1 valid £118/week social-rent fact mapped to PE housing/rent_social with source-to-target adjustment metadata
  • built Arch ONS PRHI private-rent 2026 suite: 1 valid £1,374/month UK private-rent fact mapped to PE housing/rent_private with source-to-target adjustment metadata
  • built Arch ISC census 2024 suite: 1 valid private-school pupil-count consumer fact with concept alignment
  • built Arch SLC borrower forecast 2025 and 2026 suites, student-support 2025 suite, and repayment suites for 2025
  • built Arch ONS savings-interest 2025 suite: 1 valid consumer fact
  • built Scottish Government social-security-assistance 2025 suite: 1 Scottish Child Payment spend fact mapped, with the separate under-1 child-count fact intentionally not mapped here
  • built VOA and Scottish Government council-tax-band 2025 suites: 2,662 PE voa/council_tax target names matched exactly, including the 2,563 source-numeric local-authority band facts from VOA CTSOP1.0
  • built Arch DWP PIP daily-living, benefit-statistics, and benefit-cap 2025 suites: 29 valid consumer facts mapped to 8 2025 DWP targets, including ESA/JSA counts and benefit-cap total reduction
  • built Arch DWP UC national payment distribution 2025 suite: 104 valid consumer facts mapped to all 104 PE UC payment-distribution target names
  • built Arch DWP UC two-child-limit 2026 suite: 42 valid consumer facts, selectively mapped to all 15 PE two-child-limit target names with matching values and no extra target names
  • built Arch DfT NTS household car availability 2024 suite: 3 valid share facts mapped to all 3 PE NTS household vehicle-count targets with matching values and source-to-target adjustment metadata
  • provider smoke-loaded 30 targets for 2024 from HMRC pension tax relief, ISC census, ONS tenure, ONS household-type, ONS land, NRS demographic, and NTS consumer facts
  • provider smoke-loaded 286 targets for 2025 across 27 Arch source suites, including HMRC relief projections, ONS land targets, EHS/PRHI rent targets, 104 UC payment-distribution targets, and 18 SLC targets with repayment plan rollups
  • provider smoke-loaded 28 targets for 2026, including HMRC relief projections, ONS land targets, SLC borrower forecasts, and all 15 PE 2026 DWP two-child-limit targets; no 2026 SLC target names remain missing in that year profile

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