Repository navigation
Compare Guarantee Credit pound for pound only where it is paid at both amounts - #2653
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Standard reform costings (change in gov_balance)
Standard reforms: change in each reform's target
Household net income by decileNo household's net income changes in any year. No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles. Checks failing on both base and head (1)
Counted-once checkEach of 88 components was raised by £1 per unit in 2026-27, and every head of its totals was read household by household: its own head must rise by exactly £1, no other tax head may move, no other benefit may rise, and the model's own total must move by what its heads moved. A head that breaks a rule is measured again twice: with every other head held at its baseline value, and with every other head held at its value after the first £1 while the component rises again. It fails where either still shows the response. 0 failed; 0 were skipped.
Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
Per the independent review of #2653 (F1, F2): instead of skipping steps where Guarantee Credit starts or ends, assert that the minimum guarantee does not move with WPA, that a paid Guarantee Credit becomes max(before - extra income, 0), and that from zero it rises by no more than the income falls. The new IIDB example's own 0 -> 404.40 step is now checked. The docstring's invariant 1 says the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge audit (UK hub, Claude Opus 5.5). Landing at head
|
Fixes #2652
test_guarantee_credit_falls_pound_for_pound_with_widowed_parents_allowancechecks that Guarantee Credit falls pound for pound with extra Pension Credit income. Its mask looked only at the later Guarantee Credit amount (gc[..., 1:] > 0). Where Guarantee Credit starts from zero, it rises by no more than the income falls, so such a draw would fail although the model is right. The independent review of #2645 (round 2, note N4) found this by reading the code.Changes
The pound-for-pound check now covers both ends, rather than skipping the steps where Guarantee Credit starts or ends (round 1 review of this PR, F1). Guarantee Credit is the minimum guarantee less Pension Credit income, floored at zero, and WPA does not move the minimum guarantee, so the test asserts:
max(before - extra income, 0)at the higher one;The module's invariant 1 now says the same. An earlier commit on this branch only masked the bad steps (
(gc[..., :-1] > 0) & (gc[..., 1:] > 0)); the review found that sound but weaker.CARER_WITH_IIDB(the England carer with £10,500 of IIDB) is added as an explicit@example. It is the review's hand-calculated case: WPA from £0 to £1,250 displaces Carer's Allowance, and Guarantee Credit rises from £0 to £404.40 while Pension Credit income falls £520. Its own £0 → £404.40 step is now asserted too. CI runs it.Fragment:
changelog.d/2652.fixed.md.Test-only: no formula, parameter or input changes.
Reproducer: policyengine_uk/tests/test_pension_credit_widowed_parents_allowance_properties.py::test_guarantee_credit_falls_pound_for_pound_with_widowed_parents_allowance
Validation
uvx ruff format --checkpasses on the changed file, and it parses.Impact
None: test-only. The diff changes only a test and a changelog fragment, so no model output can change. The Aggregate impact job on the first head timed out at its 60-minute limit (run 40164097546) and posted no report; it is not a required check.
axiom: n/a: test-only change
🤖 Generated with Claude Code