Repository navigation
Date the mixed-age couple Pension Credit exclusion and model the SI 2019/37 saving - #1940
Conversation
…019/37 saving is_pension_credit_eligible required every adult to be over State Pension age in every year, so PolicyEngine applied SPCA 2002 s.4(1A) before its 15 May 2019 commencement (SI 2019/37 art. 3) and ignored the art. 4 saving afterwards. A mixed-age couple got UC in 2018 where the law allowed Pension Credit and pension-age HB, and a protected couple never got Pension Credit. Add meets_pension_credit_age_conditions (every adult over State Pension age, or a mixed-age couple before the exclusion or with the saving) and use it for Pension Credit, for new Housing Benefit claims (TP Regs reg 6A(4)-(5)) and, negated, for Universal Credit (TP Regs reg 5(1)(d): one route per family). The saving, has_mixed_age_couple_pension_credit_saving, is an input that defaults to reported Pension Credit or pension-age HB without reported UC, where the older member was born by 1954. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Overlap note from #1896: that PR also rewrites |
- is_mixed_age_couple counts only the claimant and partner (adults who are not a child or qualifying young person for Pension Credit), so a single pensioner with an 18 or 19 year old dependant in education is not a mixed-age couple and stays on main's route. - Only Housing Benefit reported by the pension-age member sets the SI 2019/37 saving: art. 2(3) counts HB under the pension-age regulations, which apply to a claimant over the qualifying age (HB(SPC) reg 5(1)). - Before 15 May 2019 a couple reported on Universal Credit stays on it. - State the Pension Credit routing of saved couples and pre-2019 couples as modelling choices, not a consequence of TP Regs reg 5(1)(d). - The HB dataset-mode invariant computes the expected saving from the drawn unit rather than from model output; the mixed-age properties draw dependant shapes. Four YAML cases added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An independent Opus review (in-session) returned REQUEST_CHANGES with three should-fix items and four nits. All are addressed in 24f59a4:
Dataset totals are unchanged by these fixes on both builds; the corrected shapes don't occur in the survey data. Local results: 1,307 YAML tests and 5 property tests pass. |
|
Coordination with #1944 (mixed-age couples on UC: benefit cap and CTR pensioner status). The two compose. I merged both locally: all 29 YAML cases from both PRs pass, as do both property suites and #1944 adds two variables:
Both are true only when no claimant or partner under State Pension age has a UC award, and there is no IS, income-based JSA or income-related ESA. After both merge:
So this PR's body table figures for UC-route couples (CTR 838.11 and so on) change after #1944. No rule here conflicts. One note for later: your 🤖 Generated with Claude Code |
|
Reviewed: approve with nits. The law is right. s.4(1A) is dated 15 May 2019, and the art. 4 saving and the reg 6A(5) new-claim route are each modelled by one shared variable, so no family can get both the Pension Credit and Universal Credit routes.
Verified: I read SPCA s.4 and SI 2019/37 arts 2 and 4, including the art. 4(2) end of the saving and the art. 4(3)–(5) migration-notice window inserted in 2024, and UC (TP) Regs reg 6A(4)–(5). The YAML passes (20/20) and both property suites pass, including #1901's HB suite (5 passed). Probes give the PC route for 2015–2019 and UC for 2020, and the 75 + 60 figures in the body reproduce. CI is green. |
Codex review — mergeable with a data follow-upReviewed commit policy-1 [SHOULD ADDRESS] Stabilise the saved-status proxy in dataset builds
policy-2 [SUGGESTION] Keep route choice distinct from statutory entitlementA protected couple can chooseUC; Sources: SPCA4, appointed day, saving, HB scope, HB reg5, UC exclusion, new-claim route, NI commencement. The changed code consistently uses the saving across Pension Credit, Housing Benefit and Universal Credit and tests the modeled mutually exclusive routes. No confirmed blocking defect was found. I consider this incremental correction mergeable with the data follow-up tracked; populate saved status from survey-year facts before relying on long-horizon projections. Preserve the documented approximations and coordinate shared age/receipt/abolition paths with #1907, #1927 and #1910. Validation: 25 focused tests passed, including explicit saving on/off, reported-PC/HB inference, date boundaries, legacy-benefit exclusions and final PC/HB/UC outcomes. Eight official source originals were inspected and their cached bytes verified. No material evidence gap remains in the changed model scope; this does not certify individual survey records' historical continuity. Focused tests used an existing cached Python 3.13 environment (Core 3.32.9, NumPy 2.1.3, pandas 2.3.1, microdf-python 1.2.1, Hypothesis 6.168.2, pytest 8.4.2) with this PR’s isolated source snapshot. No dependencies were installed; this was not a freshly synced lock environment or a full-suite/population run. This is a review comment, not a formal GitHub review vote. Live check before posting (2026-10-02T10:42:58.900585+00:00): same commit, CLEAN; all reported CI checks pass. |
…d-age-saving The Pension Credit age conditions and the mixed-age couple test now read is_claimant_or_partner in place of is_adult, which #1896's code-health test forbids. is_uc_eligible keeps #1896's qualifying-claimant test and this branch's exclusion of families on the Pension Credit route. A pensioner with an 18 or 19 year old dependant now meets the Pension Credit age conditions (SPCA 2002 s.17: the claimant and any partner), so that YAML expectation and the pre-change reference formulas in the property test follow #1896. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @vahid-ahmadi, and for the Codex review. Head is now What changed since
Review items:
Run locally on the #1896 merge (before the final merge of |
…ceipt docs The saving belongs to the couple (SI 2019/37 art. 4(1)), so its default inference now reads only the claimant's and partner's ages and reported awards. A grandparent in the same benefit unit no longer supplies the 1954 age evidence or a Pension Credit or Housing Benefit report. Two YAML cases fail without the change. in_receipt_of_guarantee_credit's documentation no longer says the saving is omitted. Addresses the delta review of cf691ed (findings 1 and 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on; test each mask Before 15 May 2019 a mixed-age couple reported on Universal Credit stays on it; that test now reads the claimant's and partner's reports, like the saving. The saving's reported-award sums use add_for_members. Two more YAML cases isolate the Housing Benefit mask and the Universal Credit mask (each fails when its mask is removed). The Housing Benefit notebook describes the pension-age route as the code now applies it. Addresses the delta review of 9423120 (findings 5 to 8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged at
|
#1940 (merged after this branch last synced) added the SI 2019/37 art. 4 saving with birth_year <= 1954, a year stand-in for reaching the State Pension Credit qualifying age by 14 May 2019, i.e. born on or before 5 February 1954. With birth_year now the calendar year of the exact date, people born October-December 1954 entered that rule; in the Enhanced FRS one benefit unit (weight 10,598) gained £83m of Pension Credit in 2027-28. Replace the year with saving_latest_birth_date (19540205) and compare birth_day with it; add 5 vs 6 February 1954 YAML boundaries and tighten the property test's P8 to the date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the in_receipt_of_guarantee_credit conflict with #1940: keep this branch's payment check (also under the freeze) and take main's account of the SI 2019/37 art 4 saving, which the model now infers. Update the tests and docs that said the model omits the saving, and add a case for a saved mixed-age couple with a 2-year-old. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1940, now merged in from main, models the SI 2019/37 art. 4 saving, so a mixed-age couple can get Pension Credit and with it the passport. - YAML: the mixed-age case is now the couple without the saving (and asserts there is none); a new case gives the same couple the saving: Guarantee Credit £4,298.40 and the maximum WTC, £4,935, worked from the law in the comments. - Properties: the pinned YAML households include that couple, and the strategy draws the saving, so mixed-age couples reach the passport in the random examples too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
is_pension_credit_eligiblerequired the claimant and any partner to be over State Pension age, in every year. That creates two errors:housing_benefit_eligible(#1901) approximated the saving by a reported HB award, which only helps couples with would_claim_uc False and never pays them Pension Credit.Law (legislation.gov.uk, read 2026-09-30; point-in-time versions checked)
Change
gov.dwp.pension_credit.mixed_age_couples.excluded: false from 2003-10-06, true from 2019-05-15. Parameters are read at 30 April of the model year (convert_to_fiscal_year_parameters), so model year 2019 (2019-20) reads false and 2020 onward true. Everyone entitled on 14 May 2019 kept their benefits, so the old rule is the closer approximation for 2019-20....mixed_age_couples.saving_latest_birth_year= 1954. Art. 4 needs the older member to have been over the qualifying age on 14 May 2019, which means being born on or before 5 February 1954 (Pensions Act 1995 Sch 4; SPCA s.1(6)). With whole-year ages the model admits all of 1954.is_mixed_age_couple(SI 2019/37 art. 2(2)(a)): exactly two claimant or partner adults, excluding a child or qualifying young person for Pension Credit, one over and one under State Pension age. A single pensioner with an 18 or 19 year old dependant in education is not a mixed-age couple.has_mixed_age_couple_pension_credit_saving: an input that can be set directly. By default it is inferred when all of these hold:meets_pension_credit_age_conditions= the claimant and any partner over State Pension age (is_claimant_or_partner), or a mixed-age couple where the exclusion is not in force or the saving applies. It is used in three places:is_pension_credit_eligible;housing_benefit_eligible, for new pension-age claims (reg 6A(4)-(5)). The reported-HB continuing-award route stays for other families;is_uc_eligible, negated (reg 5(1)(d)), so a family is never on both routes.Two modelling choices, stated in the code:
Invariants (tests)
policyengine_uk/tests/test_mixed_age_couple_properties.pyis a Hypothesis test over 40 derandomized households:Invariants checked:
mixed_age_couples.yamlhas 24 hand-computed cases. Four of them put a grandparent outside the couple into the benefit unit, to check that only the claimant's and partner's ages and reported awards count (each fails if its mask is removed). The rest:Existing test updated: invariant 3 of #1901's
test_housing_benefit_pension_age_properties.py(dataset mode). A saved mixed-age couple is now HB-eligible on the new-claim route as well as the continuing-award route. The test computes the expected saving from the drawn unit (mixed-age shape, HB reported by the pension-age claimant, born by 1954), not from model output.Impact on current main (real runs, 2 October 2026)
Real Microsimulation runs of
main3c48247e(which includes #1896) against this head5c212e33, on the published Enhanced FRS 2024-25 (1.57.4, sha25603fe15e4…). One run per version and year; nothing is scaled. Household counts are shown only where at least ten survey records are behind them. The Universal Credit and Housing Benefit totals for 2026 to 2028, and the Council Tax Reduction totals, each rest on fewer than ten survey records, so read them as indicative.¹ Not given, and nor are Council Tax Reduction or household net income: these changes rest on fewer than 10 survey records or would reveal them (redacted 3 October).
mixed_age_couples.yamlgive the per-household results on this head. The household table in earlier versions of this description compared against amainthat did not yet count State Pension as Universal Credit income (Count State Pension as Universal Credit unearned income #1943), so it has been removed.Coordination (checked with
git merge-tree)is_pension_credit_eligible,is_uc_eligibleandhousing_benefit_eligible. Whichever lands second should:has_attained_state_pension_credit_qualifying_agein place ofis_SP_ageinis_mixed_age_couple,meets_pension_credit_age_conditionsandhas_mixed_age_couple_pension_credit_saving;housing_benefit_eligible. Semantically, itshousing_benefit_payable_sharekeeps awards for any family with a member over State Pension age, which covers saved mixed-age couples.mainon 2 October; composed in this branch at65ee721a). In that merge:meets_pension_credit_age_conditionsandis_mixed_age_couplereadis_claimant_or_partnerin place ofis_adult, which Replace generic child and adult flags with each programme's legal definitions #1896's code-health test forbids;is_uc_eligiblekeeps Replace generic child and adult flags with each programme's legal definitions #1896's qualifying-claimant test and this PR's~meets_pension_credit_age_conditionsterm;in_receipt_of_guarantee_credit, which goes throughis_pension_credit_eligible. So a saved mixed-age couple on Guarantee Credit now gets the Housing Benefit and Council Tax Reduction passports. Key the Housing Benefit Guarantee Credit passport on receipt #1927's tests and notebook say saved mixed-age couples lose the passport "until that saving is modelled"; whichever of Key the Housing Benefit Guarantee Credit passport on receipt #1927 and this PR lands second removes that text and re-runs both PRs' property tests.Whoever merges second should re-run both property tests.
Not modelled
Until then the gate admits everyone born in 1954, so it errs towards inclusion: people born from 6 February to December 1954 reached the qualifying age after 14 May 2019.
birth_year(model year minus age), so it can drop real savers in later years. Set the mixed-age couple Pension Credit saving at build time, from survey-year ages policyengine-uk-data#519 sets it once at build time.axiom: uk/statute/ukpga/2002/16/4 + uk/regulation/uksi/2019/37/article/4 TheAxiomFoundation/rulespec-uk#359 queued (extended), TheAxiomFoundation/rulespec-uk#370 queued (extended)
🤖 Generated with Claude Code