Add the E9 net-new UK stages: WAS debt chain segment and UC deduction attributes (#685) - #850
Open
juaristi22 wants to merge 5 commits into
Open
Add the E9 net-new UK stages: WAS debt chain segment and UC deduction attributes (#685)#850juaristi22 wants to merge 5 commits into
juaristi22 wants to merge 5 commits into
Conversation
juaristi22
force-pushed
the
uk-net-new-stages-685
branch
from
September 2, 2026 15:54
da8e275 to
c7e8505
Compare
… attributes (#685) Two of the issue's three items still needed building; bus fares were already delivered by E6 (#730) and are closed by receipt, not code. WAS debt: mortgage_debt (HMortGR8) and consumer_debt (HFINWR8_SUM less HFINWNTR8_exSLC_Sum, clipped at zero) join was_wealth as a fourth sequential chain segment conditioned on the base predictors, a declared has_mortgage_tenure flag (WAS Ten1R8 in {2, 3}; FRS OWNED_WITH_MORTGAGE) and every prior WAS output. The segment draws from the fourth child of the same declared seed, so the first three children and E5's fourteen columns are unchanged by construction (SeedSequence.spawn is prefix-stable; pinned). Bounds regenerated from the licensed tab; two net-new register entries; the dormant June allow-list rows are the pre-declaration. UC deduction attributes: a new benunit stage after uc_capital_coherence and before cgt_incidence_clone persists four columns. policyengine-uk 2.92.1 derives uc_has_deduction from the draw rather than the latent rate, so the stage writes the two identity-keyed uniforms (seed 0, output-name salts, float32-rounded and clamped as the engine stores them) together with the latent rate and type combination derived from them by the engine's own recipe, read from dwp_uc_deduction_distributions.json, a pinned mirror of gov.simulation.uc_deductions (DWP Tables 2/5/6, March-May 2025, ODS sha 307ec8fa, Chronicle package dwp-uc-deductions-march-2025-february-2026) held equal to the engine tree by a lockstep test. Both engine summation orders are reproduced. Attributes are assigned to every benefit unit and conditioned on region only; the engine gates on would_claim_uc and a positive award. Two generic operation kinds, an enum-domain gate, a stage-health check that recomputes the binomial tolerance, declared support bounds, four allow-list rows, four net-new register entries. Derived surfaces: manifest projection (indentation drift repaired), schema branches, country package, coverage-manifest sha and was_wealth outputs, spec-bundle sha, contract digests, node-graph cells/consumes/kernels, the H2 fixture regenerated with the three new WAS raw columns and a 27-transform oracle, roster pins 28 to 29, receipts skeleton with the I1 WAS audit figures, changelog. Codex implemented plan increments I2-I4 with zero deviations; an adversarial review's findings are folded in (engine summation order, declared segment predictor, producer-tolerance cap, fail-path tests, main-byte restoration of stage_health.py). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ributes by benunit id The four benunit columns are pure functions of benunit_id and the household region under the committed resource, so the licensed harness re-derives them in original and permuted row order and compares them with the stored artifact (--check e9). CGT clone and band-donor households are excluded and counted: those rows carry the completed columns copied onto re-keyed ids, not ids the stage drew on. Three hermetic tests cover the green path, a tampered stored rate, and the copy exclusion. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…r sigma The first licensed twin build ran all 27 stages and was blocked by the new stage-health gate on one band cell: the receipt compared a population- weighted share with a binomial band computed on unweighted rows. Identity- keyed draws give every unit the same probability whatever its weight, so the unweighted share is the mechanism's own statistic; the weighted share adds the frame's weight variance (design effect 1.4 among assigned units on the FRS 2024-25 spine) and belongs to the engine round-trip against the publisher. The receipt now gates the unweighted realization and reports the weighted one with its effective sample size. With about thirty cells per build, the band moves from three to four sigma (familywise false alarm from roughly one build in twelve to one in five hundred); the gate recomputes it from target and rows and still takes the tighter of producer and own. On the control spine's ids every cell passes with a worst ratio of 0.40. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rity, bus hand-off Two full builds of the branch are payload-identical, run 27 stages and pass the spine battery 15 of 15. Against the control build the only new columns are the six E9 columns, no common column differs and E5's fourteen columns are byte-equal. The e9 identity receipt passes on all 30,455 unique benefit units. The engine round-trip at 2024 and 2025 shows the flag, the held attributes and the fallback recomputed from the held draws agreeing on every claimant, zero deductions on non-claimants, and per-household statistics against DWP's (mean monthly 67.05 / 50.89; at-cap 0.148 / 0.265). Recipient incidence is read on unique rows because CGT copies double-count draws. Debt shares are donor-faithful with levels 1.2-1.3 times the donor means, inherited from E5's wealth surface. Strict parity's 15 unsigned columns are identical on the control (the 2.92.1 recognition re-record, #749's lane). Part D hands the bus totals by geography and the fare gradient against NTS to #789 and #790. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
juaristi22
force-pushed
the
uk-net-new-stages-685
branch
from
September 2, 2026 16:50
c7e8505 to
132600c
Compare
juaristi22
marked this pull request as ready for review
September 2, 2026 17:01
The licensed acceptance was re-run on the rebased tree: twins e9r-twin-a and e9r-twin-b (28 stages) are payload-identical and pass the spine battery, the control is rebuilt from main 47c7422, attribution again isolates exactly the six E9 columns with E5 byte-equal, the e9 identity receipt passes, and the six columns are byte-identical to the pre-rebase twins. The engine round-trip figures move slightly with the reporter redraw upstream (mean monthly 66.81 / 50.66; at-cap 0.145 / 0.263; unique-row incidence z 1.84 / 2.00). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #685 (WS-E child E9 of #145, epic #665). Plan:
repos/uk-685-net-new-stages-plan.md(approved 2026-09-02 after two review rounds); Codex implemented increments I2–I4 under the approved-plan protocol with zero deviations, followed by an adversarial review whose findings are folded in (listed below). Licensed I5 acceptance attached (Part E of the receipts); ready for review — María decides when to un-draft.What the issue asked for, re-measured against main
mortgage_debt(HMortGR8) andconsumer_debt(HFINWR8_SUM − HFINWNTR8_exSLC_Sum, clipped at 0) as a fourth sequential segment of thewas_wealthchain, conditioned on the base predictors, a declaredhas_mortgage_tenureflag (WASTen1R8 ∈ {2,3}↔ FRSOWNED_WITH_MORTGAGE) and every prior WAS output. Fourth child of the same seed, so E5's fourteen columns are unchanged by construction (SeedSequence.spawnprefix-stable, pinned by test).uc_deduction_attributesafteruc_capital_coherence, beforecgt_incidence_clone.UC deduction attributes — design (María's rulings A1–A3)
policyengine-uk 2.92.1 computes
uc_has_deductionfromuc_deduction_random_draw, not from the latent rate, so persisting only the two #450 attribute columns would leave the engine's flag (which every validation statistic uses) disagreeing with the held attributes on about half the units. The stage therefore persists four columns: the two identity-keyed uniforms (blake2b ofbenunit_id, seed 0, output-name salts, rounded to float32 and clamped to1 − 2⁻²⁴exactly as the engine stores them) and the two attributes derived from them by the engine's own recipe — the eleven-band inverse CDF ofu / (incidence × region factor)and the normalised seven-way combinationsearchsortedonv— read fromdwp_uc_deduction_distributions.json, a pinned mirror ofgov.simulation.uc_deductions(DWP Tables 2/5/6, March–May 2025 pre-FRR, ODS sha307ec8fa…, Chronicle packagedwp-uc-deductions-march-2025-february-2026). Both of the engine's summation orders are reproduced (left-to-right for the flag threshold, NumPy for the rate). Assignment is to all benefit units (latent, award-independent; the engine gates onwould_claim_ucand a positive award at run time, anduniversal_creditisdefined_for = would_claim_uc, so a non-claimant's attributes reach nothing) and conditioned on region only, which is what DWP publishes and what keeps the mirror exact. A parallel pe-uk seam PR (flag reads the held rate) is planned; when it releases, the two draw columns retire at that floor bump.Verification carried in the tree: engine-tree lockstep test for the resource (
requires_uk), a golden mirror test that materialises the engine's three variables on held float32 draws, band-edge equality with the engine'sBAND_LOWER/UPPER, closed-world operation drift asserts, permutation identity, enum names on export, and an independent I1 re-derivation of Tables 2, 4, 5 and 6 from the ODS (Tables 2 and 5 exact; Table 6 factors within 0.01 at two decimals under a denominator convention noted in the receipt).Surfaces moved
Two generic operation kinds (
map_uniform_to_banded_rate,map_uniform_to_categorical); the WAS chain op declaresdebt_segment_predictors; gates:uk_uc_deduction_combination_enum_domain,uk_stage_uc_deduction_attributes(stage-healthlatent_attribute_realization, which recomputes the binomial tolerance and holds each cell to the tighter of producer and recomputed),uk_support+uc_deduction_support_bounds.json,uk_stage_was_wealth_support+2 columns; export allow-list +4 benunit rows (the two household debt rows were the dormant June pre-declaration, reused per A5); sixnet_new_columnregister entries; coverage-manifest sha andwas_wealthoutputs; spec-bundle sha; contract digests; node-graph cells/consumes/kernels; the H2 fixture regenerated (synthetic WAS donor gained the three raw columns; 27-transform oracle); roster pins 28→29. The exact-k fixture also gainsuc_capital_coherence, a #828 omission surfaced by the contract test.Review findings folded in (adversarial round, 2026-09-02)
Engine summation order mirrored for both formulas;
has_mortgage_tenuredeclared in the manifest and drift-asserted (it was executed but undeclared); the boolean predictor cast likeis_renting;stage_health.pyrestored to main's bytes plus the new gate only (Codex had reformatted the whole module); the new gate no longer trusts the producer's tolerance; fail-path tests for every branch of the gate; a hand-edit indentation drift insource_stages.jsonrepaired; receipts and changelog wording.Verification
test_contract.py, the graph package incl.test_h2_uk_spine_parityin the engine tier), JUnit-counted from this branch's venv with policyengine-uk 2.92.1 present: targeted post-review set 857 passed / 0 failed / 1 expected skip (licensed WAS tab absent); rebased state on main47c74225(with UK spine: benefit-unit-grain SPI UC reporter draw with pre-take-up screen (#832); exact capital sentinel (#833) #835) 863 passed / 0 failed across the graph, roster, pin, contract and E9 suites. CI is authoritative.ruff checkclean on every touched file;tools/ci_test_groups.py --verifyok;tools/build_uk_release_input_coverage_manifest.py --checkok; fixture regeneration byte-identical to the committed directory.test_cached_reference_regeneration…,test_cached_candidate_regeneration…) fail on this machine exactly as on main: committed evidence minted under 2.89.0 vs installed 2.92.1 (PR Make the UK eFRS parity re-pin one reviewed command; hold every identity mirror in lockstep (companion to #747) #749's lane); untouched here.experiments/685-net-new-stages-receipts.md, raw JSON licensed-side): two full builds of the rebased branch (main47c74225, 28 stages) are payload-identical and pass the spine battery 15/15 (as did the pre-rebase pair). Against a control built from that main with the same inputs the only new columns are the six E9 columns, no common column differs, and E5's fourteen columns are byte-equal. The e9 identity receipt passes (30,455 unique benunits recomputed in original and permuted order equal the stored columns). Engine round-trip on 2.92.1 at 2024 and 2025 (rebased tree, with UK spine: benefit-unit-grain SPI UC reporter draw with pre-take-up screen (#832); exact capital sentinel (#833) #835's reporter redraw upstream): the flag, the attributes and the fallback recomputed from the held draws agree on every claimant (0 mismatches), non-claimants carry zero deductions; mean monthly deduction £66.81 / £50.66 (DWP £67–68 / £51–54), at-cap share 0.145 / 0.263 (pe-uk 0.134 / 0.264), unique-row incidence within three sigma (z 1.8 / 2.0). Debt: donor-faithful shares (0.307 vs 0.323; 0.526 vs 0.530), levels 1.2–1.3 times the donor means, inherited from E5's wealth surface (signed observation). Strict parity: the twin's unsigned set is identical to the control's (15 pre-existing columns from the 2.92.1 recognition re-record, Make the UK eFRS parity re-pin one reviewed command; hold every identity mirror in lockstep (companion to #747) #749's lane); E9 adds no unsigned difference.0d2e4e9d): the first twin was refused by the new stage-health gate on one band cell because the receipt gated a weighted share against an unweighted binomial band; the gate now holds the unweighted realization (identity-keyed draws are weight-blind) at four sigma and reports the weighted share with its effective sample size.47c74225); the licensed acceptance below was re-run on the rebased tree against a control built from that main, and the six E9 columns are byte-identical to the pre-rebase twins (identity-keyed draws; UK spine: benefit-unit-grain SPI UC reporter draw with pre-take-up screen (#832); exact capital sentinel (#833) #835 does not move them).UK-specificity note
DWP taxonomies (band edges, combination enum, region factors) and the WAS/FRS column names are UK; both new operation kinds are generic, and the debt segment reuses E5's generic chain machinery.
Not in this PR
Bus targets (#789), scalers (#790), the pe-uk seam PR (I7), closing PR #153 and the pointer comments on #789/#790 (each on María's go), Chronicle facts for Tables 2/5/6.
🤖 Generated with Claude Code