From 9b0c276729c5b597897fc6304b1fb07632aac52a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 10 Oct 2026 20:29:41 -0400 Subject: [PATCH 1/8] Exclude Income Support in own right from PC, Child Benefit and CTC QYPs SPC Regs 2002 reg. 4A(5), Child Benefit (General) Regulations 2006 reg. 8(2)(a) and CTC Regs 2002 reg. 5(4)(c) each say a person receiving income support is not a qualifying young person. The own-right benefits input covers Universal Credit, Employment and Support Allowance and Jobseeker's Allowance, which is Universal Credit's list (reg. 5(5)). Add receives_income_support_in_own_right: the person's own reported Income Support while Income Support is in payment (to 2025-26), settable directly. It does not read the benefit unit's calculated award, which depends on who the family's young persons are. The three programmes' qualifying young person tests exclude it; Universal Credit's does not. Co-Authored-By: Claude Opus 5.5 --- .../qyp-income-support-exclusion.fixed.md | 1 + ...ualifying_young_person_income_support.yaml | 165 ++++++++++++++++++ ..._young_person_income_support_properties.py | 128 ++++++++++++++ ...fying_young_person_for_child_tax_credit.py | 10 +- ...lifying_young_person_for_pension_credit.py | 9 +- ...alifying_young_person_for_child_benefit.py | 10 +- .../receives_income_support_in_own_right.py | 30 ++++ 7 files changed, 341 insertions(+), 12 deletions(-) create mode 100644 changelog.d/qyp-income-support-exclusion.fixed.md create mode 100644 policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml create mode 100644 policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py create mode 100644 policyengine_uk/variables/household/income/receives_income_support_in_own_right.py diff --git a/changelog.d/qyp-income-support-exclusion.fixed.md b/changelog.d/qyp-income-support-exclusion.fixed.md new file mode 100644 index 0000000000..35769651aa --- /dev/null +++ b/changelog.d/qyp-income-support-exclusion.fixed.md @@ -0,0 +1 @@ +- Stopped counting a young person who receives Income Support in their own right as a qualifying young person for Pension Credit, Child Benefit (and so Housing Benefit and the legacy benefits) and Child Tax Credit (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c)), read from their own reported Income Support while it was in payment. diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml new file mode 100644 index 0000000000..3d25203df1 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml @@ -0,0 +1,165 @@ +# Income Support in a young person's own right ends qualifying young person +# status for Pension Credit (SPC Regs 2002 reg. 4A(5)), Child Benefit (Child +# Benefit (General) Regulations 2006 reg. 8(2)(a)) and Child Tax Credit (CTC +# Regs 2002 reg. 5(4)(c)). Universal Credit's list (UC Regs 2013 reg. 5(5)) +# names Universal Credit, Employment and Support Allowance and Jobseeker's +# Allowance only. +# +# Income Support stopped paying on 31 March 2026 +# (gov/dwp/income_support/active.yaml), so reported receipt counts to 2025-26. +# 2025-26 amounts: Child Benefit eldest child £26.05 a week; Pension Credit +# first-child addition £78.10 a week. CTC child element £3,455 in 2024-25. + +- name: Case 1, a 17-year-old at school with no Income Support is every programme's qualifying young person. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + grandparent: + age: 70 + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + is_claimant_or_partner: false + benunits: + benunit: + members: [grandparent, student] + output: + receives_income_support_in_own_right: [false, false] + is_qualifying_young_person_for_pension_credit: [false, true] + is_qualifying_young_person_for_child_benefit: [false, true] + is_qualifying_young_person_for_universal_credit: [false, true] + # 78.10 * 52. + child_minimum_guarantee_addition: 4_061.20 + # 26.05 * 52. + child_benefit_entitlement: 1_354.60 + +- name: Case 2, reported Income Support of their own ends it for Pension Credit and Child Benefit, not Universal Credit. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + grandparent: + age: 70 + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + income_support_reported: 3_000 + is_claimant_or_partner: false + benunits: + benunit: + members: [grandparent, student] + output: + receives_income_support_in_own_right: [false, true] + is_qualifying_young_person_for_pension_credit: [false, false] + is_qualifying_young_person_for_child_benefit: [false, false] + is_qualifying_young_person_for_universal_credit: [false, true] + child_minimum_guarantee_addition: 0 + child_benefit_entitlement: 0 + is_child_or_young_person_for_legacy_benefits: [false, false] + +- name: Case 3, the same for Child Tax Credit in 2024-25. + period: 2024 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + is_parent: true + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + income_support_reported: 3_000 + is_claimant_or_partner: false + benunits: + benunit: + members: [parent, student] + output: + is_qualifying_young_person_for_child_tax_credit: [false, false] + CTC_child_element: 0 + +- name: Case 4, without it the Child Tax Credit child element is paid. + period: 2024 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + is_parent: true + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + is_claimant_or_partner: false + benunits: + benunit: + members: [parent, student] + output: + is_qualifying_young_person_for_child_tax_credit: [false, true] + CTC_child_element: 3_455 + +- name: Case 5, it ends the 16-year-old's status too, which has no education condition. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + grandparent: + age: 70 + is_claimant_or_partner: true + school_leaver: + age: 16 + current_education: NOT_IN_EDUCATION + income_support_reported: 3_000 + is_claimant_or_partner: false + benunits: + benunit: + members: [grandparent, school_leaver] + output: + is_qualifying_young_person_for_pension_credit: [false, false] + is_qualifying_young_person_for_child_benefit: [false, false] + is_qualifying_young_person_for_universal_credit: [false, true] + +- name: Case 6, a report of Income Support after it stopped paying does not count. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + grandparent: + age: 70 + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + income_support_reported: 3_000 + is_claimant_or_partner: false + benunits: + benunit: + members: [grandparent, student] + output: + receives_income_support_in_own_right: [false, false] + is_qualifying_young_person_for_pension_credit: [false, true] + is_qualifying_young_person_for_child_benefit: [false, true] + +- name: Case 7, the input can be set directly. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + grandparent: + age: 70 + is_claimant_or_partner: true + student: + age: 17 + current_education: UPPER_SECONDARY + receives_income_support_in_own_right: true + is_claimant_or_partner: false + benunits: + benunit: + members: [grandparent, student] + output: + is_qualifying_young_person_for_pension_credit: [false, false] + is_qualifying_young_person_for_child_benefit: [false, false] + is_qualifying_young_person_for_universal_credit: [false, true] diff --git a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py new file mode 100644 index 0000000000..bd5ab7e22e --- /dev/null +++ b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py @@ -0,0 +1,128 @@ +"""Income Support in a young person's own right and qualifying young person +status. + +A person receiving Income Support is not a qualifying young person for +Pension Credit (SPC Regs 2002 reg. 4A(5)), Child Benefit (Child Benefit +(General) Regulations 2006 reg. 8(2)(a)) or Child Tax Credit (CTC Regs 2002 +reg. 5(4)(c)). Universal Credit's list (UC Regs 2013 reg. 5(5)) does not +include Income Support. + +Invariants: + +1. Over every combination of age, education, training, the other own-right + benefits and the 16th-birthday fact: with Income Support in their own + right, nobody is a Pension Credit, Child Benefit or Child Tax Credit + qualifying young person. +2. Without it, each of those three statuses is exactly what it is when the + input is left alone, so nothing else changes. +3. Universal Credit status never depends on it. +4. Without it, Pension Credit and Universal Credit agree on every combination; + with it, Pension Credit is the narrower. +5. By default the input is the person's own reported Income Support while + Income Support is in payment (to 2025-26), and false after. +""" + +from itertools import product +from unittest.mock import patch + +import numpy as np +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_uk import Simulation +from policyengine_uk.tax_benefit_system import system +from policyengine_uk.variables.household.demographic.highest_education import ( + EducationType, +) + +YEAR = 2025 +_PROPERTY_SYSTEM = system.clone() +EDUCATIONS = tuple(item.name for item in EducationType) +SIXTEEN = "is_before_first_september_following_16th_birthday" +INCOME_SUPPORT = "receives_income_support_in_own_right" +EXCLUDING = ("pension_credit", "child_benefit", "child_tax_credit") +SETTINGS = settings( + max_examples=25, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], +) + + +def simulate(people, year=YEAR): + """Each person alone in a benefit unit: the status tests are personal.""" + situation = {"people": {}, "benunits": {}, "households": {}} + for i in range(len(people)): + situation["people"][f"p{i}"] = {} + situation["benunits"][f"b{i}"] = {"members": [f"p{i}"]} + situation["households"][f"h{i}"] = {"members": [f"p{i}"]} + with patch( + "policyengine_uk.simulation.CountryTaxBenefitSystem", + side_effect=_PROPERTY_SYSTEM.clone, + ): + sim = Simulation(situation=situation) + variables = people[0].keys() + assert all(p.keys() == variables for p in people) + for variable in variables: + sim.set_input(variable, year, [p[variable] for p in people]) + sim.input_variables = list(variables) + sim.reset_calculations() + return sim + + +def status(sim, programme, year=YEAR): + return sim.calculate(f"is_qualifying_young_person_for_{programme}", year) + + +BASE = [ + { + "age": age, + "current_education": education, + "is_in_approved_training": training, + "receives_benefits_in_own_right": own_right, + "age_started_or_accepted_current_education_or_training": 17, + SIXTEEN: sixteen, + } + for age, education, training, own_right, sixteen in product( + range(14, 22), EDUCATIONS, (False, True), (False, True), (False, True) + ) +] + + +def test_income_support_ends_three_statuses_and_not_universal_credit(): + untouched = simulate(BASE) + without = simulate([dict(p, **{INCOME_SUPPORT: False}) for p in BASE]) + with_it = simulate([dict(p, **{INCOME_SUPPORT: True}) for p in BASE]) + for programme in EXCLUDING: + before = status(untouched, programme) + # Not vacuous: there is a status to lose. + assert before.any(), programme + # Invariant 1. + assert not status(with_it, programme).any(), programme + # Invariant 2. + np.testing.assert_array_equal(status(without, programme), before) + # Invariant 3. + universal_credit = status(untouched, "universal_credit") + np.testing.assert_array_equal(status(with_it, "universal_credit"), universal_credit) + np.testing.assert_array_equal(status(without, "universal_credit"), universal_credit) + # Invariant 4. + np.testing.assert_array_equal(status(without, "pension_credit"), universal_credit) + assert (status(with_it, "pension_credit") <= universal_credit).all() + assert universal_credit.any() + + +@SETTINGS +@given( + st.lists( + st.tuples(st.integers(0, 60), st.sampled_from([0, 0, 1, 2_500, 9_000])), + min_size=1, + max_size=40, + ), + st.sampled_from([2021, 2024, 2025, 2026, 2028]), +) +def test_default_follows_reported_income_support_while_it_is_paid(rows, year): + # Invariant 5. Income Support paid its last awards on 31 March 2026. + people = [{"age": age, "income_support_reported": amount} for age, amount in rows] + sim = simulate(people, year) + expected = [year <= 2025 and amount > 0 for _, amount in rows] + np.testing.assert_array_equal(sim.calculate(INCOME_SUPPORT, year), expected) diff --git a/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py b/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py index 3fa5ac8721..f0e018b4ec 100644 --- a/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py +++ b/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py @@ -20,10 +20,11 @@ class is_qualifying_young_person_for_child_tax_credit(Variable): "until 30 August, and not the year after. The second condition " "(reg. 5(4)) always applies: a young person who has left education or " "training must not be in remunerative work, and no one may be " - "receiving a benefit in their own right. The own-right benefits " - "input covers Universal Credit, Employment and Support Allowance and " - "Jobseeker's Allowance, where reg. 5(4)(c) lists Universal Credit, " - "Income Support and the income-related and income-based allowances. " + "receiving a benefit in their own right. That is read from the " + "own-right inputs for Universal Credit, Employment and Support " + "Allowance, Jobseeker's Allowance and Income Support; reg. 5(4)(c) " + "lists Universal Credit, Income Support and only the income-related " + "and income-based allowances, which the inputs do not separate. " "Interruptions (reg. 5(7)) are not modelled." ) definition_period = YEAR @@ -70,4 +71,5 @@ def formula(person, period, parameters): ) # Reg. 5(4)(c). & ~person("receives_benefits_in_own_right", period) + & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py b/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py index ff054781b9..4cf4be9fd0 100644 --- a/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py +++ b/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py @@ -10,10 +10,9 @@ class is_qualifying_young_person_for_pension_credit(Variable): "their 16th birthday, whatever their education (reg. 4A(1)(a)), or in " "non-advanced education or approved training that meets the entry " "condition, before the 1 September following their 19th birthday " - "(reg. 4A(1)(b), (2) and (3)), and who is not receiving benefits in " - "their own right (reg. 4A(5)). The own-right benefits input covers " - "Universal Credit, Employment and Support Allowance and Jobseeker's " - "Allowance but not Income Support." + "(reg. 4A(1)(b), (2) and (3)), and who is not receiving Universal " + "Credit, Employment and Support Allowance, Jobseeker's Allowance or " + "Income Support in their own right (reg. 4A(5))." ) definition_period = YEAR reference = "https://www.legislation.gov.uk/uksi/2002/1792/regulation/4A" @@ -47,5 +46,7 @@ def formula(person, period, parameters): before_first_september_following_16th_birthday | in_education_or_training ) + # Reg. 4A(5). & ~person("receives_benefits_in_own_right", period) + & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py b/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py index 03a6cdd3ce..2a122a392c 100644 --- a/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py +++ b/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py @@ -19,10 +19,10 @@ class is_qualifying_young_person_for_child_benefit(Variable): "August (1 September for a 16th birthday on 31 August) falls in the " "same fiscal year as Universal Credit's 1 September, so a year that " "starts before one starts before the other. Interruptions (reg. 6) " - "are not modelled. The own-right benefits input covers Universal " - "Credit, Employment and Support Allowance and Jobseeker's Allowance " - "but not the Income Support, incapacity benefit and tax credits that " - "reg. 8 also lists." + "are not modelled. Reg. 8 is read from the own-right inputs for " + "Universal Credit, Employment and Support Allowance, Jobseeker's " + "Allowance and Income Support; the incapacity benefit and tax credits " + "it also lists are not." ) definition_period = YEAR reference = [ @@ -67,5 +67,7 @@ def formula(person, period, parameters): | in_extension_period | before_terminal_date ) + # Reg. 8. & ~person("receives_benefits_in_own_right", period) + & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py new file mode 100644 index 0000000000..25b20f8df6 --- /dev/null +++ b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py @@ -0,0 +1,30 @@ +from policyengine_uk.model_api import * + + +class receives_income_support_in_own_right(Variable): + value_type = bool + entity = Person + label = "Receives Income Support in own right" + documentation = ( + "Whether this person receives Income Support on a claim of their own. " + "It ends qualifying young person status for Pension Credit (SPC Regs " + "2002 reg. 4A(5)), Child Benefit (Child Benefit (General) Regulations " + "2006 reg. 8(2)(a)), with it the Housing Benefit and legacy young " + "person, and Child Tax Credit (CTC Regs 2002 reg. 5(4)(c)). Universal " + "Credit's list (UC Regs 2013 reg. 5(5)) does not include it. By " + "default it is the person's own reported Income Support " + "(income_support_reported) while Income Support is in payment; set it " + "directly otherwise. It does not read the benefit unit's calculated " + "award, which belongs to the claimant and depends on who the family's " + "young persons are." + ) + definition_period = YEAR + reference = ( + "https://www.legislation.gov.uk/uksi/2002/1792/regulation/4A", + "https://www.legislation.gov.uk/uksi/2006/223/regulation/8", + "https://www.legislation.gov.uk/uksi/2002/2007/regulation/5", + ) + + def formula(person, period, parameters): + active = parameters(period).gov.dwp.income_support.active + return active & (person("income_support_reported", period) > 0) From 39895f731fbea966e617ab5d85582eb50273d124 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 12 Oct 2026 09:02:15 -0400 Subject: [PATCH 2/8] Treat Income Support as not received once a reform removes it Review round 1 of #2302: receives_income_support_in_own_right stayed true under a reform that neutralizes income_support, so a young person's report still excluded them from the Pension Credit, Child Benefit and CTC qualifying young person status. It now also needs Income Support not to be neutralized, as is_on_income_support already does for another member's own claim. New test: the same student is excluded with Income Support and qualifies for all three once a reform removes it. Co-Authored-By: Claude Opus 5.5 --- ..._young_person_income_support_properties.py | 23 ++++++++++++++++++- .../receives_income_support_in_own_right.py | 12 +++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py index bd5ab7e22e..fef49a5512 100644 --- a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py +++ b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py @@ -19,7 +19,8 @@ 4. Without it, Pension Credit and Universal Credit agree on every combination; with it, Pension Credit is the narrower. 5. By default the input is the person's own reported Income Support while - Income Support is in payment (to 2025-26), and false after. + Income Support is in payment (to 2025-26) and no reform removes it, and + false otherwise. """ from itertools import product @@ -126,3 +127,23 @@ def test_default_follows_reported_income_support_while_it_is_paid(rows, year): sim = simulate(people, year) expected = [year <= 2025 and amount > 0 for _, amount in rows] np.testing.assert_array_equal(sim.calculate(INCOME_SUPPORT, year), expected) + + +def test_no_receipt_once_a_reform_removes_income_support(): + # Invariant 5 under a reform: a 17-year-old at school reporting £3,000 of + # Income Support of their own is excluded while Income Support exists, + # and is a qualifying young person again once a reform neutralizes it. + student = { + "age": 17, + "current_education": "UPPER_SECONDARY", + "income_support_reported": 3_000, + } + kept = simulate([student]) + assert kept.calculate(INCOME_SUPPORT, YEAR).all() + removed = simulate([student]) + removed.tax_benefit_system.neutralize_variable("income_support") + removed.delete_arrays("income_support") + assert not removed.calculate(INCOME_SUPPORT, YEAR).any() + for programme in EXCLUDING: + assert not status(kept, programme).any(), programme + assert status(removed, programme).all(), programme diff --git a/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py index 25b20f8df6..648ba7221c 100644 --- a/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py +++ b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py @@ -13,8 +13,10 @@ class receives_income_support_in_own_right(Variable): "person, and Child Tax Credit (CTC Regs 2002 reg. 5(4)(c)). Universal " "Credit's list (UC Regs 2013 reg. 5(5)) does not include it. By " "default it is the person's own reported Income Support " - "(income_support_reported) while Income Support is in payment; set it " - "directly otherwise. It does not read the benefit unit's calculated " + "(income_support_reported) while Income Support is in payment and no " + "reform removes it (neutralizes income_support), as is_on_income_support " + "reads another member's own claim; set it directly otherwise. It does " + "not read the benefit unit's calculated " "award, which belongs to the claimant and depends on who the family's " "young persons are." ) @@ -27,4 +29,8 @@ class receives_income_support_in_own_right(Variable): def formula(person, period, parameters): active = parameters(period).gov.dwp.income_support.active - return active & (person("income_support_reported", period) > 0) + # A reform that removes Income Support leaves no award to receive. + removed = person.simulation.tax_benefit_system.get_variable( + "income_support" + ).is_neutralized + return active & (not removed) & (person("income_support_reported", period) > 0) From 4e1e0176ac013b1dfb41bcbc858ceb073b1057b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 04:00:41 +0000 Subject: [PATCH 3/8] Read calculated Income Support for Pension Credit and CTC qualifying young persons receives_income_support_in_own_right treated every positive report as receipt, so a reform replacing income_support's formula with zero left a claimant's report standing: in 2019 an 18-year-old student-carer on their own Income Support stayed excluded under SPC Regs 2002 reg. 4A(5), and a co-resident pensioner lost the 3,424.20 severe disability addition. Pension Credit and Child Tax Credit now read is_on_income_support alone (the award the model calculates for a claimant or partner, and another member's own report while Income Support is in payment and not neutralised), which H2 and #2279 already read. Child Benefit keeps the report: reading the calculated award makes a cycle through income_support_applicable_amount and the legacy young person. receives_income_support_in_own_right documents that and what a reform must do for Child Benefit to follow. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6FJSEjTyXcaymMgSqM --- .../qyp-income-support-exclusion.fixed.md | 2 +- ...child_tax_credit_school_leaver_routes.yaml | 11 +- ...ualifying_young_person_income_support.yaml | 75 +++- ..._young_person_income_support_properties.py | 351 ++++++++++++++---- ...fying_young_person_for_child_tax_credit.py | 1 - ...lifying_young_person_for_pension_credit.py | 5 +- ...alifying_young_person_for_child_benefit.py | 3 + .../receives_income_support_in_own_right.py | 38 +- 8 files changed, 393 insertions(+), 93 deletions(-) diff --git a/changelog.d/qyp-income-support-exclusion.fixed.md b/changelog.d/qyp-income-support-exclusion.fixed.md index 35769651aa..cbc3f67373 100644 --- a/changelog.d/qyp-income-support-exclusion.fixed.md +++ b/changelog.d/qyp-income-support-exclusion.fixed.md @@ -1 +1 @@ -- Stopped counting a young person who receives Income Support in their own right as a qualifying young person for Pension Credit, Child Benefit (and so Housing Benefit and the legacy benefits) and Child Tax Credit (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c)), read from their own reported Income Support while it was in payment. +Stopped counting a young person who receives Income Support in their own right as a qualifying young person for Pension Credit, Child Benefit (and so Housing Benefit and the legacy benefits) and Child Tax Credit (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c)). Pension Credit and Child Tax Credit read the Income Support the model calculates for a claimant or partner, so a reform that pays no Income Support ends their exclusion; Child Benefit reads the young person's own report while Income Support is in payment. diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/family/child_tax_credit_school_leaver_routes.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/family/child_tax_credit_school_leaver_routes.yaml index 1ad7341981..2fbce2e8c9 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/family/child_tax_credit_school_leaver_routes.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/family/child_tax_credit_school_leaver_routes.yaml @@ -459,10 +459,12 @@ is_qualifying_young_person_for_child_tax_credit: [false, false] # No child or qualifying young person, so no CTC. child_tax_credit: 0 + # Child Benefit reg. 8(2)(a) ends their Child Benefit status too. + is_qualifying_young_person_for_child_benefit: [false, false] + child_benefit: 0 # PIP 57.30 x 52 = 2,979.60; Carer's Allowance 64.60 x 52 = 3,359.20; - # Child Benefit 20.70 x 52 = 1,076.40; cost-of-living payment 150; less - # TV licence 150.50: 7,414.70. - household_net_income: 7_414.70 + # cost-of-living payment 150; less TV licence 150.50: 6,338.30. + household_net_income: 6_338.30 - name: Case 19, the same family without Income Support for the 16-year-old gets CTC until 31 August 2018 (reg. 4(1)). period: 2018 @@ -494,7 +496,8 @@ is_qualifying_young_person_for_child_tax_credit: [false, true] # No income: child element 2,780 + family element 545 = 3,325. child_tax_credit: 3_325 - # Case 18's 7,414.70 + 3,325 = 10,739.70. + # Case 18's 6,338.30 + Child Benefit 20.70 x 52 = 1,076.40 + 3,325 = + # 10,739.70. household_net_income: 10_739.70 - name: Case 20, a 17-year-old at school who receives Income Support in their own right is not a qualifying young person (reg. 5(3)(a), 5(4)(c)). diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml index 3d25203df1..43b55a36b7 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml @@ -5,10 +5,19 @@ # names Universal Credit, Employment and Support Allowance and Jobseeker's # Allowance only. # +# Pension Credit and Child Tax Credit read is_on_income_support: the award the +# model calculates for a claimant or partner, and the person's own report for +# any other member. Child Benefit reads receives_income_support_in_own_right, +# the person's own report, because the family's Income Support reads the +# Child Benefit test. +# # Income Support stopped paying on 31 March 2026 # (gov/dwp/income_support/active.yaml), so reported receipt counts to 2025-26. # 2025-26 amounts: Child Benefit eldest child £26.05 a week; Pension Credit -# first-child addition £78.10 a week. CTC child element £3,455 in 2024-25. +# first-child addition £78.10 a week. CTC child element £3,455 in 2024-25; the +# element needs an existing claim that a Universal Credit claim has not ended +# (is_CTC_eligible), so the CTC cases give the parent a reported award and the +# family no Universal Credit claim. - name: Case 1, a 17-year-old at school with no Income Support is every programme's qualifying young person. period: 2025 @@ -66,6 +75,7 @@ input: people: parent: + child_tax_credit_reported: 1 age: 40 is_parent: true is_claimant_or_partner: true @@ -77,7 +87,9 @@ benunits: benunit: members: [parent, student] + would_claim_uc: false output: + is_on_income_support: [false, true] is_qualifying_young_person_for_child_tax_credit: [false, false] CTC_child_element: 0 @@ -87,6 +99,7 @@ input: people: parent: + child_tax_credit_reported: 1 age: 40 is_parent: true is_claimant_or_partner: true @@ -97,6 +110,7 @@ benunits: benunit: members: [parent, student] + would_claim_uc: false output: is_qualifying_young_person_for_child_tax_credit: [false, true] CTC_child_element: 3_455 @@ -143,7 +157,7 @@ is_qualifying_young_person_for_pension_credit: [false, true] is_qualifying_young_person_for_child_benefit: [false, true] -- name: Case 7, the input can be set directly. +- name: Case 7, the Child Benefit input can be set directly; it does not decide Pension Credit or Child Tax Credit. period: 2025 absolute_error_margin: 0.01 input: @@ -160,6 +174,61 @@ benunit: members: [grandparent, student] output: - is_qualifying_young_person_for_pension_credit: [false, false] + # No Income Support reported or calculated. + is_on_income_support: [false, false] + is_qualifying_young_person_for_pension_credit: [false, true] + is_qualifying_young_person_for_child_tax_credit: [false, true] is_qualifying_young_person_for_child_benefit: [false, false] is_qualifying_young_person_for_universal_credit: [false, true] + +# Case 8, 2019-20 amounts: standard minimum guarantee £167.25 a week; severe +# disability addition £65.85 a week; PIP daily living standard rate £58.70 a +# week; Income Support personal allowance for a single person aged 18 to 24 +# £57.90 a week; winter fuel payment £200; colour TV licence £154.50. The +# cost-of-living payment parameters start on 1 January 2022 (means-tested +# £650, pensioner £300, disability £150), and the model applies those first +# values to earlier years, so the household receives £1,100. + +- name: Case 8, a student-carer on Income Support of their own is not the pensioner's qualifying young person, so the pensioner gets no severe disability addition. + period: 2019 + absolute_error_margin: 0.01 + input: + people: + pensioner: + age: 70 + pip_dl_category: STANDARD + state_pension: 5_000 + student: + # An orphan in full-time non-advanced education with an existing + # Income Support claim (IS Regs 1987 reg. 13(2)(c)), caring for the + # pensioner 35 hours a week without Carer's Allowance. + age: 18 + current_education: UPPER_SECONDARY + care_hours: 35 + would_claim_carers_allowance: false + income_support_reported: 3_000 + benunits: + pensioner_unit: + members: [pensioner] + would_claim_uc: false + student_unit: + members: [student] + would_claim_uc: false + households: + household: + members: [pensioner, student] + output: + # The student claims Income Support for their own benefit unit: no + # income, so the award is the personal allowance, 57.90 x 52 = 3,010.80. + income_support: [0, 3_010.80] + is_on_income_support: [false, true] + # Reg. 4A(5): not a qualifying young person, so not disregarded under + # Schedule I para. 2(2)(f), and the pensioner does not live alone. + is_qualifying_young_person_for_pension_credit: [false, false] + severe_disability_minimum_guarantee_addition: [0, 0] + # 167.25 x 52 = 8,697, less the State Pension 5,000. + pension_credit: [3_697, 0] + # State Pension 5,000 + PIP 58.70 x 52 = 3,052.40 + Pension Credit 3,697 + # + Income Support 3,010.80 + cost-of-living payments 1,100 + winter fuel + # payment 200, less TV licence 154.50: 15,905.70. + household_net_income: 15_905.70 diff --git a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py index fef49a5512..21f07c2473 100644 --- a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py +++ b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py @@ -7,20 +7,37 @@ reg. 5(4)(c)). Universal Credit's list (UC Regs 2013 reg. 5(5)) does not include Income Support. +Pension Credit and Child Tax Credit read is_on_income_support: the award the +model calculates for a claimant or partner, and the person's own report for +any other member while Income Support is in payment and not neutralised. +Child Benefit reads receives_income_support_in_own_right, the person's own +report on the same terms, because the family's Income Support reads the +Child Benefit test and the calculated award would make a cycle. + Invariants: 1. Over every combination of age, education, training, the other own-right - benefits and the 16th-birthday fact: with Income Support in their own - right, nobody is a Pension Credit, Child Benefit or Child Tax Credit - qualifying young person. -2. Without it, each of those three statuses is exactly what it is when the - input is left alone, so nothing else changes. -3. Universal Credit status never depends on it. -4. Without it, Pension Credit and Universal Credit agree on every combination; - with it, Pension Credit is the narrower. -5. By default the input is the person's own reported Income Support while - Income Support is in payment (to 2025-26) and no reform removes it, and - false otherwise. + benefits and the 16th-birthday fact, for a member who is not the claimant + or partner: reporting Income Support of their own while it is in payment + ends the Pension Credit, Child Benefit and Child Tax Credit statuses; + without a report each status is what it is when the report is left + alone; Universal Credit status never depends on it; and Pension Credit + and Universal Credit agree without it. +2. By default receives_income_support_in_own_right is the person's own + reported Income Support while Income Support is in payment (to 2025-26) + and no reform neutralises it, and false otherwise. +3. Under a reform that neutralises income_support, no Pension Credit, Child + Tax Credit or Child Benefit status depends on reported Income Support. + Under a reform that replaces income_support's formula with one returning + zero, no Pension Credit or Child Tax Credit status of a claimant or + partner depends on it; another member's report and the Child Benefit + reader still exclude, as their documentation says, because only + neutralising Income Support, or setting the report to zero, removes a + report. +4. Universal Credit status never depends on reported Income Support, in the + baseline or under either reform. +5. Setting a young person's reported Income Support to zero never lowers + their household's Pension Credit. """ from itertools import product @@ -31,6 +48,8 @@ from hypothesis import strategies as st from policyengine_uk import Simulation +from policyengine_uk.model_api import YEAR as YEAR_PERIOD +from policyengine_uk.model_api import BenUnit, Variable from policyengine_uk.tax_benefit_system import system from policyengine_uk.variables.household.demographic.highest_education import ( EducationType, @@ -42,21 +61,53 @@ SIXTEEN = "is_before_first_september_following_16th_birthday" INCOME_SUPPORT = "receives_income_support_in_own_right" EXCLUDING = ("pension_credit", "child_benefit", "child_tax_credit") +# Income Support paid its last awards on 31 March 2026. +IN_PAYMENT = {2016: True, 2019: True, 2024: True, 2025: True, 2026: False} SETTINGS = settings( - max_examples=25, + max_examples=10, deadline=None, derandomize=True, suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], ) -def simulate(people, year=YEAR): - """Each person alone in a benefit unit: the status tests are personal.""" +class income_support(Variable): + """A reform's Income Support formula that pays nothing.""" + + value_type = float + entity = BenUnit + label = "Income Support" + definition_period = YEAR_PERIOD + + def formula(benunit, period, parameters): + return benunit.empty_array() + + +def apply(sim, reform): + if reform == "zero formula": + sim.tax_benefit_system.update_variable(income_support) + elif reform == "neutralised": + sim.tax_benefit_system.neutralize_variable("income_support") + return sim + + +def simulate(households, year=YEAR, reform=None): + """households: a list of households, each a list of benefit units, each a + list of people's inputs. Every person gives the same input names.""" situation = {"people": {}, "benunits": {}, "households": {}} - for i in range(len(people)): - situation["people"][f"p{i}"] = {} - situation["benunits"][f"b{i}"] = {"members": [f"p{i}"]} - situation["households"][f"h{i}"] = {"members": [f"p{i}"]} + people = [] + for h, units in enumerate(households): + household_members = [] + for b, unit in enumerate(units): + names = [] + for p, inputs in enumerate(unit): + name = f"p{h}_{b}_{p}" + situation["people"][name] = {} + people.append(inputs) + names.append(name) + situation["benunits"][f"b{h}_{b}"] = {"members": names} + household_members += names + situation["households"][f"h{h}"] = {"members": household_members} with patch( "policyengine_uk.simulation.CountryTaxBenefitSystem", side_effect=_PROPERTY_SYSTEM.clone, @@ -66,50 +117,79 @@ def simulate(people, year=YEAR): assert all(p.keys() == variables for p in people) for variable in variables: sim.set_input(variable, year, [p[variable] for p in people]) - sim.input_variables = list(variables) + # No family claims Universal Credit, so legacy awards, Child Tax Credit + # included, continue. + benunits = len(situation["benunits"]) + sim.set_input("would_claim_uc", year, np.zeros(benunits, dtype=bool)) + sim.input_variables = list(variables) + ["would_claim_uc"] sim.reset_calculations() - return sim + return apply(sim, reform) def status(sim, programme, year=YEAR): return sim.calculate(f"is_qualifying_young_person_for_{programme}", year) -BASE = [ - { +def member(age, **inputs): + return { "age": age, - "current_education": education, - "is_in_approved_training": training, - "receives_benefits_in_own_right": own_right, + "current_education": "NOT_IN_EDUCATION", + "is_in_approved_training": False, + "receives_benefits_in_own_right": False, "age_started_or_accepted_current_education_or_training": 17, - SIXTEEN: sixteen, + "is_claimant_or_partner": False, + "income_support_reported": 0, + "state_pension": 0, + "pip_dl_category": "NONE", + "care_hours": 0, + "would_claim_carers_allowance": False, + "child_tax_credit_reported": 0, + **inputs, } - for age, education, training, own_right, sixteen in product( - range(14, 22), EDUCATIONS, (False, True), (False, True), (False, True) + + +# --- Invariants 1 and 2 --- + +BASE = [ + dict( + current_education=education, + is_in_approved_training=training, + receives_benefits_in_own_right=own_right, + **{SIXTEEN: sixteen}, + ) + for education, training, own_right, sixteen in product( + EDUCATIONS, (False, True), (False, True), (False, True) ) ] +GRID = [dict(row, age=age) for age, row in product(range(14, 22), BASE)] + + +def as_members(rows, **inputs): + # Each young person sits in the benefit unit of a 70-year-old claimant, + # so they are not the claimant or partner. + claimant = member(70, is_claimant_or_partner=True, **{SIXTEEN: False}) + return [ + [[claimant, member(**{SIXTEEN: False, **row, **inputs})]] + for row in rows + ] def test_income_support_ends_three_statuses_and_not_universal_credit(): - untouched = simulate(BASE) - without = simulate([dict(p, **{INCOME_SUPPORT: False}) for p in BASE]) - with_it = simulate([dict(p, **{INCOME_SUPPORT: True}) for p in BASE]) + untouched = simulate(as_members(GRID)) + reporting = simulate(as_members(GRID, income_support_reported=3_000)) for programme in EXCLUDING: - before = status(untouched, programme) + before = status(untouched, programme)[1::2] # Not vacuous: there is a status to lose. assert before.any(), programme - # Invariant 1. - assert not status(with_it, programme).any(), programme - # Invariant 2. - np.testing.assert_array_equal(status(without, programme), before) - # Invariant 3. - universal_credit = status(untouched, "universal_credit") - np.testing.assert_array_equal(status(with_it, "universal_credit"), universal_credit) - np.testing.assert_array_equal(status(without, "universal_credit"), universal_credit) - # Invariant 4. - np.testing.assert_array_equal(status(without, "pension_credit"), universal_credit) - assert (status(with_it, "pension_credit") <= universal_credit).all() + assert not status(reporting, programme)[1::2].any(), programme + universal_credit = status(untouched, "universal_credit")[1::2] assert universal_credit.any() + np.testing.assert_array_equal( + status(reporting, "universal_credit")[1::2], universal_credit + ) + np.testing.assert_array_equal( + status(untouched, "pension_credit")[1::2], universal_credit + ) @SETTINGS @@ -122,28 +202,171 @@ def test_income_support_ends_three_statuses_and_not_universal_credit(): st.sampled_from([2021, 2024, 2025, 2026, 2028]), ) def test_default_follows_reported_income_support_while_it_is_paid(rows, year): - # Invariant 5. Income Support paid its last awards on 31 March 2026. - people = [{"age": age, "income_support_reported": amount} for age, amount in rows] - sim = simulate(people, year) + # Invariant 2. + households = [ + [[member(age, income_support_reported=amount)]] for age, amount in rows + ] + sim = simulate(households, year) expected = [year <= 2025 and amount > 0 for _, amount in rows] np.testing.assert_array_equal(sim.calculate(INCOME_SUPPORT, year), expected) + neutralised = simulate(households, year, reform="neutralised") + assert not neutralised.calculate(INCOME_SUPPORT, year).any() -def test_no_receipt_once_a_reform_removes_income_support(): - # Invariant 5 under a reform: a 17-year-old at school reporting £3,000 of - # Income Support of their own is excluded while Income Support exists, - # and is a qualifying young person again once a reform neutralizes it. - student = { - "age": 17, - "current_education": "UPPER_SECONDARY", - "income_support_reported": 3_000, - } - kept = simulate([student]) - assert kept.calculate(INCOME_SUPPORT, YEAR).all() - removed = simulate([student]) - removed.tax_benefit_system.neutralize_variable("income_support") - removed.delete_arrays("income_support") - assert not removed.calculate(INCOME_SUPPORT, YEAR).any() - for programme in EXCLUDING: - assert not status(kept, programme).any(), programme - assert status(removed, programme).all(), programme +# --- Invariants 3 to 5, on generated households --- + + +@st.composite +def household(draw): + young = member( + draw(st.integers(15, 20)), + current_education=draw(st.sampled_from(EDUCATIONS)), + is_in_approved_training=draw(st.booleans()), + income_support_reported=draw(st.sampled_from([0, 3_000])), + care_hours=draw(st.sampled_from([0, 35])), + ) + shape = draw(st.sampled_from(["pensioner's unit", "own unit", "parent's unit"])) + if shape == "parent's unit": + # A Child Tax Credit claimant and their young person. + parent = member( + draw(st.integers(35, 55)), + is_claimant_or_partner=True, + child_tax_credit_reported=1, + ) + return [[parent, young]] + pensioner = member( + draw(st.integers(66, 90)), + is_claimant_or_partner=True, + state_pension=draw(st.sampled_from([0, 5_000, 9_000])), + pip_dl_category=draw(st.sampled_from(["NONE", "STANDARD", "ENHANCED"])), + ) + if shape == "own unit": + # The young person claims for their own benefit unit, so the model + # calculates their Income Support. + return [[pensioner], [dict(young, is_claimant_or_partner=True)]] + return [[pensioner, young]] + + +def without_reports(households): + return [ + [[dict(p, income_support_reported=0) for p in unit] for unit in units] + for units in households + ] + + +def flat(households, key): + return np.array([p[key] for units in households for unit in units for p in unit]) + + +GENERATED = dict( + households=st.lists(household(), min_size=1, max_size=8), + year=st.sampled_from([2016, 2019, 2024]), +) + + +@SETTINGS +@given(**GENERATED, reform=st.sampled_from(["zero formula", "neutralised"])) +def test_reforms_that_remove_income_support_end_the_exclusions( + households, year, reform +): + # Invariants 3 and 4. + reformed = simulate(households, year, reform) + unreported = simulate(without_reports(households), year, reform) + reported = flat(households, "income_support_reported") > 0 + claimant = flat(households, "is_claimant_or_partner") + # A report counts where it is the reader's evidence: for Child Benefit + # always, and for Pension Credit and Child Tax Credit for anyone who is + # not the claimant or partner; and only until a reform neutralises it. + report_stands = reported & IN_PAYMENT[year] & (reform != "neutralised") + for programme in ("pension_credit", "child_tax_credit"): + np.testing.assert_array_equal( + status(reformed, programme, year), + status(unreported, programme, year) & ~(report_stands & ~claimant), + err_msg=programme, + ) + np.testing.assert_array_equal( + status(reformed, "child_benefit", year), + status(unreported, "child_benefit", year) & ~report_stands, + ) + np.testing.assert_array_equal( + status(reformed, "universal_credit", year), + status(unreported, "universal_credit", year), + ) + assert not reformed.calculate("income_support", year).any() + + +@SETTINGS +@given(**GENERATED) +def test_universal_credit_and_pension_credit_without_reported_income_support( + households, year +): + # Invariants 4 and 5 in the baseline. + reported = simulate(households, year) + unreported = simulate(without_reports(households), year) + np.testing.assert_array_equal( + status(reported, "universal_credit", year), + status(unreported, "universal_credit", year), + ) + gained = unreported.calculate("pension_credit", year, map_to="household") + kept = reported.calculate("pension_credit", year, map_to="household") + assert (gained >= kept - 0.01).all(), (gained, kept) + + +# --- The review's household: a pensioner and a student-carer --- + + +def pensioner_and_student_carer(): + # 2019: a pensioner aged 70 on PIP daily living with £5,000 of State + # Pension, and an unrelated 18-year-old in their own benefit unit: an + # orphan in full-time non-advanced education with an existing Income + # Support claim (IS Regs 1987 reg. 13(2)(c)), caring for the pensioner 35 + # hours a week without Carer's Allowance. + pensioner = member( + 70, + is_claimant_or_partner=True, + state_pension=5_000, + pip_dl_category="STANDARD", + ) + student = member( + 18, + is_claimant_or_partner=True, + current_education="UPPER_SECONDARY", + income_support_reported=3_000, + care_hours=35, + ) + return [[[pensioner], [student]]] + + +def test_a_reform_paying_no_income_support_restores_the_severe_disability_addition(): + # With the student's Income Support in payment, reg. 4A(5) excludes them, + # the pensioner does not live alone, and Pension Credit is the standard + # minimum guarantee 167.25 x 52 = 8,697 less the State Pension: 3,697. + # A reform that pays no Income Support leaves the student a qualifying + # young person, disregarded under Schedule I para. 2(2)(f), so the + # pensioner gets the severe disability addition 65.85 x 52 = 3,424.20 as + # well: 7,121.20. Household net income: State Pension 5,000 + PIP 58.70 x + # 52 = 3,052.40 + Pension Credit 7,121.20 + the cost-of-living payments + # the model applies before 2022 (650 + 300 + 150) + winter fuel payment + # 200, less TV licence 154.50: 16,319.10. + year = 2019 + for reform in ("zero formula", "neutralised"): + sim = simulate(pensioner_and_student_carer(), year, reform) + np.testing.assert_array_equal(status(sim, "pension_credit", year), [0, 1]) + np.testing.assert_allclose( + sim.calculate("severe_disability_minimum_guarantee_addition", year), + [3_424.20, 0], + atol=0.01, + ) + np.testing.assert_allclose( + sim.calculate("pension_credit", year), [7_121.20, 0], atol=0.01 + ) + np.testing.assert_allclose( + sim.calculate("household_net_income", year), [16_319.10], atol=0.01 + ) + # Child Benefit reads the report: only neutralising Income Support ends + # its exclusion. + zero = simulate(pensioner_and_student_carer(), year, "zero formula") + assert zero.calculate(INCOME_SUPPORT, year)[1] + assert not status(zero, "child_benefit", year)[1] + neutralised = simulate(pensioner_and_student_carer(), year, "neutralised") + assert status(neutralised, "child_benefit", year)[1] diff --git a/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py b/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py index 0b6bbf9c7c..c54648254a 100644 --- a/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py +++ b/policyengine_uk/variables/gov/dwp/is_qualifying_young_person_for_child_tax_credit.py @@ -95,5 +95,4 @@ def formula(person, period, parameters): # and Income Support, which reg. 4(2) keeps for the reg. 4 period. & ~person("receives_benefits_in_own_right", period) & ~person("is_on_income_support", period) - & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py b/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py index 80a567762c..9637a2228d 100644 --- a/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py +++ b/policyengine_uk/variables/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee/additional/is_qualifying_young_person_for_pension_credit.py @@ -43,7 +43,9 @@ def formula(person, period, parameters): # own awards without calculating family benefits, which depend on QYP # status and could recurse. Unlike UC reg. 5(5), it lists income # support, whose family follows the Child Benefit test and not this - # one, so is_on_income_support can read the calculated award. + # one, so is_on_income_support can read the calculated award: a + # claimant or partner receives Income Support only while the model + # pays their benefit unit an award. receives_own_benefits = ( person("receives_benefits_in_own_right", period) | (person("universal_credit_reported", period) > 0) @@ -63,5 +65,4 @@ def formula(person, period, parameters): | in_education_or_training ) & ~receives_own_benefits - & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py b/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py index 42004f3327..63ff9225a5 100644 --- a/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py +++ b/policyengine_uk/variables/gov/hmrc/is_qualifying_young_person_for_child_benefit.py @@ -81,5 +81,8 @@ def formula(person, period, parameters): | before_terminal_date ) & ~receives_own_benefits + # Reg. 8(2)(a). The reported award, not is_on_income_support: + # the family's Income Support reads this test, so the calculated + # award would make a cycle. & ~person("receives_income_support_in_own_right", period) ) diff --git a/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py index 648ba7221c..5035be6ea0 100644 --- a/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py +++ b/policyengine_uk/variables/household/income/receives_income_support_in_own_right.py @@ -6,26 +6,28 @@ class receives_income_support_in_own_right(Variable): entity = Person label = "Receives Income Support in own right" documentation = ( - "Whether this person receives Income Support on a claim of their own. " - "It ends qualifying young person status for Pension Credit (SPC Regs " - "2002 reg. 4A(5)), Child Benefit (Child Benefit (General) Regulations " - "2006 reg. 8(2)(a)), with it the Housing Benefit and legacy young " - "person, and Child Tax Credit (CTC Regs 2002 reg. 5(4)(c)). Universal " - "Credit's list (UC Regs 2013 reg. 5(5)) does not include it. By " - "default it is the person's own reported Income Support " - "(income_support_reported) while Income Support is in payment and no " - "reform removes it (neutralizes income_support), as is_on_income_support " - "reads another member's own claim; set it directly otherwise. It does " - "not read the benefit unit's calculated " - "award, which belongs to the claimant and depends on who the family's " - "young persons are." + "Whether this person receives Income Support on a claim of their own, " + "as the Child Benefit qualifying young person test reads it (Child " + "Benefit (General) Regulations 2006 reg. 8(2)(a)); through that test " + "it also ends the Housing Benefit and legacy young person. It is the " + "person's own reported Income Support (income_support_reported) " + "while Income Support is in payment and no reform neutralises " + "income_support; set it directly otherwise. For a member who is not " + "the claimant or partner, is_on_income_support reads the same report. " + "For a claimant or partner, is_on_income_support reads the award the " + "model calculates for their benefit unit, but that award depends on " + "who the family's Child Benefit young persons are, so this variable " + "cannot read it without a cycle. A reform that removes Income Support " + "must neutralise income_support, or set reported awards to zero, for " + "the Child Benefit status to follow; replacing its formula with zero " + "leaves this variable true. Pension Credit (SPC Regs 2002 reg. 4A(5)) " + "and Child Tax Credit (CTC Regs 2002 reg. 5(4)(c)) read " + "is_on_income_support instead, so they follow such a reform for a " + "claimant or partner. Universal Credit's list (UC Regs 2013 reg. " + "5(5)) does not include Income Support." ) definition_period = YEAR - reference = ( - "https://www.legislation.gov.uk/uksi/2002/1792/regulation/4A", - "https://www.legislation.gov.uk/uksi/2006/223/regulation/8", - "https://www.legislation.gov.uk/uksi/2002/2007/regulation/5", - ) + reference = "https://www.legislation.gov.uk/uksi/2006/223/regulation/8" def formula(person, period, parameters): active = parameters(period).gov.dwp.income_support.active From 6db2b6d47320cc380dc69bb3946e738304674e25 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 04:08:34 +0000 Subject: [PATCH 4/8] Format the Income Support properties Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6FJSEjTyXcaymMgSqM --- ...test_qualifying_young_person_income_support_properties.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py index 21f07c2473..517afa354e 100644 --- a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py +++ b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py @@ -168,10 +168,7 @@ def as_members(rows, **inputs): # Each young person sits in the benefit unit of a 70-year-old claimant, # so they are not the claimant or partner. claimant = member(70, is_claimant_or_partner=True, **{SIXTEEN: False}) - return [ - [[claimant, member(**{SIXTEEN: False, **row, **inputs})]] - for row in rows - ] + return [[[claimant, member(**{SIXTEEN: False, **row, **inputs})]] for row in rows] def test_income_support_ends_three_statuses_and_not_universal_credit(): From c21e35b266503874201caa5c0db3b26a2a19a1a5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 19:44:59 +0000 Subject: [PATCH 5/8] Pin the cost-of-living payment in Income Support Case 8 The cost-of-living payment parameters start in 2022, and parameter processing extends their first values back to 2015, so the 2019 case took 1,100 that DWP never paid. Case 8 now sets the payment to zero: household net income 5,000 + 3,052.40 + 3,697 + 3,010.80 + 200 - 154.50 = 14,805.70. The header also says that is_on_income_support gives the benefit unit's calculated award to whichever of the claimant and partner receives it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QmsZJYMi6pBmPsiyFLGCQK --- ...ualifying_young_person_income_support.yaml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml index 43b55a36b7..605023af0d 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/qualifying_young_person_income_support.yaml @@ -5,11 +5,11 @@ # names Universal Credit, Employment and Support Allowance and Jobseeker's # Allowance only. # -# Pension Credit and Child Tax Credit read is_on_income_support: the award the -# model calculates for a claimant or partner, and the person's own report for -# any other member. Child Benefit reads receives_income_support_in_own_right, -# the person's own report, because the family's Income Support reads the -# Child Benefit test. +# Pension Credit and Child Tax Credit read is_on_income_support: the benefit +# unit's calculated award, for whichever of the claimant and partner receives +# it, and the person's own report for any other member. Child Benefit reads +# receives_income_support_in_own_right, the person's own report, because the +# family's Income Support reads the Child Benefit test. # # Income Support stopped paying on 31 March 2026 # (gov/dwp/income_support/active.yaml), so reported receipt counts to 2025-26. @@ -184,10 +184,7 @@ # Case 8, 2019-20 amounts: standard minimum guarantee £167.25 a week; severe # disability addition £65.85 a week; PIP daily living standard rate £58.70 a # week; Income Support personal allowance for a single person aged 18 to 24 -# £57.90 a week; winter fuel payment £200; colour TV licence £154.50. The -# cost-of-living payment parameters start on 1 January 2022 (means-tested -# £650, pensioner £300, disability £150), and the model applies those first -# values to earlier years, so the household receives £1,100. +# £57.90 a week; winter fuel payment £200; colour TV licence £154.50. - name: Case 8, a student-carer on Income Support of their own is not the pensioner's qualifying young person, so the pensioner gets no severe disability addition. period: 2019 @@ -217,6 +214,8 @@ households: household: members: [pensioner, student] + # DWP first paid cost-of-living payments in 2022. + cost_of_living_support_payment: 0 output: # The student claims Income Support for their own benefit unit: no # income, so the award is the personal allowance, 57.90 x 52 = 3,010.80. @@ -229,6 +228,6 @@ # 167.25 x 52 = 8,697, less the State Pension 5,000. pension_credit: [3_697, 0] # State Pension 5,000 + PIP 58.70 x 52 = 3,052.40 + Pension Credit 3,697 - # + Income Support 3,010.80 + cost-of-living payments 1,100 + winter fuel - # payment 200, less TV licence 154.50: 15,905.70. - household_net_income: 15_905.70 + # + Income Support 3,010.80 + winter fuel payment 200, less TV licence + # 154.50: 14,805.70. The cost-of-living payment is set to zero. + household_net_income: 14_805.70 From 05095a161297d533a14da0e2b393008d5c089521 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 19:44:59 +0000 Subject: [PATCH 6/8] Subtract the cost-of-living payment in the reproducer, and test neutralisation on the grid test_a_reform_paying_no_income_support_restores_the_severe_disability_addition now asserts household net income less the cost-of-living payment, 15,219.10 under both reforms, so it holds whether or not the 2022 payment amounts reach 2019. test_income_support_ends_three_statuses_and_not_universal_credit also checks that under a reform that neutralises income_support every programme's status, for a member who is not the claimant or partner, is the status without the report. The docstring names the active parameter among the ways a reform removes a report, and says how is_on_income_support treats a claimant or partner. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QmsZJYMi6pBmPsiyFLGCQK --- ..._young_person_income_support_properties.py | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py index 517afa354e..f4b3255333 100644 --- a/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py +++ b/policyengine_uk/tests/test_qualifying_young_person_income_support_properties.py @@ -7,9 +7,10 @@ reg. 5(4)(c)). Universal Credit's list (UC Regs 2013 reg. 5(5)) does not include Income Support. -Pension Credit and Child Tax Credit read is_on_income_support: the award the -model calculates for a claimant or partner, and the person's own report for -any other member while Income Support is in payment and not neutralised. +Pension Credit and Child Tax Credit read is_on_income_support: the benefit +unit's calculated award, for whichever of the claimant and partner receives +it, and the person's own report for any other member while Income Support is +in payment and not neutralised. Child Benefit reads receives_income_support_in_own_right, the person's own report on the same terms, because the family's Income Support reads the Child Benefit test and the calculated award would make a cycle. @@ -31,9 +32,9 @@ Under a reform that replaces income_support's formula with one returning zero, no Pension Credit or Child Tax Credit status of a claimant or partner depends on it; another member's report and the Child Benefit - reader still exclude, as their documentation says, because only - neutralising Income Support, or setting the report to zero, removes a - report. + reader still exclude, as their documentation says, because only setting + gov.dwp.income_support.active to false, neutralising Income Support, or + setting the report to zero, removes a report. 4. Universal Credit status never depends on reported Income Support, in the baseline or under either reform. 5. Setting a young person's reported Income Support to zero never lowers @@ -174,6 +175,15 @@ def as_members(rows, **inputs): def test_income_support_ends_three_statuses_and_not_universal_credit(): untouched = simulate(as_members(GRID)) reporting = simulate(as_members(GRID, income_support_reported=3_000)) + neutralised = simulate( + as_members(GRID, income_support_reported=3_000), reform="neutralised" + ) + for programme in EXCLUDING + ("universal_credit",): + np.testing.assert_array_equal( + status(neutralised, programme)[1::2], + status(untouched, programme)[1::2], + err_msg=programme, + ) for programme in EXCLUDING: before = status(untouched, programme)[1::2] # Not vacuous: there is a status to lose. @@ -342,9 +352,8 @@ def test_a_reform_paying_no_income_support_restores_the_severe_disability_additi # young person, disregarded under Schedule I para. 2(2)(f), so the # pensioner gets the severe disability addition 65.85 x 52 = 3,424.20 as # well: 7,121.20. Household net income: State Pension 5,000 + PIP 58.70 x - # 52 = 3,052.40 + Pension Credit 7,121.20 + the cost-of-living payments - # the model applies before 2022 (650 + 300 + 150) + winter fuel payment - # 200, less TV licence 154.50: 16,319.10. + # 52 = 3,052.40 + Pension Credit 7,121.20 + winter fuel payment 200, less + # TV licence 154.50: 15,219.10, before the cost-of-living payments. year = 2019 for reform in ("zero formula", "neutralised"): sim = simulate(pensioner_and_student_carer(), year, reform) @@ -358,10 +367,13 @@ def test_a_reform_paying_no_income_support_restores_the_severe_disability_additi sim.calculate("pension_credit", year), [7_121.20, 0], atol=0.01 ) np.testing.assert_allclose( - sim.calculate("household_net_income", year), [16_319.10], atol=0.01 + sim.calculate("household_net_income", year) + - sim.calculate("cost_of_living_support_payment", year), + [15_219.10], + atol=0.01, ) - # Child Benefit reads the report: only neutralising Income Support ends - # its exclusion. + # Child Benefit reads the report: of these two reforms, only neutralising + # Income Support ends its exclusion. zero = simulate(pensioner_and_student_carer(), year, "zero formula") assert zero.calculate(INCOME_SUPPORT, year)[1] assert not status(zero, "child_benefit", year)[1] From 812131cdb8314010828d62db8347c2985b1bada0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 19:45:00 +0000 Subject: [PATCH 7/8] Describe what this branch adds in its changelog fragment The Child Benefit gate now comes from #2299, the CTC bar from #2301 and the Pension Credit reader from #2279, so the fragment describes the tests this branch adds across the three programmes and Universal Credit. A reform that pays no Income Support ends the Pension Credit and CTC exclusion for a claimant or partner only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QmsZJYMi6pBmPsiyFLGCQK --- changelog.d/qyp-income-support-exclusion.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/qyp-income-support-exclusion.fixed.md b/changelog.d/qyp-income-support-exclusion.fixed.md index cbc3f67373..5ceecdaf61 100644 --- a/changelog.d/qyp-income-support-exclusion.fixed.md +++ b/changelog.d/qyp-income-support-exclusion.fixed.md @@ -1 +1 @@ -Stopped counting a young person who receives Income Support in their own right as a qualifying young person for Pension Credit, Child Benefit (and so Housing Benefit and the legacy benefits) and Child Tax Credit (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c)). Pension Credit and Child Tax Credit read the Income Support the model calculates for a claimant or partner, so a reform that pays no Income Support ends their exclusion; Child Benefit reads the young person's own report while Income Support is in payment. +Tested that Pension Credit, Child Benefit and Child Tax Credit each stop counting a young person who receives Income Support in their own right as a qualifying young person, and Universal Credit does not (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c); UC Regs 2013 reg. 5(5)), in the baseline and under reforms that remove Income Support. Pension Credit and Child Tax Credit read the Income Support the model calculates for a claimant or partner, so a reform that pays no Income Support ends the exclusion for a claimant or partner; Child Benefit reads the young person's own report while Income Support is in payment. From 62f5fcad240837189aa74505415e724217075059 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 06:18:33 +0000 Subject: [PATCH 8/8] Say whose calculated Income Support the #2302 changelog fragment means is_on_income_support gives the benefit unit's calculated award only to whichever of the claimant and partner receives it, so the fragment says so. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6HKeDniUizUaZcFw4Q --- changelog.d/qyp-income-support-exclusion.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/qyp-income-support-exclusion.fixed.md b/changelog.d/qyp-income-support-exclusion.fixed.md index 5ceecdaf61..8dec0770f0 100644 --- a/changelog.d/qyp-income-support-exclusion.fixed.md +++ b/changelog.d/qyp-income-support-exclusion.fixed.md @@ -1 +1 @@ -Tested that Pension Credit, Child Benefit and Child Tax Credit each stop counting a young person who receives Income Support in their own right as a qualifying young person, and Universal Credit does not (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c); UC Regs 2013 reg. 5(5)), in the baseline and under reforms that remove Income Support. Pension Credit and Child Tax Credit read the Income Support the model calculates for a claimant or partner, so a reform that pays no Income Support ends the exclusion for a claimant or partner; Child Benefit reads the young person's own report while Income Support is in payment. +Tested that Pension Credit, Child Benefit and Child Tax Credit each stop counting a young person who receives Income Support in their own right as a qualifying young person, and Universal Credit does not (SPC Regs 2002 reg. 4A(5); Child Benefit (General) Regulations 2006 reg. 8(2)(a); CTC Regs 2002 reg. 5(4)(c); UC Regs 2013 reg. 5(5)), in the baseline and under reforms that remove Income Support. Pension Credit and Child Tax Credit read the benefit unit's calculated Income Support for whichever of the claimant and partner receives it, so a reform that pays no Income Support ends the exclusion for that person; Child Benefit reads the young person's own report while Income Support is in payment.