Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11695 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 3 +2
Lines 24 51 +27
=========================================
+ Hits 24 51 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hua7450
left a comment
There was a problem hiding this comment.
Thanks, David. The subtraction follows 71.05(6)(b)19, 35, 38 and 42:
- 100 percent of premiums paid in every year from 2021;
- less what was deducted federally;
- capped at income per return, as Worksheets 1 and 2 do.
The premium aggregate is the right one. It covers dental, vision and Medicare Parts B and D, leaves out employer-paid, pretax and long-term care premiums, and nets the self-employed deduction. Treating premiums as paid net of the advance credit is a fair simplification. Homestead income now takes the subtraction out, as 71.52(6) and Schedule H line 8c require. There's no cycle, and the changed expected values follow from the subtraction. One fix before I approve.
Before merge
- The same premiums still count in the itemized deduction credit.
wi_itemized_deduction_credit_potential(lines 37-41) adds the full federalmedical_expense_deduction, which includes premiums.- The rule: Wis. Stat. 71.07(5)(a)15 excludes "The amount claimed as a deduction for medical care insurance under section 213 of the Internal Revenue Code that is exempt from taxation under s. 71.05 (6) (b) 19., 35., 38., and 42." The 2025 Form 1 instructions (pages 16-17) give a worksheet: it prorates the federal medical deduction by the premium share and removes the part subtracted on Schedule SB line 6.
- Why it's new: before this PR nothing was subtracted, so counting premiums in the credit was right.
- Example (2025): a single employee has $40,000 of wages, $6,000 of after-tax premiums and $14,000 of other medical costs. The worksheet allows 11,900 of medical expenses, so the credit is (11,900 − 11,826) × 5% = 3.70. The PR gives 258.70, so Wisconsin tax is $255 too low.
- Fix: apply worksheet lines 1-5 and 10-12 to the medical part of the credit (the long-term care lines can wait for line 7), and add a case like this one.
Worth fixing here
- The cap takes the retirement subtraction first. The cap subtracts the full retirement income subtraction, but that subtraction is elective ("up to $5,000"). In Example 1 of the 2025 Schedule H instructions, the filer takes only $765 of the pension subtraction so all $1,735 of premiums can be subtracted. That gives household income of 10,765.
- The model: it gives 12,000. With $1,000 of property tax added, the credit is 523.10 instead of 609.89.
- Fix: compute the cap without the retirement subtraction, then reduce the retirement subtraction by the overlap. Wisconsin tax stays the same, and the result matches the example.
- This is the cap the PR adds, so fixing it here is easiest. Otherwise, please open an issue and link it.
Optional
- Cap wording. The statute limits the subtraction to "wages, salary, tips, unearned income, and net earnings from a trade or business that are taxable by this state". The worksheet instead uses Form 1 line 5 less the other subtractions, which also nets federal adjustments such as IRA contributions. The difference only reaches the homestead credit, and the PR follows the worksheet. A one-line comment noting it would help.
- A joint-return case. All new subtraction cases are single filers. One married couple (both on Part B, or one self-employed) would pin the head-plus-spouse sum and the shared cap.
- Part B pins. 15 existing cases for people 65 and older now set
medicare_part_b_enrolled: falseto keep their expected values. Part A alone is unusual at those ages, so keeping main's inputs and updating the expected values would keep the households realistic. Thessi: 0inputs in the new homestead Cases 8 and 34 can go, since their comments already show SSI is 0. income -= ...inwi_homestead_income.py(line 55) could be written asincome = income - ....
…raction into homestead household income Adds wi_medical_care_insurance_subtraction (Wis. Stat. 71.05(6)(b)19, 35, 38, 42; Schedule SB line 6), limited to Wisconsin income before it, and takes it out of wi_homestead_income (71.52(6); Schedule H line 8c). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…deduction credit, take the elective retirement subtraction after the premium limit, drop Part B pins - Add wi_itemized_deduction_credit_medical_expense_deduction (Wis. Stat. 71.07(5)(a)15; 2025 Form 1 instructions worksheet lines 1-5 and 10-12) and use it in wi_itemized_deduction_credit_potential. - Limit the medical care insurance subtraction without the elective retirement income subtraction and reduce that subtraction by the overlap (2025 Schedule H instructions, Example 1); total subtractions are unchanged. - Restore Schedule H Example 1 (household income 10,765; credit 609.89 with $1,000 of property tax), add a joint case, and remove the Part B pins and ssi inputs, updating expected values with the arithmetic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3852604 to
8588c37
Compare
|
Thanks for the careful review. All four points are fixed in 8588c37, which is rebased on current main. Before merge1. Premiums counted twice in the itemized deduction credit. Fixed.
Worth fixing here2. The cap takes the retirement subtraction first. Fixed.
OptionalCap wording. Done. A NOTE on the limit quotes the statute (subd. 19.dm, 35.d, 38.d and 42.d) and says the code follows the worksheet, which also nets federal adjustments. Joint-return case. Added as Case 11. Both spouses are 70 and on Part B (2,220 each), with 3,000 and 1,000 of interest. The subtraction is 4,000, the smaller of 4,440 and the return's shared 4,000; separate limits would give 3,220. Part B pins. Removed: all 17
Verification
|
hua7450
left a comment
There was a problem hiding this comment.
Thanks, David. The fixes check out at 85429bc:
- Itemized deduction credit. The new
wi_itemized_deduction_credit_medical_expense_deductionfollows the 2025 Form 1 worksheet. The subtracted premiums come out after the federal 7.5% floor, matching worksheet lines 4, 5 and 12. The round-1 household's credit drops from 258.70 to 3.70. - Retirement subtraction order. The model now matches DOR's Schedule H Example 1: household income 10,765 and a 609.89 credit, where it gave 12,000 and 523.10. Total subtractions and Wisconsin tax are unchanged.
- Optional items. The cap NOTE, the joint-return case (4,440 capped at 4,000), the Part B overrides and the
+=are all done.
One thing before I approve.
Before merge
-
Ten cases whose expected values the fix rewrote still use
absolute_error_margin: 1. Dropping the Part A overrides changed every expected value in these cases, so the margin should tighten with them:wi_retirement_income_exclusion.yaml(E2E single age 68)wi_retirement_income_exclusion_tax.yaml(E2E joint 67+ and the partial unlock)wi_income_tax.yaml(first case)household_net_income.yaml(the Wisconsin case)household_state_tax_before_refundable_credits.yaml(the six Wisconsin cases)
Some values are exact results checked only to within a dollar (303.02, 105.70, 18.20, 41,231.80, and the subtractions 2,220, 4,440 and 3,108). Others are tax table figures that pass only because of the margin: 1,172 where the model gives 1,172.81, 254 where it gives 254.02, and 926 where it gives 926.61. With a $1 margin, a small error in the new subtraction or the Part B premium feeding it would pass. Please assert the model's exact values to the cent with
absolute_error_margin: 0.01, and keep the tax table figures in the comments.
Optional
- Repeated households. The Schedule H Example 1 household is tested in three files (subtraction Case 12, homestead income Case 34, homestead credit Case 9), and the itemized-credit household in two. One full case plus the variable-level checks would do.
- Cap NOTE. It could say why the worksheet's reading is followed where the statute's wording is ambiguous.
…olds, cap note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. All three items are in ce00d2b, and the merge commit after it brings in current Before merge
Optional
Verification
|
Part of #10812 (state credit income audit).
What was wrong
wi_homestead_income(Schedule H line 13) starts from federal adjusted gross income. Wis. Stat. 71.52(6) starts household income from Wisconsin adjusted gross income, which is net of Wisconsin's medical care insurance subtraction, and doesn't add that subtraction back. The model didn't have the subtraction at all, so it also overstated Wisconsin income tax for anyone who pays medical care insurance premiums after tax.The subtraction is four subdivisions of 71.05(6)(b), not one (the audit cited (b)28, which is the tuition subtraction):
Each one then subtracts "the amounts deducted from gross income for medical care insurance in the calculation of federal adjusted gross income" (b.) and limits the result to income taxable by Wisconsin (d.). The 2025 Schedule SB instructions (line 6, pages 2-3) count Medicare premiums withheld from Social Security ("for example, Parts B and D"), exclude employer-paid and pretax premiums, and cap the subtraction at "line 5 of Form 1 less the amount on line 50 of Schedule SB without considering the subtraction for medical care insurance" (Worksheet 2, line 6). The 2021 instructions (pages 3-4) have the same worksheets.
What changes
wi_medical_care_insurance_subtraction(Schedule SB line 6). It takes the filers'medical_expense_health_insurance_premiums, the existing aggregate of after-tax, person-paid premiums that already leaves out employer-paid and pretax payroll premiums and adds the modeled Medicare Part B premium when no premium is entered. It subtractsitemized_medical_expenses_excluded_premiums, the medical part of the federal self-employed health insurance deduction (Worksheet 1, line 2, which leaves out long-term care). It then limits the result to federal AGI plus Wisconsin additions less the other Schedule SB subtractions, floored at zero. The elective retirement income subtraction ("up to $5,000") is left out of that limit, as in the 2025 Schedule H instructions, Example 1 (page 12). All four groups get 100% of what they paid, so the employer-paid share needs no input.wi_income_subtractionsadds the new subtraction to the existingsources.yamltotal. It isn't listed insources.yamlbecause its cap is computed from that list; the list's description now says so. It then reduces the retirement income subtraction by the overlap, which is the part of the medical subtraction above the income left after all other subtractions. Total subtractions, and so Wisconsin tax, stay what they are with the full retirement subtraction taken first.wi_itemized_deduction_credit_medical_expense_deduction, used bywi_itemized_deduction_credit_potentialin place ofmedical_expense_deduction. Wis. Stat. 71.07(5)(a)15 excludes the medical care insurance subtracted on Schedule SB line 6 from the credit. The variable applies lines 1-5 and 10-12 of the 2025 Form 1 instructions worksheet (pages 16-17): it prorates the federal medical deduction by the premium share and removes the part subtracted.wi_homestead_incomesubtracts it, since 71.52(6) starts from Wisconsin AGI and doesn't add it back. The 2025 Schedule H instructions (line 8c, pages 11-12) take the same subtraction on the no-return path. No double count: federal AGI already nets the self-employed deduction, and the Wisconsin subtraction excludes those premiums.Who is affected
Tests
wi_homestead_income.yamlCase 34, with the example's own inputs: 500 + 1,235 − 1,735 + 10,000 + 765 = 10,765.wi_homestead_credit.yamlCase 9 adds $1,000 of property tax: (1,000 − 2,705 × 8.785%) × 80% = 609.89.subtractions/wi_medical_care_insurance_subtraction.yaml(13 cases): retiree Medicare premiums (1,735); the cap binding (500 of 1,735) and exactly at the cap (1,735 of 1,735); an employee's after-tax premiums (Wisconsin AGI 37,600); pretax payroll premiums (0); premiums fully deducted as self-employed health insurance (0); premiums above the self-employed deduction (3,000 − 1,858.70 = 1,141.30); a dependent's own premiums left out; the modeled 2025 Part B premium (185 × 12 = 2,220) with no premium entered; a non-Wisconsin filer (0). Case 11 is a joint return with both spouses on Part B, so the summed 4,440 meets the shared 4,000 limit. Cases 12-13 leave the elective retirement subtraction out of the limit.wi_itemized_deduction_credit_medical_expense_deduction.yaml(6 cases), with the worksheet arithmetic, plus a case inwi_itemized_deduction_credit.yaml: credit 3.70, tax 809.04.wi_homestead_income.yamlCase 35, Example 2 without its railroad benefits: 100 + 1,859 − 1,959 = 0 (main: 100). Case 36, an employee's after-tax premiums: 15,000 − 1,200 = 13,800 (main: 15,000).wi_homestead_credit.yamlCase 8, the homeowner above: (1,000 − (13,265 − 8,060) × 8.785%) × 80% = 434.19 (main: 312.26).household/income/household/) keep main's inputs, so the modeled Part B premium is subtracted. The new expected values have their arithmetic in comments; for example, a 68-year-old with a $41,250 pension pays 18.20 instead of 96 on the exclusion path. Two existing homestead income cases also change because the limit leaves out the retirement subtraction: Case 6 goes from 23,500 to 21,403.60, and Case 7 (2020) from 19,500 to 17,764.80.wi_income_tax.yaml"PolicyBench scenario 091" enters 1,800 of after-tax premiums, which are now subtracted. Expected tax goes from 878.52 to 789.82: the standard deduction phase-out gives back 12% × 1,800 = 216, taxable income falls 2,016, × 4.4% = 88.70.household/income/household/all pass (535). This includes main's new blind worker transportation credit file, where three cases with a 67-year-old now subtract the modeled Part B premium (5,770.80). The other YAML files with Wisconsin households: 93/93. code_health (source conflicts, parameter keys, reference URLs, non-refundable credit consumers, entity sums): 411/411. Wisconsin Python tests: 14/14. No partner test has a Wisconsin household.Not in this PR
long_term_health_insurance_premiumsexists, but the subtraction has its own rules and isn't added here. The itemized deduction credit worksheet's long-term care lines (6-9 and 13-14) wait for it.Overlap: #10696 adds
taxable_railroad_benefitstosubtractions/sources.yamlon other lines; it is compatible and would enter the cap as another subtraction. #10722 and #10693 append cases towi_homestead_income.yamlandwi_homestead_credit.yaml, so whichever merges second resolves an end-of-file conflict.axiom: TheAxiomFoundation/rulespec-us#2935 queued
🤖 Generated with Claude Code