Skip to content

Count only filer-paid premiums in Schedule A medical expenses - #10270

Open
MaxGhenis wants to merge 4 commits into
mainfrom
fix-schedule-a-dependent-paid-premiums
Open

MaxGhenis wants to merge 4 commits into
mainfrom
fix-schedule-a-dependent-paid-premiums

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Federal Schedule A medical expenses counted every tax-unit member's health insurance premiums, including premiums a dependent paid. IRC 213(a) allows "the expenses paid during the taxable year ... for medical care of the taxpayer, his spouse, or a dependent", and premium inputs record the person who paid them (#10055: "A parent-paid dependent policy belongs on the parent"). So a dependent's own payments are not the filers' expenses. This PR counts only the head's and spouse's premiums, and fixes the state bases that read the federal subtotal. The US + core hub's methodology review of #9947 found the bug.

Law and input contract

  • IRC 213(a) covers expenses the taxpayer paid for the taxpayer, the spouse and dependents.
  • Premiums are recorded on the payer. In the CPS ASEC, premiums are asked by payer: "how much did (name/you) pay out-of-pocket for ALL health insurance premiums covering (yourself/himself/herself) or others in the household?" (Census working paper, PDF page 2).
    • Parent-paid coverage for a dependent therefore sits on the parent and still counts.
    • Modeled Medicare Part B premiums sit on the enrollee.
  • Other medical expenses are recorded on the person cared for. The CPS ASEC asks about each person's "OWN medical care" and adds: "Include any amount paid out-of-pocket on (your/his/her) behalf by anyone in this household" (same paper, PDF pages 2–3).
    • The subtotal keeps every member's other medical expenses, as it did before.
    • other_medical_expenses now documents this.

What changes

