Repository navigation
Count a loss on one source as nil in Pension Credit income and earnings - #2259
Merged
Merged
Conversation
pension_credit_income summed each source as it stood, so a property loss reduced the claimant's other income: a 75-year-old with a £20,000 pension and a £30,000 property loss had nil income and the full guarantee credit. State Pension Credit Act 2002 s. 15(1) and SPC Regulations 2002 reg. 15 list receipts, and nothing lets a loss on one be set against another. Each person-level source is now floored at zero. The earnings sources are not changed. Fixes #2255 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pension_credit_earnings summed wages and self-employment income, so a trading loss cut the earnings counted: £10,000 of wages with an £8,000 loss counted as £2,000 and raised the award from £2,376 to £10,376. Computation of Earnings Regulations 1996 reg. 13(12), applied to Pension Credit by SPC Regulations 2002 reg. 17B(5)(b), bars setting a loss in one employment against earnings in another. Each earnings source is now floored at zero. Also from the review of the property-loss fix: assert the Pension Credit income in the positive property income case, state the second invariant as tested (never higher than with no property income), run each Hypothesis example as one simulation, and reword the formula comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 10, 2026
MaxGhenis
marked this pull request as ready for review
October 10, 2026 22:50
Collaborator
Author
|
Merging on the gates.
🤖 Generated with Claude Code |
This was referenced Oct 11, 2026
MaxGhenis
added a commit
that referenced
this pull request
Oct 11, 2026
Brings in #2258 (120-minute Test job), #2180 (NICs thresholds indexed by September CPI after 2030-31), #2063 (salary sacrifice needs pay), #2038 (winter payments to the member a benefit is paid to), #2259, #2248, #2251, #2262, #2266, #2270, #2285, #2288, #2294 and #2021. Conflict: test_legacy_award_readers_properties.py imports. Kept both hypothesis.event (this branch's screened-out events) and hypothesis.example (#2294's found families). The rest of the file merged cleanly: #2294's without/silent/with-other comparison, the severe disability premium bound and the held benefit cap sit alongside this branch's work generators, screened reference and outside-member tests. Two comments now say the ESA and JSA readers also read the members' work. _legacy_award_payee.py merged cleanly: #2038's can_claim (Pension Credit) and this branch's own_report_is_paid are independent. The shared NI parameters already match main (#2058); #2180 changes only 2031-32 onward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
added a commit
that referenced
this pull request
Oct 11, 2026
MaxGhenis
added a commit
that referenced
this pull request
Oct 19, 2026
…hout a UC claim savings_credit_income now floors each person-level excluded source at nil, as pension_credit_income counts them since #2259, so the two never disagree on a negative input. Case 17 tested working-age Housing Benefit income, but on current main the couple's Universal Credit entitlement passports Housing Benefit (#2133) and makes its income nil. Set claims_universal_credit to false so the case tests the means test itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 19, 2026
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.
Fixes #2255
What was wrong
Pension Credit income added each income source as it stood, so a loss on one source reduced the claimant's other income. Main
a3752304e, 2026-27, a single pensioner in Wales who owns outright:The law
Change
pension_credit_incomefloors each person-level source at zero before adding it.pension_credit_earningsfloors each person's wages and self-employment income at zero before adding them.The rule is per employment. The model holds each person's employments as two variables,
employment_incomeandself_employment_income, so the floor applies to those totals: a profitable trade already netted against another trade's loss insideself_employment_incomecannot be recovered here.Invariants (tested)
Tested for a single person aged 75 in Wales who owns outright, with amounts in the ranges the Hypothesis strategies draw (pension and wages £0 to £40,000, losses to −£100,000, property income −£100,000 to £20,000):
The tests fix age 75 on purpose. Under 75, an existing income tax defect (#2045) turns a self-employment loss into negative pension contributions relief, which raises income tax and so lowers Pension Credit income through its tax deduction. At age 70 with a £13,000 pension and an £8,000 loss, this branch gives Pension Credit income of £11,314 and an award of £1,062, against £12,914 and £0 without the loss: income tax is £1,686 instead of £86 because
pension_contributions_reliefis −£8,000 with no contributions. That is #2045, not the earnings rule, and is not changed here.The third invariant is narrower than monotonicity on purpose. Between two positive property incomes the award can rise: the model taxes property income in full once it passes the £1,000 allowance, so at age 80 with a £13,000 pension the award is £318.62 at £1,000 of property income and £398.30 at £1,001. That is existing behaviour and not changed here.
Tests
pension_credit_income.yaml: the property-loss reproducer, the same person without the loss, a positive property income (now asserting the income, £20,914), and the self-employment reproducer end to end.pension_credit_earnings.yaml: a loss beside wages, a loss alone, and a partner's loss beside the claimant's wages.test_pension_credit_income_losses.py(Hypothesis): the three invariants over random amounts, and both reproducers. Each example runs its cases and their baselines in one simulation; the file takes about 25 seconds.pension_credit_incomerestored, the reproducer test fails and one YAML case fails.pension_credit_earningsrestored, the reproducer test and the self-employment property fail, and four YAML cases fail.Local runs: Pension Credit YAML folder 208 passed; the Python file 4 passed; Ruff clean.
Impact
On the local enhanced FRS 2023-24 file, for 2026: Pension Credit falls from £0.888bn to £0.856bn (£32m, 3.6%), and benefit units receiving it from 269,200 to 267,300. All of it comes from the earnings change; the property change alone left the total at £0.888bn.
Not in this PR
The first two are noted on #2255.
axiom: uksi/2002/1792/15 and uksi/2002/1792/17B TheAxiomFoundation/rulespec-uk#390 queued (rulespec-uk encodes only reg. 15(6) and takes
claimant_incomeas an input; two extension comments add the no-netting rules, pasteablereview_findingtext and companion cases: other income and earnings)🤖 Generated with Claude Code