Skip to content

Count dependents' medical bills in Montana's separate-filing medical deduction - #10276

Open
MaxGhenis wants to merge 4 commits into
mainfrom
fix-mt-separate-medical-dependents
Open

MaxGhenis wants to merge 4 commits into
mainfrom
fix-mt-separate-medical-dependents

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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_indiv models each column's medical deduction. It read person("other_medical_expenses") for each spouse. other_medical_expenses is 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:

  • Couple filing separately on the same form: each spouse's own other medical expenses, plus half of every dependent's.
  • Unmarried filer: the head's column holds every dependent's expenses.

mt_medical_expense_deduction_indiv now 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

  • Line 1 (2022 instructions, PDF p. 32): "Enter your medical expenses paid in 2022 … the same medical and dental expenses that are allowed under the Internal Revenue Code." IRC 213(a) covers medical care "of the taxpayer, his spouse, or a dependent".
  • Allocation between columns (2022 instructions, PDF p. 11; identical in 2021, p. 10, and 2023, pp. 12–13):
    • "Deductions that are attributable to only one spouse must be claimed by that spouse."
    • "Payments made from accounts owned by both spouses that pertain to expenses not attributable specifically to one spouse can be allocated to either spouse in any proportional amount."
  • ARM 42.15.524(3) (in effect 4/30/2010 until its repeal effective 1/25/2025, so it governed TY2021–2023; archived text). It applies to spouses who filed a joint federal return or none, which is how PE treats married units:
    • (a) A deduction "clearly attributable to one spouse may be claimed only by the spouse to whom it is attributable".
    • (b) On the same form, one "not clearly attributable to one spouse may be divided as provided on the form".
    • (c) On separate forms, it "must be divided equally unless the spouses enter into a binding written agreement".

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):

  • Charitable deduction: the model already splits it this way, as a modeling convention.
  • Dependent care deduction: the model splits it the same way, but there the equal split is statutory (MCA 2021 § 15-30-2131(1)(c)(vi)(D): it "must be divided equally between the spouses when filing separately on the same form").
  • Separate forms: an equal split is ARM (3)(c)'s default.

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_indiv gives 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):

    • main $2,929.68;
    • equal split (this PR) $2,988.30;
    • all to the spouse $2,918.36;
    • all to the head $2,789.30, the lowest of 41 splits.

    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_rate for the head and spouse of a married unit, and 1 for an unmarried head. Same defined_for as 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_rate of 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:

  1. Conservation: the head's and spouse's line 1a sum to every member's other medical expenses, the joint return's line 1 base.
  2. Closed form: a married spouse's line 1a is own + ½ × dependents'. An unmarried head's is own + all dependents'. A dependent's line 1a and deduction are 0. "Dependents" here means every member other than the head and spouse, the same members whose expenses the joint return counts.
  3. Label invariance: swapping the head and spouse labels swaps their columns, so the couple's deductions are unchanged.
  4. Accounting: separate deduction = max(0, line 1a − 7.5% × own Montana AGI) + own lines 2 and 3.
  5. Differential: for unmarried filers (single, and now head of household) whose self-employed deduction is recorded per person, the joint and separate variants agree.
  6. From 2024 under baseline law, line 1a and the separate deduction are 0.