itemized_medical_expenses sums medical_expense_health_insurance_premiums over the head and spouse with tax_unit_non_dep_sum, the label-free helper. Everything else in the formula is unchanged: the §162(l)(3) exclusion (already bounded to the filers' premiums) and every member's other_medical_expenses.

Readers of the subtotal

Reader Law on who paid Treatment
medical_expense_deduction and the federal itemized totals, and through them taxable income, the itemized limitation, QBID, the shared state tax dispatcher, the state formulas that read them (CA, CO, DC, GA, IA, ID, KS, LA, MA, MD, ME, MN, MO, MS, MT from 2024, NC, NE, NM, OK, OR, SC, UT, VA, VT, WI), three reforms (CRFB senior deduction, MA dependent exemption, MN Walz) and the TAXSIM emulator IRC 213(a) Inherit the corrected component. Kentucky subtracts the federal medical deduction from its non-SALT total, so its result is unchanged.
AL, AR, HI, NY (pre-TCJA), PR medical deductions Schedule A / IRC 213 Inherit the fix; each reads the subtotal and applies its own floor
AZ itemized deductions A.R.S. 43-1042 Inherits the fix; Arizona allows the subtotal in full, with no floor
MO premium subtraction (Form 5695 lines 10–12) Schedule A lines 1 and 4 Inherits the fix: the ratio now uses the actual filers' Schedule A
NM medical care expense deduction (PIT-1 line 16, through 2024) "medical care expenses paid during the tax year for you, your spouse, or a dependent" (2022 PIT-1 instructions, PDF page 31) Inherits the fix
NM senior credit and exemption "you paid unreimbursed and uncompensated medical care expenses of $28,000 or more", for "any combination of you, your spouse, or your dependents" (2025 PIT-ADJ, PDF pages 5–6; PIT-RC, PDF page 9) Inherit the fix (subtotal plus the applied exclusion, unchanged)
NJ medical expense deduction "unreimbursed medical expenses you paid during the year for yourself, your spouse or domestic partner, and any dependents you claim" (2025 NJ-1040 instructions, PDF page 25) Edited. In the general medical base (Worksheet F line 1), the per-dependent SE exclusion is dropped: the base no longer holds dependents' premiums, so keeping it would remove them twice. The payroll-premium add-on now counts only the filers' payroll premiums. Dependents' separate SE deductions stay on line 5, as before, because New Jersey counts their income.
ND renter refund income NDCC 57-02-08.1(5)(c) takes out "medical expenses paid during the year by the applicant or the applicant's dependent" (PDF page 16) Edited. North Dakota does not inherit the fix: it adds the dependents' own premiums back, to a supplied Schedule A subtotal as well, since one never includes them. Computed results are unchanged.
MT 2021–2023 joint line 1 Former MCA 15-30-2131 Edited. Line 1 takes out only the filers' premiums, which are all the subtotal now holds. Taking out every member's premiums would remove the dependents' twice.
ID claimant medical deduction Already filer-only (#10023) Unchanged. Idaho outputs are the same in every test; the federal figures in its tests now equal the claimant figures when only premiums differ.

Household before and after

main f9b55fc: a 2024 joint couple aged 70 and 68 with $20,000 of wages. A 19-year-old student dependent pays $1,200 of their own premiums; the filers pay none.

Variable main this PR
itemized_medical_expenses 1,200 0
nm_medical_care_expense_deduction 300 0
nj_medical_expense_deduction 800 0
nd_renters_refund_income 18,800 18,800
mt_medical_expense_deduction_joint (2022) 0 0

Invariants

These hold for every input that follows the payer contract:

  1. Dependent invariance. None of these depends on a dependent's own premium input:

    • the filers' subtotal and federal medical deduction;
    • NM's deduction, credit and exemption;
    • NJ's general medical base (Worksheet F line 1), and NJ's deduction when the self-employed deductions are held fixed;
    • MT's 2021–2023 joint deduction.

    NJ's total deduction can still rise when a premium moves to a self-employed dependent, because line 5 adds that dependent's derived SE deduction. Review r1's case: parent wages $30,000 and a dependent with $10,000 of SE earnings. A $1,000 premium paid by the parent gives $200 ($1,000 − 2% of $40,000). The same premium paid by the dependent gives $1,000, all on line 5.

  2. Payer move. Moving premiums from a filer's input to a dependent's never raises any of those amounts, with the SE deductions held fixed. A moved-back row repeats the drawn inputs, so it checks determinism (each return depends only on its own inputs), not an undo.

  3. Labels. Exchanging the head and spouse labels changes none of them, nor North Dakota's renter refund income.

  4. Conservation. Schedule A premium use plus the SE deduction equals the filers' paid premiums, when the deduction is within that pool. Every member's other medical expenses stay in the subtotal.

  5. Bounds.

    • Every member's other medical expenses ≤ itemized_medical_expenses.
    • itemized_medical_expenses ≤ filer premiums + every member's other medical expenses.
  6. North Dakota. The paid-cost base is invariant to who paid, and equals every member's premiums plus other medical expenses on the computed path.

  7. Differential. itemized_medical_expenses equals an independent oracle, max(0, filer premiums − SE deduction) + every member's other medical expenses.

Tests

  • New YAML cases. Each joint case has two tax units with the head and spouse labels exchanged.
    • Federal subtotal and deduction: a dependent's own premiums, parent-paid coverage, the SE deduction, a dependent's Medicare Part B.
    • NM deduction, credit and exemption, each with a parent-paid control.
    • NJ: after-tax and payroll premiums.
    • ND: computed, and a supplied subtotal.
    • MT line 1.
  • Fail before, pass after. Of the 28 new or edited YAML cases, the 24 that test the change fail on main f9b55fc and pass at this head. The four parent-paid controls (federal; NM deduction, credit and exemption) pass on both.
  • New property tests. tests/core/test_schedule_a_payer_attribution_properties.py (Hypothesis) checks invariants 1, 2, 3, 6 and 7 for the readers named there, with a supplied tax-unit SE deduction, in one vectorized simulation per year. It does not cover every reader of the subtotal. On main, the filer test fails and the North Dakota test passes, as it should.
  • Updated property tests. test_medical_expense_premium_conservation.py now checks conservation over the filers' paid premiums (invariants 4 and 5). Its NJ property now checks that the dependents' own premiums never enter line 1. Its ND/NM oracle now adds the dependents' premiums only for ND. On main, all five fail.
  • Existing expectations that encoded the old base.
    • Two federal cases from Exclude SE health insurance deductions from Schedule A medical expenses #10055.
    • Nine Idaho cases, where only the federal medical_expense_deduction and itemized_taxable_income_deductions moved; every Idaho output is unchanged.
    • Two NJ cases.
    • One MT case whose supplied Schedule A subtotal included the dependent's own $1,000. A Schedule A amount never holds that, so the input is now the $10,000 the head paid; the expected $7,000 is unchanged.
    • In test_id_health_insurance_premiums.py, the deletion-provenance test moves the dependent's $500 from premiums to other costs. That keeps its federal and Idaho amounts apart ($1,250 against $750), so it still catches the provenance defect.
    • In tests/unit/test_mt_medical_premium_deduction_invariants.py, invariant 6 (line 1 base) subtracts only the filers' premiums from the federal subtotal, since those are all it holds.
  • Runs (local, one file per process).
    • Every YAML file that names a medical input or one of these variables: 136 files, run 12 baseline files per process and the contrib file alone. After the fixes, all pass.
    • 29 Python test files that touch these variables, one per process. After the fixes, all pass.
  • Cost (local macOS, not CI). The new property file adds 4.4 s of wall time and 114 MB of peak footprint over a process that only loads the model (18.0 s / 1.14 GB against 13.7 s / 1.02 GB). It sits in the Rest Python core group.

Known gaps (not changed here)

  • Idaho's claimant worksheet leaves out every dependent's other_medical_expenses. Fix Idaho health insurance premium subtraction #10023 treated them as recorded on the payer, but the CPS asks them by the person cared for. In the Idaho case "Claimant medical overlap includes spouse expenses and excludes dependent expenses", the dependent's $4,000 of bills is in the federal subtotal but not in Idaho's overlap.
  • Montana's separate-filing deduction (mt_medical_expense_deduction_indiv) counts each spouse's own other_medical_expenses, so a dependent's bills reach neither spouse.
  • Count eligible long-term care premiums in Schedule A medical expenses #10265 (draft) also edits itemized_medical_expenses, adding eligible long-term care premiums recorded on the insured person. It needs the same payer decision for a dependent's policy, and whichever lands second rebases.
  • Missouri (pre-existing; found by review r1 and checked statically, not run): the premium subtraction caps the whole unit's premium pool, dependents' included, and then allocates it, so a filer can get less than Form 5695 allows. Example: filer and dependent premiums of $10,000 each, Schedule A $10,000 and $7,000, federal taxable income $5,000 gives a $2,500 filer subtraction instead of $3,000.
  • New Jersey counts dependents' income in nj_agi and their SE deductions on line 5 (pre-existing).
  • New Mexico's general deduction cites NMSA 7-2-35, which the Axiom corpus marks deleted; the operative section is 7-2-37. 7-2-37(A) also leaves out expenses already included in federal itemized deductions, and the formula applies its rate to the whole subtotal without that condition.
  • I didn't check how many premiums the dataset records on dependents. The hub's microsimulation impact will show the size.

Impact

The US + core hub runs the microsimulation impact.

axiom: us/statute/26/213, TheAxiomFoundation/rulespec-us#1654 queued (payer-scope extension: targets, verbatim law, required outputs, review_finding and 10 companion cases. rulespec-us's §213 module takes the taxpayer's paid expenses as a tax-unit input, so it has no person-level sum to get wrong; #1654's §162(l) amendment and its NM 7-2-37/7-2-5.9/7-2-18.13, NJ 54A:3-3 and ND 57-02-08.1(5)(c) slices carry the scope.)

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits October 19, 2026 08:26
IRC 213(a) allows medical expenses the taxpayer paid. Premium inputs sit
on the person who paid (#10055), so a dependent's own premium payments
are not the filers' expenses. The federal subtotal now sums premiums over
the head and spouse only and keeps every member's other medical expenses,
which the CPS ASEC records on the person cared for.

- New Jersey drops its per-dependent exclusion, which the federal base no
  longer needs, and counts only the filers' payroll premiums.
- North Dakota's renter refund adds the dependents' premiums back:
  NDCC 57-02-08.1(5)(c) counts medical expenses the applicant's
  dependent paid.
- Montana's 2021-2023 line 1 takes out only the filers' premiums.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add YAML cases for the federal subtotal, New Mexico's deduction, credit and
exemption, New Jersey, North Dakota and Montana, each with the head and
spouse labels both ways, plus Hypothesis properties: the filers' amounts do
not depend on a dependent's own premiums, moving premiums from a filer to a
dependent never raises them and moving back restores them, labels do not
matter, and North Dakota keeps both payers' premiums.

Update cases that expected a dependent's own premiums in Schedule A: two
federal, nine Idaho federal expectations (Idaho's own outputs are
unchanged), two New Jersey, and a Montana supplied subtotal that included
the dependent's payment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the fix-schedule-a-dependent-paid-premiums branch from 8d657b8 to b837849 Compare October 19, 2026 12:52
Idaho's federal-first provenance test expected the dependent's own premiums
in the federal deduction. It now gives the dependent other costs instead,
which the federal subtotal counts and Idaho's claimant worksheet does not,
so it still separates the two amounts.

Montana's line 1 invariant subtracts only the filers' premiums, which are all
the federal subtotal holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Changelog: a dependent's own premiums leave New Jersey's general medical
  base (Worksheet F line 1); line 5 still carries a dependent's derived SE
  deduction.
- North Dakota documentation: a supplied subtotal infers no exclusion, but
  the dependents' premiums are still added.
- New Mexico: a parent-paid control for the general deduction (25% of
  2,200 = 550), and the PIT-ADJ quote cited at PDF pages 5-6.
- Property test docstring: the moved-back row checks determinism, and the
  file covers the named readers, not every reader.

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

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.

1 participant