Repository navigation
Conversation
Montana's 2021-2023 separate-filing medical deduction read each spouse's own other_medical_expenses, so a dependent's bills (recorded on the person cared for) reached neither spouse. Add mt_medical_and_dental_expenses_indiv, Itemized Deductions Schedule line 1a in each column: the spouse's own expenses plus an equal share of the dependents' (spouse_allocation_rate, the model's convention for itemized deductions not clearly attributable to one spouse; ARM 42.15.524(3)(b) and the Form 2 instructions let the couple divide them in any proportion). An unmarried filer's column holds all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YAML cases fail on main: a couple with a child's expenses under both head/spouse labellings, a head of household, and the 2024 reform branch. The invariants test states the line 1a closed form and conservation (the head's and spouse's columns sum to every member's other medical expenses), uses it in the separate-variant accounting identity, and adds a head-of-household differential against the joint variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document that line 1a divides every member other than the head and spouse (so the columns hold every member's expenses, as the joint line 1 does) and test it with a member who is neither spouse nor tax unit dependent. Cite the 2022 instructions' pages 11 and 32-33, state ARM 42.15.524(3)'s federal-return precondition, and name the charitable split the equal division follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub (from session local_bb242a7d, 2026-10-19)
|
PR Review: Count dependents' medical bills in Montana's separate-filing medical deductionSummaryThe PR adds
Critical (must fix)None. Should address1. Known tax increase for some status 2a couples in claimed years; fix how the itemize election is chosen, or track it before merge. Files: What's wrong. Moving a dependent's bills into the columns can tip the summed comparison toward itemizing even when the couple's tax goes up. The PR body's TY2022 witness: head wages $60,000, spouse $15,000, a child with $10,250 of other medical expenses.
The hand arithmetic agrees. The head's column gives up 1,680.20 of deductions at the 6.75% top rate (about +$113). The spouse's column gains 1,696.20 in the 3–4% brackets (about −$55). The net is about +$58, against the body's $58.62. Why it's wrong under the law. Montana lets the couple choose the standard deduction. The 2022 Form 2 instructions say "Spouses must either both claim the standard deduction, or both itemize their deductions" (PDF p. 11). MCA 2021 § 15-30-2132(1) says the standard deduction "is allowed if elected by the taxpayer." So this couple would owe at most $2,929.68 under the standard deduction, or $2,789.30 with all of the child's bills in the head's column, which the "any proportional amount" rule allows. The model elsewhere assumes the couple makes the cheaper choice:
Why this is not critical.
Even so, merging as is knowingly makes some modeled TY2021–2023 liabilities worse. Fix (preferred). Make Fallback, if the hub prefers to merge first.
Suggestions
Verified correct
Axiom line assessmentThe line is
The line is valid. CI statusAll 27 checks pass at I did not rerun anything locally. CI covers the PR's tests at this head, and the witness figures above are the PR's own, checked against hand arithmetic. Branch statusThe branch is 4 commits ahead of main and 34 behind. Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
The law checks out: line 1 includes dependents under IRC 213, the floor is on each column's own MT AGI, and an equal split is a legal joint-account allocation. One should-address item: the equal split plus the summed test in mt_tax_unit_itemizes makes some couples itemize at a higher tax than the standard deduction the law lets them take (e.g. $2,929.68 -> $2,988.30). Choose itemizing by comparing tax, here or in a stacked PR, or file a tracked issue. Four suggestions. Full report in the comment above.
Summary
From 2021 to 2023, Montana let married couples file separately on the same form (filing status 2a, columns A and B).
mt_medical_expense_deduction_indivmodels each column's medical deduction. It readperson("other_medical_expenses")for each spouse.other_medical_expensesis recorded on the person cared for, including amounts other household members paid on that person's behalf (CPS ASEC PMED_VAL; documented on the variable by #10270). So a dependent's medical bills reached neither column. The joint variant counts every member's.This PR adds
mt_medical_and_dental_expenses_indiv, line 1a of the Itemized Deductions Schedule in each column:mt_medical_expense_deduction_indivnow floors that amount at 7.5% of the column's Montana AGI. Lines 2 and 3 (premiums) are unchanged.Example (TY2022): the earner has $1,000 of expenses and Montana AGI $60,000; the partner has $500 and $20,000; their child has $6,000. Main gives both columns $0. Now line 1a is $4,000 and $3,500, and the partner deducts 3,500 − 7.5% × 20,000 = $2,000. The result is the same whichever spouse is labelled head.
Law, and the choice it leaves
The inputs don't say who paid a dependent's bills, and for jointly paid bills the law lets the couple choose any split. So the law leaves a real choice. This PR uses an equal split,
gov.states.mt.tax.income.deductions.itemized.spouse_allocation_rate(0.5, which cites ARM 42.15.524):The equal split doesn't depend on which spouse is labelled head, and its columns sum to the joint return's line 1. Each spouse's own expenses stay in that spouse's column, as before: the instructions require that for expenses attributable to one spouse, and the "any proportional amount" rule allows it for jointly paid ones.
The model has a second precedent for dependent-related items.
mt_taxable_income_indivgives the dependent exemptions to the higher-income column until the columns' taxable incomes are equal; its comment says they are "allocated optimally".Queued for Max: d1700, keep the equal split or allocate to minimize the couple's tax, as the dependent exemptions already are. It defaults to parking, which keeps the equal split.
How much the split matters (independent review, TY2022): measure it in tax, not line 1. The line-1 example above changes no tax, because the couple takes the standard deduction at every split ($3,102.57). On the tax witness below (head $60,000, spouse $15,000, child's bills $10,250):
The worst split is 0.45, at $3,007.52, so the equal split sits near the worst. Across 1,452 couples, the best of five splits beats the equal split for 1,085, by $197.73 on average and up to $575.95. The tax-minimizing split raises no one's tax above main; the equal split raises 24. The 'any proportion' allocation covers bills paid from accounts both spouses own. A bill one spouse paid from their own funds belongs to that spouse.
What minimizing would take: each column's line 1 is convex in the split, so line 1 alone peaks at an endpoint. But the columns' marginal rates differ, so minimizing tax needs the tax at more than one split.
What the PR does not depend on: the ruling. A different ruling would be a follow-up change to one formula.
Changes
mt_medical_and_dental_expenses_indiv(new, Person):head_or_spouse × own + share × Σ dependents' other_medical_expenses, where share =spouse_allocation_ratefor the head and spouse of a married unit, and 1 for an unmarried head. Samedefined_foras the deduction (mt_married_filing_separately_on_same_return_eligible), so it is 0 from 2024 unless a reform re-enables separate filing.mt_medical_expense_deduction_indiv: line 1 floors that amount (and so does the 2024 reform branch, where premiums stay under the floor). Documentation updated.Invariants
These hold for every input, 2021–2023 (and a reform that re-enables separate filing), under the baseline
spouse_allocation_rateof 0.5. The parameter is each spouse's share, as for the charitable deduction, so a reform rate r would give the columns 2r of the dependents' expenses:Tests:
tests/unit/test_mt_medical_premium_deduction_invariants.py:mt_medical_expense_deduction_indiv.yamland the newmt_medical_and_dental_expenses_indiv.yaml:Fail-before evidence (main
f9b55fc4dd)YAML: with only the deduction outputs, all 3 new deduction cases fail on main, and the 10 existing cases pass:
Property test: on main plus only the new helper variable (main's deduction formula), the accounting property fails.
Head-of-household differential: with the accounting assertion masked, property 11 fails on main by itself, in Hypothesis and the derived and per-person seeded modes (unit mode skips it by design).
Runs at this head
b352a51acb): the two changed files pass (17 cases). The wholemt/tax/income/deductionstree plusjoint_agi_deductions_integration.yamlandstate_itemized_deductions.yamlpass: 24 files, 201 cases, two processes of 12.01fd6e5c6a; the invariants file again atb352a51acb, 5/5): each file passes in its own process:test_mt_medical_premium_deduction_invariants.py(5)test_mt_joint_agi_deductions_properties.py(15)test_mt_mortgage_interest_federal_limit_properties.py(6)test_mt_elderly_credit_dependent_deductions.py(2)test_mt_federal_income_tax_deduction_allocation.py(2)code_health/test_no_group_variables_in_person_adds.py(10)2e5fccfd1f):01fd6e5c6amerges cleanly, and on the merge the invariants file (5) and the three MT medical YAML files (46 cases at that head) pass. Both PRs edittest_mt_medical_premium_deduction_invariants.py, in different hunks, so they can land in either order.b352a51acbchanges only the new variable and its YAML file, which Count only filer-paid premiums in Schedule A medical expenses #10270 doesn't touch.Impact
Who: only TY2021–2023 Montana households (and reforms that re-enable separate filing) whose dependents have other medical expenses.
mt_income_taxabove $0.0001.Where it flows: through
mt_itemized_deductions_indivto four places:mt_tax_unit_itemizes, the separate path's itemize-or-standard choice;mt_files_separatelyandmt_income_tax, which use the separate return when it is cheaper than the joint one;mt_income_tax_before_refundable_credits_unit, the lower of the two;mt_income_tax_before_2021_rebate).mt_itemized_deductions_for_federal_itemization_indivalso changes. It feeds onlystate_itemized_deductions, which no formula reads (since Fix tax_unit_itemizes tied-federal-tax fallback (#8210) #8213 the federal itemization choice does not use it).The effect goes both ways. Most affected couples pay less, but a few pay more. Two things cause it: an existing rule, and the equal split. Either change alone removes the increase.
mt_tax_unit_itemizesmakes both columns itemize when the sum of their itemized deductions exceeds the sum of their standard deductions; it does not compare the tax under each choice. The reviewer's sweep of 1,452 TY2022 married couples (head wages 40k–90k, spouse 8k–30k, a child's expenses 0–30,000) found 641 paying less (by up to $585.66) and 24 paying more (by up to $58.62).mt_tax_unit_itemizescompare tax is a separate change, proposed as a follow-up session. With it, the witness returns to main's $2,929.68 (standard deduction). A tax-minimizing split alone gives $2,789.30.Not measured: no microsimulation was run (Fleet ops disk pause Add tax parameters #9), so this PR reports no aggregate figure.
Not covered
filing_statusis supplied; its head's column then holds all of the dependents' expenses.axiom: rulespec-us#1520 queued (extension comment). The extension covers the status 2a line 1a allocation. It adds the historical ARM 42.15.524, which the corpus lacks, to #1520's open prerequisites. At pin
437198d6, § 15-30-2110 has no MCA 2021 edition row (its section row is a repeal marker; 2023 HB 192 and HB 222 reprint it as amended in 2023), § 15-30-2132 has no text, and the IRC 213 floor rate has no TY2021–2023 version. The TY2021–2023 Form 2, its instructions, and MCA 2021 § 15-30-2131 are in the corpus.Review
The Codex lanes have been closed since 13:23Z and Fleet ops' disk pause #9 blocks new Subfleet jobs. So the independent review ran as an in-session Opus 5.5 agent, the fallback in the review rules.
r1 at
01fd6e5c6a: REQUEST_CHANGES, no code defects. All findings were in the body and the Axiom draft, plus documentation nits:state_itemized_deductions);Fixed in
b352a51acb, the Axiom draft and this body:Files:
~/reviews/us-hub/reviews-gen/us-mt-sep-medical/review-r1.md.r2 at
b352a51acb: delta review, REQUEST_CHANGES on two prose claims. The draft misdescribed the statute scope: 2023 HB 192 and HB 222 reprint § 15-30-2110. The body claimed PE couldn't apply ARM (3)(c). Both are fixed in this body and the posted comment.r2b: APPROVE at
b352a51acbwith this body and the posted draft. No blocker or should-fix remains; its two optional nits are applied.Files:
review-r2.md(rounds 2 and 2b), same folder.METHODOLOGY_CHOICE: yes in both rounds. The only methodology choice is d1700, listed for Max; nothing is chosen silently.
🤖 Generated with Claude Code