Tests:

  • Property tests in tests/unit/test_mt_medical_premium_deduction_invariants.py:
    • Hypothesis plus three seeded populations.
    • Properties 10 and 11 are new: 10 is invariants 1–2, 11 is invariant 5 for heads of household.
    • Property 1 (invariant 4) is updated, and property 8's 2024 branch now also checks line 1a (invariant 6).
    • Non-vacuity witnesses: dependents' expenses raise the separate line 1 of some spouse, some married head and some head of household.
    • No new simulation is built; the test computes one more variable.
  • YAML in mt_medical_expense_deduction_indiv.yaml and the new mt_medical_and_dental_expenses_indiv.yaml:
    • invariant 3: two tax units with the same people and swapped labels, in both files;
    • a married unit with a member who is neither spouse nor tax unit dependent (pooled and divided);
    • a head of household with two children;
    • the 2024 reform branch;
    • the zero from 2024 under baseline law.

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:

    Case Main This PR
    Couple, both labellings [0, 0, 0, 0, 0, 0] [0, 2,000, 0, 0, 2,000, 0]
    Head of household 0 1,750 (the joint variant already gave 1,750 on main)
    2024 reform [0, 0, 0] [1,000, 1,250, 0]
  • Property test: on main plus only the new helper variable (main's deduction formula), the accounting property fails.

    • Hypothesis minimizes it to one dependent with $1 of expenses: deduction 0, expected 1.
    • It also fails in all three seeded 2021–2023 populations.
  • 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

  • YAML (at b352a51acb): the two changed files pass (17 cases). The whole mt/tax/income/deductions tree plus joint_agi_deductions_integration.yaml and state_itemized_deductions.yaml pass: 24 files, 201 cases, two processes of 12.
  • Python (at 01fd6e5c6a; the invariants file again at b352a51acb, 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)
  • With Count only filer-paid premiums in Schedule A medical expenses #10270 (head 2e5fccfd1f): 01fd6e5c6a merges cleanly, and on the merge the invariants file (5) and the three MT medical YAML files (46 cases at that head) pass. Both PRs edit test_mt_medical_premium_deduction_invariants.py, in different hunks, so they can land in either order. b352a51acb changes 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.

    • The tax effect falls on married couples.
    • For unmarried filers, the joint path already counted their dependents' bills, and the model takes the lower of the two taxes. The change only makes the two variants agree. The reviewer's sweep of 2,046 TY2021–2023 head-of-household cases found no change in mt_income_tax above $0.0001.
  • Where it flows: through mt_itemized_deductions_indiv to four places:

    • mt_tax_unit_itemizes, the separate path's itemize-or-standard choice;
    • each column's tax, then mt_files_separately and mt_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;
    • the 2021 rebate's cap base (mt_income_tax_before_2021_rebate).

    mt_itemized_deductions_for_federal_itemization_indiv also changes. It feeds only state_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_itemizes makes 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).

    • Witness, reproduced at this head: head wages $60,000, spouse $15,000, a child with $10,250 of other medical expenses.
    • Before: both columns take the standard deduction (5,090 + 3,000 = 8,090), and Montana tax is $2,929.68.
    • Now: the itemized deductions (3,409.80 + 4,696.20 = 8,106.00) exceed the standard ones, so both columns itemize. The head's taxable income rises to $51,170.20 and the tax rises to $2,988.30.
    • The couple could still take the standard deduction, so the model overstates their tax.
    • Making mt_tax_unit_itemizes compare 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

  • PE's SEPARATE filing status: this is the federal status, and a separated head with a qualifying child gets HEAD_OF_HOUSEHOLD first. So a SEPARATE unit with dependents arises only when filing_status is supplied; its head's column then holds all of the dependents' expenses.
    • Couples who filed separate federal returns fall under ARM 42.15.524(2) and the instructions' "report the items of deduction the same way you reported them on your federal Form 1040", which this PR does not model.
    • For couples PE treats as one tax unit, ARM (3)(c)'s default for status 2b is the same equal split this PR uses; PE has no separate path for status 2b (the dependent care deduction does treat federal SEPARATE units as filing on a separate form).
  • Payer data: PE has none. A spouse's own expenses are taken as attributable to that spouse, which the instructions require for such expenses and allow for jointly paid ones.

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:

    • a false reader claim (state_itemized_deductions);
    • an undisclosed two-way tax effect;
    • the missing exemption precedent for d1700;
    • two gaps in the Axiom draft: output 1, and the prerequisites.
  • Fixed in b352a51acb, the Axiom draft and this body:

    • the pool documentation and a YAML case for a non-dependent member;
    • the reference pages and the ARM (3) precondition;
    • the qualified invariants;
    • this impact section;
    • the "Not covered" section.
  • 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 b352a51acb with 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

MaxGhenis and others added 3 commits October 19, 2026 09:49
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>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub (from session local_bb242a7d, 2026-10-19)

  • Head: b352a51acb1bd523756ec2f4acedd75a75d5372d. Ready for review, mergeable, no review comments.
  • Independent review: Opus 5.5, standing in for GPT-6.1 Sol. The Codex lanes were closed (reset 19:22Z), and disk pause Add tax parameters #9 blocked new Subfleet jobs.
    • r1 at 01fd6e5c6a: REQUEST_CHANGES, no code defects. The findings were the body's mechanism claims and the Axiom draft.
    • r2 (delta): REQUEST_CHANGES on two prose claims.
    • r2b: APPROVE at b352a51acb, with the current body and the posted Axiom comment.
    • Files: ~/reviews/us-hub/reviews-gen/us-mt-sep-medical/review-r1.md, review-r2.md.
  • Passed locally at this head:
    • the two changed YAML files (17 cases);
    • the 24-file MT deduction set (201 cases);
    • test_mt_medical_premium_deduction_invariants.py (5/5);
    • ruff.
  • Pending: CI run 39307755299. PR validation and Package and compatibility pass; the rest are queued.
  • Depends on: nothing. It merges cleanly with Count only filer-paid premiums in Schedule A medical expenses #10270 (head 2e5fccfd1f), and the MT tests pass on that merge; they can land in either order.
  • Decision d1700 (Max, low priority, parks 11/02 if Max is silent): keep the equal split of a dependent's bills between spouses, or allocate them to minimize tax. In my view it doesn't gate the merge. This PR replaces a dropped amount with the equal split the model already uses for the charitable deduction, and any ruling would be a one-formula follow-up. Whether the PR waits for the ruling is the hub's call.
  • Axiom: rulespec-us#1520 is queued, with the extension comment.
  • Follow-ups owed:
    • a proposed session, "Montana separate filing: itemize by tax, not deduction sums". mt_tax_unit_itemizes compares deduction sums rather than tax, so 24 of 1,452 swept couples pay up to $58.62 more; the body has a witness;
    • the same session should consider float noise in mt_files_separately's strict <.

