You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Count Universal Credit carer-element awards in the severe disability premium and addition carer test #2120
The severe disability premium (legacy benefits, Housing Benefit, Council Tax Reduction) and the Pension Credit severe disability addition are not payable when someone is paid a carer benefit for caring for the claimant or partner. The law counts three awards:
Carer's Allowance,
Carer Support Payment, and
"an award of universal credit which includes the carer element".
is_cared_for_by_carer_benefit_recipient (added in #1977) attributes only the first two. It reads receives_carer_benefit, which covers Carer's Allowance and Carer Support Payment. A carer whose only award is the Universal Credit carer element does not bar the premium or the addition in the model.
Why it was left out
The variable's documentation records the reason: reading Universal Credit there would be circular, because uc_non_dep_deduction_exempt reads pension_credit, and Pension Credit reads the addition.
What a fix needs
A way to read a Universal Credit carer-element award without that cycle (for example a carer-element eligibility variable that does not depend on the housing costs element).
The same attribution order as the other two awards (claimant or partner first, then other members, then other benefit units).
A measured impact from a real microsimulation run.
#1938 (pension-age Housing Benefit and Council Tax Reduction premium) inherits the same omission through severe_disability_premium.
Head tested: 4613ac60ffcddfead4f7a118d99a26a1d61f2c40 on fix-2120-uc-carer-awards (detached checkout; git rev-parse HEAD confirmed). The branch has since moved to 260f6a77e90bc290348bde6f3699b48b7a964b29 (two commits: d10b985d "Add a private renter above the LHA rate to the endpoint comparison" and 260f6a77 "Name the actors in the carer-award comments and documentation"). As briefed, I tested 4613ac60 only; nothing here covers the newer commits.
Set-up: cloud VM, 4 vCPU, 16 GB. uv sync --frozen --extra dev. HUGGING_FACE_TOKEN and POLICYENGINE_UK_DEFAULT_DATASET unset. No test skipped for want of a dataset. No run ran out of memory.
#
Command
Exit
Passed
Failed
Skipped
Xfailed
Wall
1
uv run pytest -q -o xfail_strict=true -n 4 policyengine_uk/tests/test_uc_carer_element_award_properties.py -k "not (the_carer_element_limb_moves_only_its_readers_and_only_one_way or every_reader_calculates_on_one_simulation_in_any_order)"
0
7
0
0
3
78 s
2
same file, -k "the_carer_element_limb_moves_only_its_readers_and_only_one_way or every_reader_calculates_on_one_simulation_in_any_order"
M12, then ... -n 4 test_uc_carer_element_award_properties.py -k "upper_bound_matches_real_award_endpoints or the_bound_reads_every_component_of_the_maximum_amount"
1
0
2
0
0
46 s
6
M13, then ... -n 4 test_uc_carer_element_award_properties.py -k "the_bound_reads_every_component_of_the_maximum_amount"
1
0
1
0
0
23 s
7a
... -n 0 -s policyengine_uk/tests/test_m14_private_cap.py (in tree, from repo root)
2
0
0
0
0
7 s (collection error)
7b
same file copied byte-for-byte to /tmp/m14, run from there: uv run --project <repo> --frozen pytest -q -o xfail_strict=true -p no:cacheprovider -s test_m14_private_cap.py
0
3
0
0
0
51 s
8
M14, then the 7b command
1
2
1
0
0
53 s
Wall times include uv run start-up. Summary lines: (1) 7 passed, 3 xfailed in 60.97s; (2) 2 passed in 83.27s; (3) 6 passed in 155.14s; (4) 7 passed in 276.90s; (5) 2 failed in 39.68s; (6) 1 failed in 15.38s; (7a) 1 error in 0.87s; (7b) 3 passed in 47.92s; (8) 1 failed, 2 passed in 48.63s.
Entry 1 reported 3 xfailed under -o xfail_strict=true, with no XPASS. The three #2795 xfail markers are at lines 595, 622 and 674 of the test file.
Mutants
Each edit was applied by a script asserting text.count(old) == 1 and reverted with git checkout -- <file>. After each revert git status --porcelain printed nothing.
M12 (delete "uc_carer_element", from uc_award_upper_bound.py): killed. Both named tests failed:
AssertionError: assert ['uc_standard...care_element'] == ['uc_standard...care_element']
At index 3 diff: 'uc_childcare_element' != 'uc_carer_element'
Right contains one more item: 'uc_childcare_element'
AssertionError: assert ['uc_standard...care_element'] == ['uc_standard...hild_benefit']
Right contains one more item: 'child_benefit'
M14 ([rent, capped_rent_amount] → [rent, rent] in uc_award_upper_bound.py): survives the branch's own tests at 4613ac60.test_authored_endpoint_parity and test_authored_component_guard, which call the branch's two guards unchanged, both passed. Only the third, added test failed:
I didn't run M14 against 260f6a77. Whether d10b985d kills it is unknown.
Entry 7 deviations
7a, in tree: saved at policyengine_uk/tests/test_m14_private_cap.py and run from the repo root, the file failed at collection with ValueError: option names {'--shard'} already added. I read the file and policyengine_uk/tests/conftest.py: the conftest registers a --shard option, and the file's pytest_plugins = ["policyengine_uk.tests.conftest"] loads that conftest again on top of the one pytest picks up from the directory.
7b and 8, outside the tree: the file's docstring says to run it alone from a directory outside the repo, so I ran a byte-identical copy from /tmp/m14 against the editable install (policyengine_uk.__file__ resolved to the checkout, so the mutant edit applied). Entry 8 used the same set-up.
No -n 4: I used -n 0 for 7a and no xdist for 7b and 8, so the -s print would reach the log. Under xdist, workers don't pass -s output through.
Afterwards I deleted the file and the copy, and git status --porcelain printed nothing.
Verdict: APPROVE WITH NITS at 260f6a77e90bc290348bde6f3699b48b7a964b29 (delta from 4613ac60ffcddfead4f7a118d99a26a1d61f2c40).
Set-up: cloud VM with 4 vCPU. The head is checked out detached in a scratch worktree, with uv sync --frozen --extra dev and HUGGING_FACE_TOKEN and POLICYENGINE_UK_DEFAULT_DATASET unset. I made each mutation in a git archive copy of the head and ran it with PYTHONPATH pointing at that copy. policyengine_uk.__file__ resolved to the copy. I restored each mutated file from git show HEAD:<file>, and diff -r against the head printed nothing afterwards. I made no commits or pushes.
Findings
No P1 or P2 finding.
P3-1: the bound's documentation still says "rent" where the LHA cap now matters
policyengine_uk/variables/gov/dwp/universal_credit/uc_award_upper_bound.py:16–18 (documentation): "Where DWP deducts less than the rent, the award stays at or below the award with no deduction. Where it deducts at least the rent, DWP calculates the award with no housing costs element…". For a private renter, the formula's housing costs are min_(uc_LHA_cap, rent), not the rent (lines 59–68). This round's new parity row is exactly that case: £30,000 rent, £18,600 cap. The PR body's first Changes bullet already says "at least the eligible housing costs". Replacement:
"Where DWP deducts less than the housing costs it allows (the rent, capped at the Local Housing Allowance rate for a private renter), the award stays at or below the award with no deduction. Where it deducts at least those housing costs, DWP calculates the award with no housing costs element…"
$ grep -n "deducts at least" policyengine_uk/variables/gov/dwp/universal_credit/uc_award_upper_bound.py
18: "deduction. Where it deducts at least the rent, DWP calculates the "
P3-2: two passives remain in documentation paragraphs the delta edited
policyengine_uk/variables/household/demographic/severe_disability_premium.py:22–23 and …/additional/severe_disability_minimum_guarantee_addition.py:28–29: "Whom a carer benefit is paid for caring for is attributed by is_cared_for_by_carer_benefit_recipient". Replacement: "is_cared_for_by_carer_benefit_recipient attributes each carer benefit to the person it is paid for caring for". The pension-age premium's documentation already uses that order in this delta.
policyengine_uk/variables/household/demographic/is_cared_for_by_carer_benefit_recipient.py:42: "Carers outside the household are not observed". Replacement: "The model does not observe carers outside the household".
P3-3: reflow orphaned comment lines
Two edited comments leave a one-word line, and one line runs past the file's wrap width:
policyengine_uk/tests/policy/baseline/household/demographic/uc_carer_element_carer_test.yaml:194–195: line 194 has 94 characters ("…DWP includes the carer element for regular and substantial caring"), and line 195 is just # Earnings.
policyengine_uk/tests/policy/baseline/gov/local_authorities/council_tax_reduction/council_tax_reduction_carer_premium.yaml:229: # carer premium. Neither of, followed by full lines.
P3-4: the reg 41(1A) row dropped "alone" from the replacement in the table
PR_BODY.md, small-housing route: "Under reg 41(1A), DWP cannot treat the carer's paid work as a relevant change of circumstances…". The round-3 replacement read "cannot treat paid work alone as a relevant change". Nobody in this brief quotes reg 41, so I can't say which wording matches the text. If reg 41(1A) refers to work alone, as the earlier wording implied, restore it: "DWP cannot treat the carer's paid work alone as a relevant change of circumstances…". Otherwise keep the current text.
Rulings and previous findings
Item
Status
Evidence
R1 / prior P3: private renter above the LHA cap
Closed
PARITY_FAMILIES[6] (test file lines 809–818) adds the lone parent, rent £30,000. The test asserts a row with uc_housing_costs_element == uc_LHA_cap < benunit_rent (lines 931–935). The rows number 126: 7 families × 4 seeds + 2 endpoints × 7 families × 7 boundary rows. The family's rows are therefore seeds 24–27, boundary rows 70–76 at the first endpoint and 119–125 at the second. M14 results are below.
R2 / prior P3: YAML citation
Closed
council_tax_reduction_carer_premium.yaml case "A Scottish carer with both Carer Support Payment and the carer element gets one premium" now cites para 6(1)(a) and (c) and para 5(2). That matches para 5(2) and 6(1) as quoted in the Axiom packet. The expected value is unchanged and passes. The CTR carer premium documentation now cites "paras 5(2) and (3)". Para 5(3) as quoted covers each partner who qualifies, so that citation is consistent.
R3 / prior P3: Axiom layout
Closed
## Completion boundary follows the review_finding block and precedes ## Companion cases, and it holds the parity-pending condition. The blocker is still at line 14 ("Queue this work under pe-parity…"). The provenance SHA reads 260f6a77e… in its own sentence.
R4 / prior P3: voice table
Closed, one caveat
Every row is applied. Two use the author's active rewording: the changelog's "an award that DWP tapers to nil because of the carer's earnings" and the bound's documentation. Both are acceptable. The reg 41 caveat is P3-4. The 🤖 footer, both Fixes lines, Reproducer: and the literal axiom: <rulespec-uk issue> queued line are all present.
R5: runs
Closed for the runs I could repeat
See the next section. Ruling 5 asked for the addition suite test by test; the author left that out and gave a reason. I ran the addition file whole at this head instead (results below).
R6: merges
Closed
See "Checked and sound".
Cloud hand-off: test_m14_private_cap.py
The branch doesn't add it
git ls-tree -r --name-only HEAD | grep -i "m14|private_cap" and git diff --name-only 2da212abc HEAD | grep -ci "m14|private_cap" both find nothing (count 0). No test under policyengine_uk/tests sets pytest_plugins. The household moved into the canonical test as PARITY_FAMILIES[6].
Checked and sound
Production code unchanged. I compared the AST of each production Python file in git diff --name-only 4613ac60f 260f6a77e -- policyengine_uk/variables policyengine_uk/utils, with docstrings and documentation = class assignments stripped. All 9 are identical: severe_disability_minimum_guarantee_addition, has_uc_award_with_carer_element, uc_award_upper_bound, council_tax_reduction_carer_premium, council_tax_reduction_premiums, carer_premium, is_cared_for_by_carer_benefit_recipient, pension_age_severe_disability_premium and severe_disability_premium. The only parameter change is the description of uc_award_includes_zero_value_award; its values are unchanged. The other changed files are the changelog fragment, two YAML test files and the property test file.
New row's figures, worked by hand first and then run. The maximum amount is (£424.90 + £303.94) × 12 + 0.85 × £6,000 + £18,600 = £32,446.08. Above the lower work allowance of £427 × 12 = £5,124, the seeds give:
£32,446.08 at (£0, £0);
£32,446.08 − 0.55 × £876 = £31,964.28 at (£6,000, £0);
£32,446.08 − 0.55 × £12,876 = £25,364.28 at (£18,000, £0);
Under M14 each rises by £30,000 − £18,600 = £11,400. A witness script read the model's endpoint and bound values (it calls endpoint_values and parity_situation from the test module on the four seed rows):
These match the hand figures and the body's figures to the penny.
Mutants. All three ran with pytest -q -o xfail_strict=true -n 2 … -k "upper_bound_matches_real_award_endpoints or the_bound_reads_every_component_of_the_maximum_amount". Before them, the unmutated head gave 2 passed in 33.81s.
M14 ([rent, capped_rent_amount] → [rent, rent] in uc_award_upper_bound.py): killed, 1 failed, 1 passed. The endpoint test fails on exactly the 18 rows the author named: array([ 24, 25, 26, 27, 70, 71, 72, 73, 74, 75, 76, 119, 120, 121, 122, 123, 124, 125]), assert not 18. The component check passes, as expected for a mutant that reads the same variables.
M12 ("uc_carer_element", removed from the bound's element list): killed, 2 failed. The component check fails with "At index 3 diff: 'uc_childcare_element' != 'uc_carer_element'", and the endpoint test with where 28 = array([16…23, 56, 57, 58, 63, 64, 65, 105…118]).size. The count is 28, as the body says. The indices differ from the 4613ac6 run (52–54, 59–61, 94–107) because the new family adds boundary rows, which shifts them.
M13 ("child_benefit", added after "uc_childcare_element", in uc_maximum_amount.py): killed, 2 failed. The component check fails with "Right contains one more item: 'child_benefit'", and the endpoint test with where 52 = array([...]).size. That matches the body's 52 of 126.
CI's outcome check: I ran the whole file with -p pytest_outcome_log and then .github/check_test_shards.py --mode source --data absent against .github/test_outcome_allowlist.toml. It printed "Every collected test ran in exactly one shard and passed, apart from allowlisted outcomes.", exit 0, with 12 outcome records. The small-housing xfail reason text changed in this delta, and the allowlist's reason = "#2795" regex still matches it.
YAML: uc_carer_element_carer_test.yaml 10 passed and council_tax_reduction_carer_premium.yaml 12 passed. The 10-file reader batch listed in the body gave 180 passed, gov/local_authorities/council_tax_reduction/343 passed and finance/benefit/family/housing_benefit/584 passed. Every count matches the body.
test_severe_disability_addition_properties.py and test_severe_disability_premium_properties.py: -n 4, whole files: 7 passed in 249.38s and 6 passed in 136.70s, the hub's counts at 4613ac60f.
Reproducer: I put the head's test file into a git archive of main 2da212abc. There, test_issue_households_read_the_carer_element_award fails with E assert np.float32(4474.6) == 0, as the body says.
Lint:uvx ruff@0.17.2 format --check on the changed Python files ("10 files already formatted"), ruff check ("All checks passed!"), ruff check --select F811,F821 policyengine_uk ("All checks passed!") and git diff --check 4613ac60f 260f6a77e (exit 0).
Merges. I fetched first, then ran git merge-tree --write-tree --name-only 260f6a77e… <sha>:
origin/main now at a8ddb927c560a4e0e96376d51d09361ad9a470dd
clean
origin/main has moved past the hold SHA: #2751, State Pension rounding, has merged. That merge is clean too. These are textual checks; I ran no tests on merged trees.
Writing in the delta. The new YAML and documentation comments name actors: DWP, councils and the Scottish Ministers. The durable comments the delta touched no longer carry fix history. The test docstring dropped "the attribution as it ran before the limb" and the pointer to the PR's differential, and the reproducer comment dropped "also runs on the old code". The remaining voice nits are P3-2 and P3-3.
What I couldn't check
The author's runs at 260f6a77e of test_legacy_carer_premium_properties.py, test_pension_age_severe_disability_premium_properties.py, test_disable_simulated_benefits_carers.py, test_legacy_award_readers_properties.py and test_council_tax_reduction_severe_disability_family.py, and the 150-household differential. I didn't rerun them; they rest on hub logs I can't read. With production code unchanged, they still describe these formulas.
Ruling 5's test-by-test run of the addition suite. I ran the file whole, as above.
Statute that nobody quoted in this brief or the PR: UC Regs 2013 reg 41(1)(b) and (1A) (P3-4), reg 30(1)(a)(i) and (2), and Sch 4 paras 15 and 16(2)(b) and (e). That includes the new "at the middle or highest rate" wording and the docstring's "Sch 4 para 16(2)(b)" for the Pension Credit exemption. The code does read uc_non_dep_receives_pension_credit in uc_non_dep_deduction_exempt, but I couldn't confirm the sub-paragraph letter. The same applies to SPC Regs 2002 Sch I para 2(2)(b), which the YAML now cites for ignoring the blind son. legislation.gov.uk doesn't resolve from this session.
The hub-machine witness folders and logs (r4/, local-runs/2120/).
Fixes #2120
Fixes #2124
## What and why
DWP and councils count Universal Credit carer-element awards, as they count Carer's Allowance and Carer Support Payment, when deciding the premiums and additions below. The model left the awards out.
- **Severe disability premium and Pension Credit addition (#2120).** DWP and councils withhold the premium or addition when a carer "has an award of universal credit which includes the carer element in respect of caring for" the claimant (HB Regs 2006 Sch 3 para 14(2)(a)(iii) and (b)(iii); HB(SPC) Regs 2006 Sch 3 para 6(2); IS Regs 1987 Sch 2 para 13(2); SPC Regs 2002 Sch I para 1(1)(a)(iii), (b), (c)(iv) and (4)). Councils apply the same words in England's, Wales's and Scotland's pension-age council tax reduction schemes. `is_cared_for_by_carer_benefit_recipient` attributed only Carer's Allowance and Carer Support Payment.
- **Scotland's working-age CTR carer premium (#2124).** The Scottish Ministers require councils to include the premium for an applicant or partner who has "an award of universal credit which includes the carer element described in regulation 29" (SSI 2021/249 Sch 1 para 6(1)(c)). `carer_premium` applied limbs (a) and (b) only. No other scheme's carer premium has limb (c): under HB Regs 2006 Sch 3 para 17, HB(SPC) Sch 3 para 9, IS Sch 2 para 14ZA, England SI 2012/2885 Sch 2 para 9, Wales WSI 2013/3029 Sch 2 para 9 and Sch 7 para 14, Scotland SSI 2012/319 Sch 1 para 10 and the pre-2022 SSI 2012/303 Sch 1 para 14, DWP and councils test entitlement to Carer's Allowance or Carer Support Payment.
### Changes
- **New `uc_award_upper_bound` (BenUnit).** The model calculates the bound without reading the non-dependant deduction, and its formula for the award before the benefit cap (`universal_credit_pre_benefit_cap`) never returns a larger award. Where DWP deducts less than the housing costs it allows (the rent, capped at the Local Housing Allowance rate for a private renter), the award stays at or below the award with no deduction. Where DWP deducts at least those housing costs, it calculates the award with no housing costs element and the work allowance without housing (UC Regs 2013 reg 22 and Sch 4 para 13). The model takes the larger of those two awards. The bound reads rent, tenure and the LHA cap as `uc_housing_costs_element` does, along with the elements, earned income before the work allowance and unearned income. It repeats the award's steps in their order, rounding to float32 wherever a step stores its value, so it never falls below the award those formulas calculate. An input or a scenario can store a larger award; the carer test then reads the stored award.
- **`has_uc_award_with_carer_element` (Person)** now needs a positive bound as well as the claim (`claims_universal_credit`), the age, pension-route and capital conditions (`is_uc_eligible`) and the carer element for this claimant (`uc_carer_element_included_for_claimant`). A carer whose bound comes to nil has a nil award. Parliament makes it a financial condition of an award that the amount payable reach the prescribed minimum (Welfare Reform Act 2012 s.5(1)(b) and (2)(b)), and DWP sets that minimum at one penny (UC Regs 2013 reg 17). So a carer whose income reduces the bound to nil has no award and no longer bars the premium or addition. Where an input or a scenario stores `universal_credit` for the period, or a reform neutralizes it, the test reads the award itself (`receives_uc_carer_element`): reading a stored award runs no formula, so it cannot cycle. `universal_credit` joins `SUPPLIED_INPUT_VARIABLES` for that check.
- **`is_cared_for_by_carer_benefit_recipient`** counts a carer-element holder as a carer, in the existing attribution order: claimants and partners of the carer's own benefit unit first, then other members, then claimants and partners of other benefit units, eldest unit first. A carer with both Carer's Allowance and a carer element counts once (SSCBA 1992 s.70(7)). Partners caring for the same severely disabled person have one relevant entitlement between them (s.70(7ZA) and (7A)), so where one receives a carer benefit, the other's carer element adds no second carer.
- **New `council_tax_reduction_carer_premium` (BenUnit).** `council_tax_reduction_premiums` reads it at working age in the same way as `council_tax_reduction_severe_disability_premium`. Outside Scotland's working-age scheme it equals `carer_premium`. In Scotland it counts each claimant or partner entitled to Carer's Allowance or Carer Support Payment (limbs (a) and (b), as `carer_premium`) or with an award that includes the carer element (limb (c)). It counts each person once (paras 5(2) and 6(1)), and only one of two partners who care for the same person (para 5(3) and (4)). Councils give the carer-element holder priority under para 5(4), which leaves the amount unchanged.
- **New parameter `gov.local_authorities.scotland.council_tax_reduction.working_age.uc_award_includes_zero_value_award`**: false from 1 April 2013, true from 1 April 2022 and false from 1 April 2025, beside the existing `carer_premium_counts_uc_carer_element` (false from 1 April 2013, true from 1 April 2022).
- Documentation of `severe_disability_premium`, `pension_age_severe_disability_premium`, `severe_disability_minimum_guarantee_addition`, `carer_premium` and `council_tax_reduction_premiums` now describes the limb. A household head who applies alone holds no Universal Credit award of their own in the model, so the head branch of `council_tax_reduction_premiums` keeps its carer test.
### A nil award
A disabled person aged 50 on the PIP daily living component in England, 2026, shares a home with a blind carer aged 40 in another benefit unit. The carer cares 35 hours a week, claims no Carer's Allowance and earns £20,000. After income tax of £1,486.00 and National Insurance of £594.40, the carer keeps earned income of £17,919.60. DWP applies a reduction of 0.55 × £17,919.60 = £9,855.78, which exceeds the maximum amount, (£424.90 + £209.34) × 12 = £7,610.88. With no housing costs and no work allowance, both of the bound's calculations come to nil too, the carer has no award, and the disabled person keeps the premium of £4,474.60 (£86.05 × 52). The YAML case at £25,000 of earnings (earned income £21,519.60, taper £11,835.78) and a new case for a pensioner whose blind son earns £20,000 expect the premium and the addition at £4,474.60 too.
### When the bound exceeds a nil award
The award can come to nil while the bound stays positive, and the carer test then counts a carer who has no award in law. #2795 tracks the three routes:
- **A non-dependant deduction.** A carer aged 40, not blind, cares 35 hours a week for a disabled person aged 50 on the PIP daily living component and earns £27,000. The carer and the disabled person rent a home privately, each liable for half of £12,000, and a blind non-dependant aged 30 earning £20,000 lives with them. DWP deducts £1,158.60 a year for the non-dependant (UC Regs 2013 Sch 4 paras 13 and 16; blindness brings no exemption, and para 15 does not exempt her as a renter). The taper of 0.55 × £22,959.60 = £12,627.78 then exceeds her maximum amount of £12,452.28, so the award comes to nil; without the deduction the maximum amount would reach £13,610.88, and the bound stays at £983.10. DWP does not count the disabled person, a joint tenant, as her non-dependant (para 9(2)(d)), and the council does not count her as his (HB Regs 2006 reg 3(2)(d)). A blind non-dependant does not bar his premium (Sch 3 para 14(4)). He keeps the premium of £4,474.60 in law; the model withholds it.
- **Tax-Free Childcare.** A blind carer aged 35, earning £60,000, has a child aged 3 in £12,000 of childcare, and the disabled person aged 60 on the PIP daily living component lives in another benefit unit of the household. The family gets £2,000 from Tax-Free Childcare against an award of £1,197.59 (maximum amount £21,458.16 less the taper of £20,260.57), so it takes no award (`forgoes_universal_credit_for_tax_free_childcare`), while the bound stays at £1,197.59. That variable reads the award, so the carer test cannot read it. The disabled person keeps the premium of £4,474.60 in law; the model withholds it.
- **A small housing costs element with a work allowance.** A blind carer aged 35 cares 35 hours a week for a disabled person aged 60 on the PIP daily living component, who lives in another benefit unit of the household and claims no Universal Credit. DWP has determined that the carer has limited capability for work (UC Regs 2013 reg 39(1)(a)). Under reg 41(1A), DWP cannot treat the carer's paid work as a relevant change of circumstances when it decides whether to reassess that determination (reg 41(1)(b)). So the award has a work allowance (reg 22(1)(b)) and the carer element too: DWP puts the LCWRA element in its place only for a claimant who also has limited capability for work-related activity (reg 29(4)). The carer earns £25,000, claims no Carer's Allowance and pays the council £600 a year in rent. After income tax of £2,486.00 and National Insurance of £994.40, the carer keeps earned income of £21,519.60. With a housing costs element of £600, DWP applies the lower work allowance, £427 × 12 = £5,124 (reg 22(2)(b)). DWP's reduction of 0.55 × (£21,519.60 − £5,124) = £9,017.58 exceeds the maximum amount, (£424.90 + £209.34) × 12 + £600 = £8,210.88, so the award comes to nil. In the bound's calculation without housing costs, the model applies the higher work allowance, £710 × 12 = £8,520, which leaves £7,610.88 − 0.55 × (£21,519.60 − £8,520) = £461.10. The model counts the disabled person as the carer's non-dependant but deducts nothing for him, since he receives the PIP daily living component (UC Regs 2013 Sch 4 para 16(2)(e)), and the family takes no Tax-Free Childcare. The council ignores the blind carer as a resident (HB Regs 2006 Sch 3 para 14(4)(b)), so the disabled person keeps the premium of £4,474.60 in law; the model withholds it.
The model applies the benefit cap after `universal_credit_pre_benefit_cap`, and DWP exempts a carer-element award from the benefit cap (UC Regs 2013 reg 83(1)(j); `is_uc_benefit_cap_exempt_specified_benefit`). The model also excludes Pension Credit from Universal Credit unearned income (`gov.dwp.universal_credit.means_test.income_definitions.unearned`); Pension Credit reaches the award only through the exemption from the non-dependant deduction, which the bound leaves out.
The model still takes non-dependant deductions from a renter whom DWP exempts under UC Regs 2013 Sch 4 para 15: a blind renter, or one who receives Attendance Allowance, the DLA care component at the middle or highest rate, or the PIP daily living component.
The property tests `test_a_non_dependant_deduction_that_takes_the_award_to_nil_leaves_no_award`, `test_a_family_that_takes_tax_free_childcare_instead_has_no_award` and `test_small_housing_costs_with_a_work_allowance_leave_no_award` assert the premium of £4,474.60 and run as strict expected failures citing #2795, each with an `xfailed` entry in `.github/test_outcome_allowlist.toml`. A change that pays the premium turns them into failures, so whoever fixes #2795 removes the markers and the entries with it. Each test raises `RuntimeError` when a premise fails, so the expected failure covers only the premium.
### Scotland's definition by date
The Scottish Ministers defined an "award of universal credit" to include "a universal credit award with a value of zero" from 31 March 2022 (SSI 2022/52 reg 3, inserting the words into SSI 2021/249 reg 4 before the scheme started on 1 April 2022). From 1 April 2025 they defined it as "an award of universal credit made under Part 1 of the 2012 Act" (SSI 2025/24 regs 1 and 8), so an income that tapers the award to nil leaves no award. From the same date they count two nil awards as awards (reg 10A, inserted by SSI 2025/24 reg 9):
- an award that a sanction under s.26 or s.27 of the 2012 Act reduces to zero;
- an award whose entitlement ended under the UC Claims and Payments Regs 2013 reg 32A(1)(b), where the Secretary of State treats the claimant as reclaiming under reg 32A(2).
While the zero-value definition holds (`uc_award_includes_zero_value_award`), the model reads limb (c) from the award's conditions: the family claims Universal Credit, meets its basic conditions and takes no Tax-Free Childcare instead, and the award includes the carer element for this claimant. Afterwards it reads the positive award (`receives_uc_carer_element`). The model has no input for a sanction or a reg 32A reclaim, so it pays no premium for reg 10A's awards.
The model reads the 2022 definition as reaching a carer whose earnings take the award to nil, and so counts that nil award from 2022-23 to 2024-25. The sources leave that reading open. UC Claims and Payments Regs 2013 reg 32A lets the Secretary of State treat a claimant as reclaiming in two cases: a claim on which DWP makes no award because income fails the financial condition (reg 32A(1)(a)), and an award whose entitlement ends for that reason (reg 32A(1)(b)). The Scottish Ministers' reg 10A(b) later counts only the second. In the policy note to SSI 2025/24, the Scottish Government records its 2022 intention to treat such a claimant as having an award, but calls reg 10A an expansion that gives the intention effect. In Ipswich BC v TD [2024] UKUT 117 (AAC), the Upper Tribunal held that a nil award carries no Universal Credit entitlement (paras 36 to 38), without construing the Scottish definition. The model's behaviour from 2022-23 to 2024-25 therefore rests on its chosen reading of reg 4.
A Scottish carer aged 40, caring 35 hours a week, with no Carer's Allowance or Carer Support Payment claim and £20,000 of earnings:
- **2024-25.** The maximum amount comes to (£393.45 + £198.31) × 12 = £7,101.12. The carer keeps earned income of £17,942.66, and DWP's reduction of 0.55 × £17,942.66 = £9,868.46 takes the award to nil. The model counts the nil award and pays the carer premium of £45.60 × 52 = £2,371.20.
- **2025-26.** The maximum amount comes to (£400.14 + £201.68) × 12 = £7,221.84. The carer keeps earned income of £17,947.87, and DWP's reduction of £9,871.33 takes the award to nil, which leaves no award and no carer premium.
### The 2022-23 Scottish amount
The Scottish Ministers left two amounts in force on 1 April 2022. SSI 2021/249 Sch 1 para 5(1) still read £37.70, as made, while the Ministers had replaced £37.70 with £38.85 in para 17's table (SSI 2022/52 reg 25(c)(ii)). They set both to £42.75 from 1 April 2023 (SSI 2023/38 reg 20(h) and (i)). In its *Council Tax Reduction in Scotland: 2022-2023* statistics (Table 1), the Scottish Government gives the 2022-23 carer premium as £38.85, the para 17 figure, and the model pays the same amount, reading `gov.dwp.carer_premium.single` at 30 April 2022.
### Which years
- The model reads each year's parameters at 30 April of that year (`policyengine_uk/utils/parameters.py`).
- **Severe disability premium and addition.** DWP added the limb to HB, HB(SPC), IS, JSA, ESA and SPC through SI 2015/1754, from 4 November 2015. The government added it to England's pension-age CTR for schemes from 1 April 2016 (SI 2015/2041 reg 1(2)). The Scottish Ministers added it to Scotland's from 1 April 2016 (SSI 2016/81), had it in the working-age SSI 2012/303 by 1 April 2021, and included it in SSI 2021/249 from its start on 1 April 2022. The Welsh Ministers added it to Wales's for schemes from 1 April 2017 (WSI 2017/46 reg 1(3)). No parameter gates the limb. The carer element parameter starts on 9 April 2016, and the programmes' verified years start at 2019 (Universal Credit) and 2022 (Housing Benefit, Pension Credit, Income Support). Before them the model applies the limb in Welsh pension-age CTR in model year 2016, a year before WSI 2017/46, and in model year 2015 before SI 2015/1754, wherever a hand-built household has a carer-element award.
- **Scottish working-age carer premium.** The model applies limb (c) from model year 2022, counts a nil award in 2022, 2023 and 2024 under its reading of reg 4, and needs a positive award from 2025.
### Reforms
A reform that makes `is_uc_eligible` read Pension Credit would cycle through the attribution, which has to read eligibility; the invariants below hold for baseline households and stored awards.
### Interaction with #1966
#1966 (draft) gives Scotland's and Wales's working-age CTR their own applicable amount (`council_tax_reduction_working_age_applicable_amount`), with its own carer count in place of `council_tax_reduction_premiums`, so it needs no subtraction from the shared premiums. Its `council_tax_reduction_working_age_carers` adds the carer element as one carer only when neither the claimant nor a partner has a carer benefit entitlement, with no date gate, and reads a positive award (`uc_carer_element > 0` with `council_tax_reduction_working_age_has_universal_credit`). When merging #1966, count each claimant or partner with `is_entitled_to_carer_benefit` or a carer-element award before applying the same-person cap, as `council_tax_reduction_carer_premium` does. Gate limb (c) on `carer_premium_counts_uc_carer_element`, and count a nil award in 2022 to 2024 under `uc_award_includes_zero_value_award`. The parameter files do not overlap.
### Overlap with open branches
Against this head (`fff13eda8`), `git merge-tree --write-tree` finds:
- `main` (`47bda0a7a`): merges cleanly.
- `fix-1971-enhanced-disability` (`43a545dcb`): one textual conflict in `council_tax_reduction_premiums.py`, where both branches add a substitution term to the working-age premiums (this branch the carer premium, that one the enhanced disability premium). Keep both substitutions when resolving the conflict; neither calculation reads the other's variables.
- `fix-1933-ctr-pensioner-children` (`c5b07aec7`, and the same at `e8831fb6b`): merges cleanly. It adds pension-age CTR child and family amounts and tariff income. Its child-count exception reads final Child Tax Credit as well as claim and eligibility, so it can reach the shared Pension Credit carer tests through the tax-credit passport. Source inspection of `f5c75cbfc` found no new cycle, and `e8831fb6b`'s variables differ from it only in docstrings and documentation; historical CTC households still need a merged-tree check.
- `hb-ctr-non-dep-exemptions` (`97f792542`): merges cleanly. Its HB and CTR non-dependant exemptions read `universal_credit_pre_benefit_cap` and Pension Credit; neither the bound nor the attribution reads those.
- #2756 (`c34662736`): merges cleanly. It derives the economic assumptions' index horizon from the growth series and changes no award or premium formula.
- Open pull requests that touch `policyengine_uk/utils/supplied_inputs.py`, where this branch adds `universal_credit` to `SUPPLIED_INPUT_VARIABLES`: #2776 (`1d4a3e475`), #2765 (`edda47ea2`) and #2661 (`f06ae765f`) merge cleanly; #2308 (`5b4dc2143`) and #2265 (`e4c54d7fa`) already conflict with `main` in that file and `simulation.py` (and #2265 in `test_input_records.py`), and this branch adds no conflict there. #1966 (`779f5dcfd`) conflicts with this branch and with `main` in the same files: `CHANGELOG.md`, `pyproject.toml` and `test_means_test_income_properties.py`.
## Invariants
On generated households under baseline law, `policyengine_uk/tests/test_uc_carer_element_award_properties.py` checks:
1. **No change without a carer element.** In a household where no one has `has_uc_award_with_carer_element` or `receives_uc_carer_element`, the attribution, the severe disability premium and its CTR and pension-age variants, and the addition equal their values with `has_uc_award_with_carer_element` supplied as false, and `council_tax_reduction_carer_premium` equals `carer_premium`, exactly.
2. **A carer element never raises the severe disability premium or addition**, and never removes anyone from the cared-for set.
3. **The Scottish carer premium never lowers the carer premium** and differs from `carer_premium` only for a Scottish working-age family.
4. **Bounds.** The Scottish premium comes to a whole number of weekly amounts, at most one per claimant or partner, at most one where partners care for the same person.
5. **A nil bound leaves a nil award:** `uc_award_upper_bound` ≥ `universal_credit_pre_benefit_cap` ≥ `universal_credit`, exactly, for awards the model's formulas calculate, so `receives_uc_carer_element` implies `has_uc_award_with_carer_element`. The implication also holds where the simulation stores the award, which can exceed the bound.
6. **Attribution.** Everyone the attribution counts as cared for meets the Carer's Allowance severe disability test; no household has more people cared for than carers; the attribution never counts a lone carer as cared for.
7. **No cycle.** Every reader, with `uc_award_upper_bound`, `universal_credit`, `pension_credit`, `housing_benefit`, `income_support`, `council_tax_reduction` and `household_net_income`, calculates on one simulation in either order, on generated baseline households and where the simulation stores the award.
8. **The bound reads neither the award nor Pension Credit:** its trace reaches none of `pension_credit`, `uc_housing_costs_element`, `uc_non_dep_deductions`, `uc_non_dep_deduction_exempt`, `uc_maximum_amount`, `uc_income_reduction`, `universal_credit_pre_benefit_cap`, `universal_credit` or the attribution.
The bound repeats the award's arithmetic, since the carer test cannot read the award. Two tests in the same file guard that copy:
9. **Endpoint parity.** `test_upper_bound_matches_real_award_endpoints` checks that `uc_award_upper_bound` equals, exactly, the larger of two awards that the model's own formulas calculate in separate simulations: one with non-dependant deductions supplied as nil, the other with the housing costs element supplied as nil. Both switch off the Tax-Free Childcare choice, the benefit cap and debt deductions, and the test compares the award before the cap and the final award. Its 126 English 2026 rows cover every element of the maximum amount, both work allowances, private rents below and above the Local Housing Allowance rate, rows where each calculation gives the larger award, and rows within three float32 steps of a nil award. The test also asserts that, in some row, the housing costs element equals a Local Housing Allowance cap below the rent.
10. **Every component.** `test_the_bound_reads_every_component_of_the_maximum_amount` checks that the bound reads each element of `uc_maximum_amount` in its order, and every input of the award's steps apart from the non-dependant deduction, the Tax-Free Childcare choice and the claim. A new element or input therefore fails it.
These two catch drift in either direction at the tested rows and year, and any new component; drift that only other inputs or years expose passes them.
## Test plan
Since `1f87a159d` this branch changes only tests, labels, documentation and comments, so runs on any later commit, and the earlier runs on `1f87a159d`, still describe these formulas. Each run on a later commit names it. An AST comparison that ignores docstrings and `documentation` assignments finds every production Python file the branch changes identical at `260f6a77e` and `4613ac60f`, and every Python file that `fff13eda8` changes identical at `fff13eda8` and `260f6a77e`; the two YAML test files `fff13eda8` changes parse to identical data with comments dropped.
- [x] YAML tests with hand-worked arithmetic citing the provision, amounts from DWP Benefit and pension rates 2026 to 2027 / SI 2026/148 and SSI 2021/249 Sch 1 paras 5(1) and 17 as amended:
- `policyengine_uk/tests/policy/baseline/household/demographic/uc_carer_element_carer_test.yaml`: 10 cases, 10 passed at `fff13eda8`. The blind carer; a partner inside the benefit unit (couple rate to single rate); a son outside it (addition and pension-age premium); a carer on Carer's Allowance and Universal Credit (one carer); a partner's carer element beside the other partner's allowance (one carer); a carer whose income tapers the award to nil (premium kept); a council-renting carer whose housing costs element keeps an award (premium withheld); a son whose income tapers the award to nil (addition kept); a stored award with no claim (premium withheld); no claim, no award.
- `policyengine_uk/tests/policy/baseline/gov/local_authorities/council_tax_reduction/council_tax_reduction_carer_premium.yaml`: 12 cases, 12 passed at `fff13eda8`. The issue's Scottish carer aged 40 with `care_hours: 35`; 2022 and 2021; English and Welsh controls; the nil award in 2026, in 2024 (£2,371.20) and in 2025 (nil); allowance and carer element together; a couple caring for the same person; a Scottish pensioner; a dependant who receives Carer Support Payment (no premium).
- [x] Existing YAML tests on the changed readers, in one batch with the first file above: 180 passed at `260f6a77e` (its 10 cases and 170 in `household/demographic/is_cared_for_by_carer_benefit_recipient.yaml`, `finance/benefit/carer_premium.yaml`, `finance/benefit/couple_carer_award.yaml`, `finance/benefit/family/severe_disability_premium.yaml`, `finance/benefit/family/housing_benefit/pension_age_severe_disability_conditions.yaml`, `finance/benefit/family/housing_benefit/pension_age_premiums.yaml` and three files in `gov/dwp/pension_credit/guarantee_credit/`: `severe_disability_residence_and_carers.yaml`, `carer_and_severe_disability_additions.yaml` and `severe_disability_claimant_partner.yaml`). No existing test's expected value changed.
- [x] `policyengine_uk/tests/test_uc_carer_element_award_properties.py`, 12 tests: 9 passed and 3 expected failures at `fff13eda8` in one `-n 4` run with strict expected failures (65 s). At `260f6a77e`, the same outcomes in two processes under a 1,500 s cap each (the ten tests without Hypothesis in 414 s, the two Hypothesis tests in 305 s). Runs at `4613ac60f` gave the same outcomes.
- `test_issue_households_read_the_carer_element_award` (the reproducer; reads only variables that predate the fix): passed; on origin/main it fails with `assert np.float32(4474.6) == 0`, the blind carer's premium.
- `test_a_stored_award_is_the_award_and_reads_no_cycle`, forward and reverse reader order: 2 passed. With `universal_credit` supplied as £0 and £100 and claims supplied as false, the carer test gives [false, true], the attribution [true, false] and the premium [0, 0].
- `test_a_reform_that_abolishes_universal_credit_leaves_no_carer_element_award`: passed.
- `test_the_bound_reads_neither_the_award_nor_pension_credit` (invariant 8): passed.
- `test_upper_bound_matches_real_award_endpoints` (invariant 9) and `test_the_bound_reads_every_component_of_the_maximum_amount` (invariant 10): 2 passed, and 2 passed alone at `d10b985d2` (413 s), whose two tests match this head. On the four seed rows of the private renter above the cap, the bound comes to £32,446.08, £31,964.28, £25,364.28 and £27,164.28. A hand calculation gives the same figures: a maximum amount of (£424.90 + £303.94) × 12 + 0.85 × £6,000 + £1,550 × 12 = £32,446.08, less 0.55 of earnings above the £427 × 12 work allowance, less any unearned income.
- The three #2795 tests: 3 expected failures (strict), each at the premium assertion.
- `test_the_carer_element_limb_moves_only_its_readers_and_only_one_way` (Hypothesis, invariants 1 to 6 and the bound in 5; generated households include private and council renters with non-dependants) passed its explicit example of five households and five derandomized generated examples. `test_every_reader_calculates_on_one_simulation_in_any_order` (Hypothesis, invariant 7) passed both explicit orders and three generated examples, with all 18 readers on one simulation.
- CI's outcome check (`.github/check_test_shards.py`, source mode, no dataset) passes on the outcomes that `.github/pytest_outcome_log.py` recorded for all 12 tests at `260f6a77e`, and accepts the three expected failures through their allowlist entries.
- [x] Wider YAML directories: `gov/local_authorities/council_tax_reduction/` 343 passed and `finance/benefit/family/housing_benefit/` 584 passed, at `260f6a77e`.
- [x] Existing Python suites on these readers, each process running alone under a 1,500 s cap unless stated:
- `test_council_tax_reduction_severe_disability_family.py`: 8 passed.
- `test_severe_disability_premium_properties.py`: 6 passed at `4613ac60f` (123 s, under a 3,000 s cap).
- `test_severe_disability_addition_properties.py`: 7 passed at `4613ac60f` (254 s, under a 3,400 s cap).
- `test_legacy_carer_premium_properties.py`: 4 passed at `260f6a77e` (1,261 s).
- `test_pension_age_severe_disability_premium_properties.py`: 3 passed at `260f6a77e` (422 s).
- `test_disable_simulated_benefits_carers.py`, whose reform stores `universal_credit`: 18 passed at `260f6a77e` (465 s).
- `test_legacy_award_readers_properties.py`, three of whose tests store a nil `universal_credit` award beside carers and so send the carer test to the stored award: 18 passed at `260f6a77e` (522 s).
- [x] `policyengine_uk/tests/code_health`: 3,092 passed, and `test_parameter_descriptions.py`: 24 passed, at `fff13eda8`.
- [x] Differential against origin/main (`2da212abc`), computing both trees on a hand-built `UKSingleYearDataset` of 150 households (503 people, 308 benefit units; London, North West, South East, Scotland, Wales and Northern Ireland; 2026): 73 households have someone with `has_uc_award_with_carer_element` or `receives_uc_carer_element`, and every reader matches in the other 77. In those 73, the severe disability premium falls in 6 benefit units (−£26,847.60), the addition in 6 (−£26,847.60) and the CTR severe disability premium in 6 (−£26,847.60); the CTR premiums rise in 4 and fall in 6 (−£16,832.40 net); the attribution moves 39 people from not cared for to cared for and none the other way; `universal_credit`, `housing_benefit`, `council_tax_reduction`, `pension_credit`, the pension-age premium and `household_net_income` do not change. The sums weight each hand-built household equally and estimate nothing about the population.
- [x] Mutations, each in a scratch copy of the package, run against both new YAML files (M11 to M14 against the property tests):
- M1, attribution ignores the carer element (`carer = receives`): 5 cases fail.
- M2, attribution drops the same-person rule: 1 fails, the partners' case.
- M3, the Scottish premium counts a nil award in every year: 2 fail, the nil award in 2026 (£2,503.80 instead of £0) and in 2025 (£2,412.80 instead of £0).
- M4, limb (c) from 2013: 1 fails, the 2021 case (£1,960.40 instead of £0).
- M5, `council_tax_reduction_premiums` drops the carer premium substitution: 2 fail, the issue's applicable amount (£4,968.60 instead of £7,472.40) and 2022's (£4,004.00 instead of £6,024.20).
- M6, the Scottish premium counts every member, not only claimants and partners: 1 fails, the dependant (£2,503.80 instead of £0).
- M7, the carer test drops the bound: 2 fail, the two nil awards.
- M8, the carer test ignores a stored award: 1 fails, the stored award.
- M9a, a nil award never counts in Scotland: 1 fails, 2024. M9b, it always counts: 2 fail, the nil awards in 2025 and 2026.
- M10, the bound drops the housing costs element and keeps its two passes: 1 fails, the council-renting carer (bound £0 instead of £1,775.10).
- M11, the carer test ignores a neutralized award: the abolition test fails.
- M12, the bound's maximum drops the carer element (scratch copy of `d10b985d2`, whose parity tests match this head): both invariant 9 and 10 tests fail, the endpoint comparison on 28 of its 126 rows and the component check at the missing `uc_carer_element`.
- M13, `uc_maximum_amount` adds `child_benefit` (same copy): both fail, the component check at the extra `child_benefit` and the endpoint comparison on 52 of 126 rows.
- M14, the bound takes the full private rent in place of the Local Housing Allowance cap (same copy): the endpoint comparison fails on the 18 rows of the private renter above the cap and on no others, and the component check passes, since the mutant reads the same variables. On a scratch copy of `260f6a77e` with the same change, the renter's four seed rows give a mutant bound of £43,846.08, £43,364.28, £36,764.28 and £38,564.28, the hand calculation with the £30,000 rent in place of the £18,600 cap.
- [x] `ruff format --check .`, `ruff check .` (0.17.2), `ruff check --select F811,F821 policyengine_uk` and `git diff --check`: clean at `fff13eda8`.
- [x] Changelog fragment `changelog.d/2120.fixed.md`.
## Reproducer
Reproducer: policyengine_uk/tests/test_uc_carer_element_award_properties.py::test_issue_households_read_the_carer_element_award
axiom: TheAxiomFoundation/rulespec-uk#520 queued
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Head:fff13eda816c608a8dbe2e064131472363fae9f7 on branch claude/uc-carer-awards-nits-1pezj2. This session can only push to claude/... branches, so fix-2120-uc-carer-awards still sits at 260f6a77e. The new branch is that head plus one commit. Draft PR:#2827 (opened once, at the end, after the commit; nothing pushed since).
Pre-start check:fix-2120-uc-carer-awards was at 260f6a77e, the brief's base. Its last commit is dated 10:18Z, about 5 h 40 min before I started (15:59Z), so it falls inside the 6-hour window. It is the brief's own base, though, and nothing was pushed after it. Neither comment on #2120 said anyone was mid-change, so I went ahead and posted the pick-up comment.
Findings
P3-1: I replaced the sentence with the review's text, verbatim. It is at policyengine_uk/variables/gov/dwp/universal_credit/uc_award_upper_bound.py:16-21. I gave the PR body's first Changes bullet the same wording so the two agree.
P3-2: I applied both replacements:
severe_disability_premium.py:22-25 now reads "is_cared_for_by_carer_benefit_recipient attributes each carer benefit to the person it is paid for caring for, and the Pension Credit severe disability addition shares it".
severe_disability_minimum_guarantee_addition.py:27-30 has the same sentence, ending "and the legacy severe disability premium shares it".
is_cared_for_by_carer_benefit_recipient.py:42-44 now reads "The model does not observe carers outside the household, nor a carer whose allowance runs on…".
I also joined the split string literals ("counts an award " / "of Universal Credit", "Blindness " / "(is_blind)", "eight " / "weeks") inside those paragraphs. The resulting strings are unchanged.
P3-3: I reflowed the comments to at most 79 columns, with no one-word lines:
uc_carer_element_carer_test.yaml:8-10: the 93-character header line. The review's "line 194" quote ("…DWP includes the carer element for regular and substantial caring") is actually at line 8.
uc_carer_element_carer_test.yaml:194-203: the # Earnings orphan.
Sch 4 para 16(2)(b), Pension Credit: matches the bound's documentation (uc_award_upper_bound.py, "Sch 4 para 16(2)(b)").
Sch 4 para 16(2)(e), PIP daily living component: matches the YAML at uc_carer_element_carer_test.yaml:240 and the body's small-housing route.
Sch 4 para 16(2)(c): nothing in the branch or body cites it.
"at the middle or highest rate" (body, para 15 paragraph): matches para 15(2)(b) word for word. The body's list (blind; Attendance Allowance; DLA care component at middle or highest; PIP daily living) matches 15(2)(a)-(d). It leaves out the Scottish benefits and the (e) limb, so it reads as examples, not the full list. The model code confirms the gap: uc_non_dep_deduction_exempt has no para 15 test.
"Blindness brings no exemption" (para 16): correct, since 16(2) has no blindness limb.
SPC Sch I para 2(2)(b) for ignoring the blind son: matches ("certified as severely sight impaired or blind by a consultant ophthalmologist", within para 2(1)'s ignored persons). The YAML is at uc_carer_element_carer_test.yaml:84-85.
Open question I did not change: the body and the non-dependant test (test_uc_carer_element_award_properties.py:599-601) say "para 15 does not exempt her as a renter". That holds under para 15(1)(a), because the carer is not blind and gets no listed benefit. But para 15(1)(b) exempts "any joint renter where at least one joint renter is a person to whom sub-paragraph (2) applies", and the disabled co-tenant receives the PIP daily living component (15(2)(d)). Whether he is a "joint renter" depends on Sch 4's definition of that term, which nobody has quoted. If the definition covers a co-tenant outside the claimant's benefit unit, that Pay the severe disability premium when a carer's award comes to nil #2795 route's premise is wrong. I stopped on this item, as the brief says to when a provision is unquoted.
No citation disagreed with the quoted text, so the citation check changed no text.
Text-only check (item 6), 260f6a77e → fff13eda8
Python ASTs are compared with module, class and function docstrings and documentation = assignments blanked. YAML is compared with yaml.safe_load, which drops comments.
File
Result
uc_award_upper_bound.py
AST identical
severe_disability_premium.py
AST identical
severe_disability_minimum_guarantee_addition.py
AST identical
is_cared_for_by_carer_benefit_recipient.py
AST identical
uc_carer_element_carer_test.yaml
parsed YAML identical
council_tax_reduction_carer_premium.yaml
parsed YAML identical
As a negative control, the same script over 4613ac60f → 260f6a77e reports DIFFERS for uc_award_includes_zero_value_award.yaml and the property test file, so it does detect changes.
Tests at fff13eda8 (4 vCPU, uv sync --frozen --extra dev, no HF token)
I made no mutation or revert checks this round. The commit changes no executable code or expected value, as the AST and YAML comparison shows.
I did not rerun these: the reader YAML batch and the wider YAML directories, the other Python suites, the differential and the CI outcome check. The body keeps their earlier results with their SHAs.
No test needed a survey dataset.
Judgment calls
PR title. The hub's title has 80 characters, and the repository asks for under 70. I used "Count UC carer awards for severe disability and Scottish CTR premiums" (69).
PR body updates:
The Test plan names fff13eda8 for the runs above, and code_health and parameter descriptions are added.
Activity
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Head tested:
4613ac60ffcddfead4f7a118d99a26a1d61f2c40onfix-2120-uc-carer-awards(detached checkout;git rev-parse HEADconfirmed). The branch has since moved to260f6a77e90bc290348bde6f3699b48b7a964b29(two commits:d10b985d"Add a private renter above the LHA rate to the endpoint comparison" and260f6a77"Name the actors in the carer-award comments and documentation"). As briefed, I tested4613ac60only; nothing here covers the newer commits.Set-up: cloud VM, 4 vCPU, 16 GB.
uv sync --frozen --extra dev.HUGGING_FACE_TOKENandPOLICYENGINE_UK_DEFAULT_DATASETunset. No test skipped for want of a dataset. No run ran out of memory.uv run pytest -q -o xfail_strict=true -n 4 policyengine_uk/tests/test_uc_carer_element_award_properties.py -k "not (the_carer_element_limb_moves_only_its_readers_and_only_one_way or every_reader_calculates_on_one_simulation_in_any_order)"-k "the_carer_element_limb_moves_only_its_readers_and_only_one_way or every_reader_calculates_on_one_simulation_in_any_order"... -n 4 policyengine_uk/tests/test_severe_disability_premium_properties.py... -n 4 policyengine_uk/tests/test_severe_disability_addition_properties.py... -n 4 test_uc_carer_element_award_properties.py -k "upper_bound_matches_real_award_endpoints or the_bound_reads_every_component_of_the_maximum_amount"... -n 4 test_uc_carer_element_award_properties.py -k "the_bound_reads_every_component_of_the_maximum_amount"... -n 0 -s policyengine_uk/tests/test_m14_private_cap.py(in tree, from repo root)/tmp/m14, run from there:uv run --project <repo> --frozen pytest -q -o xfail_strict=true -p no:cacheprovider -s test_m14_private_cap.pyWall times include
uv runstart-up. Summary lines: (1)7 passed, 3 xfailed in 60.97s; (2)2 passed in 83.27s; (3)6 passed in 155.14s; (4)7 passed in 276.90s; (5)2 failed in 39.68s; (6)1 failed in 15.38s; (7a)1 error in 0.87s; (7b)3 passed in 47.92s; (8)1 failed, 2 passed in 48.63s.Expected failures (#2795)
Entry 1 reported 3 xfailed under
-o xfail_strict=true, with no XPASS. The three#2795xfail markers are at lines 595, 622 and 674 of the test file.Mutants
Each edit was applied by a script asserting
text.count(old) == 1and reverted withgit checkout -- <file>. After each revertgit status --porcelainprinted nothing.M12 (delete
"uc_carer_element",fromuc_award_upper_bound.py): killed. Both named tests failed:test_the_bound_reads_every_component_of_the_maximum_amount(line 981):test_upper_bound_matches_real_award_endpoints(line 936):M13 (add
"child_benefit",after"uc_childcare_element",inuc_maximum_amount.py): killed.test_the_bound_reads_every_component_of_the_maximum_amount:M14 (
[rent, capped_rent_amount]→[rent, rent]inuc_award_upper_bound.py): survives the branch's own tests at4613ac60.test_authored_endpoint_parityandtest_authored_component_guard, which call the branch's two guards unchanged, both passed. Only the third, added test failed:test_m14_private_cap.py::test_private_rent_above_the_lha_cap_keeps_endpoint_parity(line 41):I didn't run M14 against
260f6a77. Whetherd10b985dkills it is unknown.Entry 7 deviations
policyengine_uk/tests/test_m14_private_cap.pyand run from the repo root, the file failed at collection withValueError: option names {'--shard'} already added. I read the file andpolicyengine_uk/tests/conftest.py: the conftest registers a--shardoption, and the file'spytest_plugins = ["policyengine_uk.tests.conftest"]loads that conftest again on top of the one pytest picks up from the directory./tmp/m14against the editable install (policyengine_uk.__file__resolved to the checkout, so the mutant edit applied). Entry 8 used the same set-up.-n 4: I used-n 0for 7a and no xdist for 7b and 8, so the-sprint would reach the log. Under xdist, workers don't pass-soutput through.Afterwards I deleted the file and the copy, and
git status --porcelainprinted nothing.PRIVATE_CAP_WITNESSAt the head (7b):
Under M14 (8):
Nothing was skipped. No failure was rerun.
Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Verdict: APPROVE WITH NITS at
260f6a77e90bc290348bde6f3699b48b7a964b29(delta from4613ac60ffcddfead4f7a118d99a26a1d61f2c40).Set-up: cloud VM with 4 vCPU. The head is checked out detached in a scratch worktree, with
uv sync --frozen --extra devandHUGGING_FACE_TOKENandPOLICYENGINE_UK_DEFAULT_DATASETunset. I made each mutation in agit archivecopy of the head and ran it withPYTHONPATHpointing at that copy.policyengine_uk.__file__resolved to the copy. I restored each mutated file fromgit show HEAD:<file>, anddiff -ragainst the head printed nothing afterwards. I made no commits or pushes.Findings
No P1 or P2 finding.
P3-1: the bound's documentation still says "rent" where the LHA cap now matters
policyengine_uk/variables/gov/dwp/universal_credit/uc_award_upper_bound.py:16–18(documentation): "Where DWP deducts less than the rent, the award stays at or below the award with no deduction. Where it deducts at least the rent, DWP calculates the award with no housing costs element…". For a private renter, the formula's housing costs aremin_(uc_LHA_cap, rent), not the rent (lines 59–68). This round's new parity row is exactly that case: £30,000 rent, £18,600 cap. The PR body's first Changes bullet already says "at least the eligible housing costs". Replacement:P3-2: two passives remain in documentation paragraphs the delta edited
policyengine_uk/variables/household/demographic/severe_disability_premium.py:22–23and…/additional/severe_disability_minimum_guarantee_addition.py:28–29: "Whom a carer benefit is paid for caring for is attributed by is_cared_for_by_carer_benefit_recipient". Replacement: "is_cared_for_by_carer_benefit_recipient attributes each carer benefit to the person it is paid for caring for". The pension-age premium's documentation already uses that order in this delta.policyengine_uk/variables/household/demographic/is_cared_for_by_carer_benefit_recipient.py:42: "Carers outside the household are not observed". Replacement: "The model does not observe carers outside the household".P3-3: reflow orphaned comment lines
Two edited comments leave a one-word line, and one line runs past the file's wrap width:
policyengine_uk/tests/policy/baseline/household/demographic/uc_carer_element_carer_test.yaml:194–195: line 194 has 94 characters ("…DWP includes the carer element for regular and substantial caring"), and line 195 is just# Earnings.policyengine_uk/tests/policy/baseline/gov/local_authorities/council_tax_reduction/council_tax_reduction_carer_premium.yaml:229:# carer premium. Neither of, followed by full lines.This is cosmetic, and no expected value changes.
P3-4: the reg 41(1A) row dropped "alone" from the replacement in the table
PR_BODY.md, small-housing route: "Under reg 41(1A), DWP cannot treat the carer's paid work as a relevant change of circumstances…". The round-3 replacement read "cannot treat paid work alone as a relevant change". Nobody in this brief quotes reg 41, so I can't say which wording matches the text. If reg 41(1A) refers to work alone, as the earlier wording implied, restore it: "DWP cannot treat the carer's paid work alone as a relevant change of circumstances…". Otherwise keep the current text.Rulings and previous findings
PARITY_FAMILIES[6](test file lines 809–818) adds the lone parent, rent £30,000. The test asserts a row withuc_housing_costs_element == uc_LHA_cap < benunit_rent(lines 931–935). The rows number 126: 7 families × 4 seeds + 2 endpoints × 7 families × 7 boundary rows. The family's rows are therefore seeds 24–27, boundary rows 70–76 at the first endpoint and 119–125 at the second. M14 results are below.council_tax_reduction_carer_premium.yamlcase "A Scottish carer with both Carer Support Payment and the carer element gets one premium" now cites para 6(1)(a) and (c) and para 5(2). That matches para 5(2) and 6(1) as quoted in the Axiom packet. The expected value is unchanged and passes. The CTR carer premium documentation now cites "paras 5(2) and (3)". Para 5(3) as quoted covers each partner who qualifies, so that citation is consistent.## Completion boundaryfollows thereview_findingblock and precedes## Companion cases, and it holds the parity-pending condition. The blocker is still at line 14 ("Queue this work underpe-parity…"). The provenance SHA reads260f6a77e…in its own sentence.Fixeslines,Reproducer:and the literalaxiom: <rulespec-uk issue> queuedline are all present.test_m14_private_cap.pygit ls-tree -r --name-only HEAD | grep -i "m14|private_cap"andgit diff --name-only 2da212abc HEAD | grep -ci "m14|private_cap"both find nothing (count 0). No test underpolicyengine_uk/testssetspytest_plugins. The household moved into the canonical test asPARITY_FAMILIES[6].Checked and sound
Production code unchanged. I compared the AST of each production Python file in
git diff --name-only 4613ac60f 260f6a77e -- policyengine_uk/variables policyengine_uk/utils, with docstrings anddocumentation =class assignments stripped. All 9 are identical:severe_disability_minimum_guarantee_addition,has_uc_award_with_carer_element,uc_award_upper_bound,council_tax_reduction_carer_premium,council_tax_reduction_premiums,carer_premium,is_cared_for_by_carer_benefit_recipient,pension_age_severe_disability_premiumandsevere_disability_premium. The only parameter change is thedescriptionofuc_award_includes_zero_value_award; its values are unchanged. The other changed files are the changelog fragment, two YAML test files and the property test file.New row's figures, worked by hand first and then run. The maximum amount is (£424.90 + £303.94) × 12 + 0.85 × £6,000 + £18,600 = £32,446.08. Above the lower work allowance of £427 × 12 = £5,124, the seeds give:
Under M14 each rises by £30,000 − £18,600 = £11,400. A witness script read the model's endpoint and bound values (it calls
endpoint_valuesandparity_situationfrom the test module on the four seed rows):These match the hand figures and the body's figures to the penny.
Mutants. All three ran with
pytest -q -o xfail_strict=true -n 2 … -k "upper_bound_matches_real_award_endpoints or the_bound_reads_every_component_of_the_maximum_amount". Before them, the unmutated head gave2 passed in 33.81s.[rent, capped_rent_amount]→[rent, rent]inuc_award_upper_bound.py): killed,1 failed, 1 passed. The endpoint test fails on exactly the 18 rows the author named:array([ 24, 25, 26, 27, 70, 71, 72, 73, 74, 75, 76, 119, 120, 121, 122, 123, 124, 125]),assert not 18. The component check passes, as expected for a mutant that reads the same variables."uc_carer_element",removed from the bound's element list): killed,2 failed. The component check fails with "At index 3 diff: 'uc_childcare_element' != 'uc_carer_element'", and the endpoint test withwhere 28 = array([16…23, 56, 57, 58, 63, 64, 65, 105…118]).size. The count is 28, as the body says. The indices differ from the 4613ac6 run (52–54, 59–61, 94–107) because the new family adds boundary rows, which shifts them."child_benefit",added after"uc_childcare_element",inuc_maximum_amount.py): killed,2 failed. The component check fails with "Right contains one more item: 'child_benefit'", and the endpoint test withwhere 52 = array([...]).size. That matches the body's 52 of 126.Tests at this head:
test_uc_carer_element_award_properties.py, without its two Hypothesis tests,-n 4:7 passed, 3 xfailed in 40.45s. All three XFAIL reasons start "Pay the severe disability premium when a carer's award comes to nil #2795".2 passed in 61.54s.-p pytest_outcome_logand then.github/check_test_shards.py --mode source --data absentagainst.github/test_outcome_allowlist.toml. It printed "Every collected test ran in exactly one shard and passed, apart from allowlisted outcomes.", exit 0, with 12 outcome records. The small-housing xfail reason text changed in this delta, and the allowlist'sreason = "#2795"regex still matches it.uc_carer_element_carer_test.yaml10 passed andcouncil_tax_reduction_carer_premium.yaml12 passed. The 10-file reader batch listed in the body gave180 passed,gov/local_authorities/council_tax_reduction/343 passedandfinance/benefit/family/housing_benefit/584 passed. Every count matches the body.test_severe_disability_addition_properties.pyandtest_severe_disability_premium_properties.py:-n 4, whole files:7 passed in 249.38sand6 passed in 136.70s, the hub's counts at4613ac60f.git archiveof main2da212abc. There,test_issue_households_read_the_carer_element_awardfails withE assert np.float32(4474.6) == 0, as the body says.Lint:
uvx ruff@0.17.2 format --checkon the changed Python files ("10 files already formatted"),ruff check("All checks passed!"),ruff check --select F811,F821 policyengine_uk("All checks passed!") andgit diff --check 4613ac60f 260f6a77e(exit 0).Merges. I fetched first, then ran
git merge-tree --write-tree --name-only 260f6a77e… <sha>:2da212abcf2086337fc088a4a1236f4ae7b6af63fix-1971-enhanced-disability43a545dcb2d56d37e693743657699e042d18f804council_tax_reduction_premiums.pyfix-1933-ctr-pensioner-childrenc5b07aec7e28d84114efe49600eb54e055a85c14fix-1933current heade8831fb6b295d0c959b4694913574366997b26b3c34662736e0c19fe948f85e959a6a3bcd475c023origin/mainnow ata8ddb927c560a4e0e96376d51d09361ad9a470ddorigin/mainhas moved past the hold SHA: #2751, State Pension rounding, has merged. That merge is clean too. These are textual checks; I ran no tests on merged trees.Writing in the delta. The new YAML and documentation comments name actors: DWP, councils and the Scottish Ministers. The durable comments the delta touched no longer carry fix history. The test docstring dropped "the attribution as it ran before the limb" and the pointer to the PR's differential, and the reproducer comment dropped "also runs on the old code". The remaining voice nits are P3-2 and P3-3.
What I couldn't check
260f6a77eoftest_legacy_carer_premium_properties.py,test_pension_age_severe_disability_premium_properties.py,test_disable_simulated_benefits_carers.py,test_legacy_award_readers_properties.pyandtest_council_tax_reduction_severe_disability_family.py, and the 150-household differential. I didn't rerun them; they rest on hub logs I can't read. With production code unchanged, they still describe these formulas.uc_non_dep_receives_pension_creditinuc_non_dep_deduction_exempt, but I couldn't confirm the sub-paragraph letter. The same applies to SPC Regs 2002 Sch I para 2(2)(b), which the YAML now cites for ignoring the blind son. legislation.gov.uk doesn't resolve from this session.r4/,local-runs/2120/).Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Picking this up for the UK hub. Reply here if you're mid-change and I'll stop.
Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_TITLE.txtGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_BODY.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Head:
fff13eda816c608a8dbe2e064131472363fae9f7on branchclaude/uc-carer-awards-nits-1pezj2. This session can only push toclaude/...branches, sofix-2120-uc-carer-awardsstill sits at260f6a77e. The new branch is that head plus one commit.Draft PR: #2827 (opened once, at the end, after the commit; nothing pushed since).
Pre-start check:
fix-2120-uc-carer-awardswas at260f6a77e, the brief's base. Its last commit is dated 10:18Z, about 5 h 40 min before I started (15:59Z), so it falls inside the 6-hour window. It is the brief's own base, though, and nothing was pushed after it. Neither comment on #2120 said anyone was mid-change, so I went ahead and posted the pick-up comment.Findings
policyengine_uk/variables/gov/dwp/universal_credit/uc_award_upper_bound.py:16-21. I gave the PR body's first Changes bullet the same wording so the two agree.severe_disability_premium.py:22-25now reads "is_cared_for_by_carer_benefit_recipient attributes each carer benefit to the person it is paid for caring for, and the Pension Credit severe disability addition shares it".severe_disability_minimum_guarantee_addition.py:27-30has the same sentence, ending "and the legacy severe disability premium shares it".is_cared_for_by_carer_benefit_recipient.py:42-44now reads "The model does not observe carers outside the household, nor a carer whose allowance runs on…".uc_carer_element_carer_test.yaml:8-10: the 93-character header line. The review's "line 194" quote ("…DWP includes the carer element for regular and substantial caring") is actually at line 8.uc_carer_element_carer_test.yaml:194-203: the# Earningsorphan.council_tax_reduction_carer_premium.yaml:229-230: "Neither of".:163-165: an 84-character line in the comment of the nil-award case.Citations (item 5), checked against the quoted text
uc_carer_element_carer_test.yaml:10("regs 29 and 30(2)");is_cared_for_by_carer_benefit_recipient.py("UC Regs 2013 reg 30").uc_award_upper_bound.py, "Sch 4 para 16(2)(b)").uc_carer_element_carer_test.yaml:240and the body's small-housing route.uc_non_dep_deduction_exempthas no para 15 test.uc_carer_element_carer_test.yaml:84-85.test_uc_carer_element_award_properties.py:599-601) say "para 15 does not exempt her as a renter". That holds under para 15(1)(a), because the carer is not blind and gets no listed benefit. But para 15(1)(b) exempts "any joint renter where at least one joint renter is a person to whom sub-paragraph (2) applies", and the disabled co-tenant receives the PIP daily living component (15(2)(d)). Whether he is a "joint renter" depends on Sch 4's definition of that term, which nobody has quoted. If the definition covers a co-tenant outside the claimant's benefit unit, that Pay the severe disability premium when a carer's award comes to nil #2795 route's premise is wrong. I stopped on this item, as the brief says to when a provision is unquoted.Text-only check (item 6),
260f6a77e→fff13eda8Python ASTs are compared with module, class and function docstrings and
documentation =assignments blanked. YAML is compared withyaml.safe_load, which drops comments.uc_award_upper_bound.pysevere_disability_premium.pysevere_disability_minimum_guarantee_addition.pyis_cared_for_by_carer_benefit_recipient.pyuc_carer_element_carer_test.yamlcouncil_tax_reduction_carer_premium.yamlAs a negative control, the same script over
4613ac60f→260f6a77ereports DIFFERS foruc_award_includes_zero_value_award.yamland the property test file, so it does detect changes.Tests at
fff13eda8(4 vCPU,uv sync --frozen --extra dev, no HF token)uc_carer_element_carer_test.yamlcouncil_tax_reduction_carer_premium.yamltest_uc_carer_element_award_properties.py -n 4 -o xfail_strict=truetest_parameter_descriptions.py -n 4policyengine_uk/tests/code_health -n 4.github/check_fix_pr.pyon the final title and body, changes vs merge-base withorigin/main, full head SHAruff@0.17.2 format --check .ruff check .ruff check --select F811,F821 policyengine_ukgit diff --checkMerges (
git merge-tree) fromfff13eda8:origin/main47bda0a7a,fix-1933-ctr-pensioner-childrene8831fb6b,hb-ctr-non-dep-exemptions97f792542, Derive economic assumption index horizon from the growth series #2756c34662736, Disregard WTC before the Housing Benefit childcare deduction #27761d4a3e475, Add a trading allowance claim status, so allowance reforms reach claimants without turnover data #2765edda47ea2and Carry unused Income Tax trading losses forward once #2661f06ae765f.fix-1971-enhanced-disability43a545dcbconflicts only incouncil_tax_reduction_premiums.py, as before.main.779f5dcfdnow conflicts inCHANGELOG.md,pyproject.tomlandtest_means_test_income_properties.py, against both this branch andmain.Skipped and why
Judgment calls
fff13eda8for the runs above, and code_health and parameter descriptions are added.mainmerge and the moved heads of Add a trading allowance claim status, so allowance reforms reach claimants without turnover data #2765 and Carry unused Income Tax trading losses forward once #2661, and corrects Give Scotland and Wales working-age CTR their own rules #1966's conflict list.Fixeslines,Reproducer:, theaxiom:line and the 🤖 line are unchanged.claude/uc-carer-awards-nits-1pezj2because this session cannot push tofix-2120-uc-carer-awards.Generated by Claude Code