Repository navigation
Conversation
#1966 already reads claimant_or_partner_esa_income in council_tax_reduction_working_age_personal_allowance (aed6724). Add excluded-adult cases for Scotland and Wales: another member's own income-related ESA leaves a single applicant under 25 on the lower personal allowance, and the applicant's own award gives the higher one (SSI 2021/249 Sch 1 para 1; WSI 2013/3029 Sch 7 para 1). The two excluded-adult cases fail on #1966's pre-switch reader (fae2f38). Add the reader to FAMILY_READERS, and to CTR_APPLICANT_READERS: an added member older than the claimant becomes the household head who applies alone, which changes the applicant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Childcare Offer for Wales limits each parent's gross income to £100,000 (guidance for local authorities, April 2026, paras 57 and 69). benunit_gross_income_sources listed esa_income and jsa_income, so an award that another member of the benefit unit claims in their own right counted towards a parent's gross income. List claimant_or_partner_esa_income and claimant_or_partner_jsa_income instead, as the offer's exception criteria already do. The equal split between the claimant and any partner is unchanged. Add excluded-adult cases and controls, pin the new names in test_wales_childcare_offer_income_sources.py, add wales_childcare_offer_parent_condition to MEMBER_READERS, and add a property shape with a Welsh parent just under the limit, since the other shapes never come near £100,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22
left a comment
There was a problem hiding this comment.
Review status: COMPLETE — request changes for one completion blocker
Reviewed head: a8affa040113600fe99998164c613c228c8ad92f.
C1 — Make the queued source record dispatch-ready for the Welsh Childcare Offer change. The repository requirement applies to policy and parameter fixes. A queued record must identify the operative source, module/corpus boundary, required outputs, companion cases and actual execution blocker.
I checked issue #416 and all eight comments, including the linked addendum. That packet covers the CTR personal-allowance reader but omits the new Welsh Childcare Offer £100,000 income rule, its guidance/corpus boundary, per-parent outputs and excluded-adult companion cases. The English childcare provisions concern different programmes; #393's CTR packet also does not supply this change.
Please extend the actual filed packet with that provision, source-derived cases and the ingest/execution blocker, then update the PR's completion record. This requires a reviewable dispatch record; no billed encoder execution is requested here. The blocker concerns the explicit completion requirement.
The policy and code checks otherwise support the switch. Welsh guidance, paragraphs 57–58 and 69 supports the per-parent limit and exclusion of other adults without parental responsibility. 173 repository tests passed (68 YAML and 105 Python), plus eight childcare and four positive-CTR household controls. The childcare exclusion cases pay £6,720 with the corresponding household-income effect. The entered-own-award controls test the stored-input contract; they do not certify benefit entitlement at those wages. CTR production is unchanged, and the final CTR checks do not claim a monetary effect from the personal-allowance reader.
There are no material evidence gaps in this completed review. The PR remains a draft and current-head CI was still pending. The planned survey run and expected £0 impact are not counted as completed validation.
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
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2007 merged reading whom each award is payable to, through #2027's is_on_income_support, is_on_income_based_jsa and is_on_income_related_esa, and banding a non-dependant couple on claimant_or_partner_jsa_income and claimant_or_partner_esa_income, so no formula changes. Add excluded-adult cases and controls in legacy_award_readers/non_dependant_exemptions.yaml, and add both non-dependant exemptions and the Housing Benefit individual deduction to MEMBER_READERS. With #2007's earlier is_award_payee restored, 4 of the 8 cases fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unit The working-age families seldom put a claimant in remunerative work beside another member's own award, so the property did not catch #2007's earlier payee rule or the benefit-unit totals in a couple's gross income. Add a shape: an applicant aged 70 in Maidstone and a non-dependant benefit unit whose claimants work 35 hours on £13,000 or not at all, some with a £200 report below the tariff income on £10,000 of savings. With the earlier code restored, the property fails in the generate phase on the council tax reduction deduction (the couple's band); with only the earlier payee rule restored, on the Housing Benefit exemption. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1 on 3720d44: "that member has no award" was too broad, since a claimant's £200 report and a partner's £3,000 report of the same award leave the couple £2,368 after the £832 tariff income. Say that a £200 report on its own gives no award, that the couple's reports make one award, and cite SI 2006/214 reg 55(4) beside reg 74(4) for the couple's band. Docstring only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@juaristi22 on C1: the filed packet now covers the Childcare Offer for Wales rule. Addendum 3 on TheAxiomFoundation/rulespec-uk#416 (TheAxiomFoundation/rulespec-uk#416 (comment)) gives:
The body's axiom line now cites addendum 3, with TheAxiomFoundation/rulespec-uk#480. Since your review, 6805d2d adds #2007's tests ( |
juaristi22
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-uk
PR number: 2895
Reviewed head SHA: 98cdbc4
Merge base SHA: 2c57022
Mode: incremental from a8affa0
Scope: changed behavior and affected dependencies; seven PR-owned paths, C1 queue completion and new reader tests
Source manifest: /private/tmp/policyengine-command-runs/32baa0e3c673/pr-2895-sweep20261116-1956-review-sources.json
Review status: PARTIAL
Source Documents
- reused-00-original.xml — cached original.
- reused-01-original.xml — cached original.
- reused-02-original.xml — cached original.
- reused-03-original.xml — cached original.
- reused-04-original.pdf — cached original.
- reused-05-original.pdf — cached original.
- reused-06-original.xml — cached original.
- reused-07-original.xml — cached original.
- reused-08-original.xml — cached original.
- reused-09-original.xml — cached original.
- reused-10-original.xml — cached original.
- reused-11-original.xml — cached original.
- reused-12-original.xml — cached original.
- hb-reg6-original.xml — cached original.
- esa-tariff-2025-original.xml — cached original.
- esa-capital-2025-original.xml — cached original.
- ctr-2025-rates-original.xml — cached original.
- hb-pensioner55-2025-original.xml — cached original.
Critical
C1 — Make the queued record dispatch-ready for the Welsh Childcare Offer change (RESOLVED)
The current repository requirement still requires a pe-parity queued issue with module/corpus citation, operative text, required outputs, same-source companion tests and the signed-encoder blocker. I read the actual current issue416/comments, addendum3 6941251151, and companion issues480/393/407; this is not acceptance of the PR body's promise or the author's private review.
Addendum3 now identifies #480's uk/policies/govwales/childcare-offer-for-wales.yaml; the April2026 and July2020 guidance ingest citations; verbatim paragraphs57/58/69 and income questions8/9; annual per-parent childcare_offer_gross_income feeding output2 childcare_offer_parent_condition; the unrelated-adult exclusion; companion20a–d and the invariant. It records missing guidance ingest, a UK release and toolchain rebind through CODEOWNERS, and separate approval for every billed signed-encoder run. Issue480 is OPEN/pe-parity and supplies the parent/child eligibility, hours, value outputs and wider same-source companions. Issue416 is OPEN/pe-parity, and the new comment hash dd35d21afa0948db2c4e37a2f37a326844f69f45afcf1ce37b4fac3af567f1a8 matches the source watch. Issues393/407 supply the existing CTR/non-dependant context, not a replacement for the newly filed Wales consumer.
The passage allowing an encoding to omit legacy benefits is explicit, rather than an undisclosed claim that the guidance uniquely dictates their inclusion. For this reader change, both admissible approaches must exclude a non-parent adult's own award. Cases20c/d separately declare the PolicyEngine legacy-count convention. The relevant unit change, outputs and companion obligations are dispatchable without pretending the entire module is already encoded or the signed encoder has run. This satisfies the demonstrated C1 completion requirement; the billing/ingest work remains queued and no encoder execution was authorized or attempted here.
C2 — Complete the required Test / Result check at the reviewed head (OPEN)
The current required Test / Result job133960336726 is FAILURE, not a superseded attempt. Official job metadata binds it to 98cdbc4b1bc548eb0452e3ebd052c7ad0c47822d. Python7/8 job133914606729 was cancelled after90 minutes; its official annotation explicitly says it exceeded1h30m0s. The result job fails both the all-jobs-success gate and the outcome-coverage check (.github/workflows/test-suite.yaml:310,:341):14,119 collected tests,12,041 outcomes (11,989 passed,50 skipped,2 xfailed), and 2,078 collected tests with no outcome. This confirms a required-check/execution blocker, not a newly established policy assertion failure or a measured Wales/HB error. Provide healthy complete execution before approval; neither local passes nor author-attributed prior runs satisfy this gate. Raw job, annotations and Result log are retained in the technical receipt.
Should Address
None.
Suggestions
None.
Evidence Gaps
- LOCAL_EXECUTION_COMPLETION: 95 of122 selected local checks remain unfinished after the bounded campaign;27PASS/0FAIL, all16 newYAML passed. Complete the named remaining tests or obtain qualified exact-head hosted execution; current required CI is incomplete/failing.
- Role checks incomplete: pr-2895-sweep20261116-1956-review-code.md; see recovered report.
Notes
- Review completion and severity are separate. The automatic partial-role gap below is an alias for the single named required gap, not a second missing question.
- No foreign branch/source edits, fixes, merges, private data runs, dependency installs or billed encoders.
- Role reports and raw receipts retain exact validation premises and excluded exploratory attempts.
- Only seven PR-owned paths relative current main are audited; the wide prior-head interval contains unrelated main imports. CTR/HB production is unchanged.
- The Welsh £6,720 is provider-funded childcare valuation, not cash paid to parents. High-wage own-ESA/JSA cases are stored-award reader controls, not lawful means-tested entitlement. Equal couple splitting remains a disclosed model convention.
- Policy progress-log maximum gap230.314s exceeded its120s cadence and is recorded; acquisition and completion clocks were not reset.
- Setup/role/cleanup intervals use captured clocks; scope/dispatch overhead was not separately timed and remains in total elapsed. Heartbeat delivery and app interruption clocks are retained separately in caller acceptance. No source or CI timing was reset.
Validation Summary
Current local:27PASS(16newYAML+11Python),0FAIL,95unfinished/122selected; one actual pytest invocation, original540s window retained, timeout124. Six final2025 Wales Offer controls returned6720/6720/0/0/6720/6720, and two finalCTR controls1480/1740, separate frompytestcounts. Exact snapshot imports,17lockedpins,194Core3.34.9payload hashes verified via read-only cached overlay; noinstall. Invalid diagnostic/setup attempts preserved and excluded; HBzero is notpositiveHBcoverage. Prior173passes remain historical only. Latest exact-head requiredTest/Result133960336726FAILURE followsPython7/8 90mtimeout,2078missing outcomes.18officiallaw/guidancepairs(13reuse5new),8currentGitHubtechnicalpairs; zero source rejects/discards,0PDF renders,167.061s newacquisition. No privatepopulation/authorSubfleet proof adopted.
Timing
setup seconds: 5.24s; elapsed seconds: 1055.95s; adjudication seconds: 0.00s; consolidation cleanup seconds: 196.41s; code role seconds: 820.59s; policy role seconds: 729.32s; parallel review seconds: 820.59s
Review Severity
REQUEST_CHANGES. Open findings: 1 critical, 0 should address, 0 suggestions.
|
@juaristi22 on C2: the 90-minute job limit cancelled Python 7/8 in all four attempts of run 44046798159 at
Python 7/8 runs close to the limit on main too: main's push run 43904807430 needed 89.5 minutes for it, and the merge queue's run 44600036553 for #2926 on 19 November needed 89.1. With this PR, Python 7/8 runs 2,078 tests against 2,079 in main's push run, and the two test lists differ only in three Wales offer source cases whose ids name the income sources this PR swaps. Python 6/8 ran both new property tests and passed. I haven't changed the code since your review and won't rerun the shard. Once #2919 merges and spreads main's tests over ten shards, I'll merge main into this branch for a fresh run and re-request your review when that run passes. I've updated the body's Enhanced FRS section to report CI's aggregate impact run at this head: base |
Follow-up to #2026 and #2027.
Summary
#2027 added
claimant_or_partner_esa_income,claimant_or_partner_jsa_incomeand the person-levelis_on_*flags, which say whom an award is payable to. Parallel PRs added readers of the benefit-unit totalsesa_incomeandjsa_income. Those totals also hold an award that another member of the benefit unit (neither the claimant, the partner nor a child or young person they are responsible for) claims in their own right. This PR finishes the readers whose source PRs have since merged:esa_incomeandjsa_income, so another member's own award counted towards a parent's £100,000 gross income limit. The list now namesclaimant_or_partner_esa_incomeandclaimant_or_partner_jsa_income.Reader by reader
wales_childcare_offer_parent_condition, throughgov.welsh_government.childcare_offer.income.benunit_gross_income_sourcesesa_incomeandjsa_income, so another member's own award counted towards a parent's gross incomeclaimant_or_partner_esa_incomeandclaimant_or_partner_jsa_income, as the offer's exception criteria already do. The equal split between the claimant and any partner, a modelling convention, is unchangedcouncil_tax_reduction_working_age_personal_allowanceadd_for_members(benunit, period, ["esa_contrib", "esa_income"], claimant_or_partner), which counted the benefit unit's income-related ESAclaimant_or_partner_esa_incomewhere the benefit unit's awards are the applicant's. This PR adds YAML cases and a property entry for this readerhousing_benefit_non_dep_deduction_exempt,council_tax_reduction_non_dep_deduction_exempt(with Scotland's working-age partner rule),household_benefits_individual_non_dep_deduction(remunerative work) and_non_dependants.FAMILY_GROSS_INCOME_BENEFITS(a couple's gross income)is_award_payeeread the benefit-unit awards and took the payee to be any member who reported one, or the head where none did; the couple's gross income added the benefit-unitjsa_incomeandesa_incomeis_on_income_support,is_on_income_based_jsaandis_on_income_related_esa(throughis_on_legacy_income_related_benefit) andis_on_pension_credit; its main merge c915c72 replacedis_award_payee, and 634047b scoped the couple's gross income toclaimant_or_partner_jsa_incomeandclaimant_or_partner_esa_income. This PR adds YAML cases and property entries for these readersThe only formula input that changes is the Wales offer list. The other changes are tests, comments and the changelog.
#2007's code on main reads the payee flags partly through a shared helper,
is_on_legacy_income_related_benefit, and counts State Pension Credit throughis_on_pension_credit. The readers use the person-level payee flags, apply Scotland's working-age partner rule, and band a couple on the claimant's and partner's awards, so no reader needed a change.Sweep of the remaining readers on main
git grepon main (2c570224b) for"esa_income"/"jsa_income"in variables and for the unquoted names in parameters. No new reader turned up. Every remaining reader is one #2027 left on the totals on purpose, or one another PR owns:is_on_*;gov_spending,pre_budget_change_household_benefits;esa_income_eligible, which only sets inputs for its branches.Invariants
test_legacy_award_readers_properties.pyalso add that member, and allow a change only where their presence ends the severe disability premium or makes them the council tax reduction applicant. This PR adds the personal allowance toFAMILY_READERS, and both non-dependant exemptions, the Housing Benefit individual deduction and the Wales parent condition toMEMBER_READERS. It adds two shapes the other shapes never reach. One has families in Wales with a parent just under £100,000. The other (test_other_members_awards_never_change_the_non_dependant_readers) has a household with an applicant aged 70 in England and a non-dependant benefit unit, whose claimants work 35 hours on £13,000 or not at all, some with a £200 report below the tariff income on £10,000 of savings; it checks both exemptions and both individual deductions for every existing member. As Count only the claimant's and partner's legacy awards in means tests and passports #2027 notes, this holds while the benefit cap does not bind.Tests
New YAML in
policyengine_uk/tests/policy/baseline/finance/benefit/family/legacy_award_readers/. Each file cites the law and parameter values behind its expectations.council_tax_reduction_working_age_personal_allowance.yaml: 4 cases (another member's income-related ESA, or the applicant's own, in Scotland and in Wales, 2025-26).wales_childcare_offer.yaml: 4 cases (a lone parent earning £96,000 with another member's income-related ESA or income-based JSA of £8,000, or the parent's own).non_dependant_exemptions.yaml: 8 cases. Another member's income-based JSA or income-related ESA exempts that member, not the non-dependant claimant. A claimant whose own ESA falls below tariff income is not on it, while another member receives their own award. Another member who reports Income Support in their own right is on it (aged 23, exempt under both; aged 40, under council tax reduction only). The claimant's own JSA or ESA exempts the claimant. The deduction bands a non-dependant couple on its own income, leaving out another member's ESA.Each case passes with the switch, and cases fail without it (
check_switch.sh, which restores only the switched files):2c570224bfae2f38b4539a03c06: main's three reader files with #2007'sis_award_payee(4a0935b) restored, and the couple's gross income on the benefit-unit totalsWith the old code, the properties fail in the generate phase (no shrinking):
council_tax_reduction_working_age_personal_allowance;wales_childcare_offer_parent_condition;539a03c06readers (oncouncil_tax_reduction_individual_non_dep_deduction, the couple's band, here; oncouncil_tax_reduction_non_dep_deduction_exemptin review r1's run), and onhousing_benefit_non_dep_deduction_exemptwith the old payee rule and the claimant-or-partner names inFAMILY_GROSS_INCOME_BENEFITS.Test runs on this branch started at
c240ddbea, with this PR's #2007 files in the working tree, and at6805d2d78; the property file ran last, at98cdbc4b1. Review r1 reran the legacy YAML, the switch checks and the property file at3720d44d3.test_wales_childcare_offer_income_sources.py: 84 passed;test_legacy_award_readers_properties.py: 22 passed (here at98cdbc4b1, and in review r1 at3720d44d3);ruff format --checkandruff check: clean.Enhanced FRS impact
CI's aggregate impact job makes real microsimulation runs on the certified Enhanced FRS (
enhanced_frs_2024_25.h5, policyengine-uk-data 1.58.1, sha256056e80fd8e91) for each fiscal year 2025-26 to 2031-32. Its report for98cdbc4b1compared base2c570224b1(main) with merge commit72c8d60642. The report records no household net income changes in any year. The change broke no checks (the VAT sign check fails on both sides), and the report flagged no moves for review.A local pair of runs on a private copy of another Enhanced FRS build (sha256
e433e532b17b, not the certified file) compared main at2c570224bwith this head,98cdbc4b1, for 2025 to 2030. Each year they compared 143 arrays exactly: the readers in the table, the benefits and non-dependant deductions they feed, the claimant-or-partner awards, the benefit-unit totals and household net income. None changed in any year. In that file no other member (neither a claimant, a partner nor a child or young person they are responsible for) reports income-related ESA, income-based JSA or Income Support, so the switch has nothing to move there; the tests above are what exercise it.Review
20261117-025243-reader-switches-review) approved3720d44d3with one nit. It re-derived the 16 new YAML expectations from the law and parameters, and reran the legacy reader YAML (105 passed), the threecheck_switch.shchecks (2, 2 and 4 cases fail without the switch), the new property against539a03c06(fails) and the property file (22 passed). It also checked the mechanism claims against aed6724, c915c72 and 634047b. The nit: the new property's docstring said a £200 report leaves no award, which a partner's report of the same award can change.98cdbc4b1fixes that docstring (no code change). Review r2 (Subfleet, GPT-6.1 Sol, delta) confirmed the fix, its arithmetic and its citations, and requested corrections to drafts of this body and of the reply on C1.warm_home_discount.py; SI 2026/389 reg 9 names the electricity customer or partner) and the cost-of-living payment (cost_of_living_means_tested_payment.py). This PR leaves both for follow-ups.Axiom
axiom: TheAxiomFoundation/rulespec-uk#416 queued (addendum TheAxiomFoundation/rulespec-uk#416 (comment); addendum 3, companion test 20: TheAxiomFoundation/rulespec-uk#416 (comment)), with TheAxiomFoundation/rulespec-uk#393 (Scotland and Wales working-age CTR), TheAxiomFoundation/rulespec-uk#407 (non-dependant deductions) and TheAxiomFoundation/rulespec-uk#480 (Childcare Offer for Wales).
Reproducer:
policyengine_uk/tests/policy/baseline/finance/benefit/family/legacy_award_readers/wales_childcare_offer.yaml;policyengine_uk/tests/policy/baseline/finance/benefit/family/legacy_award_readers/council_tax_reduction_working_age_personal_allowance.yaml;policyengine_uk/tests/policy/baseline/finance/benefit/family/legacy_award_readers/non_dependant_exemptions.yaml;policyengine_uk/tests/test_legacy_award_readers_properties.py::test_other_members_awards_never_change_the_non_dependant_readers🤖 Generated with Claude Code