Brings in main through 1661d71, including #10279's update to North Carolina SA Case 37, which was the only CI failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Count dependents' medical bills in Montana's separate-filing medical deduction

Summary

The PR adds mt_medical_and_dental_expenses_indiv, which fills Itemized Deductions Schedule line 1a in each column. Each spouse keeps their own other medical expenses, and the expenses of every other member of the unit are split equally between the spouses. An unmarried filer's column takes all of them. mt_medical_expense_deduction_indiv now applies the 7.5% floor to that amount. Before this, a dependent's bills reached neither status 2a column.

  • Law. The fix matches TY2021–2023 law. Line 1 takes IRC 213 expenses, which cover a dependent's care. The floor applies to each column's own Montana AGI. If a bill was paid from an account both spouses own, the couple may split it in any proportion, so an equal split is one of the allowed choices. Federal MFS practice also treats such bills as paid equally.
  • Code. The code is vectorized, limited to Montana, and limited to 2021–2023 (zero from 2024). It doesn't touch the joint path or non-MT households, and for unmarried filers it doesn't change the tax.
  • Tests. The tests check out by hand.
  • Axiom. rulespec-us#1520 is open, labelled pe-parity, dispatch-ready, and records its corpus blocker.
  • The one problem. Some couples now pay more, and the PR knows it. The equal split interacts with the existing rule in mt_tax_unit_itemizes, which picks itemizing by comparing deduction sums rather than tax. In the author's sweep, 24 of 1,452 TY2022 couples pay up to $58.62 more than on main. That is also more than they would owe if they took the standard deduction, which the law lets them do. The fix is only "proposed as a follow-up session", and no issue tracks it.

Critical (must fix)

None.

Should address

1. Known tax increase for some status 2a couples in claimed years; fix how the itemize election is chosen, or track it before merge.

Files: policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_and_dental_expenses_indiv.py:50, which interacts with policyengine_us/variables/gov/states/mt/tax/income/deductions/general/mt_tax_unit_itemizes.py:12-14 (itemized_ded > standard_ded, summed over both columns).

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.

  • Standard deductions: 5,090 + 3,000 = 8,090.
  • Itemized deductions: 3,409.80 + 4,696.20 = 8,106.00.
  • Both columns therefore itemize, and Montana tax rises from $2,929.68 to $2,988.30.

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:

  • mt_files_separately takes the lower of the joint and separate taxes.
  • mt_taxable_income_indiv says its dependent exemptions are "allocated optimally".
  • Federal tax_unit_itemizes compares tax_liability_if_itemizing with tax_liability_if_not_itemizing.

Why this is not critical.

  • The PR's own allocation is a legal election.
  • The comparison that causes the increase was already there before this PR.
  • Main is also wrong for these couples, because it ignores bills they can legally deduct.
  • The PR discloses the effect.
  • 641 of the 1,452 swept couples pay less.

Even so, merging as is knowingly makes some modeled TY2021–2023 liabilities worse.

Fix (preferred). Make mt_tax_unit_itemizes choose by comparing the couple's combined column tax under each election, using the branch pattern from federal tax_unit_itemizes. Do it in this PR, or in a stacked PR that merges with it. The body reports that this change alone brings the witness back to $2,929.68 and removes all 24 increases. Whatever Max decides on d1700, the change is right, because the election belongs to the couple.

Fallback, if the hub prefers to merge first.

  • File the itemize-by-tax change as a policyengine-us issue and link it in the PR body. A "proposed session" is not tracked.
  • Record Max's d1700 ruling, or the default of keeping the equal split, on the PR.

