Repository navigation
Include SSP and SMP in pension-relief earnings - #2464
juaristi22 wants to merge 2 commits into
Conversation
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Fine once the merged annual-allowance helpers use the same relevant earnings.
@juaristi22 the law and the main change are right. PTM044100 lists "Statutory Sick Pay (SSP) and Statutory Maternity Pay (SMP) if paid by the employer and taxable under Section 7(2) ITEPA 2003" as relevant UK earnings, and employment_benefits is exactly SSP + SMP on main, so it is counted once. One gap appears after merging with current main.
- must The branch is 138 commits behind main, and #2441 has since merged three more relevant-earnings constructions that leave out
employment_benefits:policyengine_uk/utils/pensions.py:42-46(actual_earnings, used on the supplied-ANI path at :57 and forrelievable_net_payat :66-67) andpolicyengine_uk/variables/gov/hmrc/pensions/pension_annual_allowance_threshold_income.py:40-44. Git merges the PR cleanly, so nothing flags it. On the merged tree, a 50-year-old with £22,000 net-pay contributions and suppliedadjusted_net_income£5,000 gets threshold income £5,000 and adjusted income £27,000 when all £22,000 earnings are wages, but £3,000 and £25,000 when £2,000 of it is SSP. The helper adds back £20,000 relief whilepension_contributions_reliefnow gives £22,000. The PR body says the #2441 combination kept the aggregate at both callers, but this branch does not carry that change. Please rebase and addemployment_benefitsat those sites (a sharedrelevant_uk_earningshelper would stop this drifting again), with one SSP case for the supplied-ANI path. - should #2462 rewrites the same
actual_earningsblock inutils/pensions.py(theactual_earningslines). Whichever lands second will need to keepemployment_benefitsin it. - nit
changelog.d/2371.fixed.md: "taxable statutory employment pay" reads wider than the change, which covers SSP and SMP only until #2368 adds SPP. "statutory sick and maternity pay" would be exact. - nit An open docs PR (#2386,
docs/book/programs/gov/hmrc/pension-tax-relief.md) describes the cap as "employment plus self-employment income". That line will be out of date once this lands.
What I checked
- Read the PR body, full diff and #2371. Checked FA 2004 s.189 on legislation.gov.uk and PTM044100 on GOV.UK.
- Hand-computed five YAML expectations, e.g. "SSP final ordinary tax": (20,000 + 2,000 + 20,000 - 22,000 - 12,570) x 20% = £1,486; before the fix relief is £20,000, giving £1,886.
policyengine-core teston the new file: 10 passed. Wholetests/policy/baseline/gov/hmrc/pensionsfolder: 81 passed. With the formula reverted to the merge base: 5 failed, 5 passed, as the PR says.- Merged origin/main locally (no conflicts) and ran the item 1 households with
Simulation. ruff checkandruff format --checkon the changed Python file: clean. CI on the head: all checks pass. The Reproducer: and axiom: lines are present and Fix evidence passed.- Not checked: the full test suite locally, or the population effect on enhanced FRS data.
🤖 Generated with Claude Code
The page said the earnings limit applies first, so someone with no earnings gets no relief, and that the annual allowance caps relief. On main, relief at source can use the £3,600 basic amount above earnings (FA 2004 s. 191(7)), the annual allowance does not limit relief, the taper tests adjusted and threshold income, the charge is sliced across the rate bands, and relieved contributions reduce adjusted net income. Mentions #2464 (SSP and SMP in relevant earnings) and #2488 (ATI uplift) as pending. Figures re-run on policyengine-uk 2.135.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3f0b0b0 to
4d4787e
Compare
|
Rebased this onto the pension changes merged in #2441 and aligned the three relevant-earnings paths through one helper that includes taxable employer-paid SSP/SMP once. The paired supplied-ANI regression now preserves threshold income of £5,000 and adjusted income of £27,000 for both £22,000 wages and £20,000 wages plus £2,000 SSP, with £22,000 net-pay contributions. The SSP threshold was £3,000 before the fix. The original ten cases and README are unchanged, and the changelog now names SSP/SMP explicitly. Validation: 127 pension cases passed on minimum Core 3.32.27; 3,587 policy YAML cases passed on frozen Core 3.33.2. The full Python run recorded 6,512 passes, 96 skips and one expected failure. Its coverage-only follow-up passed under CI's sys.monitoring configuration; an independently qualified local Darwin/glibc exception then allowed the unchanged native auditor to account for all 6,609 outcomes in a separate local composition. The original failed audit is retained and hosted Linux CI remains separate. #2371 remains open for SPP/#2368. The #2462 follow-up is planned to stack on this change so the shared helper and its relief/threshold callers remain coherent. The external #2386 cap wording still needs a landing-time reconciliation with that work; its branch has not been changed here. |
Addresses #2371.
Count employer-paid, taxable statutory sick and maternity pay once in the relevant UK earnings used for pension contribution relief and the annual-allowance calculations. A common earnings helper keeps the relief, adjusted-income restoration and threshold-income paths consistent after the pension changes merged in #2441.
The new paired regression uses £22,000 relevant earnings, £22,000 net-pay contributions and supplied adjusted net income of £5,000. Replacing £2,000 of wages with statutory sick pay must preserve £27,000 restored income and a £5,000 threshold-income result. The unchanged integration produced £3,000 for the SSP case; both cases now pass. Supplied ANI is an explicit input in these tests.
Reproducer: policyengine_uk/tests/policy/baseline/gov/hmrc/pensions/statutory_pay_pension_relief.yaml
Sources: FA 2004 s189 and HMRC PTM044100, which expressly includes employer-paid SSP/SMP. Tests use actual annual taxable payments.
Validation on the candidate:
Issue #2371 remains open: statutory paternity pay needs #2368 to add SPP to the taxable aggregate. This change preserves the loss-relief helper's existing taxable-pay input, which already includes statutory pay. PR #2462 will be based on this verified change to preserve its separate NI-only and actual-return input contract. The external #2368 and #2386 branches remain separate landing work. Private population effects have not been calculated.
axiom: needed