Repository navigation
Apply minimum ages to computed carer and DLA mobility awards - #2474
Conversation
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Fine once the clash with #2473 is settled.
@juaristi22, the ages and formulas match the statute. One process point and some nits.
- should:
policyengine_uk/variables/gov/social_security_scotland/carer_support_payment_pre_overlap.py:33-40conflicts textually with #2473, which adds the CSP earnings condition to the sameeligibleexpression. I merged the two heads locally and git reports a content conflict there. You already flag this in the PR body. Whichever lands second needs a rebase that keeps both conditions, ideally with one combined YAML case covering age and earnings together. - nit:
policyengine_uk/parameters/gov/dwp/dla/mobility/higher_min_age.yaml:3dates the age 3 rule from 9 April 2001 but cites only SSCBA s.73. Adding the Welfare Reform and Pensions Act 1999 amendment and its commencement as a reference would support the date. - nit:
policyengine_uk/parameters/gov/dwp/carers_allowance/min_age.yaml:5uses 2015-01-01 as a model-coverage anchor. That is explained in the comment, but an earlier date would read less like a commencement date. Not a blocker. - nit: s.70(3) also excludes people in full-time education, and #1793 mentions
dla_sc. Both are outside this PR, which the body and assumptions page say. Worth a follow-up issue for the education rule soFixes #1793does not leave it untracked.
On the law:
- SSCBA 1992 s.70(3): no Carer's Allowance under 16. Checked on legislation.gov.uk.
- SSI 2023/302 reg. 4(1): CSP only for someone 16 or older. Checked on legislation.gov.uk.
- SSCBA 1992 s.73(1) and (1A): the "relevant age" is 3 for the higher-rate conditions and 5 for the lower-rate condition (para. (d)). Checked on legislation.gov.uk.
selectfalls through to 0 for a HIGHER or LOWER category below the age, so the child gets no mobility component, which is right. - DLA care is untouched, which matches the statute having no categorical floor there.
Hand checks (2026): higher mobility £80.00 × 52 = £4,160; lower mobility £30.30 × 52 = £1,575.60; higher care £114.60 × 52 = £5,959.20. These match the expectations in carer_and_dla_minimum_ages.yaml.
What I checked
- Read the PR body, issue #1793 and the full diff. Fetched SSCBA s.70 and s.73 and SSI 2023/302 reg. 4.
policyengine-core testoncarer_and_dla_minimum_ages.yaml: 14 passed. With the three formulas reverted to main: 9 failed, 5 passed, as the PR says.pytest policyengine_uk/tests/test_carer_and_dla_minimum_ages.py: 19 passed.- Social Security Scotland YAML tests, the Carer's Allowance YAML files and every YAML test using
dla_mordla_m_category: 139 passed. ruff checkandruff format --checkon the changed Python files: clean.- Hosted CI is green on the current head. Changelog fragment is
fixed; Reproducer and axiom lines are present. - Merged with #2473 locally: content conflict. No overlap with the other open PRs I checked.
- Not checked: the docs page build, and any population-level effect.
🤖 Generated with Claude Code
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 13 (thresholds in Notes
Moves flagged for review
Receipts by tax head
Spending by benefit and service
Caseloads
Government balance, each component counted once
Model totals
Household income totals
Poverty rates
People in poverty
Inequality
Mean household net income in each side's own deciles
Standard reform costings (change in gov_balance)
Standard reforms: change in each reform's target
Household net income by decileMean change in household net income per household, and as a share of the decile's base income; households stay in the base run's deciles.
No change in any year: components the model counts twice; population. Checks failing on both base and head (1)
Counted-once checkEach of 84 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
Components the model counts twice: 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
|
|
The published child retains both the minimum-age and earnings/penny gates on repaired #2473, with seven combined natural-input regression cases. It remains stacked on |
|
Merged by the UK hub (session local_8e19f9d5, Opus 5.5) on Max's explicit instruction to merge the team's ready PRs before the Budget (21 October, about 23:00Z: "go ahead and merge them. none of us has time to wait on each other"). One merge-queue enqueue, pinned to head
🤖 Generated with Claude Code |
Fixes #1793.
Computed Carer's Allowance and Carer Support Payment now require the person's annual age to be at least 16, including routes triggered by reported receipt. DLA mobility applies age 3 to HIGHER and age 5 to LOWER categories. The DLA care component, rates, overlap, claim preferences and generic explicit amount overrides retain their behavior.
The new independently reformable age parameters use CA section 70(3) and its NI counterpart, CSP regulation 4(1), and DLA section 73 in GB and NI. CA's 2015-01-01 parameter date is the existing model-coverage anchor, not legal commencement. CSP uses 19 November 2023 and DLA mobility 9 April 2001. These changes preserve the modeled Scottish 2024 CA/2025 CSP switch and do not extend historical rate coverage.
Age remains a Person/YEAR FLOAT stock compared directly, without rounding or a new birthday/part-year calculation. Positive cash cases assume the remaining qualifying-care/disability/duration conditions; report-only positives retain an input proxy. Direct final/pre-overlap amounts remain overrides, not statutory entitlement proof. There is no new DLA-care floor, PIP/CDP/upper-age, education or caree-status rule. The assumptions page records these limits, including CSP's unimplemented exact leap-day treatment.
Historical validation at 312b572: the 14 natural actual-rate YAML cases produced 9 genuine cash failures and 5 passing controls on untouched production. One bounded combined run passed 109 unique cases:33 new (14 YAML/19 Python) and 76 unchanged direct regressions, with 0 failures/errors/skips;54.747 s pytest/62.2458 s CLI. Cases cover both carer routes, age/fractional boundaries, DLA totals/care preservation, programme-specific age reforms, direct overrides, default age and personal/multiple-family/order isolation. Native HTML build passed in10.7355 s; existing config/Node warnings and public-template bootstrap are retained.
That historical validation used Python 3.13.14/Core 3.32.27/Hypothesis 6.168.2 versus locked Core 3.33.2/Hypothesis 6.169.0, without environment sync/install or private population data. Hosted full CI and human review remain required. No population effect or independently encoded parity was established; the historical Axiom 146 disposition does not certify this head.
Coordination: reviewed child commit 315e374 stacks on repaired #2473 commit d7f1a43, which integrates captured main42c01db9 after #2444. The shared CSP formula retains BOTH age and earnings conditions. Seven natural-input combined cases cover underage/age16, reported-receipt proxy, exact/fractional/first-excluded penny and personal mixed-vector behavior; two failed on unchanged production and all seven now pass. The original annual/award-week/PAYE and unmodelled-condition qualifications remain. The proposed publication base is the existing #2473 branch
fix-2345-csp-earnings-limit; the child branch remainsfix-1793-benefit-minimum-ages. Only after #2473 actually merges should this child retarget main and rerun combined cash checks against that integration before merging. Passing local tests or queue admission does not establish parent landing.Reproducer: policyengine_uk/tests/policy/integration/carer_and_dla_minimum_ages.yaml::Reported Carers Allowance cannot pay a fifteen year old
Current private runtime: Python3.13.14, UK2.141.1, Core3.33.2 and Hypothesis6.169.0, offline/no-sync with actual-worktree imports and external caches. Current combined validation passed 40 Python checks and 178 successful raw YAML checks (218 raw checks) across the frozen 12-file policy manifest, with no failures/errors/skips. Both affected assumptions pages built with cached MyST; existing builder warnings are retained. Historical counts above are not transferred to this combined head. Independent captured-head reviews are complete for these exact commits; fresh publication guards, new-head hosted CI and separate publication authority remain required.
Captured current-main check: separate local test projections of the reviewed heads with main c281c2e passed 17 CSP earnings/NI/pension-age YAML checks for #2473 and 21 age/earnings/DLA YAML checks for #2474. These projections used UK2.141.2/Core3.33.2. The checks overlap earlier validation; the counts are not added across heads or batches. They do not replace new-head hosted CI or establish that either PR has landed.
Pension reform scope remains open. Captured main c281c2e reads
gov.dwp.carers_allowance.pension_contribution_deduction_rate, whose default is 0.5, through the shared CA earnings reader. Changing only that CA-labelled share from 0.5 to 0 changed a Scottish carer's earnings from £10,500 to £11,000 and CSP from £4,495.40 to £0 in the 2026 natural-input check (£11,000 pay, £1,000 employee pension contributions, age 45 and 40 weekly care hours). CSP schedule 2 paragraphs 9 and 12 separately specify half the individual's pension contributions. The shared reader has no independent CSP pension-share reform control. The default checks passed; no default-law defect, independent CA-only reform behavior or encoded parity is claimed. A proposed shared pre-floor calculation with programme-specific pension shares and locality tests remains an unimplemented follow-up.axiom: needed