Suggestions

  1. d1700: consider a tax-minimizing split. The law permits the equal split, but it sits near the worst of the splits the body measured ($2,988.30 at 0.5 against $2,789.30 at all-to-head; the worst split found was 0.45). A tax-minimizing allocation would match how the model already handles the dependent exemptions and the joint-or-separate choice. This is a methodology call, so it is fine as a follow-up once Max rules.

  2. spouse_allocation_rate metadata. The parameter is policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/spouse_allocation_rate.yaml, which this PR does not change. It now serves medical expenses too.

    • Its description calls 0.5 "a mathematical representation of 'divided equally'". For status 2a, ARM 42.15.524(3)(b) defers to the form, and the form allows "any proportional amount", so for 2a the 0.5 is a modeling convention.
    • Its ARM link points at the live rules site, but the rule was repealed effective 1/25/2025 (LII history: "MAR, 42-1088, Eff. 1/25/2025"). The archived text the new variable cites would serve better, together with the 2022 instructions p. 11.
    • The equal default has a useful federal anchor: IRS Pub. 502, "Separate returns": "Any medical expenses paid out of a joint checking account in which you and your spouse have the same interest are considered to have been paid equally by each of you, unless you can show otherwise."
  3. Add a downstream integration case. All the new YAML cases stop at line 1a or the medical deduction. A small mt_income_tax (or mt_income_tax_indiv) case would pin the flow through mt_itemized_deductions_indiv and mt_tax_unit_itemizes. Use a status 2a couple where the dependent's bills lower the tax.

  4. PR body housekeeping. The Review section cites local files (~/reviews/us-hub/...) and internal queue terms that outside reviewers can't open. Link the review text or drop the paths.

