Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Key the UK Child Benefit claim draw on each family's eldest eligible child under 16, and redraw the SPI copies' Child Benefit reports before the draw reads them (#1508).

The draw claims for all of a family's children or none, and keyed each family on its eldest eligible child. A family whose 16-to-19-year-old's claim had lapsed lost its younger children's claims with it, and the rates at younger ages could not make up for them. Families are now keyed on their eldest eligible child under 16, or on their eldest when none is under 16, and the rates are solved for ages 15 down to 0, then 19 down to 16. A young person who lives with younger siblings is then claimed for at the younger child's rate, so ages 17 to 19 can sit above HMRC's claimed shares; the stage gate reports such clipped ages without holding them.

The SPI income chain gave each SPI copy its benefit reports from its age, gender, region and incomes, without its children. A copy with no eligible child could report Child Benefit, and copy families reported it too rarely below the charge start and too often where the charge takes the whole benefit. A reporter always claims and is never opted out, so the stage now redraws the copies' reports first: a copy family reports at the weighted share of FRS families that report in its cell (eligible children 1, 2 or 3 or more, by the charge band of its highest adjusted net income), coupled to its FRS twin so that a copy in its twin's cell keeps the twin's report, and a copy with no eligible child takes its twin's reports. A new report carries the engine's `child_benefit_entitlement` on the benefit unit head. FRS rows are unchanged. `child_benefit_reported` joins the stage's rewrites and `child_benefit_entitlement` its engine predictors; the receipt gains `copy_reports`, and the stage gate also requires FRS rows unchanged, every cell on at least 30 FRS source households and the copies' reporting share within 0.05 of its cells' rates.

On the b2179c spine at the stage's weights (survey year 2024), copy families report at 69% after the redraw against 46% before and 68% expected from their cells; 87.1% of eligible children are claimed for against 87.0% at HMRC's claimed shares by age; ages 0, 1 and 17 to 19 clip; 7.9% of claiming families opt out against 9.1%, with the fully charged pool exhausted; and families paid with an income above the charge start fall from about 0.89m under the old rules to 0.75m, 0.58m of them reporters. The UK spine graph fixture is regenerated.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hold HMRC's one-child Child Benefit families in payment (`hmrc.child_benefit.families_in_payment.children_1`) out of the UK solve (#1710). HMRC counts claimant families by the children in payment, and its one-child count is above the FRS's benefit units with one dependent child of any kind, while the other family sizes agree within a few percent; the claim draw only chooses which eligible units are paid, so the row could be met only by inflating one-child families. The row stays measured on every evaluation, and the other family sizes stay bound.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A new UK spine stage, `uc_housing_costs_claim`, stores policyengine-uk 2.180.0's `would_claim_uc_housing_costs_element` from DWP's award statement (B1 of microcosm#1710). A linked FRS claim whose statement carries no housing element (BENEFITS.UCHOUSEL 0) where the locked engine pays one is false, so the flag carries only the zeros the engine can't explain. Every other benefit unit keeps the default: unlinked units have no statement of their own, and an SPI-channel unit's copied statement no longer belongs to it, since the SPI income chain redraws the copies' incomes and benefit reports. The stage runs just before `uc_take_up`, so the take-up draw sees the awards it leaves. `frs_spine` carries the statement as the person carrier `frs_uc_housing_element_status`, which the release drops; the flag joins the export surface and, like the other take-up flags the build writes, the concept mapping's take-up bindings, so the gate battery's vintage pins, the release cut's digests and the concept coverage follow. María signed the choices on 25 November 2026.
1 change: 1 addition & 0 deletions changelog.d/1710-uc-three-loss-families.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK national calibration weights its targets by loss family (`loss_family_equal`, María's ruling of 25 November 2026, microcosm#1710). A row's loss family is its register family, except that DWP's Universal Credit family splits into three by contract target (`UK_NATIONAL_LOSS_FAMILIES`): the award amount bands by family type; UC households in total, by family type and by number of children, with people aged 16 to 21 and 22 to 24; and the housing element by tenure with the six single-row tables. Each of the three takes one family's share of the objective, where under `family_equal` each composition row weighed under 1/4,000 of it. A bound row of the split family whose contract target is not listed is refused. Only the national loss weights change: the register family stays every row's family for source months, holds, exclusions, the support floor, gates, diagnostics and the mass reason, and the local doctrine's rules read it as before. `family_equal` stays a receipted per-run override.
1 change: 1 addition & 0 deletions changelog.d/uk-policyengine-uk-2-180-0.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK lock moves from policyengine-uk 2.179.2 to 2.180.0 (microcosm#1710), the newest release; the UK side's policyengine-core stays at 3.34.10 and the US side at 3.32.5. 2.180.0's stored-draw check still names only policyengine-core 3.34.9 as qualified (`QUALIFIED_CORE_VERSIONS`), as 2.179.2's did. 2.180.0 adds one engine input, `would_claim_uc_housing_costs_element` (policyengine-uk#2951), whose false leaves the Universal Credit housing costs element out of an award; the new `uc_housing_costs_claim` stage stores it (B1 of microcosm#1710). The other rule changes since 2.179.2: Housing Benefit takes the rent, less the meals deduction, as the eligible rent of a private renter in a houseboat, caravan or mobile home instead of capping it at the Local Housing Allowance (2.180.0; the spine records `accommodation_type`), and the Universal Credit education protection for a claimant moved off legacy benefits now needs a full-time course that reg 12(2) covers (2.179.4). The texts that describe the locked engine were checked against the diff from 2.179.2 to 2.180.0 and now cite 2.180.0; the concept coverage (404 inputs), the uprating pins and bonus anchor (stamps only), the core pin test, `APPROVED_UV_LOCK_SHA256`, the release input coverage manifest and the H2 spine fixture follow.
8 changes: 4 additions & 4 deletions docs/concept-coverage/policyengine-uk.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Concept coverage: policyengine-uk

Engine version `2.179.2`; concept schema `5a55669d0447`. Generated by `tools/refresh_concept_coverage.py`; do not edit by hand.
Engine version `2.180.0`; concept schema `5a55669d0447`. Generated by `tools/refresh_concept_coverage.py`; do not edit by hand.

- Engine inputs: 403
- Fed by a concept: 41
- Engine inputs: 404
- Fed by a concept: 42
- Structural: 11
- Uncovered: 351
- Mapped but missing from the engine: 0
Expand All @@ -30,7 +30,7 @@ Engine version `2.179.2`; concept schema `5a55669d0447`. Generated by `tools/ref
| `fact:person.educational_attainment` | `highest_education` (person) |
| `fact:person.education_enrollment` | `childcare_grant_full_time_student` (person)<br>`in_HE` (person) |
| `fact:person.enrolled_full_time` | `childcare_grant_full_time_student` (person) |
| `fact:person.take_up_seed` | `child_benefit_opts_out` (benunit)<br>`would_claim_adult_dependants_grant` (person)<br>`would_claim_bursary_fund_16_to_19` (person)<br>`would_claim_care_to_learn` (benunit)<br>`would_claim_carers_allowance` (person)<br>`would_claim_child_benefit` (benunit)<br>`would_claim_childcare_grant` (person)<br>`would_claim_disabled_students_allowance` (person)<br>`would_claim_extended_childcare` (benunit)<br>`would_claim_marriage_allowance` (person)<br>`would_claim_parents_learning_allowance` (person)<br>`would_claim_pc` (benunit)<br>`would_claim_scp` (person)<br>`would_claim_targeted_childcare` (benunit)<br>`would_claim_tfc` (benunit)<br>`would_claim_travel_grant` (person)<br>`would_claim_uc` (benunit)<br>`would_claim_uc_at_legacy_closure` (benunit)<br>`would_claim_uc_childcare` (benunit)<br>`would_claim_universal_childcare` (benunit) |
| `fact:person.take_up_seed` | `child_benefit_opts_out` (benunit)<br>`would_claim_adult_dependants_grant` (person)<br>`would_claim_bursary_fund_16_to_19` (person)<br>`would_claim_care_to_learn` (benunit)<br>`would_claim_carers_allowance` (person)<br>`would_claim_child_benefit` (benunit)<br>`would_claim_childcare_grant` (person)<br>`would_claim_disabled_students_allowance` (person)<br>`would_claim_extended_childcare` (benunit)<br>`would_claim_marriage_allowance` (person)<br>`would_claim_parents_learning_allowance` (person)<br>`would_claim_pc` (benunit)<br>`would_claim_scp` (person)<br>`would_claim_targeted_childcare` (benunit)<br>`would_claim_tfc` (benunit)<br>`would_claim_travel_grant` (person)<br>`would_claim_uc` (benunit)<br>`would_claim_uc_at_legacy_closure` (benunit)<br>`would_claim_uc_childcare` (benunit)<br>`would_claim_uc_housing_costs_element` (benunit)<br>`would_claim_universal_childcare` (benunit) |
| `fact:household.tenure` | `tenure_type` (household) |
| `fact:household.rent` | `rent` (household) |
| `fact:household.mortgage_interest` | `mortgage_interest_repayment` (household) |
Expand Down
25 changes: 25 additions & 0 deletions docs/uk-child-benefit-claim-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ families for any remainder. Neither contract opts out reporters or nonclaimants,
and units without eligible children keep their early claim draw. Identity-keyed
random draws and claim-rate solving remain unchanged.

## The family key and the SPI copies' reports

Two parts of the stage changed in [Microcosm #1508](https://github.com/PolicyEngine/microcosm/issues/1508):

- The claim draw keys each family on its eldest eligible child under 16, or on
its eldest eligible child when none is under 16, and solves the claim rates
for ages 15 down to 0 before 19 down to 16. A family whose young person's
claim lapses keeps claiming for its younger children, so the young person's
low claim rate no longer applies to them.
- The SPI copies' Child Benefit reports are redrawn before the claim draw reads
them. The SPI income chain gives a copy its benefit reports without seeing
its children, and a reporter always claims and is never opted out. A copy
family now reports at the weighted share of FRS families that report in its
cell, eligible children (1, 2, 3 or more) by the charge band of its highest
adjusted net income, coupled to its FRS twin so that a copy in its twin's cell
keeps the twin's report. A copy without an eligible child takes its twin's
reports. FRS rows are unchanged.

The receipt's `copy_reports` records each cell's FRS reporting rate and the FRS
source households it rests on, and the copy families' reporting share before
the redraw, expected from their cells and after it. A figure resting on one or
two households is withheld. The stage gate requires FRS rows unchanged, every
cell on the declared support, and the copies' share within 0.05 of its
expectation.

The stage's `claims`, `opt_outs` and `in_payment` statistics describe the draws
against HMRC targets. `in_payment` counts claims excluding drawn opt-outs, whose
selection now matches the installed baseline payment-suppression rule. It does
Expand Down
4 changes: 2 additions & 2 deletions docs/uk-full-build-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ For smaller outputs, add `--dataset-households 150000` to use the common informe

## Graph owners and shared contracts

The spine graph is the 57-stage source roster declared by the UK spec, built by `uk_runtime.spine_build` (the spine tool moved into the package; `tools/build_uk_frs_spine.py` is a six-line shim over it). The superseded `frs_hmrc_retained_leaves` and `hmrc_spi_income` stages and the `UK_SPINE_EXCLUSIONS` list that hid them are removed; the active HMRC path is `frs_hmrc_spine_leaves`, `spi_support_channel`, `spi_income_band_donors` and `hmrc_spi_income_spine`, and the FRS HMRC leaf columns come from `uk_runtime.frs_hmrc_source`. The spine's assembled and transferred gate batteries are graph nodes (`uk_runtime.graph_evidence`); stage evidence and fit-weight records are read back from the content store through the shared `stage_evidence` artifact rather than from in-memory collectors; the HMRC replay sidecar is rebuilt from the SPI stage's checkpoint metadata; the spine sidecar records the operation inventory and the graph manifest, and the graph manifest is saved as `spine.graph.json` under the checkpoint root.
The spine graph is the 58-stage source roster declared by the UK spec, built by `uk_runtime.spine_build` (the spine tool moved into the package; `tools/build_uk_frs_spine.py` is a six-line shim over it). The superseded `frs_hmrc_retained_leaves` and `hmrc_spi_income` stages and the `UK_SPINE_EXCLUSIONS` list that hid them are removed; the active HMRC path is `frs_hmrc_spine_leaves`, `spi_support_channel`, `spi_income_band_donors` and `hmrc_spi_income_spine`, and the FRS HMRC leaf columns come from `uk_runtime.frs_hmrc_source`. The spine's assembled and transferred gate batteries are graph nodes (`uk_runtime.graph_evidence`); stage evidence and fit-weight records are read back from the content store through the shared `stage_evidence` artifact rather than from in-memory collectors; the HMRC replay sidecar is rebuilt from the SPI stage's checkpoint metadata; the spine sidecar records the operation inventory and the graph manifest, and the graph manifest is saved as `spine.graph.json` under the checkpoint root.

| Operation | Graph owner |
| --- | --- |
| Raw FRS and donor preparation, enrichment, support channels | The 57 UK spine stage nodes and their declared composite operations |
| Raw FRS and donor preparation, enrichment, support channels | The 58 UK spine stage nodes and their declared composite operations |
| Assembled and transferred spine gates | `spine.gates.assembled`, `spine.gates.transferred` |
| Bound checkpoint admission | `uk.full.spine_checkpoint`, when resuming a saved spine |
| Pool sample and mass normalization | `uk.full.sample`, `uk.full.normalize` |
Expand Down
4 changes: 2 additions & 2 deletions docs/uk-isa-subscriptions-1415.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nothing in the spine reads its outputs.
The `was_lisa` stage also anchors Lifetime ISA holders to HMRC's payers (below,
and [the LISA notes](uk-lisa-1003.md)).

The pinned policyengine-uk 2.179.2 reads all five:
The pinned policyengine-uk 2.180.0 reads all five:

- `lifetime_isa_payments`, whose 25% bonus is `lifetime_isa_bonus`;
- the subscriptions, against the limits of policyengine-uk#2712
Expand Down Expand Up @@ -193,7 +193,7 @@ HMRC's national totals, so it is a population fact check.
The fields support the subscriptions a limit leaves out: the overall £20,000
limit and a separate cash limit (the £12,000 under-65 setting is a reform in
policyengine-uk), through `isa_subscriptions_above_limit` and
`cash_isa_subscriptions_above_limit`. policyengine-uk 2.179.2 reads neither in
`cash_isa_subscriptions_above_limit`. policyengine-uk 2.180.0 reads neither in
any tax or spending variable, so a limit reform changes those amounts but costs
nothing until the engine models where the excess goes. The subscriptions are
flows the engine does not uprate, so a later year reads 2024-25 amounts. In
Expand Down
2 changes: 1 addition & 1 deletion docs/uk-lisa-1003.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ financial wealth. LISAs are not inside `savings` (savings accounts),
`cash_isa`, `stocks_and_shares_isa` or `corporate_wealth`. The LISA columns are
a detail of gross financial wealth: they must never be added to it, to
`savings`, or to the ISA columns. The engine's `total_wealth` does not read
`gross_financial_wealth`. On policyengine-uk 2.179.2 the means tests of
`gross_financial_wealth`. On policyengine-uk 2.180.0 the means tests of
Universal Credit, Housing Benefit, Pension Credit, income-based ESA and JSA and
Income Support count a LISA at its surrender value
(`lifetime_isa_countable_capital`: the balance less the withdrawal charge below
Expand Down
10 changes: 7 additions & 3 deletions docs/uk-national-calibration-runbook-623.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ supply, and no way for the receipt to claim an identity the file does not have.

Solve parameters are per-run overrides of the declared doctrine. Since the
2026-09-20 ruling (microcosm#823) the doctrine is the campaign posture itself:
1,500 epochs, `family_equal`, learning rate 0.02, seed 0, so a doctrine run
passes no solve flags and records no overrides; `--target-weight-rule uniform`,
another `--epochs`, `--learning-rate` or `--target-loss-cap` is validated
1,500 epochs, `loss_family_equal`, learning rate 0.02, seed 0, so a doctrine run
passes no solve flags and records no overrides. `loss_family_equal` (María's
ruling of 2026-11-25, microcosm#1710) is `family_equal` over loss families: a
row's loss family is its register family, except that DWP's Universal Credit
family splits into award bands, composition, and housing with the single-row
tables (`UK_NATIONAL_LOSS_FAMILIES`). `--target-weight-rule family_equal` or
`uniform`, another `--epochs`, `--learning-rate` or `--target-loss-cap` is validated
through the doctrine dataclass and echoed as an explicit deviation in the
manifest, diagnostics and build record. The national role refuses
`--release-candidate` outright: its six-gate battery cannot sign
Expand Down
2 changes: 1 addition & 1 deletion docs/uk-national-release-assembly-runbook-806.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ recorded as `status: error` and warned. Without the flags the manifest says
is scored with `tools/score_uk_national_candidate.py`, given `--reference-h5`
and `--reference-record`.

The role's doctrine is the campaign posture (1,500 epochs, `family_equal`,
The role's doctrine is the campaign posture (1,500 epochs, `loss_family_equal`,
learning rate 0.02, seed 0): a certified cut passes no solve flags and records
no overrides. It writes `microcosm_uk_2024_25.h5`,
`calibration_diagnostics.json`, `build_record.json`,
Expand Down
2 changes: 1 addition & 1 deletion packages/microcosm-build/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ us = [
# The UK extra adds the rules engine for local metric generation from a
# Microcosm UK H5. Target tables remain explicit inputs, and the base package
# still does not import policyengine-uk at import time.
uk = ["policyengine-uk>=2.179.2", "microcosm-data>=0.1,<0.2", "h5py>=3", "tables>=3", "openpyxl>=3.1"]
uk = ["policyengine-uk>=2.180.0", "microcosm-data>=0.1,<0.2", "h5py>=3", "tables>=3", "openpyxl>=3.1"]

[project.scripts]
microcosm-build-uk = "microcosm.build.uk_runtime.full_build_cli:main"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"assign_trips_from_band_means",
# microcosm#1428: the self-employed's gross receipts.
"assign_trading_allowance_receipts",
# B1 of microcosm#1710: DWP's admin-linked UC housing element status.
"assign_uc_housing_claim_from_admin_status",
# microcosm#1095 (Y1): DWP's admin-linked UC limited capability status.
"assign_uc_limited_capability_from_admin_status",
# microcosm#1095: UC's new-claimant health element draw, by claim recency.
Expand Down Expand Up @@ -208,6 +210,7 @@
"restore_spi_channel_reports_from_source_within_earnings_limit",
"zero_pension_age_reports_below_state_pension_age",
"zero_spi_channel_reports",
"redraw_spi_reported_child_benefit",
"redraw_spi_reported_uc",
"redraw_spi_reporter_capital",
"record_mass_conservation_receipt",
Expand Down
Loading
Loading