Repository navigation
Conversation
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Thanks Anthony. Reviewed at 54e19d2: the fix looks right to me, with a few small points.
All four corrected 2025-26 values match SI 2025/295 art. 29 (£227.10 / £346.60; £198.27 / £314.34; NI SR 2025/64 gives the same), and the explicit 2026 entries match SI 2026/148. Tests pass locally (PC directory 106/106; PC + integration 207/207 when merged into current main), and six of the new tests fail on the old values.
- Overlap with #1925. Max's #1925 sets the same four values and makes the same
entitledto_scenarios.yamledit (4,023.20 / 18,048.66), so whichever merges second will conflict. #1925 currently has conflicts with main and this PR is green, so I'd suggest merging this one first and rebasing #1925 on it. That also keeps the tests here and closes #2083, which #1925 doesn't link. - The savings credit tests don't catch the fix.
savings_credit.yamlCase 3 passes on the old values too (MG − threshold is 28.83 under both sets), and Case 4 only moves by 1p. A case that separates them: a single person with £11,000 income gets 413.98 on the new values vs 577.78 on the old. A positive eligibility case just above the new threshold would help too; the current eligibility cases are all negative. - Nit: the other 2025 amounts in art. 29 are still off on main (carer £46.40 vs 46.37, severe disability £82.90 vs 83.25, child £67.42 vs 67.60, child disability £36.54 vs 36.68, child severe disability £114.12 vs 114.54). #1925 covers these, so fine to leave them there.
- Nit, follow-up rather than this PR: from 2027 the minimum guarantee is uprated by
gov.benefit_uprating_cpi(minimum_guarantee.yaml), but SSAA 1992 s.150A(2) requires an increase not less than earnings growth, so projected Pension Credit is understated in later years. - Nit: the docs edit and its revert (b270272 / 54e19d2) could be squashed.
b1097c2 to
ddfd3f0
Compare
Critical fixed
Should-address fixed
Skipped by design
Verification
|
|
Addressed all three findings from the latest review:
Validation: |
0d45a0d to
8bc60ad
Compare
|
@vahid-ahmadi I rebased this PR cleanly onto current main (base revision c85ffef; new PR revision 8bc60ad) and renewed your review request. Focused local validation passed: formatting/lint, 40 Python tests, and 51 YAML policy tests. I did not run the full test suite locally; GitHub checks are running against the rebased revision. Could you please re-review the latest revision? |
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Thanks Anthony. I re-reviewed at 8bc60ad. The earnings uprating of the guarantee, the derived Savings Credit threshold and the protected HB allowances all look right to me. The 2025-26 and 2026-27 enacted values are unchanged from the SIs, and the projected maximum Savings Credit follows September CPI exactly: £17.96 → £18.34 → £18.72 → £19.10 → £19.49 for a single person, 2026 to 2030.
Locally, the 40 changed Python tests pass, and so do 448 YAML cases (the Pension Credit, Housing Benefit and integration directories). From my last round:
- the £11,000 savings credit case (413.98);
- the positive eligibility case;
- the s.150A earnings point.
Those are all in now, and the docs edit and its revert go away in the squash.
Should
-
2025-26 pension-age HB allowances are still on the old guarantee.
housing_benefit/allowances/{single,lone_parent}/aged.yaml:11-12hold 239.20 andcouple/aged.yaml:11holds 357.98, which is the old £221.85 / £338.61 guarantee plus maximum Savings Credit. DWP's 2025-26 rates are 244.40 / 366.00: £227.10 + £17.30, and £346.60 + £19.35 rounded up.- With the corrected guarantee, the protected allowance in 2025-26 sits only £12.10 (single) and £11.38 (couple) above it, instead of the maximum Savings Credit, so HB is understated by up to £5.20 a week for pension-age claimants just above Guarantee Credit.
- Since this PR now owns the PC/HB relationship and edits these files, I'd fix the three 2025 values here and add one 2025 case. #1925 makes the same change, so it can drop those hunks when it rebases. It conflicts with this PR on
minimum_guarantee.yaml,threshold.yaml, the threeaged.yamlfiles andentitledto_scenarios.yamleither way.
-
BASE_YEAR = 2026is hard-coded increate_savings_credit_threshold_projection.py:22andcreate_protected_pension_age_uprating.py:18.- When the 2027-28 rates go in, the 2027 values become the uprating anchor but the indices are still built from projected 2027 amounts. The maximum Savings Credit then no longer follows CPI from the enacted 2027 maximum, and the HB uplift drifts the same way.
- Fix: take the base year as the latest year with an explicit value. Raise an error if the guarantee, threshold and aged allowances disagree on that year, so the next uprating update can't miss it.
Nits
- A guarantee reform doesn't move the derived threshold. With
minimum_guarantee.SINGLEset to 260 in 2027, the threshold stays at 216.71, so the maximum Savings Credit jumps from £18.34 to £25.97, and the protected HB allowance doesn't move either. That's what main does too, and arguably right, since the threshold is set separately by SI. A sentence in the threshold description saying reforms to the guarantee don't re-derive the threshold or the HB allowance would save someone a surprise. - Docs placement: the paragraph about Pension Credit and HB sits in
docs/book/programs/gov/dwp/state-pension.md:213-220. A line or link from the Pension Credit page would make it easier to find.
Happy to approve once 1 is in. 2 could be a follow-up issue if you'd rather keep this PR tight.
|
@vahid-ahmadi The local parameter audit selected the protected pension-age Housing Benefit couple allowance and confirmed your item 1. Commit 9442ffb corrects all three 2025 rates: £244.40 for single/lone-parent claimants and £366.00 for couples. Each dated value now cites SI 2025/295 Schedule 6 and NI SR 2025/64 Schedule 6, plus DWP's published rates. The enacted 2026 amounts and projection builders are unchanged. The three new parameter regressions fail on the old values. After the correction, the entire altered protected-allowance Python test file passes (10 cases), and the new YAML file passes both tapered-award cases. Formatting/lint, Towncrier preview and diff checks pass. No full suite or population simulation was run. The cited audit is #2195. #1925 still owns the remaining historical rate corrections and can drop the overlapping three 2025 hunks when rebasing; #1913 still owns the cohort split. Your separate item 2 about the hard-coded projection base year remains unaddressed in this small rate correction, as do the two documentation nits. Could you re-review the rate correction? |
|
Thanks Anthony, the rate correction is right. £244.40 and £366.00 match SI 2025/295 Schedule 6 and DWP's 2025-26 rates page, and at It needs a rebase before it can go in, though. #1925 merged on 11 October, and the branch now conflicts with main in seven files: the three The hard-coded 🤖 Generated with Claude Code |
9442ffb to
3c8b9bf
Compare
|
Rebased onto main The 2035 boundary tests initially failed because their old fixed income values no longer crossed the updated forecast cutoff. They now locate the actual £1 step across that cutoff, including income-tax deductions; the assertions against discontinuous benefit losses are unchanged. Validation: 43 Python tests and 24 YAML cases passed, sequentially. Formatting, lint, Towncrier draft, fix-evidence validation and whitespace checks passed. No full suite or CI polling. The 2026 projection-anchor follow-up remains unchanged. |
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Thanks Anthony. The conflict resolution itself looks right at 3c8b9bf: the cited 2025 values are kept on top of #1925's, the builders sit in main's process_parameter_tree, and the new bisection in the 2035 boundary test leaves the assertions unchanged. The 43 Python tests and 475 Pension Credit, Housing Benefit and integration YAML cases pass locally.
CI is red, though, and I can reproduce it: six tests fail in run 38255826272, all with ValueError: The protected Housing Benefit allowance cannot be lower than the corresponding Pension Credit guarantee. from create_protected_pension_age_uprating.py:37.
test_council_tax_reduction_pension_credit_properties.py: five tests (test_freeze_keeps_savings_credit_only_receipt_when_the_reform_adds_guarantee_credit,test_guarantee_credit_recipients_ctr_is_invariant_to_state_pension,test_guarantee_credit_recipients_ctr_is_invariant_to_savings,test_awards_follow_the_pension_credit_routes,test_not_claiming_pension_credit_never_raises_a_recipients_ctr)test_savings_credit_only_receipt_properties.py::test_pension_credit_freeze_keeps_the_baseline_receipt
Both files landed on main on 11 October (6731dd7), so the focused run wouldn't have picked them up. Their CREDIT_REFORMS raise the 2026 minimum guarantee to £300 / £459. Now that the builders run inside the parameter processing, they see the reformed guarantee, which is above the enacted £256 / £383.35 protected allowance, so retained_uplift goes negative and the guard raises. A one-line check: minimum_guarantee.SINGLE at 300 from 2026 raises on this branch and gives £15,600 of Pension Credit on main. A reform from 2027 onwards doesn't raise, so it's only the base-year guard.
The guard makes sense for the enacted base, but under a reform it should fall back rather than stop the simulation, for example by flooring the uplift at zero or building the index from the baseline values. Either is fine by me, and it stays consistent with the earlier point that a guarantee reform doesn't re-derive the HB allowance. A test with a 2026 guarantee reform would cover it. Happy to approve once that's in and CI is green.
🤖 Generated with Claude Code
Aggregate impact on certified data: FAILThe report did not run, so this change has no report. See the workflow run. |
Resolves the conflicts with #2557 (September CPI uprating), which moved the standard minimum guarantee, Savings Credit threshold and pension-age HB allowances onto lagged CPI "until its own basis is modelled". This branch is that basis, so its projection indices replace the lagged-CPI placeholder, with a comment on each allowance and the guarantee saying why. Keeps main's NI scale validation ahead of the generation steps in process_parameter_tree, and both sides' Savings Credit YAML cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the guards Review items on #2092 (vahid-ahmadi, 8 and 13 October): - BASE_YEAR = 2026 is gone from both builders. The base year is the last year with an explicit value for the standard minimum guarantee, the Savings Credit threshold and the three protected HB allowances, read from the enacted tree; they must all reach the same year, or processing raises, so a rates update that misses one fails instead of indexing from a projection. - The protected-allowance guard was reachable: any reform that set a base-year allowance below its guarantee (or to zero) raised ValueError while the tree was built. Such an allowance keeps no retained Savings Credit, so it is now projected whole with the guarantee's earnings path, continuously with an allowance equal to its guarantee. Only an enacted allowance below its guarantee still raises. intermediate_projection is no longer needed and is removed from tax_benefit_system.py, which shrinks this PR's footprint there. - The same class of failure in the threshold builder: a zero phase-in rate raised, and a zero threshold divided by zero. The threshold now uses the enacted phase-in rate, as it already used the unreformed guarantee, and a zero base stays zero. - Lone parents get their own index, so a reform to the single allowance no longer moves the lone-parent projection. Tests: boundary cases at, 1p below and 1p above the guarantee; zero-base and phase-in reforms; base-year derivation and an incomplete rates update. Pins for 2027 move with main's published September 2026 CPI (3.5%, replacing the 2.116% forecast). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1913's aged_from_cutoff allowances equal the Pension Credit standard minimum guarantee in every enacted year (SI 2006/214 Sch 3 para 1(1)(c) and (2)(c)). On main both were on lagged CPI, so they stayed equal; once this branch moves the guarantee to the statutory earnings floor, the allowances would have drifted below it from 2027. They now use the same index, and a test checks they are equal in every year to 2040. #2557's lagged-CPI test now checks that these amounts have left lagged CPI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hand-off: review items addressed and main merged (backlog job B, 23 Oct 2026)Head: What I changed
Tests (locked env, core 3.33.2)
Open items
|
|
UK hub (Claude session, for Max): overlap with #2576. The hub should have spotted this before building #2576, and didn't. #2576 ("Fix Pension Credit and pension-age Housing Benefit earnings uprating") follows from #2557's review. It is independently approved and in the merge queue. It implements much of this PR's projection design:
The two PRs share 12 files, including Plan: let #2576 land, because it's Budget-critical and already green and approved. Then the hub reconciles this PR onto main, keeping what #2576 doesn't have and dropping what duplicates it:
Where the two implementations differ, the hub will list each difference here before choosing. @anth-volk, @vahid-ahmadi: say if you'd rather this PR's version win on a particular point. The backlog build's |
Hand-off: #2092 reconciled onto mainHead: ResolutionKept #2576’s dedicated earnings series, published maximum Savings Credit and exact unreformed higher-HB forecast identity. Integrated this PR’s reform-safe independent indices into main’s existing builder modules; removed the duplicate builder files and 2072/2083/2154 changelog fragments. Retained derived enacted base validation, non-negative threshold residuals, zero/below-guarantee reform fallbacks, lone-parent independence, later-cohort equality and boundary regressions. W1’s tax_benefit_system.py changes are limited to builder registration/order and passing unreformed context. All main published values stay exact. All PR published values stay at their original dates except three obsolete 2015 HB placeholders corrected by #2207; their amounts remain at the proper 2019 dates. 2025 HB values were already correct on main (£244.40/£366); retained PR’s dated GB/NI citations and test cases. Checks and counts
Not run: all projection Python files (including #2576’s test_pension_credit_uprating.py and the new Hypothesis/differential file); test_september_cpi_uprating.py; test_triple_lock_statutory_inputs.py; test_process_time_reforms.py including inventory/cycle coverage; test_council_tax_reduction_pension_credit_properties.py and test_savings_credit_only_receipt_properties.py (including all six 13 October failures); Pension Credit, Housing Benefit and integration YAML directories, including #2576’s pension_age_earnings_uprating.yaml and council_tax_reduction_pension_age_personal_allowance.yaml. Also not run: rendered docs build, full suite, mutation tests or microsimulation. Runtime validation and impact are pending CI at this head; old aggregate reports are not evidence for this merge. Vahid’s points
The CHANGES_REQUESTED review remains open. Do not mark ready or merge. Hub to undraft for CI and dispatch the independent review. Workspace/recoveryThe assigned checkout contains only the build brief and its .git file is read-only, pointing outside the writable workspace. Original .git and prompt.md were preserved. All real repository operations use workspace-local #2092 reconciliation decisions (written before resolution)Sides: main
Sources: SSAA s150A, SPCA s3, DWP A3/2021, 2025 rates. The DWP published couple maximum in 2025 is £19.36 (formula £19.356), not £19.35. Published HB £366 is preserved without reconstructing its rounding. Static preservation checkAll main explicit parameter values are preserved exactly. All PR explicit values are preserved at the same dates except the three obsolete |
Fixes #2083
Fixes #2072
Fixes #2154
Fixes #2155
Fixes #2195
Changes
Merge main
eb0b8087d821(including #2576 and #2207) into Anthony Volk’s52c96b111efe(merge head9b0d406723d1), preserving his commits without rebasing or force-pushing.The two existing builder modules retain main’s formulas and now generate the independent indices before general uprating.
tax_benefit_system.pychanges only their registration/order and unreformed context, including prior-law projections (archived W1 ownership).Invariants and evidence
test_unreformed_higher_allowances_equal_guarantee_plus_maximum_every_year.test_combined_reforms_build_and_never_project_negative_amounts(Hypothesis, zero/subnormal/large amounts and future anchors).test_forecasts_reproduce_each_enacted_value_exactlyand existing published-rate properties. Independently rounded enacted HB amounts are preserved; the exact forecast identity applies after them.test_reconciled_builders_agree_with_main_where_its_behavior_is_retained(Hypothesis, positive and negative macro paths).Validation
Locked Python 3.13 environment, policyengine-core 3.33.2 (
uv sync --frozen --extra dev). Ruff format/check and static YAML/AST/notebook checks pass; 156 explicit values audited against both sides, with only the three documented #2207 date corrections.Runtime tests: 0 executed locally. Reservation allows uk-hub, but the host gate closed before tests: load1 123.56 and free disk 33.89 GB; last retry load1 73.14 and free disk 33.81 GB (required <=110 and >=55 GB). The Python projection/CPI/triple-lock tests, prior six failing properties, #2576 tests and Pension Credit/HB/integration YAML suites remain for CI. No mutation run, microsimulation or full docs build.
Impact and runtime validation are pending CI at this head. Prior aggregate reports predate this merge and are not evidence for this head. Keep this PR draft for the hub to undraft and dispatch independent review; do not merge.
Reproducer: policyengine_uk/tests/test_pension_age_projection_invariants.py::test_combined_reforms_build_and_never_project_negative_amounts
axiom: needed