Verified correct

  • Line 1 law. The 2022 instructions (PDF p. 32; 2021 p. 31 and 2023 p. 36 differ only in the year) say "Enter your medical expenses paid in 2022 … The expenses allowed on line 1 are the same medical and dental expenses that are allowed under the Internal Revenue Code." IRC 213(a) covers care "of the taxpayer, his spouse, or a dependent".
  • Per-column floor. On the 2022 Form 2 (PDF p. 7), each of columns A and B has "1a … Enter the amount from page 1, line 14 1b … Multiply line 1b by 7.5% (0.075) 1c". So the 7.5% floor applies to each spouse's own Montana AGI, which is what mt_agi_indiv gives. The floor parameter is 0.075 for 2021–2024.
  • Allocation rules.
    • The instructions' allocation text is the same in 2021 (p. 10), 2022 (p. 11) and 2023 (pp. 12–13): "Deductions that are attributable to only one spouse must be claimed by that spouse" and "Payments made from accounts owned by both spouses that pertain to expenses not attributable specifically to one spouse can be allocated to either spouse in any proportional amount."
    • The archived ARM 42.15.524(3)(a)–(c) text matches the PR body, and LII confirms the repeal date.
    • MCA 2021 § 15-30-2131 requires an equal split only for the dependent care deduction ((1)(c)(vi)(D): "must be divided equally between the spouses when filing separately on the same form"). It has no medical-specific allocation rule. Nothing in these sources conflicts.
  • The spouse split.
    • The model has no data on who paid. Each spouse keeps their own expenses, and other members' expenses are split 0.5/0.5. Both choices fall within "any proportional amount" if the bills were paid from a joint account, and the federal default for such bills is an equal split. An unmarried filer takes everything.
    • Swapping which spouse is labelled head doesn't change the result.
    • The columns add up to the joint return's line 1 base. itemized_medical_expenses is premiums minus the excluded premiums plus other_medical_expenses, so the joint variant counts every member's expenses, as the pool does.
  • Code.
    • Vectorization is correct (where and tax_unit.sum; the scalar if in the deduction is on a parameter).
    • The new variable is on Person, like the other _indiv variables.
    • defined_for = "mt_married_filing_separately_on_same_return_eligible" limits it to MT, and to 2021–2023 because the allowed-flag parameter is false from 2024.
    • The NH Add New Hampshire state supplementation for 2026 #10156 pattern doesn't apply: no state-gated int or enum variable is used as a parameter or breakdown key.
    • Non-MT households and the joint path (mt_medical_expense_deduction_joint) are unchanged.
    • For unmarried filers, the separate path now matches the joint path. Their tax can't go up: there is one column, and the final tax is the lower of joint and separate.
    • Readers: mt_itemized_deductions_indiv, and mt_itemized_deductions_for_federal_itemization_indiv. The latter feeds only state_itemized_deductions, which no formula reads.
  • Hand-checked expectations (12).
    • New file, TY2021 couple, both labellings: [2,000, 2,700, 0, 0, 2,000, 2,700, 0, 0]. The pool is 3,000 + 1,000 = 4,000, half to each spouse, and the spouse's own 700 is added to that spouse's column.
    • New file, TY2022 unmarried: [1,000, 0] (100 + 900).
    • New file, TY2024: eligible is [false, false] and line 1a is [0, 0]. This is the 2024 non-effect.
    • New file, TY2023 non-dependent relative: [500, 500, 0].
    • Deduction file, TY2022 couple, line 1a: [4,000, 3,500, 0, 4,000, 3,500, 0].
    • Same case, deduction: [0, 2,000, 0, 0, 2,000, 0]. The earner gets max(0, 4,000 − 0.075 × 60,000) = 0. The partner gets 3,500 − 0.075 × 20,000 = 2,000. This checks the floor on each spouse's own AGI.
    • TY2023 head of household: line 1a is 4,000; the separate deduction is 4,000 − 2,250 = 1,750, the same as the joint deduction of 1,750.
    • TY2024 reform: line 1a is [2,000, 2,000, 0]. The deductions are head (2,000 premiums + 2,000) − 3,000 = 1,000 and spouse 2,000 − 750 = 1,250.
    • Invariants test property 10: the closed form filer × own + share × pool matches the formula. It is conserved within each unit, and dependents get 0.
    • The PR body's witness: the standard and itemized totals (8,090 against 8,106) and the size of the tax increase, as worked out above.
  • Changelog. changelog.d/fix-mt-separate-medical-dependents.fixed.md is a top-level fragment with the fixed type.
  • References. Each source is cited once, and multi-page hrefs carry a # PDF pages … comment. The 2022 instructions p. 11 anchor shows the allocation text.
  • Source-conflict guard (Tie source-conflict markers to the register shared with Axiom #10287). None of the comment lines in the two changed variable files match CONFLICT_COMMENT_RE or ATTEMPT_RE. Neither file is in KNOWN_UNMARKED, and the PR changes no parameter files. So test_source_conflicts.py passes on the merged tree; I checked this statically.
  • Partner tests. No files under tests/policy/baseline/partners/** are touched.

Axiom line assessment

The line is axiom: rulespec-us#1520 queued, with an extension comment.

  • State. rulespec-us#1520 is OPEN and labelled pe-parity.
  • Extension comment. Posted 2026-10-19; it covers PR head b352a51acb. The current head, a358eb61d0, only merges main into that commit. It leaves the PR's six files unchanged, so the comment still describes this head.
  • Dispatch-ready. The comment has everything the rules ask for:
    • the module path (us-mt/statutes/15-30-2131/1/a.yaml, medical component, extended to status 2a);
    • corpus citations for the TY2021–2023 Form 2 and instructions rows, and the MCA 2021 § 15-30-2131 row;
    • the law verbatim: the instructions' allocation text, line 1, ARM 42.15.524(3)(a)–(c), and IRC 213(a);
    • required outputs 10–12: the per-column line 1a with the couple's election s taken as an input and no default, conservation, and the per-column floor;
    • companion cases 7–10, worked from the form and instructions rather than PE output. Cases 7 and 10 match the PR's YAML (4,000/0 and 3,500/2,000; 4,000 and 1,750).
  • Blocker. The comment records it: ARM 42.15.524 (the 2010 version) is missing from the corpus. The issue's other prerequisites are also still open: §§ 15-30-2110 and 15-30-2132 exist only as repeal markers, and IRC 213's floor rate has no TY2021–2025 version.
  • Methodology. The equal split is fenced off correctly as a PE projection and kept out of the legal outputs.

The line is valid.

CI status

All 27 checks pass at a358eb61d0 (gh pr checks 10276). That includes the four Baseline states shards, which run the MT YAML, and the Python Rest shards, which run test_mt_medical_premium_deduction_invariants.py. Household API Partners, PR validation and Quick Feedback also pass. No checks are pending.

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 status

The branch is 4 commits ahead of main and 34 behind. git merge-tree --write-tree PolicyEngine/main a358eb61d0 merges cleanly, with no conflicts. Since the merge base, main has changed mt_itemized_deductions_indiv (mortgage insurance premiums), which doesn't overlap this PR. #10270 is still open; it edits other hunks of the invariants test file.

Verdict: REQUEST_CHANGES

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants