Repository navigation
Fix UC higher disabled-child eligibility - #2468
Conversation
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Looks right, fine to approve. Two small follow-ups below, neither blocking.
@juaristi22, the legal change is correct. UC Regs 2013 reg 24(2)(b) gives the higher rate for highest-rate DLA care (and the Scottish equivalents), enhanced ADP or PIP daily living, or blindness. It has no AA or AFIP limb, and reg 2 defines "blind" as certified by a consultant ophthalmologist, which matches is_blind. Splitting the UC condition from the tax-credit flag and stopping the lower addition from stacking with the higher one is right.
-
should: the £10 a week tolerance now lives in two places. The new parameter
parameters/gov/dwp/universal_credit/elements/child/severely_disabled/benefit_amount_tolerance.yamlfeeds the UC condition, butis_severely_disabled_for_benefits.py:46still hardcodesTHRESHOLD_SAFETY_GAP = 10 * WEEKS_IN_YEAR. The two can now drift apart. The parameter also sits in the statutorygov/dwptree with a self-referencing citation and an arbitrary 2015-01-01 start, so it reads like a DWP rate. I'd suggest one shared modelling parameter outside the statutory tree (for example undergov/simulation) that both formulas read. A follow-up is fine. -
should: the population effect will differ from what the household tests show. In dataset runs, UC used the stored
is_severely_disabled_for_benefitsflag. policyengine-uk-data builds that flag indatasets/disability_benefits.py:221with a strict>=test that also counts any AA or AFCS. UC now ignores the stored flag and testsdla_sc/pip_dlwith the tolerance. The data pipeline also does not setis_blindfrom the FRS, so the blind limb has no effect in Enhanced FRS runs. The real population changes should therefore be the removal of double counting plus small differences in the threshold. That fits the Enhanced FRS run the PR body already says is still to do. It would help to say in that run's write-up that the blind limb will only show once uk-data populatesis_blind. -
nit: the lower addition is still gated by
is_disabled_for_benefits. That variable has no formula and defaults to False, so a household-calculator user has to set it by hand next to the DLA or PIP category, as the new tests do. This is not new and is outside this PR, but it may be worth an issue.
What I checked
- I read reg 24(2) and the reg 2 "blind" definition on legislation.gov.uk (current text, including the SI 2014/2888 and SI 2022/177 amendments). I did not open the NI regs separately.
- I worked out the expectations by hand: higher 514.71 x 12 = 6,176.52; lower 164.79 x 12 = 1,977.48; blind-child UC 12 x (424.90 + 303.94 + 514.71) = 14,922.60; no-award UC 12 x 728.84 = 8,746.08. All match.
policyengine-core testonintegration/uc_disabled_child_addition.yaml, the UCchild_elementfolder andclaimant_child_element.yaml: 32 passed.pytest test_uc_disabled_child_addition_properties.py: 8 passed.- I reverted the two element formulas to main: 4 of the 8 new integration cases fail, so the tests catch the fix.
ruff checkandruff format --checkon the changed Python files: clean.- Process: the
fixedchangelog fragment,Reproducer:andaxiom: neededlines are present, and the Fix evidence check passes. Hosted CI is all green on04c843d1. - No other open PR touches these files. Nothing clashes with #1820 (its benefit cap exemption does not read these variables) or with the other PRs I checked.
- I did not run any Enhanced FRS microsimulation. I did not check the Scottish award routes or hospital-stay rules, which the PR says are out of scope.
🤖 Generated with Claude Code
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Approving, per my review above. The shoulds and nits can follow.
Addresses #1970. The household fix is ready for review; keep the issue open for the requested Enhanced FRS impact run and Axiom follow-up.
UC's higher disabled-child addition currently uses the tax-credit severe-disability flag. A certified-blind child with no DLA/PIP award therefore receives no disability addition, and the independent lower-rate flag can allow both rates together.
This gives UC its own higher-rate condition, includes the existing certified-blind input, and excludes the higher category from the lower addition. Child/qualifying-young-person and nonclaimant selection are retained. The CTC/WTC condition formula is unchanged.
The DLA/PIP routes retain the model's existing reported-amount approximation, including its £10/week tolerance and direct-amount input precedence. The new parameter documents that tolerance as a modeling assumption; it is not a statutory threshold. This does not add Scottish award inputs or hospital-related entitlement modeling.
Sources: GB regulation 24(2), GB blindness definition, NI regulation 25(2), and NI definition. The blind limb exists in the original GB regulations; SI 2014/2888 regulations 1 and 3 establishes the certified-blind wording and its November 2014 assessment-period transition. No new NI commencement or historical-rate claim is made.
Validation: 62 distinct cases accepted (16 new and 46 existing): 61 passed in the combined batch; the single case with an invalid inherited-LCWRA aggregate expectation passed after that assertion was removed. Its higher/lower assertions remain. Original RED: eight relevant failures, six controls, and one separately classified invalid fixture oracle. The shared generic formula AST and 26 protected files are unchanged.
make formatpassed. Runtime: Python 3.13.14, Core 3.32.27 and Hypothesis 6.168.2; locked hosted CI remains required. Independent policy and code reviews are required before publication.Reproducer: policyengine_uk/tests/policy/integration/uc_disabled_child_addition.yaml
Enhanced FRS population impact has not been run; no population result or stored-input coverage is asserted. Independent household policy/code review and local tests do not substitute for that run. Hosted CI and human review remain required.
axiom: needed