Repository navigation
Model the two-child limit exceptions for Universal Credit and Child Tax Credit - #2631
vahid-ahmadi wants to merge 6 commits into
Conversation
Add a person-level input for each exception in UC Regulations 2013 Schedule 12 paragraphs 2 to 6 and CTC Regulations 2002 regs 10 to 14, defaulting to false. UC leaves adopted children and children in non-parental care out of the order of children (reg 24B(2A)) and pays the element for a third or later child with any other exception. CTC includes the individual element for a third or later child with an exception or when all, or all but one, of the other children are adopted or in non-parental care (reg 9(1)(a)). Fixes #2613 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reg 9(1)(a) applies to a third or later child; reg 9(1)(b) covers the first and second. Amounts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Standard reform costings (change in gov_balance)
Standard reforms: change in each reform's target
Household net income by decileNo household's net income changes in any year. No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles. Checks failing on both base and head (1)
Counted-once checkEach of 86 components was raised by £1 per unit in 2026-27, and every head of its totals was read household by household: its own head must rise by exactly £1, no other tax head may move, no other benefit may rise, and the model's own total must move by what its heads moved. A head that breaks a rule is measured again twice: with every other head held at its baseline value, and with every other head held at its value after the first £1 while the component rises again. It fails where either still shows the response. 0 failed; 0 were skipped.
Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
juaristi22
left a comment
There was a problem hiding this comment.
Reviewed at 050e7d0ac39b67f472702a737989d76b2322ec07. Two P2 findings are attached inline: the expanded adoption/kinship rules apply before their November 2018 commencement, and same-date exception ordering changes final awards when input rows are swapped.
All 17 focused tests passed, but a separate actual-model diagnostic reproduces both omitted paths in final UC and CTC awards. Independent source review checked 17 primary statutory originals, including the historical amendments. The same-date finding concerns supported current-law flags and correctly known birth dates; it is separate from the documented responsibility-date and continuation-history limitations.
| "https://www.legislation.gov.uk/uksi/2013/376/regulation/24B/2025-04-06", | ||
| ) | ||
|
|
||
| def formula(person, period, parameters): |
There was a problem hiding this comment.
[P2] Start the expanded adoption/kinship rules at their commencement
This undated formula applies the expanded disregard before its 28 November 2018 commencement (SI 2018/1129, regulations 1 and 3). In 2017, two adopted children born in 2011/2013 still occupied the first two positions, so a biological third child born May 2017 had no child element. The new flags instead add £2,780.04 to final UC; the parallel undated CTC expansion adds £2,780. Gate both expanded routes by commencement under the model date convention, retaining earlier rules, and test a pre/post pair.
There was a problem hiding this comment.
@juaristi22 agreed, and it was our omission: we read the law only as at 6 April 2025. Fixed in 823f5d6 (code in c0d98df).
- SI 2018/1129 regs 1(2), 3(3) and 3(4) inserted UC reg 24A(1)(za) and reg 24B(2A) from 28 November 2018. Before then reg 24A(1)(b)(ii) covered every Schedule 12 exception, so an adopted or kinship child kept their place and got the element only as a third or later child.
- SI 2018/1130 regs 1 and 3(a) inserted CTC reg 9(1)(a)(ii), the "all, or all but one, adopted or cared for" route, from the same date.
- Two dated parameters now gate them:
gov.dwp.universal_credit.elements.child.limit.adoption_and_kinship_outside_orderandgov.dwp.tax_credits.child_tax_credit.limit.other_children_adopted_or_cared_for_exception, false until 2018-11-28. The model reads fiscal-year values at 30 April, so 2018-19 keeps the earlier rules and 2019-20 is the first year with the new ones. Before commencement, UC treats adoption and kinship as ordinary third-child exceptions inuc_child_limit_exception. - Your case is now a pre/post pair in both YAML files (two adopted children born 2011 and 2013, a birth child born May 2017). In 2017-18 the birth child gets nothing (UC £0, CTC £5,560 in total). In 2019-20 it gets £2,780.04 in UC and £2,780 in CTC. Both 2017 cases fail at 050e7d0.
- The body's "Not modelled" now lists the other rules replaced that day: UC reg 24B(1)(b) and (2)(b), and CTC reg 9(1)(b) with 9(2), 9(4), 9(6)(b) and 9(8).
🤖 Generated with Claude Code
| # available for as many as possible, so a child with the multiple | ||
| # births exception comes after a sibling born that day without it. | ||
| multiple_birth = person("child_limit_multiple_birth_exception", period) | ||
| order_key = birth_day(person, period) + 0.5 * multiple_birth |
There was a problem hiding this comment.
[P2] Optimise all same-date exception ties, not only multiple births
The tie key handles only multiple births, but UC regulation 24B(2) and CTC regulation 9(6) require the ordering that includes the greatest number of children. In a blended family with an eldest child and two younger same-date children from different pregnancies, one with the pre-assessed non-consensual-conception exception, swapping the younger input rows changes final 2025 UC from £14,564.64 to £18,078.36 and final 2024 CTC from £6,910 to £10,365. Both multiple-birth flags are false; neither UC award is capped. Apply exception-aware tie optimisation to both ordering variables and add this permutation regression.
There was a problem hiding this comment.
@juaristi22 agreed, the tie key wrongly assumed only multiple births could share a date. Fixed in c0d98df.
uc_child_limit_positionnow puts any child withuc_child_limit_exception(paras 2, 5 and 6, and paras 3 and 4 before November 2018) after the children born that day without one. A child with an exception gets the element in any place, so this gives the element to as many as possible, as reg 24B(2) requires.ctc_child_limit_positiondoes the same with a new variable,is_CTC_child_limit_own_exception(regs 10 to 14), for reg 9(6). It reads the input flags only, so the position does not depend on itself.- Your permutation is now a regression in both files: an eldest child and two same-day children from different pregnancies, one with the non-consensual conception exception, listed in both orders. UC child element is £10,541.16 (3 x £3,513.72) and CTC £10,365 either way. The "listed first" cases fail at 050e7d0.
One more change in 823f5d6: #2599 gates CTC_child_element on is_CTC_eligible, which cut every CTC case here to £0 on a merge with it. Each CTC case now has a continuing tax credit claim (child_tax_credit_reported: 1_000, would_claim_uc: false), as in your #2599 fixtures. On a local merge of this head with main and #2599 (b454cea), 1,548 YAML cases under finance/benefit, two_child_limit and social_security_scotland pass, as do 187 pytest cases in the 13 related property, registry and unit test files (1 skipped).
🤖 Generated with Claude Code
…imise all same-day ties UC reg 24A(1)(za) and 24B(2A) and CTC reg 9(1)(a)(ii) came into force on 28 November 2018 (SI 2018/1129, SI 2018/1130). Before then adopted children and those in non-parental care kept their place in the order. Same-day ties now put any child with an exception after those without, as UC reg 24B(2) and CTC reg 9(6) require. CTC tests claim tax credits, not UC, so they hold once CTC_child_element is gated on eligibility (#2599). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Decision on the open question: we will not model the pre-28 November 2018 ordering rules. They only affect historical years and no dataset sets these exception flags. Left as listed under "Not modelled". 🤖 Generated with Claude Code |
Summary
The Universal Credit child element limit and the Child Tax Credit limit were modelled with only the protection for children born before 6 April 2017. This PR adds the statutory exceptions, as person-level inputs that default to false, so the household calculator and reforms that reinstate a limit can apply them:
child_limit_multiple_birth_exceptionchild_limit_adoption_exceptionchild_limit_non_parental_caring_exceptionchild_limit_non_consensual_conception_exceptionchild_limit_continuation_exceptionEach flag means the exception applies to that child. For multiple births, set it on every child of the pregnancy except the first, as para 2(d) and reg 10(d) require.
Universal Credit (reg 24A(1) and 24B, as at 6 April 2025):
uc_child_limit_disregarded: adoption and non-parental caring children (reg 24A(1)(za)). They get the element whatever their place and are left out of the order of children (reg 24B(2A)), so they no longer use up one of the two places. This applies from 28 November 2018 (SI 2018/1129 regs 1(2), 3(3) and 3(4)), through the new parametergov.dwp.universal_credit.elements.child.limit.adoption_and_kinship_outside_order. Fiscal-year values are read at 30 April, so 2018-19 keeps the earlier rules.uc_child_limit_exception: multiple births, non-consensual conception and continuation (reg 24A(1)(b)(ii)). A third or later child gets the element and keeps their place. Before 28 November 2018 reg 24A(1)(b)(ii) covered every Schedule 12 exception, so adoption and non-parental caring are treated the same way then.uc_child_limit_position: the reg 24B order without the disregarded children. Children born on the same day are ordered so the element reaches as many as possible (reg 24B(2)), so any child with an exception comes after a child born that day without one, whatever the exception and the input order.uc_individual_child_elementuses these.uc_child_index, and so the higher first child amount, is unchanged.Child Tax Credit (regs 7(2A) and 9, as at 6 April 2025):
ctc_child_limit_position: the reg 9(5) order, by date of birth, with the same tie rule (reg 9(6)), keyed onis_CTC_child_limit_own_exception(regs 10 to 14).is_CTC_child_limit_exception: regs 10 to 14, or all, or all but one, of the other children adopted or in non-parental care (reg 9(1)(a)(ii)). The second route applies from 28 November 2018 (SI 2018/1130 regs 1 and 3(a)), through the new parametergov.dwp.tax_credits.child_tax_credit.limit.other_children_adopted_or_cared_for_exception.is_CTC_child_element_included: exempt (born before 6 April 2017, or the existing age-exemption reform), within the limit in the order, or an exception.CTC_child_elementandctc_child_limit_affectednow count this per child. The old count assumed exempt children were the eldest, which an exception child need not be.The limit is removed for UC from 6 April 2026 and tax credits closed in 2025, both already on main, so this changes 2025-26 and earlier and any reform that reinstates a limit. With every flag false, results are unchanged.
Fixes #2613
Evidence
Law checked against legislation.gov.uk as in force on 6 April 2025: UC reg 24A, reg 24B, Schedule 12, and CTC Regs 2002 regs 7, 9, 10, 11, 12, 13 and 14. For commencement, the same provisions as in force on 27 November 2018 and 28 November 2018, with SI 2018/1129 and SI 2018/1130. The key difference between the two schemes: UC puts adoption and non-parental caring children outside the order (24A(1)(za) with 24B(2A)), while CTC keeps every child in the order and instead gives a third child an exception when all, or all but one, of the others are adopted or cared for (9(1)(a)(ii)).
Not modelled
Tests
policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/child_element/uc_child_limit_exceptions.yaml, 12 cases. Eight in 2025-26 at £292.81 a month (£3,513.72 a year) for children born after 6 April 2017: no exception; each of paras 2 to 6; an exception on the second child changing nothing; and 2026-27, where the flags make no difference. The adoption case shows the disregard: an adopted eldest child plus three birth children gives 3 x £3,513.72 = £10,541.16. Then a commencement pair (two adopted children born 2011 and 2013, a birth child born May 2017): in 2017-18 the birth child is third and gets nothing; in 2019-20 the adopted children are left out of the order and it gets £2,780.04. And a same-day pair from different pregnancies, one with the non-consensual conception exception, listed in both orders: 3 x £3,513.72 = £10,541.16 either way.policyengine_uk/tests/policy/baseline/finance/benefit/family/ctc_child_limit_exceptions.yaml, 12 cases at £3,455 a child in 2024-25: no exception (2 x £3,455 = £6,910); each of regs 10 to 14; twins at second and third with a younger fourth child (3 x £3,455 = £10,365; adding exception children to the old exempt count would have given £6,910); two adopted then two birth children (4 x £3,455 = £13,820 under reg 9(1)(a)(ii)); three birth children then an adopted child (£10,365); the same commencement pair (2017-18: £5,560; 2019-20: £8,340 at £2,780 a child); and the same-day pair in both orders (£10,365 either way). Every case has a continuing tax credit claim (child_tax_credit_reportedabove zero andwould_claim_uc: false), so the cases hold once Gate the Child Tax Credit child element on eligibility #2599 gatesCTC_child_elementonis_CTC_eligible.family/tax_credits,family/tax_credits.yamlandreforms/parametric/two_child_limitpass (61 cases).ruff checkandruff format --checkpass on the changed Python.This touches
CTC_child_element.py, which #2599 also changes (it adds theis_CTC_eligiblegate). Git merges the two without a conflict, and with #2599's gate the CTC tests need an eligible claim, which they now have.Open questions
Reproducer: policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/child_element/uc_child_limit_exceptions.yaml::Adoption (Sch 12 para 3) - the adopted child is left out of the order, so two birth children fill the limit
Reproducer: policyengine_uk/tests/policy/baseline/finance/benefit/family/ctc_child_limit_exceptions.yaml::Multiple births (reg 10) - twins second and third in the order and a younger child get three elements
axiom: TheAxiomFoundation/rulespec-uk#490 queued
🤖 Generated with Claude Code