Repository navigation
Conversation
List the tax helpers among the exclusions and give spending heads their own section for components. Add tests for the shared trading allowance in 2027, and for Step 6 with the Pension Tax Allowance and finance cost relief applying together. Fixes #2762 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read the new section as exclusions are read, and refuse an entry whose head isn't a spending head. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Standard reform costings (change in gov_balance)
Standard reforms: change in each reform's target
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. Checks failing on both base and head (1)
Counted-once checkEach of 92 components was raised by £1 per unit in 2026-27, and every head of its totals was read 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 head that breaks a rule is measured again twice: with every other head held at its baseline value, and with every other head held at its value after the first £1 while the component rises again. It fails where either still shows the response. 0 failed; 0 were skipped.
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
|
Fixes #2762
What and why
policyengine_uk/data/fiscal_partition.yamlnames the heads that make up each total and the variables that must never count alongside them. Eight helpers from recent changes had no entry. Older helpers without an entry stay out of this PR.miscellaneous_income_trading_allowance_deduction,uses_trading_allowance,miscellaneous_income_before_trading_allowanceandincome_not_otherwise_chargedgo inexclusionsas assessments.machine_games_standard_rate_higher_stake_net_takingsgoes inexclusionsas a component.carers_allowance_weekly_earnings_above_limit,ebr_alternative_fuel_paymentandmonthly_ebr_alternative_fuel_paymentsit inside spending heads. The file had no place for those, so a newspending_exclusionssection holds them, with the same fields asexclusions.The reader now loads
spending_exclusionsand refuses an entry that names anything but a spending head. This changes no calculated amount: eight households in 2023, 2026, 2027 and 2030 give the samegov_tax,gov_spendingandhousehold_net_incomeasmain.The PR also adds tests that #2719 and #2735 left open:
trading_allowance_miscellaneous_income.yaml).test_income_tax_step_6_step_7_properties.py.Two comments change: the trading allowance parameter now says the model shares the allowance between both sources, and a Carer's Allowance test no longer quotes a limit it computes.
Reproducer: policyengine_uk/tests/aggregate_impact/test_aggregate_impact_partition.py::test_budget_and_energy_support_variables_have_fiscal_classifications
axiom: n/a: this classifies variables for measurement and changes no rule.
Invariants
spending_exclusionsentry names a known variable and a spending head, has a kind of component or assessment, and carries a note. The reader refuses an entry with a head outsidespending_heads, or a variable that is itself a head.Test plan
Each file ran on its own at
6ca062e68, without survey data, under a 4 GB memory cap.tests/aggregate_impact/test_aggregate_impact_partition.pymain'sfiscal_partition.yamltests/aggregate_impact/test_aggregate_impact_compare.py,test_aggregate_impact_data_mode.pytests/test_fiscal_partition.pytests/test_income_tax_step_6_step_7_properties.pytests/policy/reforms/oct_2026_budget/trading_allowance_miscellaneous_income.yamlLint passes: ruff 0.17.2
format --checkandcheckon the changed Python files, andgit diff --check.trading_allowance.yaml.make formatchangelog.d/2762.fixed.md🤖 Generated with Claude Code