Skip to content

Refresh the UK Universal Credit target contract - #727

Open
MaxGhenis wants to merge 1 commit into
mainfrom
uk-uc-contract-refresh
Open

Refresh the UK Universal Credit target contract#727
MaxGhenis wants to merge 1 commit into
mainfrom
uk-uc-contract-refresh

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

Part of #622 and the UC slice of #701. Refreshes the UK national calibration contract from policyengine-uk-data ebf733c to 1.56.16 (12a1e028afeef08d8b2d74ee03fd9de3a78b2dd3), following policyengine-uk-data#452 and chronicle#184.

The contract adds the value-free dwp.uc.households declaration: a prepared UC-receipt indicator summed at benefit-unit level. DWP “household” means the UC unit of assessment, not an ONS household.

This PR deliberately stops after the contract refresh. It does not start #623's calibration step and does not add an active UC reference, for the period-semantics reason below.

Period-semantics receipts and verdict

  • packages/microcosm-build/src/microcosm/build/ledger_targets.py:48-68: each LedgerTargetReference owns an optional per-reference period; periods are not restricted to one file-wide value.
  • packages/microcosm-build/src/microcosm/build/ledger_targets.py:797-845: selector resolution filters to facts at or before that reference's period and fails loudly when no eligible fact exists.
  • packages/microcosm-build/src/microcosm/build/country_spec.py:804-817 and :925-952: target_references.json is loaded and typed into CountrySpec.
  • There is no target_references receipt in packages/microcosm-build/src/microcosm/build/uk_runtime/national_build.py: the national build does not evaluate this resource yet.
  • Adopt the UK national calibration contract (re-homed from chronicle#164 per the #166 ruling) #707's 13 active references all carry period 2023, the certified-spine year.

Verdict: references support per-reference periods in the Belgian convention, but the present UK national build evaluates none of them. A 2025 UC fact cannot resolve for the certified 2023 active subset because the resolver admits only facts at or before the reference period. Labelling the UC row 2023 would fail closed; labelling it 2025 would create an inert mixed-period declaration rather than a target evaluated by the national build. Per the requested stop rule, activation is deferred instead of forcing a misleading period.

Consequently, fixture-backed activation and its loud-failure test are also deferred: adding tests for an activation that the verdict disallows would contradict the stop rule. The Chronicle bundle dependency remains chronicle#184 and a later released consumer feed.

Registry-parity accounting

The governed surface changes from 651 rows (609 mapped + 42 signed exclusions) to 652 rows (610 mapped + 42 signed exclusions):

  • added dwp/uc/householdsdwp.uc.households;
  • no other registry delta surfaced;
  • the four deleted UC jobseeker dispatch names from policyengine-uk-data#452 were never registry rows in the carried contract, so there were no parity entries to remove;
  • obr/jobseekers_allowance remains because it is the distinct published JSA expenditure target, not one of those deleted UC split names.

The exact closure invariant remains 187 declarations = 184 distinct mapped target IDs + 3 signed unmapped declarations.

Tests

All checks passed!
.............................................................            [100%]

Commands:

uv run ruff check packages/microcosm-build/tests/test_uk_national_targets.py
uv run pytest packages/microcosm-build/tests/test_uk_national_targets.py packages/microcosm-build/tests/test_uk_target_references.py packages/microcosm-build/tests/test_ledger_targets.py -q

Scope

No calibration, dataset build, upload, merge, or active-reference change is included. This PR does not close #622; other items remain. The separate #623 claim remains for a later run.

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.

Consume Ledger UK facts: uk_target_references, mapping module, and a compile-parity gate

1 participant