Skip to content

Give UC property-test adults explicit claimant roles - #2107

Open
MaxGhenis wants to merge 1 commit into
mainfrom
uc-capital-income-property-roles
Open

MaxGhenis wants to merge 1 commit into
mainfrom
uc-capital-income-property-roles

Conversation

@MaxGhenis

Copy link
Copy Markdown
Collaborator

Summary

This fixes a latent flake in two property tests: the one that #1950 added and the State Pension test inverted while landing #1950.

Since #1896, uc_unearned_income counts income only for the claimant, the partner and UC children. Without relationship inputs, the model presumes that an adult under 20 who is at least 16 years younger than another adult is that adult's child.

The capital-income property test's single-count expectation summed every member's listed income. So for a family aged 19 and 57, with £1,000 of private pension on the 19-year-old:

  • the model counts £0, because the 19-year-old is presumed a child and is not a UC child;
  • the test expected £1,000.

A family aged 25 and 57 agrees at £1,000. CI stayed green only because its 10 fixed Hypothesis examples never draw such a family; at 60 examples they do. The independent review of #1950's final head found this.

The fix is in the test fixtures only. Generated adults get is_claimant_or_partner = True and children False, as the FRS supplies it. That follows the pattern of 207e225 for the other UC and CTR property fixtures, and it is applied in:

  • test_uc_income_from_capital_properties.py, where the 19-and-57 family failed before and passes after;
  • test_uc_state_pension_properties.py, where an 18- or 19-year-old "partner" draw was presumed the pensioner's child, so those draws had stopped testing a mixed-age couple.

Tests

  • The counterexample, reproduced on main 84f5ad4: [19, 57] gives model £0 against expected £1,000. With this change both families agree at £1,000.
  • The capital-income property file at 60 examples: running; result to follow in a comment.

Impact

Tests only. The diff touches two test files and a changelog fragment, and no model code, so model outputs are unchanged.

axiom: n/a, test fixtures only.

🤖 Generated with Claude Code

Since #1896, UC counts income only for the claimant, partner and UC
children, and presumes an adult under 20 who is 16 or more years younger
than another to be their child. The capital-income property test's
single-count expectation summed every member's listed income, so a family
aged 19 and 57 failed (model £0, expected £1,000), though CI's 10 fixed
examples never drew one. Set is_claimant_or_partner True for generated
adults and False for children, as 207e225 did for other fixtures, here
and in the State Pension property test, whose 18- or 19-year-old partner
draws had stopped testing a mixed-age couple.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

The capital-income property file passes at 60 examples on head 9ab7554: 4 passed, 1 xfailed (the strict #1942 marker), in 20 min. That run used a copy of the file with max_examples=60; at that setting the reviewer counted 13 under-20 'partner' families in the draws.

🤖 Generated with Claude Code

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

The State Pension property file also passes on head 9ab7554: 4 passed, 1 xfailed, in 4 min 40 s locally. The first CI Test attempt was cancelled at GitHub's 6-hour job limit (#2099), not by a failing test; attempt 2 is running.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

1 participant