Conversation
The State Pension age parameters held one age per year and stayed at 66 from 2020, so the model never applied the Pensions Act 2014 s.26 rise to 67 for people born on or after 6 April 1960. From 2026-27 every 66-year-old counted as over State Pension age. Encode Pensions Act 1995 Sch 4 para 1 by date of birth, row for row: age_by_birth_date (the age, in months) and day_by_birth_date (the day, where the statute sets one), for women and for men born on or after 6 December 1953, plus rule (1) for men born earlier. A person attains State Pension age on the later of the two. months_since_last_birthday places each date of birth within the year of age, measured at 6 October, the middle of the fiscal year. A fractional age is the exact age; single households use the middle of the year of age; representative microdata spreads each single year of age and sex evenly by weight, so the weighted share over State Pension age is the statutory share (three quarters of 66-year-olds in 2026-27, a quarter in 2027-28, none after). state_pension_age is now the person's own State Pension age, and is_SP_age, the basic/new State Pension split and the Savings Credit age test (SPCA 2002 s.3(1)(a), including its age-65 limb) all follow it. No additional State Pension is paid below State Pension age. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A birth instant within a day is the day starting at or after it, so a person's legal age on 6 October is their age and each age is attained at the commencement of the anniversary (Family Law Reform Act 1969 s.9(1)). The time-of-day carry onto the anniversary is gone. - One helper gives exact age in months (float64), capping months since the last birthday a few minutes short of 12 so it never rounds onto the next birthday. Hypothesis found that edge. - Birthdays are spread over the year in any simulation built from data (Simulation.built_from_dataset), not whenever weights exceed a million, so a constituency or local authority filtered from the data is still spread, and filter_dataset carries each person's place into an extract. - Rewrite the old Savings Credit cases from dates of birth, keep one that tests the state_pension_age override, and test the attainment day exactly in the day-level differential test. - male/born_before is a YYYYMMDD number like the scales; labels no longer hardcode the date; the NI reference notes its numbering; the removed fragment and docs say how to reform the timetable now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for Class 4 State Pension Credit Act 2002 s.1(6) sets the qualifying age as a woman's pensionable age, and for a man that of a woman born on the same day. Pension Credit, Universal Credit (WRA 2012 s.4(1)(b), (4)), Housing Benefit (reg 5 of SI 2006/213 and 2006/214; SI 2014/1230 reg 6A(4)), Council Tax Reduction pension-age schemes, Income Support (SSCBA 1992 s.124(1)(aa)), the benefit cap's pensioner exception and Winter Fuel Payment (SI 2000/729 reg 2(1)(b)) now use it instead of the person's own pensionable age. They differ only for men born before 6 December 1953, so only in 2018-19 and earlier. Class 4 NI (SI 2001/1004 reg 91(a)) now excepts only people over State Pension age at the beginning of the tax year (6 April), not on 6 October. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…more tests - is_benefit_cap_exempt_other: say the cap has no age exception and that exempting any unit with a member over the qualifying age misses Universal Credit mixed-age couples (UC Regs 2013 reg 3(2)(a)); behaviour unchanged. - council_tax_reduction_household_has_pensioner: note the unmodelled "not on UC, IS, JSA(IB) or ESA(IR)" limb of SI 2012/2885 reg 3(1)(a)(ii). - is_pension_credit_eligible and YAML case 13: s.4(1A) is in force from 15 May 2019 (SI 2019/37 art. 3); the model applies it in every year. - ni_class_4_liable: label the 6 April reading as an interpretation; name the six-month offset MONTHS_FROM_TAX_YEAR_START_TO_MID_YEAR (also used by the Savings Credit age test). - Changelog and docs: describe the benefit cap as reaching only working-age HB and UC, and point the qualifying-age entry to the Class 4 entry. - Tests: YAML cases 14-20 pin the HB and CTR applicable amounts, HB tariff income and capital, the guarantee credit route and Pension Credit capital (4 of the 7 fail on the parent commit; 3 are controls). A property test now samples only the cohort where the two ages differ (men born 6 April 1950 to 6 December 1953, 2015-16 to 2018-19) and also checks the pension-age CTR allowance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Class 4 "stops from the first tax year that begins on or after the day State Pension age is reached", matching the 6 April reading. The cohort property test samples births up to 5 December 1953, the last day rule (1) covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Overlap with #1940 (mixed-age couples, SI 2019/37). #1940 routes |
|
Coordination with #1944 (mixed-age couples on UC: benefit cap and CTR pensioner status). #1944 rewrites the two
Whichever lands second should:
A review agent merged the two branches in a scratch clone and took #1944's side of the two conflicting files. #1907's consumer assertion then failed for men born 1951-53 in 2017, because the new variables still read 🤖 Generated with Claude Code |
#1895 described ni_liable as covering primary Class 1, Class 2 and Class 4. Class 4 now uses ni_class_4_liable (status at 6 April, SI 2001/1004 reg 91(a)), so ni_liable covers primary Class 1 and Class 2 only. The National Insurance docs page states the Class 4 age rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed: not ready. The law is right. SPCA 2002 s.1(6) gives men born before 6 December 1953 a qualifying age earlier than their own pensionable age. Reg 91(a) makes Class 4 depend on status at 6 April, and
Verified: I read SPCA s.1(6), SI 2001/1004 reg 91, SSCBA s.17(2)(b) and NIM24510. SSCBA Sch 2 para 6 is about interest; the age exception is reg 91(a). I checked Class 4 case 1 by hand: (30,000 − 12,570) × 6% = £1,045.80. The new and #1899 YAML tests passed (69/69). The new Python tests and |
|
Composition note: #2015 (stacked on #2009 → #2006) deletes |
Fixes #1906
Depends on #1899 (State Pension age by date of birth). Until #1899 merges, this PR's diff includes its commits. This PR's own commits are
aa45dd76, the review fixesb9d8573dandcae31319,09ec4bf0, which follows a merge of main, and0408ef14, a docs rewrap.Summary
Two statutory age tests read the wrong State Pension age status. The statutes below were all read on legislation.gov.uk for this PR.
1. The qualifying age for State Pension Credit
State Pension Credit Act 2002 s.1(6): "the qualifying age" means "(a) in the case of a woman, pensionable age; or (b) in the case of a man, the age which is pensionable age in the case of a woman born on the same day as the man." A man born before 6 December 1953 has a pensionable age of 65 (Pensions Act 1995 Sch 4 para 1 rule (1)). His qualifying age is earlier: the day table 1 gives a woman with his date of birth. The model used his own pensionable age (
is_SP_age) wherever the law uses the qualifying age.state_pension_credit_qualifying_age: Set State Pension age from date of birth, including the rise to 67 #1899's timetable (age_by_birth_date,day_by_birth_date) without the male rule.has_attained_state_pension_credit_qualifying_age: whether that age is reached by 6 October, likeis_SP_age.state_pension_ageintopolicyengine_uk/utils/state_pension_age.py, so both ages share one implementation. Set State Pension age from date of birth, including the rise to 67 #1899's full test suite passes unchanged.is_pension_credit_eligible,pension_credit_assessable_capitalis_uc_eligible(was viais_WA_adult)housing_benefit_eligible,_applicable_amount,_assessable_capital,_applicable_income,_tariff_incomecouncil_tax_reduction_household_has_pensioner,council_tax_reduction_applicable_amountincome_support_eligibleis_benefit_cap_exempt_otherwinter_fuel_allowanceni_liable(Class 1 employee, Class 2),state_pension_type,additional_state_pension,meets_savings_credit_age_requirement(SPCA s.3(1)(a): "has attained pensionable age before 6 April 2016"), HBAI pensioner statusis_SP_age)pawhp(Scotland), contrib basic incomeis_benefit_cap_exempt_earningsand_health_disabilitystill compute an unusedhas_pensionerfromis_SP_age. That is dead code, which #1820 removes, so this PR leaves it alone to avoid a conflict.2. Class 4 National Insurance at the start of the tax year
SI 2001/1004 reg 91 excepts "any earner who (a) at the beginning of a year of assessment is over pensionable age".
ni_class_4andni_class_4_mainuseddefined_for = "ni_liable", which is status on 6 October, so they excepted anyone who reached State Pension age between 6 April and 6 October. HMRC NIM24510: "A person who attains State pension age during the course of the year of assessment remains liable for Class 4 NICs for the whole of that year."ni_class_4_liable=over_16and not (months_since_state_pension_age≥ 6), since 6 April is six months before 6 October. Class 4 now uses it in place ofni_liable.ni_liable. Charge employer NI on employees over state pension age #1895, merged since, describedni_liableas covering Class 4 too.09ec4bf0narrows its label and documentation to primary Class 1 and Class 2, and the National Insurance docs page now states the Class 4 age rule.ni_liable: SSCBA 1992 s.6(3) stops primary Class 1 on earnings paid "after he attains pensionable age".over_16condition is kept. Reg 93's under-16 exception applies only on application for a certificate.Invariants (stated and tested)
test_state_pension_credit_qualifying_age.pyreuses Set State Pension age from date of birth, including the rise to 67 #1899's differential population: births every third day from 1945 to 1984 plus both sides of every statutory boundary, both sexes, 13 fiscal years. Set State Pension age from date of birth, including the rise to 67 #1899's statute-text reference (reference_attainment_day) shares no code with the model. For every person, the model's qualifying day equals that reference's day for a woman born the same day, and status on 6 October follows it.ni_class_4_liableequals "attains pensionable age after 6 April" (reference day vs 6 April), for every person and year.has_attained_state_pension_credit_qualifying_age⊇is_SP_age, with equality in every year from 2019-20. A companion test checks that 2015-16 to 2018-19 do contain people where the two differ, all of them men born before 6 December 1953, so the checks are not vacuous.is_pension_credit_eligible,council_tax_reduction_household_has_pensionerandis_benefit_cap_exempt_otherequal the statutory qualifying-age status,is_uc_eligibleis its negation, the pension-age CTR personal allowance applies exactly when it holds, and Winter Fuel Payment follows it through 2023-24. A second property test samples only the cohort where the two ages differ (men born 6 April 1950 to 6 December 1953, in 2015-16 to 2018-19), so every run exercises the change.months_since_state_pension_age< 6.YAML tests:
state_pension_credit_qualifying_age.yaml(20 cases): men born 1950-1953 in 2015-16 to 2018-19, the 6 December 1953 boundary, a woman born the same day, and a couple both born 6 June 1953 who are not a mixed-age couple. The cases cover Pension Credit (eligibility and capital), Universal Credit, Housing Benefit (new claims, applicable amount, tariff income, capital and the guarantee credit route), Income Support, Council Tax Reduction (pensioner status and applicable amount), the benefit cap and Winter Fuel Payment. Every expected day comes from Sch 4 para 1 table 1. Of cases 14-20, the four on the qualifying-age side fail on the parent commit; the three controls pass on both.ni_class_4_liable.yaml(9 cases): the issue's example (born 6 June 1960, State Pension age 6 September 2026: pays (30,000 − 12,570) × 6% = £1,045.80 for 2026-27 and nothing for 2027-28); State Pension age after 6 October; exactly on 6 April 2025 (excepted); on 9 April 2025 (liable); a 2016-17 case at 9%; and Class 1 still stopping at State Pension age.Tests run locally:
test_state_pension_age.py(24);gov/dwp,gov/hmrc,finance/benefit,gov/local_authorities,gov/social_security_scotland,gov/treasury,gov/dfe,gov/dcms,consumption,integrationandreforms(1,261 cases).The full suite runs in CI.
Microsimulation impact
Every figure is from full microsimulation runs on Enhanced FRS 2024-25 (policyengine-uk-data-private, snapshot ace89433): the parent commit
c820eed9(#1899 merged with main) against this branch, for each fiscal year 2024-25 to 2030-31.Qualifying age. There is no change in any year the data covers. In every year from 2024-25 to 2030-31, no person in the data has
has_attained_state_pension_credit_qualifying_agedifferent fromis_SP_age(0 records, 0 weighted people). Pension Credit, Universal Credit, Housing Benefit, Council Tax Reduction, Income Support and Winter Fuel Payment totals and absolute poverty (BHC and AHC) are unchanged (zero to the nearest £100 and the nearest person). The years this fix changes, 2015-16 to 2018-19, cannot be run: the earliest PolicyEngine UK dataset is Enhanced FRS 2022-23, and simulations extend datasets forward only.Class 4. Differences are this branch minus the parent commit.
Review
An independent Opus 5.5 review of
aa45dd76(Subfleet,--task review --tier standard) returned APPROVE. It verified the refactor, the qualifying-age boundaries, every hand-computed YAML value and the Class 4 rounding.b9d8573daddresses its findings. A second review ofb9d8573dalso returned APPROVE, with every finding resolved and cases 14-20 re-derived by hand;cae31319applies its two optional nits, the Class 4 wording and the cohort test's end date. A third review, ofcae31319and09ec4bf0, returned APPROVE with one cosmetic nit (a long docs line, fixed in0408ef14); it re-read reg 91(a) and SSCBA s.11(7)(b) and found nothing else relying onni_liablefor Class 4. None of the three reviewers could run the tests, so the test results are the author's local runs and CI. Round-1 findings:MONTHS_FROM_TAX_YEAR_START_TO_MID_YEAR.is_WA_adultis left as it is. No model rule reads it now, and Replace generic child and adult flags with each programme's legal definitions #1896 deprecates it while keeping its formula for downstream users.Caveats and follow-ups
is_benefit_cap_exempt_otherexempts any benefit unit with a member over the qualifying age. That is right for pension-age Housing Benefit, but not for Universal Credit mixed-age couples. Not changed here (Fix benefit cap exemption defects (#1818) #1820 is reworking these variables).agedrate (£181 a week for 2015-16 to 2020-21). Not changed here.Axiom parity
axiom: uk/statute/ukpga/2002/16/1 encoded-correct (
uk/statutes/ukpga/2002/16/1.test.yamlcaseman_uses_woman_same_birthday_age: a man's qualifying age is a woman's pensionable age for the same birthday)axiom: uk/statute/ukpga/2012/5/4 encoded-correct (
uk/statutes/ukpga/2012/5/4.test.yamlcaseperson_does_not_meet_basic_conditions_after_reaching_state_pension_credit_qualifying_age_without_exception; the qualifying age is a leaf input)axiom: uk/statute/ukpga/1995/26/schedule/4/paragraph/1 TheAxiomFoundation/rulespec-uk#369 queued (computing pensionable age, and so the qualifying age, from date of birth)
axiom: uk/regulation/uksi/2006/213/5 TheAxiomFoundation/rulespec-uk#370 queued (which Housing Benefit regulations apply, and new claims)
axiom: uk/regulation/uksi/2001/1004/91 TheAxiomFoundation/rulespec-uk#373 queued
🤖 Generated with Claude Code