Repository navigation
Conversation
…ze criteria Universal Credit: a qualifying young person the renter is responsible for has a bedroom (UC Regs 2013 Sch 4 para 10(1)(b)), and any other member aged 16 or over is a non-dependant with one (para 9(2), 10(1)(c)), except a qualifying young person no one is responsible for (para 9(2)(g)). Housing Benefit: every member aged 16 or over other than the claimant or partner is a person who is not a child (HB Regs 2006 and HB (SPC) Regs 2006 reg 13D(3)(b); reg 2(1)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YAML cases for a qualifying young person aged 17 and 19, an 18-year-old non-dependant, a looked-after qualifying young person (no UC bedroom), a couple with a young person and two younger children (category E), a partner aged 19 (no extra bedroom) and a pensioner couple's grandchild under HB (SPC). Two LHA_claimant_composition cases asserted the old one-bedroom count for an apprentice non-dependant and an 18-year-old qualifying young person; both are now two bedrooms (Sch 4 para 10(1)(c) and (b)). Hypothesis properties: bedrooms never fall when a person aged 16-19 joins any family; the exact change when they do; and agreement with an independent count of the size criteria, children's rooms found by brute force. Fixes #2008 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o lha-bedroom-young-people
This was referenced Oct 1, 2026
Open
Draft
…milies; one HB bedroom for an occupier couple Review findings on #2010: - UC Sch 4 para 9(2)(g) applies to the whole extended benefit unit, so a qualifying young person no one is responsible for (reg 4(6)) in a non-dependant's family adds no bedroom for the household head. - HB reg 13D(3)(a): an ordinary occupier couple outside the claimant's family shares one bedroom (DWP circular HB A3/2017); only non-couple occupiers aged 16 or over take one each under (b). The property oracles encoded both errors as law; they now count the law, and two YAML cases pin the cross-family results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take #2006's housing_benefit_LHA_allowed_bedrooms.py whole: its rewrite over the claim's occupiers already gives the benefit unit's own members aged 16 or over a bedroom (reg 13D(3)(b)) and an occupier couple one bedroom (13D(3)(a)), so #2010's HB change is dropped and its HB YAML cases stay as tests. Keep #2010's UC change on top of #2006's LHA_allowed_bedrooms.py: the family term (para 10(1)(b), (c)) and the para 9(2)(g) exclusion on the non-dependant count, which now goes to uc_non_dependants_counted's claim. The exclusion stays in the UC formula, not in is_non_dependant_of_household_head, because that variable also feeds HB and CTR, where para 9(2)(g) does not apply. The property oracles follow #2006's claim rules: UC non-dependants count in the uc_non_dependants_counted claim, and every family liable for the rent counts the HB occupiers, with their children pooled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o lha-bedroom-young-people
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2008
Stacked on #2006 (base
benefit-unit-rent-liability, at 7769fa3, which includesmainand #1896). Retarget tomainonce #2006 merges.Problem
The LHA size criteria gave no bedroom to a member of the benefit unit aged 16 or over who is not the claimant or partner. The commonest case is a young person at school or college living with a parent.
LHA_allowed_bedrooms(Universal Credit) counted:So a lone parent with a 17-year-old at college was assessed for one bedroom (category B) instead of two (C).
mainsubtracts every benefit-unit member aged 16 or over from the household count, which has the same effect. Housing Benefit had the same gap until #2006's rewrite ofhousing_benefit_LHA_allowed_bedroomsover the claim's occupiers, which this PR now builds on.The law
Universal Credit. UC Regs 2013 Sch 4 para 10(1) says "A renter is entitled to one bedroom for each of the following categories of persons in their extended benefit unit". The categories are:
Para 9(2) makes anyone else aged 16 or over who normally lives with the renter a non-dependant. The exception relevant here is (g): "a child or qualifying young person for whom no-one in the renter's extended benefit unit is responsible", such as a young person looked after by a local authority (reg 4(6)). It applies across the whole extended benefit unit, so it covers a looked-after young person in a non-dependant's family too.
A child is a person under 16 (WRA 2012 s.40). A qualifying young person is defined in reg 5.
Housing Benefit. HB Regs 2006 and HB (SPC) Regs 2006 reg 13D(3) (SI 2006/213, SI 2006/214) give "one bedroom for each of the following categories of occupier", including "(a) a couple" and "(b) a person who is not a child", where a child is "a person under the age of 16" (reg 2(1)). An ordinary couple shares one bedroom; DWP circular HB A3/2017 confirms that only a couple who cannot share because of disability has an extra one.
Change
UC (
LHA_allowed_bedrooms). Each member of the benefit unit aged 16 or over who is not the claimant or partner gets a bedroom:is_child_or_qualifying_young_person_for_universal_credit), under para 10(1)(b);A qualifying young person no one is responsible for is not a non-dependant (para 9(2)(g)). This exclusion also applies to the count of non-dependants from other families, which now goes to the claim in #2006's
uc_non_dependants_counted.The exclusion is in the UC formula, not in
is_non_dependant_of_household_head, because that variable also feeds Housing Benefit's non-dependant tests and deductions, where para 9(2)(g) does not apply. (Council Tax Reduction classifies non-dependants separately.)HB. No code change here: #2006's rewrite already gives the benefit unit's own members aged 16 or over a bedroom under reg 13D(3)(b), and gives an occupier couple one bedroom under (a). This PR adds HB test cases and properties for both.
Why the UC rule covers non-dependants as well as qualifying young people. The issue's UC example is the qualifying young person. A benefit-unit member aged 16 or over who is not a qualifying young person is, in law, a non-dependant with their own bedroom. On the enhanced FRS that group is 19k people in 20 survey households, against 1.95m qualifying young people.
Invariants
The Hypothesis properties are in
test_lha_bedroom_young_people_properties.py. Each runs 25 derandomized examples over populations of up to 4 households with sharers, boarders, lodgers and non-dependant families.Monotonicity. Adding a person aged 16 to 19 to any family never lowers any family's UC or HB bedrooms. This holds whether the claimant and partner are supplied or inferred.
Exact effect. When the added person is not the claimant or partner, these changes happen and nothing else:
Reference agreement (differential). Every family's bedrooms equal an independent count of the size criteria under both schemes:
This also checks
child_bedrooms' greedy pairing against the optimum on every generated family.The corrected reference property fails on #2010's previous formulas, which counted an occupier couple as two HB bedrooms.
Tests
LHA_young_person_bedroom.yaml, 9 cases at 2026:The £ expectations use a rent of £200 a week. That sits between the published Maidstone one- and two-bedroom rates (VOA LHA April 2024, held for 2025-26: B £172.60, C £208.27), so the expectations do not depend on the model's rate table.
LHA_claimant_composition.yaml: two cases asserted "existing bedroom formula = 1: B", for a 17-year-old apprentice non-dependant and an 18-year-old qualifying young person. Both are now C, citing para 10(1)(c) and (b).Full YAML suite (
policyengine-core test policyengine_uk/tests/policy -c policyengine_uk): 1,518 passed on 6e6234d. On 2a88024, which adds only Give sharers, boarders and lodgers their own rent, tenure and LHA category #2006's merge ofmain, the three bedroom and rent files (40 cases) pass, and CI runs the full suite once this PR targetsmain.Full pytest (
pytest policyengine_uk/tests --ignore=policyengine_uk/tests/microsimulation) on 6e6234d: every one of the 2,069 collected tests ran, with 0 failures and 0 errors (19 skipped). It took three invocations, because the host's tool time limit cut off the first two.Hypothesis properties (
pytest policyengine_uk/tests/test_lha_bedroom_young_people_properties.py) on 2a88024: 3 passed.Formatting:
ruff formatandruff checkon the changed files are clean.Impact (real microsimulation)
The data is the released enhanced FRS 2024-25 (policyengine-uk-data 1.57.4,
enhanced_frs_2024_25.h5, sha25603fe15e4…), for 2026. The base is #2006's head, 7769fa3; the branch is 2a88024. Both runs use the same dataset. Earlier runs against #2006's pre-mainheads gave the same bedroom counts and UC within £1m.Every figure below has at least 10 distinct survey households contributing to it, and no suppressed cell can be recovered by subtracting published ones.
About half of the element's rise is in benefit units with no UC award, where it changes nothing. Within UC awards, the remaining gap reflects income means-testing for newly positive awards, the benefit cap and UC deductions.
In fewer than 10 survey households, the LHA cap falls when the bedroom count rises. This is because in 5 of 200 BRMAs the model's rate table prices a larger category below a smaller one; #2022 (published LHA rates) addresses that.
Known gaps (other PRs)
Review
The first independent review (Subfleet, Codex lane) of 7c6f5f3 requested changes, and all five findings are fixed:
The model now matches the first two oracle findings: a code fix for UC, and #2006's HB rewrite for the couple. A second review of 2a88024 is running.
Documentation
The variable's
documentationfield describes the new rule. The Housing Benefit docs notebook does not cover the size criteria.axiom: uk/regulations/uksi/2013/376/schedule/4/paragraph/10 (UC Sch 4 para 10(1)(b), (c)) encoded-correct, companion cases in TheAxiomFoundation/rulespec-uk#408 (merged) | HB Regs 2006 / HB (SPC) Regs 2006 reg 13D(3)(a), (b): TheAxiomFoundation/rulespec-uk#406 queued (addendum: TheAxiomFoundation/rulespec-uk#406 (comment))
🤖 Generated with Claude Code
Reproducer:
policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_claimant_composition.yaml::A 17-year-old apprentice in the renter's benefit unit is a non-dependant,policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_claimant_composition.yaml::Lone parent with an 18-year-old qualifying young person,policyengine_uk/tests/policy/baseline/finance/benefit/family/LHA_young_person_bedroom.yaml,policyengine_uk/tests/test_lha_bedroom_young_people_properties.py::test_adding_a_person_aged_16_to_19_never_lowers_bedrooms,policyengine_uk/tests/test_lha_bedroom_young_people_properties.py::test_exact_effect_of_adding_a_person_aged_16_to_19,policyengine_uk/tests/test_lha_bedroom_young_people_properties.py::test_bedrooms_match_an_independent_count_of_the_size_criteria