Repository navigation
Description
Found while fixing Scottish Council Tax Reduction (CTR) income for Carer Support Payment (#1992, fixes #1955).
council_tax_reduction_applicable_income deducts the claimant's and partner's whole income_tax and national_insurance from every income it counts:
tax = add_for_members(
benunit, period, ["income_tax", "national_insurance"], members
)
income_under_general_rules = max_(
0, increased_income - tax - pension_contributions
)The CTR instruments deduct less than that. The working-age and pension-age rules differ.
Working age. The Council Tax Reduction (Scotland) Regulations 2021 (SSI 2021/249) take tax and NI off earnings only. Reg 50(3)(a) reads "Earnings do not include— (a) any amount deducted from them by way of income tax or primary Class 1 contributions under the 1992 Act". Reg 49(6)(b) (applicants with UC) and reg 51(2) (self-employed with UC) do the same. Part 6 Chapter 4 (unearned income, regs 57 to 65) has no tax deduction. So tax on unearned income such as State Pension, private pensions, contributory benefits and Carer Support Payment should not come off. The model takes it off, so CTR is too generous wherever such income is taxed.
Pension age. All three pensioner schemes disregard tax only on income they take into account:
- Scotland, SSI 2012/319 reg 31(12): "In the case of any income taken into account for the purpose of calculating a person's income, any amount payable by way of tax must be disregarded."
- England, SI 2012/2885 Sch 1 para 17(13), and Wales, WSI 2013/3029 Sch 1 para 11(13): "In the case of any income taken into account for the purpose of calculating a person's income any amount payable by way of tax is disregarded."
NI comes off earnings only (SSI 2012/319 regs 33, 36 and 37), and the model's NI is all charged on earnings, so the NI deduction matches. The model's whole-tax deduction is close to the law for tax on counted income. It also deducts tax on income CTR does not count. One example is the taxable Scottish Carer Supplement (SI 2026/93), which SSI 2012/319 reg 27(1)(j)(xxib) excepts. Another is income disregarded under the schedules.
Not yet checked. The English and Welsh working-age schemes: SI 2012/2886 (the English default scheme), the local English schemes, and the WSI 2013/3029 working-age parts.
Related.
- Pension Credit income still omits IIDB, SDA, the AFCS guaranteed income payment and other countable income #1954 records the same issue for Pension Credit (SPC Regs reg 17(10)) and pension-age Housing Benefit (HB (SPC) Regs reg 33(12)).
- Take Housing Benefit earnings disregards from net earnings only #1908 takes HB earnings disregards from net earnings only.
- In Count Carer Support Payment as Council Tax Reduction income #1992 the property test
test_council_tax_reduction_income_ignores_the_scottish_carer_supplementadds income tax back before comparing CTR income with and without the supplement. Once this is fixed, tighten it to assert that CTR income itself is unchanged.
Suggested fix. Deduct tax and NI on earnings only, and at pension age also the income tax attributable to counted unearned income. Pension-age HB and PC need the same apportionment (#1954), so a shared helper would fit. Test it with:
- a working-age Scottish carer with taxable State Pension or private pension, whose CTR income should not be reduced by the tax on it;
- a pension-age Scottish carer whose Scottish Carer Supplement tax should not reduce CTR income.
Law texts were fetched from legislation.gov.uk on 2026-10-02 (CLML, valid from 2026-04-01 for the Scottish instruments).
🤖 Generated with Claude Code
Activity
MaxGhenis commentedon Oct 11, 2026
Two pieces of evidence from PolicyBench UK round 2 (policyengine-uk 2.126.7).
1. Pension-age CTR, scenario 048.
council_tax_reduction_applicable_incomededucts the whole £1,659.40 of income tax. Only the £1,547.60 on the pensions is deductible, because the scheme disregards the savings interest.2. #2327 makes this defect visible on the transfer data. Scenario 148:
The enhanced FRS has no negative miscellaneous income, so #2327 moves nothing there. The fix for this case belongs here.
MaxGhenis commentedon Nov 2, 2026
Picking this up for the UK hub. Reply here if you're mid-change and I'll stop.
Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_TITLE.txtGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_BODY.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
AXIOM_ISSUE.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Branch
claude/council-tax-reduction-deductions-clzysl, head411dc0243dbbadefd56d46389b4b2b6270591eda, based onmainat2da212abcf2086337fc088a4a1236f4ae7b6af63. No PR opened. PR title, body and Axiom packet are in the three comments above.Findings and resolutions
council_tax_reduction_applicable_income.pydeducted the wholeincome_tax_before_winter_fuel_payment_chargeandnational_insurance. It now reads the new BenUnit variablecouncil_tax_reduction_tax_deduction(policyengine_uk/variables/gov/local_authorities/council_tax_reduction/council_tax_reduction_tax_deduction.py,formulafrom line 141). That variable selects by scheme: Scotland working age deducts tax on earnings plus Class 1, 2 and 4 NI; the GB pensioner schemes deduct tax on counted income plus the same NI; all others keep the whole liability.savings_income_tax,dividend_income_tax), so their tax comes apart exactly. Within non-savings income,earned_income_taxlumps earnings, pensions, taxable benefits and miscellaneous income together, so there is no exact split.tax_below_top_slice(same file, line 30) takes the uncounted income as the highest part of non-savings income and prices it at the main rates.tax_after_reductions_and_charges(line 79) takes Step 6 reductions off the counted part first and shares Step 7 charges pro rata. On the issue's households the gap from this choice is nil (048's non-savings income is all pension; 148's is all pay). For a Scottish carer with £8,000 pay, £14,000 pension and CSP, earnings tax is £0.00 here, £846.25 pro rata, and £1,600.00 with earnings on top.restored_allowance, line 57). After the fix, the deduction is £4,845.47 at £60,000, £90,000 and £200,000 of interest.Tests run
policyengine_uk/tests/policy/baseline/gov/local_authorities/council_tax_reduction: 336 passed.test_council_tax_reduction_tax_deduction_properties.pyandtest_council_tax_reduction_carer_income_properties.py: 8 passed.policyengine_uk/tests/code_health: 3,088 passed.ruff@0.17.2 format --check,check,check --select F811,F821 policyengine_uk,git diff --check: clean.Revert and mutation checks
main(scratch worktree), the four scheme cases incouncil_tax_reduction_tax_deduction.yamlfail on CTR income: £25,954.53 against £27,959.27, £17,648.60 against £18,760.40, £17,492.75 against £18,514, and £14,422.70 against £14,538.30. The Welsh working-age guard passes atmain, by design. The deduction outputs don't exist atmain, so I checked CTR income only there.Changed existing tests
council_tax_reduction_carer_support_payment.yaml, the pension-age Scottish carer case: the supplement's tax is no longer deducted. New expected values are deduction £1,145.41, CTR income £17,349.99 and reduction £1,693.16 (was £1,717.50).test_council_tax_reduction_carer_income_properties.py: reads the new deduction and tightens the supplement test to "CTR income and award unchanged", as Council Tax Reduction income deducts the family's whole income tax, not the tax the schemes allow #2090 asked. The HB/CTR differential now nets off the tax HB deducts and CTR does not.Skipped and why
test_claims_all_entitled_benefits.py::test_survey_takeup_follows_reports_in_microdata: microsimulation test that needs the survey dataset. Skipped locally; this is not a new skip.Addresses #2090.Judgement calls
person_net_earningsalready assumes) and with uncounted income at pension age.council_tax_reduction_net_earnings(the whole-income share inperson_net_earnings); this branch leaves it alone.Merge notes
Full list in the PR body. Conflicts this branch causes: #1933 in
council_tax_reduction_applicable_income.py, and #1966 incouncil_tax_reduction_carer_support_payment.yaml. #1995 and #2077 conflict only in files that already conflict withmain. #1995 also overlaps in substance: itslegacy_means_test_income_taxreplaces the same tax line under a different reading. #2799, #2120, #2007 (hub/2007-r5), #2794 and #2768 merge cleanly.Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Verdict: REQUEST_CHANGES at
411dc0243dbbadefd56d46389b4b2b6270591eda(branchclaude/council-tax-reduction-deductions-clzysl, one commit on2da212abcf2086337fc088a4a1236f4ae7b6af63).The pensioner half is sound: the four YAML cases fail at the base and pass at the head with the figures the hand-off gives, I get the same expected values by hand, and the deduction does not move when uncounted income changes. Three things block. (1) For Scotland's working-age scheme the formula uses the opposite tax split to the ruling main already carries for Pension Credit (#2019, ruling d1424), and the body doesn't say so. (2) The Scottish self-employed rules without Universal Credit use a notional basic-rate tax and Class 4 between the limits, but the formula deducts the real liability while the body claims the law is met. (3) One row of the body's evidence table doesn't reproduce at the base.
Setup: detached worktrees at base, head and #1995 (
1b8f2ded);uv sync --frozen --extra dev;HUGGING_FACE_TOKENandPOLICYENGINE_UK_DEFAULT_DATASETunset. All households are single adults in 2026 withwould_claim_uc: false, council tax £2,000 and inputs keyed to 2026, unless stated. Scripts:hh.py,hh2.py,opta.py,misc.py,props.py,order.py,table.py,mut.py(bodies available on request).P1
P1-1. The Scottish working-age split contradicts the split main already uses, and the body doesn't say so
council_tax_reduction_tax_deduction.py:160-165: in Scotland's working-age scheme the formula treats earnings as the lowest slice of non-savings income. Main has a standing ruling the other way.pension_credit_income_tax_without_employment_incomeand its siblings on main (from #2019, merged 2026-10-21 at1fac3a50) carryDECISION = "... settled as option (a): treat earnings as the top slice of the person's income."#2019's body says: "Max's d1424 ruling remains option (a): tax on earnings is the extra tax those earnings cause, including savings-band and partner interactions." The PR body calls its ordering "a modelling choice" and never mentions d1424.The ordering decides the result. These are Scotland working-age deductions, CTR income and CTR. "Option (a)" means income tax with the earnings, less income tax with
employment_incomeset to nil, plus NI on earnings. I computed the alternatives byset_inputoncouncil_tax_reduction_tax_deduction(hh.py,hh2.py,opta.py):care_hours: 35)Pensioner with SCS (the changed CSP YAML case: pension £14,000, CSP, SCS, age 70): head £1,145.41 / £17,349.99 / £1,693.16; main £1,267.09 / £17,228.31 / £1,717.50. At pension age the uncounted-on-top choice is option (a) applied to the supplement ("the extra tax the supplement causes"), so the pensioner half agrees with d1424. The working-age half reverses it.
What the text supports. Regs 50(3)(a) and 49(6)(b) take off the amount actually "deducted from them" or "paid ... in respect of the employment". The model has no PAYE codes, so no slice ordering is exact. Two facts the body leaves out:
The Scotland working-age YAML case (
council_tax_reduction_tax_deduction.yaml:20-48) only fails at main because of this choice. Under earnings-on-top or option (a) its CTR income is £25,954.53, the same as main.Replacement for the body's "Limitation: how the tax is split", first paragraph's last two sentences:
Then replace the carer sentence with the table above, or with its first two rows.
P1-2. Self-employed earnings without Universal Credit: the formula deducts the real liability, the law a notional one
council_tax_reduction_tax_deduction.py:27,145-168. Without UC, reg 51(9) of SSI 2021/249 applies regs 37 and 38 of SSI 2012/303. Reg 38(1) prices tax "as if that income was assessable to income tax at the basic rate of tax applicable ... less only the personal relief". Reg 38(2) omits head (a) (Class 2) and limits Class 4 to chargeable income that "exceeds the lower limit but does not exceed the upper limit". SSI 2012/319 regs 36 and 37 say the same at pension age. The formula deducts the actual Scottish-band tax on profits plus all ofni_class_2andni_class_4, including the 2% above the upper limit. The body's "reg 51(2) (self-employed with UC) do the same" is true only with UC, and the body never says the non-UC rule differs.misc.py, Scotland,self_employment_incomeonly:Main already has a precedent:
pension_credit_self_employment_income_taxapplies the matching Pension Credit notional rule (CER 1996 reg 14), and #2019's review records it as "basic or Scottish basic rate ... and main-rate Class 4 between the limits". The working-age figures don't depend on the split question, because a self-employed person with no other income gets the same tax under every ordering. Either implement reg 38 and SSI 2012/319 reg 37 for the no-UC and pension-age self-employed (council_tax_reduction_universal_credit_awardwould select reg 51(2) or 51(9)), or state it as a limitation. If the PR keeps the limitation, the body's Scotland bullet should read:and the law bullet should read "[reg 51(2)] (self-employed with UC) ... ; without UC, [reg 51(9)] applies SSI 2012/303 regs 37 and 38".
P1-3. The body's 148 "with the loss" row and the Westminster sentence don't reproduce at the base
At
2da212abc,miscellaneous_income_before_trading_allowanceismax_(0, miscellaneous_income)(policyengine_uk/variables/gov/hmrc/income_tax/bases/miscellaneous_income_before_trading_allowance.py:40). The ring-fence is already on main, so the −£2,399,684 input changes nothing.table.py(pay £510,223, dividends £973,043, interest £108,067, age 40), as whole liability / deduction / CTR income / CTR:The body's row "148: ... £423,320.41 | £12,215.06 | £86,902.59 | £498,007.94 | £0 | £0" and the sentence "With the loss, 148 in Westminster's working-age scheme (unchanged) gives the same CTR income as Wales: £86,902.59 before and after" don't come out of the model at the base or the head. The "loss set to nil" rows do reproduce exactly, and so do all three 048 rows. Replace the 148-with-loss row and the two sentences after the table with:
P2
P2-1. The finance-cost reduction on uncounted property income comes off the earnings tax
council_tax_reduction_tax_deduction.py:79-95.tax_after_reductions_and_chargestakes all Step 6 reductions off the counted part first, andproperty_finance_cost_reliefis one of them (step_6_tax_reductions.yaml). In Scotland's working-age scheme property income is uncounted, so the relief for its finance costs cuts the tax deducted from pay.misc.py, pay £30,000 and property income £20,000:PAYE on the pay doesn't change. ITTOIA ss.274A–274AA, cited in #1995's
legacy_means_test_income_tax, give the reduction on property profits. #1995 takes it offproperty_income_taxfirst. Fix: takeproperty_finance_cost_reliefoff the uncounted property tax first, and only any excess off the counted part. Docstring line 82, "The Step 6 reductions come off that part first", then needs "except the finance-cost reduction, which comes off the tax on property income first".P2-2. Benefits in kind at pension age: the formula drops tax that reg 33(2)(a) deducts
council_tax_reduction_tax_deduction.py:20-24. At pension agebenefits_in_kindsits in the uncounted top slice. SSI 2012/319 reg 33(2)(a) deducts "any amount deducted from those earnings by way of— (i) income tax". That is the same "deducted from" wording the branch reads at working age (reg 50(3)(a)) to keep benefits-in-kind tax with earnings, because PAYE collects it from the pay.misc.py, Scotland, age 70, pay £30,000,company_car_benefit£8,000: deduction £3,451.07, the tax on the pay alone. The £8,000 adds 8,000 × 21% = £1,680 that the formula doesn't deduct. At working age the same household gets £6,525.47, the whole liability. Judgment call 2 treats the two schemes in opposite ways under the same words. I couldn't check England and Wales (no text for their net-earnings rules). Either movebenefits_in_kindout ofPENSIONER_UNCOUNTED_NON_SAVINGS_INCOMEfor Scotland at least, or state in the body that reg 33(2)(a) reads like reg 50(3)(a) and the formula departs from it.P2-3. Invariant 5's "reads ... no family benefit" is false
order.pytracedcouncil_tax_reduction_tax_deductionfor each new YAML case. The tree reachesincome_support,jsa_income,esa_income,universal_credit_pre_benefit_capandchild_benefit. The first four come throughcouncil_tax_reduction_pensioner→council_tax_reduction_relevant_income_based_benefit(council_tax_reduction_pensioner.py:67);child_benefitcomes through income tax (HICBC). These are readscouncil_tax_reduction_applicable_incomealready made. Both orders give identical CTR and deductions in all five cases (for example 1,754.74 and 461.70 in the Scotland pensioner case), so there's no cycle. Replacement:P2-4. "The savings-credit-only routes do not deduct tax" is false
council_tax_reduction_applicable_income.pytakespension_credit_incomeon that route, andpension_credit_income.py:53-67deductsincome_tax_before_winter_fuel_payment_chargeandnational_insurance. Replacement:P2-5. Overlap with #1995: the two readings disagree, and each is partly wrong
git merge-tree --write-tree --name-onlygives exactly the body's merge notes (outputs below). On substance, fromhh.py,hh2.pyandmisc.pyat1b8f2ded(legacy_means_test_income_tax=earned_income_taxless reductions):The quoted law backs this branch on the working-age pension tax (reg 50(3)(a), and regs 57 to 65 with no deduction) and on the supplement (reg 27(1)(j)(xxib) and reg 31(12)). It backs #1995 on the finance-cost ordering (P2-1). Whether property income counts at all is #1995's own question, and none of the law quoted here settles it. Before both land, #1995 has to route the CTR line through
council_tax_reduction_tax_deduction, notlegacy_means_test_income_tax, because #1995's helper re-deducts the pension and supplement tax in Scotland. This branch has to adopt #1995's finance-cost ordering. The body's "Whichever lands second should route both through one helper" is right but should name these two points.P2-6. No test can fail on Class 3 (hand-off finding 5)
Adding
ni_class_3back toNATIONAL_INSURANCE_ON_EARNINGS(line 27) leaves all 17 YAML cases and all 8 property tests passing (table below).misc.pyshows the head gets it right: pay £20,000 withni_class_3£900 deducts £2,040.73, not £2,940.73. Add a YAML case: Scotland, age 40,employment_income: 20_000,ni_class_3: 900,would_claim_uc: false, expectingcouncil_tax_reduction_tax_deduction: 2_040.73(worked as in the first case: 1,446.33 + 594.40; Class 3 is voluntary and not charged on earnings) andcouncil_tax_reduction_applicable_income: 17_959.27.P3
restored_allowance(line 57) shields the counted income from the personal-allowance taper but not from losing Marriage Allowance.props.pyraised a Welsh pensioner partner's savings by £70,000 and added £40,000 of dividends, with the pension fixed. The partner stopped qualifying as recipient (marriage_allowance1,260 → 0) and the benefit unit's deduction rose by £252.00. This is the same pattern as hand-off finding 3, through a different allowance, and Apply the Pension Credit earnings disregards (SPC Regs 2002 Sch VI) #2019 handled it ("Hold ...marriage_allowance... consistently"). Fix it or name it in the docstring.NATIONAL_INSURANCE_ON_EARNINGSincludesni_class_2, and reg 38(2)(a) and SSI 2012/319 reg 37(2)(a) omit it.ni_class_2is £0 in 2026 for every self-employed case I ran, so no figure changes. Docstring line 25 should say "Class 2 contributions count only where the model charges them".pension_credit£2,660.16 (and CTR income 0 by the guarantee route) at the base and the head. Worth its own issue.Mutation checks
The YAML set is
council_tax_reduction_tax_deduction.yamlpluscouncil_tax_reduction_carer_support_payment.yaml(17 cases). The property set is the two CTR property files (8 tests). Each mutant was applied to a scratch copy of the head withPYTHONPATHpinned to it, then restored (the restore diffs clean against the head).test_scottish_working_age_income_never_falls_...,test_council_tax_reduction_income_ignores_the_scottish_carer_supplement)NATIONAL_INSURANCE_ON_EARNINGStest_pensioner_schemes_deduct_no_more_...)restored_allowanceremoved..._income_never_falls_...,test_pensioner_schemes_...)test_scottish_working_age_deducts_no_tax_without_earnings)The Class 3 mutant leaves every tested output unchanged, so its run (17 and 8 passed) is also the head's own result for these files.
Checked and sound
Base vs head, new and changed YAML (
policyengine-core test). Head: 17 passed. Base, with the new file minus itscouncil_tax_reduction_tax_deductionoutputs, plus the head's CSP file: 5 failed, 12 passed, matching the hand-off:[25954.527] differs from 27959.27,[17648.6] ... 18760.4,[17492.75] ... 18514.0,[14422.704] ... 14538.30, and the CSP pension-age case[17228.31] ... 17349.99. The Welsh guard passes at the base as intended.By hand from the law. The Scotland working-age case: 7,430 taxable, 753.73 + 692.60 = 1,446.33; Class 1 (20,000 − 12,569.96) × 8% = 594.40; total 2,040.73, given the earnings-lowest choice. The England pensioner case: (20,308 − 12,570) × 20% = 1,547.60, by reg 31(12) / para 17(13). The Scotland SCS case: 2,430 × 19% = 461.70. The CSP pension-age case: 5,925.40 taxable → 753.73 + 391.68 = 1,145.41; CTR 2,000 − 0.2 × (17,349.99 − 15,815.80) = 1,693.16. That CSP expectation follows reg 27(1)(j)(xxib) and reg 31(12), not just the new code. The carer property file's tightened invariant (CTR income and award unchanged by the supplement) follows the same law. Its HB differential nets off the tax only HB deducts, which keeps HB's own over-deduction (Pension Credit income still omits IIDB, SDA, the AFCS guaranteed income payment and other countable income #1954) visible, not hidden.
Scheme map, read from
simulated_council_tax_reduction_benunit.py,config.pyand the local scheme files:council_tax_reduction_applicable_incomethrough_legacy.pyor directly).council_tax_reduction_scheme_supportedfalls back to reported CTR. Northern Ireland gets the whole liability.Addresses #2090and the open list agree with this.The author's counterexample. Pay £30,000 with interest £60,000 and £90,000: deduction £4,845.47 in both (PA £12,570, then £2,570), CTR income £25,154.53. Main gives CTR income £5,308.53 and £0. By hand: 17,430 taxable → 753.73 + 2,597.80 + 99.54 = 3,451.07, plus Class 1 1,394.40 = 4,845.47.
My properties (
props.py, 60 random cases each, earnings, self-employment and pension random, then one kind of uncounted income raised):hh2.pyabove; the deduction doesn't move with the supplement.Float guard (line 76). It doesn't zero real pennies. Pay £12,570.00 / .10 / .50 / 1 / 5 / 20 with pension £10,000 gives deductions 0.0032 / 0.0301 / 0.1382 / 0.2732 / 1.3531 / 5.4031 (tax plus NI). Pensioner pension £12,570 + 0.10 / 0.50 / 1 / 5 gives 0.0189 / 0.095 / 0.19 / 0.95.
Rates.
tax_at_main_ratesuses Scottish rates wherepays_scottish_income_tax, otherwise UK rates (Welsh rates equal UK rates in the model), with the same gift aid extension asearned_income_tax. The 2027-28 and 2028-29 property-rate note: an English pensioner with pension £30,000, property £20,000 and miscellaneous £15,000 gets deduction £8,286.00 with or without the miscellaneous income. That equals income tax before the winter fuel payment charge without it (income_tax£8,486 includes the £200 charge), so the main-rate pricing of the top slice leaves the counted tax exact there.Class 3.
ni_class_3£900 on pay £20,000: deduction £2,040.73, unchanged.Determinism (
order.py). For each of the five new cases,council_tax_reductionfirst and the deduction first give identical results.Merge-tree (
git merge-tree --write-tree --name-only), head vs each and base vs each:e8831fb6: conflict incouncil_tax_reduction_applicable_income.pyagainst the head only.779f5dcf:council_tax_reduction_carer_support_payment.yamlagainst the head only;CHANGELOG.md,test_means_test_income_properties.pyandpyproject.tomlagainst both.cf0475dd: the same seven non-dependant files against both.1b8f2ded: the same six files against both.dd39eafb, Count Universal Credit carer-element awards in the severe disability premium and addition carer test #2120260f6a77, Fix HB and national CTR non-dependant deductions #20072667976b, Assess Oxford Universal Credit applicants on Appendix 3 income #279419378b97, Pay the 2022 £150 to Council Tax Reduction recipients in any band in Scotland and Wales #2768fe1c4f1a, andmain46a60678: clean.Fix evidence.
python3 .github/check_fix_pr.py --title-file … --body-file … --labels-file (empty) --changes-file <(git diff -z --name-status 2da212abc...411dc0243) --repo-root . --head-sha 411dc024…givesFix evidence: PASS ... Changed executable tests: 4.(exit 0). The title is 55 characters.Lint.
uvx ruff@0.17.2 format --check(4 files already formatted),ruff check(all passed), andgit diff --check(clean) on the changed Python files.048 rows. England, Wales and Scotland reproduce exactly, before and after (for example England 2,659.40 → 1,547.60, 17,648.60 → 18,760.40, CTR 1,132.68 → 910.32). So do the two 148 "loss nil" rows.
CTR YAML directory (
policyengine-core test policyengine_uk/tests/policy/baseline/gov/local_authorities/council_tax_reduction -c policyengine_uk): 336 passed at the head; 336 passed on a local merge of the head withmain46a60678(clean merge; nothing pushed).What I couldn't check
tests/code_health): not rerun.Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Picking this up for the UK hub. Reply here if you're mid-change and I'll stop.
Generated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_TITLE.txtGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
PR_BODY.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
AXIOM_ISSUE.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
FOLLOWUP_ISSUE.mdGenerated by Claude Code
MaxGhenis commentedon Nov 2, 2026
Ready for hub review
Branch
claude/ctr-deductions-review-kpqmyj, head7778076a4b611e99978fd44256d7d04a0f6c15c6. It branches from411dc0243dbbadefd56d46389b4b2b6270591edaand adds five commits. Nothing was pushed toclaude/council-tax-reduction-deductions-clzysl, and no PR is open. The title, body, Axiom packet andFOLLOWUP_ISSUE.mdare in the four comments above.Before starting: the only push to the base branch was
411dc024itself (15:53Z, the build this job reviews). No comment said anyone was mid-change. The pick-up comment went up before my first push.Findings and resolution
P1-1, the split (item 1). I rewrote
council_tax_reduction_tax_deduction.pyto option (a) in every scheme that deducts tax from earnings:pension_credit_income_tax_without_employment_income.pension_credit_income_tax_without_earnings.A new Person variable,
council_tax_reduction_income_tax_on_other_counted_income, gives T(E, S, U) through main'sincome_tax_with_inputs_zeroed, unchanged. It builds a branch only when someone has uncounted income, and the deduction reads each branch only when some benefit unit is in a scheme that uses it.U comes from
council_tax_reduction_applicable_income's pensioner route (..._income_tax_on_other_counted_income.py:12):scottish_carer_supplement,miscellaneous_income,benefits_in_kind,savings_interest_income,other_investment_incomeanddividend_income. One gap: the route counts Widowed Parent's Allowance less £15 a week, and the branch does not take that £15 out. The body names it.E equals main's statutory payments list. The schemes also count adoption, shared parental, parental bereavement and neonatal care pay, and the NI equivalents, but the model has no variables for those.
tax_below_top_slice,restored_allowance,tax_after_reductions_and_chargesand the float guard had no work left, and I removed them all. The DECISION text is cited from main's Pension Credit module.P2-2. Benefits in kind stay in both terms. For pay £30,000 plus a £8,000 company car benefit in Scotland:
With a £15,000 car benefit it is £7,814.75 and £6,420.35. Neither scheme deducts the £461.70 the car benefit alone would bear.
P2-1. Pay £30,000 plus property £20,000: deduction £8,930.12 without finance costs and £8,376.45 with £10,000 of them.
property_finance_cost_reliefis £2,000 with the pay.P3-1. The Welsh pensioner couple (pensions £9,000 and £30,000; partner adds £70,000 interest and £40,000 dividends) loses Marriage Allowance (£1,260 to nil). The deduction stays at £3,234, because the T(E, S, U) branch zeroes everyone's uncounted income. CTR income still falls, from £35,766 to nil, because Pension Credit's whole-tax deduction puts the couple on the guarantee credit route (P3-5).
Invariant 1 of the build no longer holds at working age: pay £30,000 with interest £60,000 gives CTR income £15,640.53, and with £90,000 it gives £11,540.53. The body says so.
P1-2 and item 2, self-employed. I added
council_tax_reduction_scotland_self_employment_deductions, used for both Scottish schemes:personal_allowance(line 60).Readings I took:
pension_credit_self_employment_deductions. Wales's text has no Scottish clause, but the model treats nobody in Wales as a Scottish taxpayer. Wales's Class 2 cutoff is FY 2025, while the Pension Credit variable stops at 6 April 2024. Both give nil in 2024 because the model's compulsory rate is nil from 6 April 2024.class_2_liable(small profits threshold before 2022-23). I have only the 5 April 2024 text, so earlier years follow the then-current SSCBA test.The deduction exceeds the tax paid where the law says it should (£631.80 against £607.50); invariant 3 states and tests this. The body's self-employed section also covers child minders and partnerships.
I put the Scottish variable in the CTR directory, not beside the Pension Credit file, so this PR changes nothing under
gov/dwp/pension_credit.P1-3, item 3. I reran every evidence-table row at the head:
Loss and no-loss give the same figures at both base and head. The review's ring-fence sentence replaces the old row.
P2-3 and P2-4, item 4. I traced six cases at the head. The deduction reaches
income_support,jsa_income,esa_income,universal_credit,universal_credit_pre_benefit_cap,child_benefit,council_tax_reduction_relevant_income_based_benefitandcouncil_tax_reduction_pensioner. The UC self-employed case also reachespension_creditandguarantee_credit; I did not trace which path. All six give the same result whichever variable is calculated first. Invariant 7 now namesuniversal_creditfor the Scottish route. P2-4 uses the review's text.P2-5, item 5, #1995. I reran the five households at the head and at
1b8f2ded(table in the body). They now agree on the working-age pension case and the carer case. They differ on:#1995 must route the CTR line through
council_tax_reduction_tax_deduction. On finance costs, option (a) settles the ordering, so this branch does not adopt #1995's.P2-6, item 6. I added the Class 3 case (yaml line 265: £2,040.73 and £17,959.27, worked by hand). The Class 3 mutant now fails exactly that case.
P3 (item 7).
main6c6e229a. Pension Credit is £2,660.11, not £2,660.16, and the same at2da212abc.FOLLOWUP_ISSUE.mdis posted.Item 8, main.
git merge-treeis clean against6c6e229aand against the newermain0080274d, so I did not merge.e8831fb6has no PR. It conflicts incouncil_tax_reduction_applicable_income.py, caused by this branch.council_tax_reduction_carer_support_payment.yaml(caused here) plus three files that already conflict with main.council_tax_reduction_applicable_income.py, caused here (the review listed seven files then).Item 9, packet.
Tests
Each count is from a clean run at the head unless stated.
YAML
council_tax_reduction_tax_deduction.yaml(17 cases) plus the CSP file (12 cases): 29 passed.2da212abc, with the deduction outputs stripped: 16 fail and 13 pass. The 13 are the two guards, as intended, and 11 CSP cases. The Scotland pay £20,000 / pension £10,000 case is kept as a guard, not a reproducer.Python
--hypothesis-show-statistics, 25 examples each; the per-scheme shares are in the body. Every route of each invariant is drawn, and 15% of invariant 5's draws crossed a tax cliff.test_council_tax_reduction_pension_credit_properties.py, whose oracle deducted the whole liability. The third wastest_trading_loss_properties.py::test_means_tests_see_the_loss_only_through_tax, which held income tax as an input that the branches then read unchanged. Both now read or holdcouncil_tax_reduction_tax_deduction, and those two files then passed (21 tests). I did not rerun the other 37 files after that change, which touched only those two test files.test_claims_all_entitled_benefits.py::test_survey_takeup_follows_reports_in_microdata, which needs the survey dataset.Checks
tests/code_health: 3,090 passed.uvx ruff@0.17.2 format --check .(2,168 files formatted),ruff check ., F811/F821 andgit diff --check: all clean..github/check_fix_pr.pyon the final title and body:Fix evidence: PASS, changed executable tests 6, exit 0.Invariant 5 counterexample. I minimised one by hand. A Scottish couple whose pay rises from £43,661 to £43,662 loses Marriage Allowance: the deduction rises £264.89 and CTR rises £52.78 (council tax set to £15,000 so CTR is positive). The personal savings allowance falling from £1,000 to £500 does the same (CTR £7,902.21 at pay £47,270 against £7,920.41 at £47,300, with £3,000 of interest). Both are tax cliffs, labelled intended; the test exempts draws where
marriage_allowanceorsavings_allowancechanges. No other counterexample turned up.Timing.
council_tax_reductionfor one simulation of 500 generated households: 1.13 s at2da212abc(two runs) and 1.01 s and 0.97 s at the head.Mutants
Each was applied alone in a scratch copy with
PYTHONPATHpinned to it, and run against the two YAML files (29 cases):I did not run the mutants against the property tests.
Skipped and judgment calls
applicant_has_universal_credit;Generated by Claude Code