Repository navigation
Give children and couples who cannot share a bedroom their own bedrooms in the LHA size criteria - #2080
Give children and couples who cannot share a bedroom their own bedrooms in the LHA size criteria#2080MaxGhenis wants to merge 6 commits into
Conversation
…ms in the LHA size criteria UC Regs 2013 Sch 4 para 12(6), (6A), (8), (9)(c)-(d) and HB Regs 2006 / HB (SPC) Regs 2006 reg 13D(3)(za), (zb), (ba) and closing words. A child who cannot share is taken out of the children's pairing and has a room of their own; a couple one of whom cannot share has a bedroom each. Housing Benefit allows these bedrooms only where the dwelling has them (num_bedrooms; assumed where not reported). New input cannot_reasonably_share_bedroom_due_to_disability. In force from 4 December 2013 (children) and 1 April 2017 (couples); attendance allowance only at the higher rate before 27 January 2025 (SI 2025/3). Fixes #2069. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The property generator now flags none, the first or both adults of a couple, so the Housing Benefit count of one further bedroom per occupier couple, however many members qualify, is exercised. Adds the matching YAML case for a non-dependant couple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coordination with #2084 (UC claim by a member of a couple as a single person, UC Regs 2013 reg 3(3)). UC Sch 4 para 12's disabled person condition applies where a renter "would ... be expected to share a bedroom with a joint renter". Where a member of a couple claims UC as a single person, the other member is not a joint renter. They are not a non-dependant either (Sch 4 para 9(2)(b)), and the renter has one bedroom (para 10(1)(a)). So that couple gets no extra room for not being able to share. That PR adds |
Invariant 8 always builds a couple from another family and flags one or both members: the couple's own claim gains one bedroom under each scheme, and the household head's family one Housing Benefit bedroom when the couple are occupiers it counts. A mutation that counted a bedroom per qualifying member survived the reference test's 25 examples; this test pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#2062 is now on This PR still adds formulas that read the raw flag:
Each needs to read the resolved head instead:
|
juaristi22
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-uk
PR number: 2080
Reviewed head SHA: 4e7cfd7
Merge base SHA: 1f3ce21
Mode: full
Scope: All 18 changed disability cannot-share LHA bedroom paths and affected UC/HB category, rent-cap and award dependencies; inherited parent audit and private impact excluded
Source manifest: /private/tmp/policyengine-command-runs/881387a1b745/pr2080-hb1141-review-20261027-review-sources.json
Review status: PARTIAL
Source Documents
- authorized-1.original — cached original.
- authorized-4.original — cached original.
- authorized-5.original — cached original.
- authorized-6.original — cached original.
- authorized-9.original — cached original.
- authorized-11.original — cached original.
- authorized-18.original — cached original.
- authorized-19.original — cached original.
- authorized-1.original — cached original.
- authorized-2.original — cached original.
- authorized-3.original — cached original.
- authorized-4.original — cached original.
- authorized-pdf-1.original — cached original.
Critical
None.
Should Address
None.
Suggestions
None.
Evidence Gaps
- CODE G1 — Exact-head execution remains unverified: captured matching-head CI is null, and local imports, collection, 27 new YAML cases, eight properties and affected UC/HB final-award regressions were NOT RUN. Static parameter/date/entity/oracle traces do not establish their combined runtime behavior. Qualified matching-head CI or focused integrated execution is needed; author-reported results are not reviewer execution.
- POLICY-G1 — Historical UC AFIP inclusion for 2017–24 remains unresolved: the broad regulation 2 attendance-allowance definition must be reconciled with the former paragraph 12(6A) higher-rate qualifier. The acquired amendment and current DWP guidance do not conclusively settle that historical interaction; the older-guidance URL redirected to a current edition. This is missing qualification, not a confirmed wrong rule.
- Role checks incomplete: pr2080-hb1141-review-20261027-review-code.md; see recovered report.
- Role checks incomplete: pr2080-hb1141-review-20261027-review-policy.md; see recovered report.
Notes
- No introduced implementation or policy defect was confirmed in the reviewed change. The scheme-specific child/couple allocation, HB physical-bedroom proviso, principal dates and neutral defaults have source-supported static results. The two material checks above prevent approval.
- The pre-effect parameter-access question was resolved by CODE using the owned UK backdating helper: earliest leaves are supplied from 2015, while the in-effect masks stay false. No supported-2015/16 exception was established; this is not an additional finding or evidence gap. No model execution or pre-2015 support is claimed.
- The inherited Scottish working-age CTR adoption-mask issue already reported on PR2030 is parent context. This review does not relabel it an introduced PR2080 defect or certify the whole stack. Private survey judgement/bedroom coverage, default assumptions, Scottish benefit mapping, upper-bound population counts, calibration and adoption remain unverified.
- Eight exact prior official originals/derivatives were reused with explicit hash/applicability qualification; five genuinely missing official originals were acquired. Old PR2030 originals and its closed source window remain unchanged. Current guidance is not backdated to 2024.
- The 62.730-second scope phase includes dispatch/coordinator overhead and missed its 60-second aim; original wall time and role/source clocks are retained. Parallel review timing includes dispatch overhead and overlaps the scope phase; these spans must not be summed. The first cleanup inspection guessed a receipt key and stopped before any git command; normal cleanup then completed using the actual schema.
- Generic partial-role aliases added by the assembler refer to the two specific material gaps above. They are not four distinct missing checks.
Validation Summary
Local tests, country/Core imports, collection, model execution and environment work: NOT RUN. Exact-head hosted CI was null. CODE inspected all 18 paths, all 927 YAML lines and the 692-line property module, traced final UC/HB award consumers and parsed 12 changed Python files as AST. POLICY bound 13 official originals/full-text derivatives (8 reuses, 5 new); source window 179.231236/300s CLOSED and manifest checker0. One official DWP PDF was fully text-extracted, with relevant pages inspected and physical page22 rendered; its current edition does not establish historical 2024 guidance. Both roles finished within 600s. Snapshot removed normally after both DONE; hub retained. No private/log/artifact reads, author edits or issue work.
Timing
setup seconds: 75.15s; scope seconds: 62.73s; parallel review seconds: 462.02s; policy role seconds: 348.07s; code role seconds: 423.94s; adjudication seconds: 0.00s; consolidation cleanup seconds: 85.93s; elapsed seconds: 663.58s; source acquisition window seconds: 179.23s
Review Severity
COMMENT. Open findings: 0 critical, 0 should address, 0 suggestions.
Main restructured the size criteria after #2016's base (1f3ce21): UC non-dependants now count in the one claim uc_non_dependants_counted names (other_family_non_dependants), and the HB formula totals over the claim's occupiers, with the household's other families counted by every family liable for the rent and a child placed with a non-dependant, boarder or lodger counted as an occupier. Main's structure is kept and this PR's rules re-applied inside it: - bedrooms_for_children keeps main's counts_other_children and gains cannot_share; universal_credit_child_bedrooms gives LHA_allowed_bedrooms and LHA_cannot_share_bedrooms the same children. - HB: main's formula body is housing_benefit_bedrooms_if_able_to_share, over the helpers housing_benefit_occupiers_total and housing_benefit_child_bedrooms; housing_benefit_LHA_cannot_share_bedrooms gives a room to each counted child who cannot share and one more to each counted couple of occupiers one of whom cannot share, within the dwelling proviso. - The property test takes main's invariants 1-9 and adds the PR's as 10-12, with the reference count (5) extended on main's claim roles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Household net income by decileNo household's net income changes in any year. No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles; standard reform costings (change in gov_balance); standard reforms: change in each reform's target. Checks failing on both base and head (1)
Counted-once checkThe check raised each of 92 components by £1 per unit in 2026-27 and read every head of its totals 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 response that is not finite breaks every rule. The check measures a head that breaks a rule twice more: once holding every other head at its baseline value, and once holding every other head at its value after the first £1 while the component rises again. The head fails where either measurement still shows the response. The check cannot hold a head at a value that is not finite. In each unit where another head is not finite after the first £1, it holds that head at its baseline value, and the second measurement judges no household the unit belongs to. There a head fails wherever it first broke a rule, or wherever the check could not confirm whether its response contains the component. 0 failed and the check skipped 0.
Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
vahid-ahmadi
left a comment
There was a problem hiding this comment.
1. UC gives the disabled-person room when a member of a couple claims as a single person.
-
In
policyengine_uk/variables/gov/dwp/LHA_cannot_share_bedrooms.py:50-52, the para 12(6A) room depends onis_member_of_couple_who_cannot_share_bedroom. -
That variable (
is_member_of_couple_who_cannot_share_bedroom.py:36-38) checks onlyis_claimant_or_partner & is_couple. Neither variable readsuc_member_of_couple_claims_as_single_person. -
The law. Para 12(6A) requires the renter to be someone who "would ... be expected to share a bedroom with a joint renter" (UC Regs 2013 Sch 4 para 12). Sch 4 para 1(2) defines "joint renters" as "joint claimants to whom regulation 26(2) applies" (para 1). A member of a couple who claims as a single person under reg 3(3) has no joint claimant, so has no joint renter. The 2 Oct coordination comment on this PR reaches the same conclusion ("should give no room where it is true").
-
Example at this head. 2026, Maidstone, private rent £20,000. The claimant is 40, receives
pip_dland hascannot_reasonably_share_bedroom_due_to_disability. The partner is 17 with no reg 8 circumstance, souc_member_of_couple_claims_as_single_personis true.Run LHA_cannot_share_bedroomsLHA_categoryuc_housing_costs_elementThis household 1 C £10,860 Same household, cannot-share flag off 0 B £9,000 The extra room is worth £1,860 a year here.
-
Control. Give the same partner 35 care hours (reg 8, so the couple claims jointly) and the room is still given, which is correct.
-
Suggested fix. In
LHA_cannot_share_bedrooms, ANDdisabled_person_roomwith~benunit("uc_member_of_couple_claims_as_single_person", period), and add a YAML case.- Put the mask there, not in the person variable, because
housing_benefit_LHA_cannot_share_bedroomsalso reads the person variable. HB has no single claim.
- Put the mask there, not in the person variable, because
2. The Fix evidence check fails: "Missing named reproducer".
- The PR changes model source and adds
changelog.d/2069.fixed.md, so the body needs aReproducer:line. - A case from
LHA_cannot_share_bedroom.yamlwould do, for exampleReproducer: policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_cannot_share_bedroom.yaml::A member of a couple who cannot share with the other has a second bedroom.
Review drafted with AI assistance and checked against the code at 422c044.
UC Regs 2013 Sch 4 para 12(6A) gives the bedroom only where a renter would otherwise share with a joint renter, and para 1(2) makes joint renters joint claimants. A member of a couple who claims as a single person under reg 3(3) has none, so LHA_cannot_share_bedrooms now masks the couple room with uc_member_of_couple_claims_as_single_person. Housing Benefit, which has no single claim, keeps the room. Three YAML cases pin it. A single claim beside a 17-year-old partner gives no room and the one-bedroom category. A partner whose care hours let the couple claim jointly keeps the room. A single claim supplied as an input removes it too. In each, Housing Benefit still gives the couple a bedroom each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review at
The single-claim rule also went to Axiom as an addendum on rulespec-uk#411. CI is running at the new head, and an independent review of the commits since |
UC Regs 2013 Sch 4 para 12(6A) needs a joint renter to share with, and para 1(2) makes joint renters joint claimants. The mask read only uc_member_of_couple_claims_as_single_person, which stays false for a claimant over the State Pension Credit age, so a single claim on the SI 2014/1230 reg 60A route kept the room (2 bedrooms, category C). LHA_cannot_share_bedrooms now also requires two UC claimants (is_uc_single_or_joint_claimant). The flag still covers a single claim supplied as an input. New YAML case: the reg 60A household from reg_60a_working_tax_credit.yaml (claimant 70, partner 17 on Working Tax Credit) on attendance allowance and flagged, renting privately in Maidstone: UC 0 additional bedrooms, 1 bedroom, category B; HB still a bedroom each. The docstring and changelog now state the exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An independent review of the change from 3224946 to 884f42b raised no findings. A member of a couple who claims singly under regulation 3(3) has no joint renter under Schedule 4 paragraph 1(2), including when they qualify under regulation 60A. The fix counts When more than two people have claimant or partner flags, a disabled third person can still meet the shared disability test ( Code changes and Aggregate impact are still running at 884f42b, and no reviewer has approved this draft yet. |
Fixes #2069.
Reproducer:
policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_cannot_share_bedroom.yaml::A member of a couple who cannot share with the other has a second bedroom,policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_cannot_share_bedroom.yaml::A member of a couple who claims as a single person has no Universal Credit bedroom for not sharing,policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_cannot_share_bedroom.yaml::A claimant over pension age who claims alone on the reg 60A route has no Universal Credit bedroom for not sharingWhat changes
The LHA size criteria now give bedrooms to children and couples who cannot share a bedroom because of disability. On
main, the UC and HB bedroom variables document these rooms as not modelled.New input.
cannot_reasonably_share_bedroom_due_to_disability(Person, default false) records the decision maker's or local authority's judgement. For a child it means the child cannot share with another child; for a member of a couple, with the other member.Children who cannot share (
is_child_who_cannot_share_bedroom): under 16, on the DLA care component at the middle or highest rate, and flagged.bedrooms_for_childrengains acannot_sharemask. Each counted child so marked has a room of their own, and the other children are paired as before. A room is therefore added only where the child would otherwise share.Couples, one of whom cannot share (
is_member_of_couple_who_cannot_share_bedroom): the claimant or partner of a couple, on attendance allowance, AFIP, DLA care at the middle or highest rate, or PIP daily living, and flagged.LHA_cannot_share_bedroomsgives the room only where the benefit unit has two UC claimants (is_uc_single_or_joint_claimant) and no single claim (uc_member_of_couple_claims_as_single_person, which a user can also set as an input). The claimant count also catches a claimant over the qualifying age for State Pension Credit who claims alone on the SI 2014/1230 reg 60A route, whom the single-claim flag does not mark.HB dwelling condition (13D(3), closing words). These bedrooms count only so far as the dwelling has bedrooms beyond the entitlement if everyone could share, including the (3A)/(3B) rooms. The dwelling's bedrooms come from
num_bedrooms. When it is 0, the default meaning "not reported", the room is assumed.Variables
LHA_additional_bedroomsnow addsLHA_cannot_share_bedrooms(UC).housing_benefit_LHA_allowed_bedroomsnow addshousing_benefit_LHA_cannot_share_bedrooms(HB).universal_credit_child_bedrooms(UC) andhousing_benefit_child_bedrooms(HB) count the children's rooms with or without the cannot-share flag.housing_benefit_occupiers_totaltotals a quantity over the claim's occupiers, andhousing_benefit_bedrooms_if_able_to_sharecounts the HB rooms if everyone could share. They count the peoplemain's size criteria count: in the UC claim that counts the household's non-dependants (uc_non_dependants_counted), and in each HB family liable for the rent.Dates
receives_higher_rate_attendance_allowance.Law checked
The citations follow legislation.gov.uk's revised texts as of 1 October 2026. For UC Regs 2013 Sch 4 paras 1, 9 and 12 and regs 3, 4 and 8, and for SI 2014/1230 reg 60A, they follow the texts as of 16 November 2026. For the amending SIs, they follow the texts as made.
legislation.gov.uk's revised text of 13D(3) has editorial errors in both HB instruments:
The model follows the amending SIs.
Judgement calls and limits
maindoes for the overnight carer's and foster child's rooms (Count other families' children and add the foster and overnight-care bedrooms in the LHA size criteria #2016).is_uc_single_or_joint_claimant) and the single-claim flag (uc_member_of_couple_claims_as_single_person).meets_uc_minimum_age_conditionto true. The model treats a partner who is a care leaver and cares as able to claim jointly.uc_is_ineligible_partnersupplied on the partner.Review responses
Vahid, review 5918312584 at 422c044
LHA_cannot_share_bedroomsnow gives the room only whereuc_member_of_couple_claims_as_single_personis false, as he suggested. Since884f42bb5, it also requires two UC claimants (is_uc_single_or_joint_claimant), because the single-claim flag stays false for a claimant over the qualifying age for State Pension Credit who claims alone on the SI 2014/1230 reg 60A route.is_member_of_couple_who_cannot_share_bedroom, because HB also reads that variable and has no single claim. The 2 October coordination comment reached the same reading of the law but named the person variable.LHA_cannot_share_bedrooms0,LHA_allowed_bedrooms1 andLHA_categoryB, with HB still giving a bedroom each (2). His run at 422c044 gave 1 and C where the case expects 0 and B.LHA_cannot_share_bedrooms0,LHA_allowed_bedrooms1 andLHA_categoryB, with HB still giving a bedroom each (2). At32249461ait fails, withLHA_cannot_share_bedrooms1 where it expects 0.LHA_cannot_share_bedrooms, and the changelog fragment, now state the exception.LHA_cannot_share_bedroom.yaml, which this PR adds.6 October comment: the resolved household head
At 422c044, none of this PR's formulas reads
is_household_head.test_only_the_resolved_head_reads_the_flagpassed in shard 3's log before that shard was cancelled.Tests
LHA_cannot_share_bedroom.yaml, 31 cases.policyengine_uk/tests/test_lha_bedroom_young_people_properties.py; invariants 1-9 come frommain):num_bedroomsdrawn from {unreported, 1..6}.Validation at
884f42bb5Local runs, with Python 3.12 and policyengine-core 3.34.9:
LHA_cannot_share_bedroom.yaml: all 31 cases passed.32249461a: failed, withLHA_cannot_share_bedrooms1 where it expects 0.universal_credit/reg_60a_working_tax_credit.yaml: all 7 cases passed.universal_credit/claims_as_single_person.yaml: all 33 cases passed.test_lha_bedroom_young_people_properties.py: 12 passed.LHA_cannot_share_bedrooms.pypasses the format and lint checks.CI on GitHub:
Runs at earlier commits
3224946: CI
884f42bb5replaced the head.422c044 (
mainat b007ac8 merged in): CImain(e4bc49e) withmain(b007ac8) on the enhanced FRS 2024-25 (policyengine-uk-data 1.58.1), fiscal years 2025-26 to 2031-32. No household's net income changed in any year, the change broke no check and the job flagged no move.4e7cfd7: local
LHA_cannot_share_bedroom.yaml: all 27 cases passed.Invariant 8 (now 12) passed.
Mutation checks: four broken copies of the model code, each run against invariants 5-8 (now 5 and 10-12). Each failed at least one property:
The couple mutant survived the reference test's 25 examples, so 4e7cfd7 added invariant 8 (now 12) to pin that effect exactly.
b2942e3: local
These runs predate the merge of
mainand the single-claim exception.LHA_cannot_share_bedroom.yaml: all 26 cases then in the file passed, and so did the 7 property tests then in the file.num_bedrooms, so the HB dwelling condition never bound.axiom: TheAxiomFoundation/rulespec-uk#411 queued (addenda TheAxiomFoundation/rulespec-uk#411 (comment) and TheAxiomFoundation/rulespec-uk#411 (comment)) | TheAxiomFoundation/rulespec-uk#406 queued (addendum TheAxiomFoundation/rulespec-uk#406 (comment); pointer on TheAxiomFoundation/rulespec-uk#357)
🤖 Generated with Claude Code