Conversation
The 2-year-old entitlement listed the raw guarantee_credit amount as a qualifying benefit. PolicyEngine computes that amount for every benefit unit, so low-income working-age families and pensioners who do not claim Pension Credit qualified through it. SI 2014/2147 reg 1(2) requires the parent to be entitled to the guaranteed element of state pension credit, and entitlement needs the qualifying age (SPCA 2002 s.1(2)(b)) and a claim (SSAA 1992 s.1(1), (4)(ab)). The entry is now in_receipt_of_guarantee_credit (Pension Credit eligible, claims it, guarantee credit positive), the variable #1927 and #1909 add; the file is byte-identical to theirs. Its YAML test is #1927's, also byte-identical. Fixes #1956 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #1956
Summary
The targeted (2-year-old) childcare entitlement in England listed the raw
guarantee_creditamount as a qualifying benefit. PolicyEngine computesguarantee_creditfor every benefit unit as max(0, minimum guarantee − Pension Credit income), so low-income working-age families, and pensioners who do not claim Pension Credit, qualified through it. This PR replaces that entry ingov.dfe.targeted_childcare_entitlement.qualifying_benefitswithin_receipt_of_guarantee_credit: the benefit unit is eligible for Pension Credit (every adult at State Pension age), claims it (would_claim_pc), and its guarantee credit is positive.in_receipt_of_guarantee_credit.pyis byte-identical to the file #1927 and #1909 add (git blob 877ab36), and its YAML test is byte-identical to #1927's (blob fe4b686). Whichever of the three merges first adds them; the others then merge without a conflict on those files.The law
A working-age parent can never be entitled to the guaranteed element, and a pensioner who has not claimed is not entitled to it.
Before 1 April 2018 (the parameter starts on 2014-01-01), the route ran through Education Act 1996 s.512ZB(4)(aa) and the Education (Free School Lunches) (State Pension Credit) Order 2005 (SI 2005/885) art 2, which required the parent to be "receiving guarantee credit". That is also a receipt test.
The other three entries are already receipt-based:
income_supportneeds a reported Income Support award (income_support_eligiblechecksincome_support_reported), andjsa_incomeandesa_incomepay reported awards screened by a capital test. Income Support and income-based JSA stop from April 2026 (gov.dwp.income_support.active,gov.dwp.JSA.income.active).Household example
A lone parent aged 30 in England with a 2-year-old, no income, not claiming Universal Credit, in 2026:
guarantee_credit(£238.00 × 52 + £69.98 × 52)pension_credittargeted_childcare_entitlement_eligibletargeted_childcare_entitlement(child)household_net_incomeThe same parent on Universal Credit with no earnings still qualifies through the Universal Credit criterion (YAML Case 11).
Enhanced FRS impact
Real runs of origin/main (da947ee) and this branch on the Enhanced FRS 2024-25 (
enhanced_frs_2024_25.h5), one microsimulation per package covering every year, totals summed in float64. Weighted aggregates only.household_net_income,household_benefitsandgov_spendingfall by the same amounts, andgov_balancerises by them (to within £36, the float32 rounding of the household arrays).hbai_household_net_income, and BHC and AHC poverty for children and for everyone, do not change.Effect on #1952: that PR counts Carer's Allowance as Pension Credit income. It moved targeted childcare by −£1.6m to −£1.8m because it lowered working-age carers' computed guarantee credit. #1952 can only lower a guarantee credit, and no benefit unit with a 2-year-old receives one in the Enhanced FRS, so after this PR #1952 cannot change targeted childcare on this dataset.
Invariants
Stated for every input, and tested with Hypothesis in
test_targeted_childcare_guarantee_credit_properties.py. Generated populations mix working-age, pension-age and mixed-age families with a 2-year-old, across England, Wales, Scotland and Northern Ireland, in 2025, 2026 and 2029.targeted_childcare_entitlement_eligibleequals: claims targeted childcare, lives in England, is not eligible for the extended entitlement, and has at least one open route (IS, income-based JSA, income-related ESA, receipt of a guarantee credit, or aqualifying_criteriacriterion).pension_creditandguarantee_creditare both positive, so it implieswould_claim_pcand that every adult is over State Pension age.gov.contrib.freeze_pension_credit, the route follows the baseline receipt.On main, invariant 1 fails in every test year for 3 of the 5 below-age known families (working-age lone parent, working-age couple, a 65-year-old), whose computed guarantee credit is £15,051 to £23,972. It holds on this branch.
Tests
targeted_childcare_entitlement_guarantee_credit.yaml, 11 cases. Working-age lone parent, working-age couple and a 65-year-old with a 2-year-old and no income do not qualify. A parent over the qualifying age, with no income or with a State Pension below the minimum guarantee, does qualify. A non-claimant, a pensioner above the minimum guarantee, a Savings-Credit-only pensioner and a mixed-age couple do not. A pension-age couple in Wales does not. A working-age parent on Universal Credit still does. Main has noin_receipt_of_guarantee_credit, so the file cannot run there as written; with the same inputs, main makes cases 1, 2, 3, 6 and 9 eligible.in_receipt_of_guarantee_credit.yaml: Key the Housing Benefit Guarantee Credit passport on receipt #1927's six cases, unchanged.targeted_childcare_entitlement_eligible.yaml: inputs now setin_receipt_of_guarantee_credit: falseinstead ofguarantee_credit: 0.Commands run:
uv run policyengine-core test policyengine_uk/tests/policy -c policyengine_uk: 1,349 passed.uv run pytest policyengine_uk/tests/ --ignore=policyengine_uk/tests/microsimulation: PYTESTuv run pytest policyengine_uk/tests/test_targeted_childcare_guarantee_credit_properties.py: 5 passed (116 s).ruff format .andruff check .: clean.make test-microsimulation.Known departures from the law (unchanged by this PR)
is_pension_credit_eligiblerequires every adult to be at State Pension age. Since 15 May 2019 SPCA s.4(1A) excludes mixed-age couples, but SI 2019/37 art 4 saves couples entitled on 14 May 2019, and before that date the older member could be entitled. Date the mixed-age couple Pension Credit exclusion and model the SI 2019/37 saving #1940 models the saving and dates the exclusion; this route follows it once that merges.is_pension_credit_eligible, so it picks those up.would_claim_pcis the claim. It defaults to true outside the dataset and is a take-up draw in the Enhanced FRS.Axiom
axiom: AXIOM
SI 2014/2147 is not in the Axiom corpus (no rows for
uk/regulation/uksi/2014/2147or/1), and rulespec-uk has no module for it. SPCA 2002 ss.1 and 2 are in the corpus and encoded. The queued issue covers corpus ingestion and the reg 1(2)(a) routes, with the guaranteed element composed from the SPCA modules, and companion tests taken from the law.🤖 Generated with Claude Code