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 |
Summary
is_pension_credit_eligiblerequired every adult in the benefit unit 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= every adult over State Pension age, 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:
Household results (real runs, main 44240bd → this branch)
The 2018 and 2019 couples get less net income on this branch than on main. Main's UC leaves State Pension out of unearned income, contrary to UC Regs regs 66(1)(a) and 67, so main overstates their UC. That is a separate bug.
Invariants (tests)
policyengine_uk/tests/test_mixed_age_couple_properties.pyis a Hypothesis test over 40 derandomized households:Invariants checked:
mixed_age_couples.yamlhas 16 hand-computed cases: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.All 1,303 YAML policy tests pass locally, as do the parameter metadata and fiscal-year parameter tests.
Dataset impact (real runs of main 44240bd and this branch)
Two Enhanced FRS 2024-25 builds are in use locally. Build A (md5 10a924c0, 126.6 MB) is the copy most review sessions use. Build B (md5 beba41cc, 127.5 MB) is the newer published download.
Caveats:
has_mixed_age_couple_pension_credit_savingat build time from survey-year ages.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.65ee721a): the branch now contains Replace generic child and adult flags with each programme's legal definitions #1896's head207e225cand currentmain, so CI tests the combined tree. In the 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