Repository navigation
Count Scottish Child Payment, Healthy Start and the Two Child Limit Payment in government spending - #2366
Merged
Conversation
…ayment in government spending HOUSEHOLD_BENEFIT_VARIABLES listed scottish_child_payment, healthy_start_vouchers and two_child_limit_payment, but GOV_SPENDING_VARIABLES did not, so households received them at no cost to the government and gov_balance was overstated by the amount paid. two_child_limit_payment is zero at baseline (the regulations were not laid) but is paid when a reform turns it on. Adds a code-health test that every household benefit is in government spending or on an explicit, documented NOT_PAID_BY_GOVERNMENT list (empty today), YAML cases, and Hypothesis properties: gov_spending is the sum of its list, gov_balance = gov_tax - gov_spending, household benefits equal government spending on households, and a pound more of each payment is a pound more spending and a pound less balance. Fixes #2338 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
MaxGhenis
marked this pull request as ready for review
October 12, 2026 08:53
Collaborator
Author
|
Hand-off to the UK hub from session local_615fdd79-8fa2-4544-b8ce-67188d179ad6 (started by the UK hub).
|
Collaborator
Author
|
UK hub (2026-10-12): this PR's head |
This was referenced Oct 12, 2026
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 #2338
What and why
scottish_child_payment,healthy_start_vouchersandtwo_child_limit_paymentwere inHOUSEHOLD_BENEFIT_VARIABLESbut not inGOV_SPENDING_VARIABLES. Households received them, but government spending didn't count them, sogov_balanceoverstated the public finances by the amount paid.The issue named the first two.
two_child_limit_paymenthad the same gap. It is zero at baseline, because the regulations were not laid, but it is paid when a reform turns it on (gov.social_security_scotland.two_child_limit_payment.in_effect).This PR adds all three to
GOV_SPENDING_VARIABLES. It also adds a code-health test so the gap can't reopen: every household benefit must be in government spending, or on an explicit, documentedNOT_PAID_BY_GOVERNMENTlist, which is empty today.Invariants
HOUSEHOLD_BENEFIT_VARIABLESis inGOV_SPENDING_VARIABLESor inNOT_PAID_BY_GOVERNMENTwith a reason (tests/code_health/test_household_benefits_in_government_spending.py). A third test there runs the checker on the old list and confirms it reports exactly the three.gov_spendingequals the sum of the distinctGOV_SPENDING_VARIABLES.gov_balance = gov_tax − gov_spending.household_benefits − NOT_PAID_BY_GOVERNMENT = gov_spending − (spending that is not a household benefit: pawhp, other_public_spending_budget_change). "At baseline" meansgov.contrib.benefit_upratingis at zero:household_benefitsapplies that lever andgov_spendingdoesn't, which predates this PR (see follow-ups).household_benefitsandgov_spendingby d, lowersgov_balanceby d, and leavesgov_taxunchanged.Invariants 2-5 are Hypothesis properties in
tests/test_gov_spending_properties.py. Power: on the old list, the code-health test, both YAML cases (tests/policy/baseline/gov/gov_spending.yaml) and both properties fail. On this branch they pass.Impact
Real run, 2026, one Microsimulation each. Both runs use the certified enhanced FRS: uk-data 1.58.0,
enhanced_frs_2024_25.h5, HF revision 47bbb58d, sha2565ba399ea…d960b6, verified at load. Main is 3f174d0; this branch is b0e8fb1, a clean tree. The runs went through the heavy lock, one at a time. Script and outputs:~/reviews/uk-statutory-pay-gov-spending-2026-10-12/(impact.py,compare.py,runs/).gov_spendinggov_balanceuniversal_credithousehold_benefitshousehold_net_incomegov_taxgov_spendingequals the sum of the three payments, to within half a penny. This re-measures the issue's ~£0.57bn.gov_balancefall. No household's income changes.Tests run
gov_spending.yaml2 passed; properties 2 passed (45 s).test_aggregation_lists.pypassed.Review
GPT-6.1 Sol (
subfleet run --task review --tier hard) approved head b0e8fb1 with no blocking findings. The review is at~/reviews/uk-statutory-pay-gov-spending-2026-10-12/review/out_2366.md. It checked the following:What I did with its non-blocking notes:
gov_spendingapply the uprating lever.test_state_pension_credit_qualifying_age.py.Interactions
pawhpinto household income) is compatible in either order. Its exact-set test still holds, because the three variables here were already household benefits.totals: [gov_spending, household_benefits]and reword thehousehold_benefitsdescription; see the comment on #2335.statutory_paternity_payto both lists. The hunks differ, and this PR's invariant passes with it.Ownership: no W1 or W3 file is touched.
axiom: n/a: government-spending accounting lists for microsimulation aggregates, not a policy rule.
🤖 Generated with Claude Code
Reproducer:
policyengine_uk/tests/code_health/test_household_benefits_in_government_spending.py::test_every_household_benefit_is_government_spending_or_excluded,policyengine_uk/tests/code_health/test_household_benefits_in_government_spending.py::test_exclusions_are_household_benefits_outside_government_spending,policyengine_uk/tests/code_health/test_household_benefits_in_government_spending.py::test_the_check_reports_a_benefit_left_out_of_government_spending,policyengine_uk/tests/policy/baseline/gov/gov_spending.yaml::Scottish Child Payment and Healthy Start vouchers are government spending,policyengine_uk/tests/policy/baseline/gov/gov_spending.yaml::The Two Child Limit Payment is government spending when a reform turns it on,policyengine_uk/tests/test_gov_spending_properties.py::test_government_spending_counts_every_benefit_government_pays