Repository navigation
Add UC claimant-only LCWRA, carer and work allowance companion cases - #405
Merged
Merged
Conversation
Reg 27(4): one LCWRA element for joint claimants who both have LCWRA at the same amount, the higher amount when the first is higher, only the first's amount when only the first has LCWRA, and the pre-2026 amount for a single claimant. Each claim type ignores the other type's slots. Reg 29(4) parenthetical: a joint claimant who is a carer with LCWRA keeps the carer element when the LCWRA element is included for the other joint claimant, and has the LCWRA element only when it is not. Reg 29(2): not both carer elements for the same severely disabled person, when only one qualifies, or on a single claim. Reg 22(1)(b): a work allowance from limited capability for work alone (no child), for joint and single claimants, with and without housing costs; no work allowance with neither; reg 22(3) for a member of a couple claiming as a single person. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
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.
Adds 23 companion cases to
uk/regulations/uksi/2013/376/{22,27,29}.test.yaml: claimant-only LCWRA and work-allowance inputs, the reg 29(4) joint-claimant parenthetical, and reg 29(2)'s limits on two carer elements. No module bytes change.Why now
PolicyEngine/policyengine-uk#1989 changes LCWRA, carer elements and work-allowance eligibility to use the claimants' circumstances. These cases establish the existing atomic RuleSpec behavior independently from PolicyEngine. The ProgramSpec carer composition and benefit-cap receipt/entitlement scopes are queued separately; this PR does not claim those integration paths are correct.
Hand-computed expectations
The expectations come from UC Regs 2013 reg 27, reg 29, reg 22, and reg 36's table, using the revised CLML fetched 2026-10-01. WRA 2012 s 40 defines “claimant” as a single claimant or each of joint claimants. All households are synthetic.
The period conventions match the existing files:
2026-04for regs 22 and 27; a custom one-day period,2026-04-06through2026-04-06, for reg 29's Day judgments. The £429.80 case supplies the reg 36 amount for a pre-2026 claimant in the 2026-27 regime; it is not a test of a historical assessment period or of upstream rate selection.Reg 27: one LCWRA element, claimant slots only
The only asserted output is
universal_credit_award_lcwra_element_included_amount. The reg 36 amounts are explicit test inputs. Reg 27(1)-(2) includes the qualifying claimant's amount; (4)(a)-(b) permits one element and selects the higher amount when both qualify.joint_claimants_both_lcwra_at_same_amount_include_one_elementjoint_claimants_both_lcwra_include_one_higher_amount_when_first_is_higherjoint_claimants_only_first_has_lcwra_include_first_amountjoint_claim_with_neither_lcwra_ignores_single_claimant_slotsingle_claimant_pre_2026_lcwra_includes_higher_regulation_36_amountsingle_claim_ignores_joint_claimant_lcwra_slotsReg 29: LCWRA priority and the joint-claimant exception
Reg 29's atomic module exposes inclusion judgments; its monetary output is deferred (29.yaml:9). These cases assert those judgments, not a monetary amount. The first six assert
claimant_carer_element_included; the last three assertboth_joint_claimants_carer_elements_included.joint_claimant_carer_with_lcwra_keeps_carer_element_when_lcwra_element_is_included_for_other_claimantjoint_claimant_carer_with_lcwra_has_lcwra_element_only_when_not_included_for_other_claimantsingle_claimant_carer_with_lcwra_has_lcwra_element_only_even_if_other_claimant_slot_is_setjoint_claimant_carer_without_lcwra_keeps_carer_element_when_other_claimant_has_lcwra_elementjoint_claimant_not_elected_for_same_severely_disabled_person_has_no_carer_elementclaimant_without_regular_and_substantial_caring_responsibilities_has_no_carer_elementjoint_claimants_caring_for_same_severely_disabled_person_not_both_includedjoint_claimants_not_both_included_when_only_one_qualifiessingle_claim_never_includes_two_carer_elementsReg 22: limited capability alone gives the work allowance
Reg 22(1)(b) gives a work allowance for claimant LCW even without a child. Under (2), the allowance is £710 without a housing costs element and £427 with one. The earned deduction is 0.55 × max(0, E − allowance), or 0.55 × E when neither condition is met. The total deduction adds U under (1)(a). Reg 22(3) uses the joint-claimant calculation for a couple member claiming as a single person.
The table shows every asserted output: effective joint-claimant judgment (J), work-allowance judgment (WA),
earned_income_for_deduction(E),unearned_income_for_deduction(U),applicable_work_allowance_amount(A),earned_income_amount_subject_to_taper(T),earned_income_deduction_from_maximum_amount(D), anduniversal_credit_award_deduction_from_maximum_amount(total).joint_claimants_without_child_one_with_lcw_higher_work_allowance_without_housing_costsjoint_claimants_without_child_one_with_lcw_lower_work_allowance_with_housing_costssingle_claimant_with_lcw_and_no_child_higher_work_allowance_without_housing_costssingle_claimant_with_lcw_and_no_child_lower_work_allowance_with_housing_costssingle_claimant_without_child_or_lcw_has_no_work_allowance_with_housing_costsjoint_claimants_without_child_or_lcw_have_no_work_allowancesingle_claim_ignores_joint_claimant_child_and_lcw_slotsmember_of_couple_claiming_as_single_with_partner_lcw_uses_joint_work_allowanceVerification
Unsigned local
python -m axiom_encode.cli testat current-main CI pins: axiom-encodec326d1ac0acdb557f047a3054160b19dd72602fa; axiom-rules-engine05eac9d2f89dabe5c6673176260762cef3a58f47, built from the exact pinned source in scratch. All three runs returnsuccess: trueand empty failure lists.22.test.yaml27.test.yaml29.test.yamlRepository
pytest tests -p no:cacheprovider: 26 passed, 2 skipped.git diff --checkpasses. Saved JSON logs, the reproducible runner, pinned-source metadata and the engine-build log are in a local scratch checkout; the completion report records their exact paths. These are synthetic companion tests; no paid encode, signing, oracle or survey-data run was made.CI: Repository Checks is green and terminal:
validate / shards,validate / validate (uk)andvalidate / validatepassed;drift-alarmwas skipped as expected on a pull request. Backgroundgh pr checks --watchexited 0. The PR is ready for review and remains unmerged.Scope
This follows the test-only companion pattern of #391. The atomic modules use claimant-specific slots (27.yaml:43, 22.yaml:151); reg 29(4)'s parenthetical is present (29.yaml:42). The tests establish these paths as encoded-correct for parity, conditional on correctly projected claimant inputs. They do not establish which members an upstream runtime places in those slots.
Queued separately: #404 covers claimant-only ProgramSpec carer composition and independent oracle projections; the scope comment on #389 covers reg 83 receipt/entitlement limbs. The atomic tests here do not close either queue.
🤖 Generated with Claude Code
Verification at the merged head (2026-10-12)
The verification links above describe the original 2026-10-01 head. Before merging, main was merged in (head
faad423a). CI is green at that head, and an independent review re-checked all 23 expectations against the regulations: reg 22's 2026-04-06 table, reg 27, reg 29 and the reg 36 amounts. It confirmed that only the three companion files change.