Skip to content

Keep Working Tax Credit age and hours conditions on the same worker - #2472

Merged
juaristi22 merged 1 commit into
mainfrom
fix-2042-wtc-worker-conditions
Oct 20, 2026
Merged

juaristi22 merged 1 commit into
mainfrom
fix-2042-wtc-worker-conditions

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Fixes #2042.

Working Tax Credit now requires the same claimant or partner to meet the qualifying age or disability condition and work the required hours. This prevents a worker borrowing a nonworking partner’s age or disability, two ordinary 15-hour workers qualifying for the 30-hour route, and a child’s hours completing the parents’ combined-hours requirement. The parental 24-hour route and existing other-disabled-partner exception proxy remain.

The corrected formula starts on 6 April 2012, when the joint-claim variations were inserted into regulation 4. It uses source-referenced age parameters and preserves the earlier formula. Annual 2012 still selects the earlier method under native period selection. The disability and partner-exception flags retain their existing limitations as proxies for regulations 9 and 13; amount, take-up, reported-award and closure rules are unchanged.

Reproducer: policyengine_uk/tests/policy/baseline/finance/benefit/family/tax_credits_working_hours.yaml::A childless worker cannot borrow a nonworking partners age sixty

Validation: 68 checks passed: 18 new natural-input YAML cases, five composition/age-parameter cash controls and 45 existing regressions covering tax credits, closure, Pension Credit passports and childcare. The original code failed five eligibility cases and paid positive final WTC where zero was expected. Three historical probes encountered pre-existing missing parameters; they were excluded from the passing count, with native formula selection and preservation of the earlier method checked separately.

make format and the focused affected-regression runner passed. The documentation build was not run for the prose-only clarification on the existing page; the full suite remains with hosted CI.

Local validation used Python 3.13.14 / Core 3.32.27, versus locked Core 3.33.2. Hosted CI and human review remain pending. No population or RuleSpec parity result is claimed.

axiom: needed

@juaristi22 juaristi22 self-assigned this Oct 17, 2026

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right, fine to approve.

@juaristi22 the new formula matches the second condition of WTC Regulations 2002 reg 4(1) person by person, and the tests catch the pooling bug. One follow-up worth filing and two nits.

  1. should (follow-up, not this PR): policyengine_uk/variables/gov/dwp/WTC_worker_element.py:14-15 still pools hours with add(benunit, period, ["weekly_hours"]), which sums every benefit unit member, children included. Reg 10 gives the 30-hour element where the person works 30 hours, or where a couple with a child works 30 hours between them with one working 16. So a childless couple where a disabled partner works 16 hours and the other works 16 hours now passes is_WTC_eligible correctly but would still get the 30-hour element, and a child's hours can count towards it. Same defect class as #2042, so a separate issue would be cleaner than widening this PR.
  2. nit: policyengine_uk/variables/gov/dwp/is_WTC_eligible.py:55. Because the new formula is keyed to 2012-04-06, annual 2012 still runs the old pooled formula. The docs page says this, which is fine. Just flagging that a 2012 annual run will not show the fix.
  3. nit: policyengine_uk/variables/gov/dwp/is_WTC_eligible.py:82-84. For the third variation limb (a), the code requires the partner working 16 hours to be at least 16. The regulation puts the age test on "the person" claiming, not on the 16-hour worker. In practice both partners will be adults, so this makes no difference.

What I checked

  • Read the full diff, PR body and issue #2042. Read reg 4(1) as at 6 April 2024 on legislation.gov.uk. Each limb of the first, second and third variations maps to one of disabled_worker, older_worker, ordinary_worker, lone_parent or parents. Only claimant and partner hours count, so a child's hours are excluded.
  • Hand-computed three YAML expectations at 2024-25 rates with nil income: 60-year-old couple on 16 hours is basic 2,435 + couple 2,500 = 4,935; 25-year-old on 30 hours adds 1,015 for 5,950; disabled worker on 16 hours adds 3,935 for 8,870. All match.
  • Ran policyengine-core test .../tax_credits_working_hours.yaml -c policyengine_uk: 18 passed. Ran pytest on test_working_tax_credit_eligibility_properties.py: 5 passed.
  • Reverted is_WTC_eligible.py to main: 5 of the 18 YAML cases fail, as expected.
  • ruff check and ruff format --check clean on the changed Python files.
  • Process: 2042.fixed.md fragment, Reproducer and axiom lines present. Hosted CI is green.
  • Overlaps: #2475 also edits docs/book/programs/gov/dwp/tax-credits.md, but a trial merge of the two heads is clean. No clash with other open PRs.
  • Not checked: the pre-2012 formula and the full test suite locally.

🤖 Generated with Claude Code

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, per my review above. Nits are optional.

@juaristi22
juaristi22 added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit e3af4eb Oct 20, 2026
15 checks passed
@juaristi22
juaristi22 deleted the fix-2042-wtc-worker-conditions branch October 20, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WTC eligibility pools the age, disability and hours conditions across a couple (WTC Regs 2002 reg 4(1))

2 participants