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>
@DTrim99

DTrim99 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Count only filer-paid premiums in Schedule A medical expenses

Summary

This is a correct and carefully scoped fix. Under IRC 213(a), a taxpayer deducts medical expenses the taxpayer paid for themselves, their spouse and their dependents. Premium inputs already follow payer attribution (#10055, #10046). Main nevertheless summed every tax-unit member's medical_expense_health_insurance_premiums into itemized_medical_expenses, so a premium a dependent paid counted as the filers' expense.

The PR changes that sum to the head and spouse (tax_unit_non_dep_sum). Every member's other_medical_expenses is still counted, because the CPS records those on the person cared for. It then fixes the four state slices that lean on the old base:

  • New Jersey: drops the per-dependent SE exclusion and counts only the filers' payroll premiums.
  • North Dakota: adds the dependents' own premiums back, as NDCC 57-02-08.1(5)(c) requires.
  • Montana 2021–2023 line 1: takes out only the filers' premiums.
  • New Mexico: inherits the fix through its existing formulas.

I checked each legal claim against its source. I hand-checked 16 expectations, traced the interactions with #10046 (pre-tax premiums), §162(l) and Medicare Part B, and confirmed consistency with #10272. I found no wrong result in a claimed year, no double exclusion and no double benefit. The PR merges cleanly with current main. The source-conflict ratchet passes statically on the merged tree. rulespec-us#1654 is open, labelled pe-parity, and its payer-scope extension matches this head.

0 critical, 0 should, 6 suggestions.

Critical (must fix)

None.

Should address

None.

Suggestions

  1. Ohio has the same defect outside the subtotal. List it with the known gaps or open an issue.

    • Law. R.C. 5747.01(A)(10)(a)–(b) allows "the amount the taxpayer paid during the taxable year for medical care insurance … for the taxpayer, the taxpayer's spouse, and dependents". That is the same payer scope as §213.
    • Code.
      • oh_unreimbursed_medical_care_expense_deduction adds oh_unreimbursed_medical_care_expense_deduction_person over every member.
      • Through oh_uninsured_unreimbursed_medical_care_expenses (line 1, no floor) and oh_insured_unreimbursed_medical_care_expenses (line 3), each person's oh_medical_care_insurance_premiums is counted, dependents' own payments included.
    • Example. A dependent student who is not eligible for an employer plan or Medicare pays $1,200 of their own premiums. Ohio deducts all $1,200 on the parents' return, while the federal subtotal at this head drops it.
    • Missouri. mo_qualified_health_insurance_premiums also pools dependents' own premiums. When the unit itemizes, it applies the filers' Form 5695 ratio to them. This sits next to the Missouri gap the PR body already lists.
    • The PR's scope ("state bases that read the federal subtotal") is accurate, and both defects predate this PR. Now that the payer contract is documented as the rule, these readers are known to be wrong and should be tracked.
  2. Show the payer contract in the input labels. This PR makes payer versus beneficiary attribution decide whether a dependent's premiums count at all.

    • Why it matters. Before, entering a child's policy on the child or on the parent gave the same federal result, except for the SE-exclusion bound. Now an app or API user who enters a child-only policy on the child's row loses it from Schedule A, New Jersey and New Mexico.
    • The documentation strings say "person-paid", but the labels shown in the household builder are just "Health insurance premiums" and "Health insurance premiums without Medicare Part B premiums".
    • other_medical_expenses follows the opposite convention (the person cared for), and its label doesn't say so either.
    • Suggested labels: "Health insurance premiums this person paid", "Health insurance premiums this person paid, excluding Medicare Part B", and "Other medical expenses for this person's care".
  3. Refresh rulespec-us#1654's body so it doesn't contradict this head.

    • The extension comment matches the head. The issue body still quotes main's old fixture values as "current", in its "Defensive/incomplete-input fixtures" and New Jersey paragraphs:
      • federal: "retain $500 child premiums (or $800 including $300 other costs)";
      • New Jersey: the dependent A/B fixture "expects 2,000", and "the $1,800 and $1,000 dependent fixtures".
    • At this head these are 0 and 300 (federal), 1,000 (dependent A/B) and 1,300 (the former $1,800 case).
    • The body already bars them from the oracle, so no companion test is affected. A one-line note that the Count only filer-paid premiums in Schedule A medical expenses #10270 comment supersedes them would stop an encoder from reading stale numbers.
    • Separately, the extension lists no prerequisite for the NM 7-2-37 slice ("None found"), so the hub could dispatch that slice without waiting on the federal §162(l)(3) blocker.
  4. Track the disclosed gaps so they don't get lost. The PR body names each of these clearly, but none has an issue yet:

    • Idaho. The claimant worksheet (Fix Idaho health insurance premium subtraction #10023) leaves out dependents' other_medical_expenses. That contradicts the contract this PR documents on other_medical_expenses. In "Claimant medical overlap includes spouse expenses and excludes dependent expenses", federal is now 5,000 against an Idaho overlap of 1,000.
    • New Mexico, citation. nm_medical_care_expense_deduction cites deleted §7-2-35.
    • New Mexico, overlap condition. The formula ignores 7-2-37(A)'s condition that expenses "have not been included in the taxpayer's itemized deductions".
    • Montana. The separate-filing gap is already in Count dependents' medical bills in Montana's separate-filing medical deduction #10276.
  5. Add the Linux CI cost figures to the PR body (CLAUDE.md, "Measure simulation-heavy additions"). The body gives only local macOS figures, correctly labelled as such.

    • In the head's CI run, the new file's tests took 2.66 s and 0.57 s (call time). The Rest Python core group ran 1,740 tests in 2,283 s of pytest time.
    • I couldn't download the group's /usr/bin/time resources artifact (GitHub returned 503, "Egress is over the account limit"), so Linux peak RSS is unverified. The added load is small: one batched simulation per example, eight examples per test.
  6. Optional tests and polish.

    • New Jersey case. Add a self-employed dependent whose premiums exceed their SE earnings, for example $1,000 of premiums and $600 of earnings. Line 5 takes $600, and the $400 left over now reaches neither line 1 nor line 5. That is correct for the parent's return under 54A:3-3, and pinning it documents the deliberate change from main.
    • Property file. The moved_back variant repeats the drawn inputs exactly, as the docstring admits. It only re-checks row independence, which the other variants already exercise, so it could be dropped.

Verified correct

Law (each quote checked against the cited page).

  • Federal.
    • 26 USC 213(a): "the expenses paid during the taxable year, not compensated for by insurance or otherwise, for medical care of the taxpayer, his spouse, or a dependent".
    • Pub. 502 (2025), PDF p. 3: "You can generally include medical expenses you pay for yourself, as well as those you pay for someone who was your spouse or your dependent". Also: "If your spouse had paid the expenses, you couldn't include your spouse's expenses on your separate return", and "You can include medical expenses you paid for your dependent." Payer, not beneficiary, decides.
    • Pub. 502 (2025), PDF p. 8:
      • "You can include in medical expenses insurance premiums you pay … You can't include in medical expenses insurance premiums that were paid and for which you are claiming a credit or deduction."
      • Employer-sponsored plan: "Don't include … any insurance premiums paid by an employer-sponsored health insurance plan unless the premiums are included on your Form W-2", with the FEHB pre-tax salary-reduction example.
      • "Premiums you pay for Medicare Part B are a medical expense."
    • 26 USC 162(l)(3): SE-deducted premiums "shall not be taken into account in computing the amount allowable … under section 213(a)". The bounded exclusion is unchanged and stays within the filers' premiums.
  • New Jersey.
    • N.J.S.A. 54A:3-3, (a): "medical expenses for the taxpayer, the taxpayer's spouse, and the taxpayer's dependents with respect to such expenses that were paid during the taxable year". (c)(3) bars amounts allowed under C.54A:3-5.
    • The statute doesn't name the payer. The 2025 NJ-1040 instructions, PDF p. 25 fill that gap: "unreimbursed medical expenses you paid during the year for yourself, your spouse or domestic partner, and any dependents you claim". Worksheet F applies the 2% floor on line 3 and adds the SE deduction on line 5.
  • North Dakota. NDCC 57-02-08.1(5)(c), PDF p. 16: income includes "the income of any dependent of the applicant" and excludes "medical expenses paid during the year by the applicant or the applicant's dependent". The PR's (5)(c) citation is right; Issue with NY EITC documentation page #1654's older (7)(c) is corrected in the extension.
  • New Mexico (statute text checked against TRD's compilation of the Income Tax Act).
    • NMSA 7-2-5.9(A): "medical care expenses paid by the individual for that individual or for the individual's spouse or dependent".
    • NMSA 7-2-18.13(A): "medical care expenses paid by the taxpayer for that taxpayer or for the taxpayer's spouse or dependent".
    • NMSA 7-2-37(A): "Prior to January 1, 2025 … medical care expenses paid during the taxable year for medical care of the taxpayer, the taxpayer's spouse or a dependent".
    • The form instructions match:
  • Input contract. Census CPS ASEC working paper:
    • PDF p. 2, 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?"
    • PDF p. 3, by person cared for: "(name's/your) OWN medical care … Include any amount paid out-of-pocket on (your/his/her) behalf by anyone in this household". The 2011–2013 wording on p. 2 is the same.
    • The new references follow CLAUDE.md: the href opens on the first page, and a pages comment sits above it.

The §213 premium split, item by item.

  • Employer-paid premiums are in no input; every premium input documents that it excludes them.
  • Pre-tax §125 premiums (Document disjoint health premium inputs and correct consumer treatment #10046) live only in pre_tax_health_insurance_premiums. medical_expense_health_insurance_premiums excludes them, so they never enter the federal subtotal, which matches Pub. 502's employer-plan rule. The PR doesn't touch that path.
    • New Jersey adds the filers' payroll premiums once, since New Jersey taxes §125 salary reductions (TB-39(R)).
    • North Dakota subtracts every member's pre-tax premiums once, as income "excluded from income by federal … law". They aren't in the subtotal, so nothing is excluded twice.
  • §162(l): itemized_medical_expenses_excluded_premiums = min(filer premiums, max(0, SE ALD)). The premium term is now the same filer pool, so the subtotal's premium part is never negative, and an SE deduction above the filers' premiums can no longer reach a dependent's premiums or other costs. A dependent's own SE deduction stays off the filers' federal return (self_employed_health_insurance_ald is filer-only), so there is no double benefit.
  • Medicare Part B: the modeled premium sits on the enrollee (medicare_part_b_premium × medicare_enrolled), and a filer's Part B still counts. A dependent's Part B is withheld from the dependent's own benefits, or paid by Medicaid under a Medicare Savings Program. Neither is the filers' payment, so dropping it is right in both cases. Part D and Medigap premiums arrive through health_insurance_premiums_without_medicare_part_b and follow the same payer rule.
  • Long-term care (§213(d)(10)): the computed subtotal holds no long-term care premiums, before or after this PR. Count eligible long-term care premiums in Schedule A medical expenses #10265 (draft) will add them and needs the same payer decision, as the PR body says. Montana's line 3 and the long-term care documentation already use the filer split.
  • Who counts: tax_unit_non_dep_sum keeps the head and spouse whatever their labels, which the label-swap YAML and Hypothesis variants confirm. A non-dependent household member is in a separate tax unit, so their premiums never reached this unit's sum, before or after.

Consistency with #10272 (approved today, still open). #10272 builds W-2 box 1 as irs_employment_income = employment_income − pre_tax_contributions, which includes pre_tax_health_insurance_premiums. This PR keeps those premiums out of Schedule A. A pre-tax premium is therefore left out of wages once and never deducted, as Pub. 502 requires. Neither PR subtracts it twice. The two PRs share no files, and a trial merge of the two heads is clean.

State slices.

  • New Jersey.
    • Line 1 is now the filers' subtotal plus the filers' payroll premiums.
    • The removed per-dependent exclusion would subtract dependents' SE premiums that are no longer in the base.
    • Line 5 keeps dependents_self_employed_health_insurance_ald, because nj_agi counts dependents' income. That pre-existing choice is disclosed.
  • North Dakota.
    • The computed result is unchanged: (filer premiums − exclusion + other) + exclusion + dependents' premiums equals every member's premiums plus other costs.
    • With a supplied Schedule A subtotal, the dependents' premiums are now added, which is correct because a Schedule A amount never includes them.
  • New Mexico. The deduction, credit and exemption read the subtotal (plus the applied exclusion for the senior items), so they now count only the filers' premiums, as all three statutes require.
  • Montana 2021–2023.
  • Inheritors.
    • AL, AR, HI, NY (pre-TCJA) and PR follow §213 and apply their own floors. AZ (43-1042) takes the subtotal in full.
    • Missouri's ratio now uses the actual filers' Schedule A lines 1 and 4.
    • Kentucky adds itemized_deductions_less_salt and subtracts medical_expense_deduction, so it is unchanged.
    • Idaho's claimant figures were already filer-only, and its outputs are unchanged in every edited case.

Callers.

  • The same 17 variables read itemized_medical_expenses on the merge base and on the tree merged with current main. None of main's 45 newer commits adds or changes a reader.
  • Readers of the exclusion helpers:
    • self_employed_health_insurance_ald_excluded_premiums is still read by mt_eligible_medical_insurance_premiums, so dropping it from New Jersey leaves no dead code.
    • dependents_self_employed_health_insurance_ald is still read by New Jersey.
  • Ohio, Missouri and Idaho build their own premium bases; see suggestion 1.
  • No partner contract files are touched.

Code.

  • Vectorized throughout, with no hard-coded values, no new parameters and no state-gated int or enum key variable (the NH Add New Hampshire state supplementation for 2026 #10156 pattern doesn't apply).
  • The changelog is a top-level changelog.d/fix-schedule-a-dependent-paid-premiums.fixed.md, with type fixed.
  • Test periods are plain years.

Hand-checks (2025 unless noted).

# Case Expected Check
1 Federal: student dependent pays own $1,200; student's bills $800; AGI $8,000 subtotal 800; deduction 200 800 − 7.5% × 8,000 = 800 − 600 ✓; premiums [0, 0, 1,200] per unit ✓
2 Federal: partner pays the $1,200 policy covering the student 2,000 / 1,400 1,200 + 800; 2,000 − 600 ✓
3 Federal: filer premiums 3,000, supplied SE ALD 2,000, other 2,500 + 500, student's own 1,200, AGI 40,000 excluded 2,000; 4,000; 1,000 min(3,000, 2,000); (3,000 − 2,000) + 3,000; 4,000 − 3,000 ✓
4 Federal: disabled adult dependent's Part B 2,220; other 1,000 + 3,000; AGI 30,000 4,000 / 1,750 Part B on enrollee, not counted; 4,000 − 2,250 ✓
5 Federal: parent 300 premiums + 100 other; child's own 500 + 200 other; SE ALD 1,000; AGI 0 300 / 300 300 − min(300, 1,000) + 300 ✓
6 Idaho: filers' premiums 5,000; every member's other 6,000; dependent's own 500; AGI 80,000 federal 5,000 11,000 − 6,000 ✓; Idaho overlap 1,000 unchanged
7 Idaho (2026): federal 40,500 → 40,000; itemized total 66,689.19 → 66,216.22 −472.97 500 × 35/37 under the 2/37 limitation ✓
8 NJ: parent 300 + 100; child's own 500 + 200; SE ALD 1,000; NJ income 0 1,300 line 1: 300; line 5: 1,000 ✓
9 NJ: dependent A has $10,000 SE income and $1,000 SE premiums; dependent B pays own $1,000 1,000 line 1: 0; line 5: min(10,000, 1,000) ✓
10 NJ: filer other 3,000 + filer payroll 400; student's own 1,200 after-tax + 500 payroll; NJ income 50,000 2,400 3,400 − 2% × 50,000 ✓; with the student's, 4,100
11 NM deduction (2024, joint AGI 20,000): filers' 1,000; student's own 1,200 250; control 550 25% × 1,000; 25% × 2,200 ✓
12 NM credit and exemption: 70-year-old filer paid 27,500; son's own 1,200 0 / 0; control 2,800 / 3,000 27,500 < 28,000; 28,700 ≥ 28,000 ✓
13 ND computed: income 30,000; filers' 500; student's own 1,200 subtotal 500; income 28,300 30,000 − (500 + 1,200) ✓
14 ND: supplied Schedule A subtotal 500; student's own 1,200 28,300 dependent's premiums added to the supplied amount ✓
15 MT 2022: spouse premiums 3,000; SE ALD 1,000; other 5,000 + 800; student's own 1,200; Montana AGI 50,000 subtotal 7,800; line 2 2,000; 4,050 on the head (7,800 − 2,000) − 3,750 = 2,050; + 2,000 ✓; head at person indices 0 and 4 ✓
16 MT 2022: supplied subtotal 10,000; applied exclusion 6,400; head premiums 6,000; Montana AGI 40,000 7,000; line 2 0 6,000 − min(6,000, 6,400) = 0 left in the subtotal; 10,000 − 3,000 ✓

The PR body's household also checks: New Jersey 1,200 − 2% × 20,000 = 800 → 0, and New Mexico 25% × 1,200 = 300 → 0.

Tests and cost.

  • Each new joint YAML case repeats the household with the head and spouse labels exchanged, and each New Mexico case has a parent-paid control.
  • The Hypothesis file checks invariants YAML can't express across generated returns:
    • an independent oracle for the subtotal;
    • dependent invariance;
    • monotonicity when a premium moves from a filer to a dependent;
    • label invariance;
    • North Dakota's payer invariance.
  • It builds one vectorized simulation per example against the shared system.
  • The edited conservation properties now conserve over the filers' paid premiums. The New Jersey oracle is now parent premiums + every member's other costs + SE deductions, and only North Dakota adds the dependents' premiums.
  • No CI selector names the renamed test functions.

Population effect (reasoned; no microsimulation run).

  • Who is affected. Units with a dependent who carries a premium input. Under the microsimulation's defaults, that means:
    • CPS-reported premiums of dependents aged 15 or older, mostly young adult students and elderly or disabled relatives;
    • the modeled Part B premium on every Medicare-enrolled dependent: $2,220 in 2025 and about $2,435 in 2026 at the standard rate.
  • Direction. Weakly toward more tax: federal and inheriting-state medical deductions fall or stay the same.
    • Federal: only itemizers above the 7.5% floor lose, by the dependents' own premiums times their marginal rate. For example, 12% × $2,220 ≈ $266.
    • States: New Jersey's deduction (2% floor, no itemizing requirement) and Arizona's (no floor) reach more units per dollar.
    • New Mexico's general deduction ends in 2024, and the $28,000 senior tests rarely bind.
    • North Dakota is unchanged. Missouri's subtraction can rise slightly as the Schedule A ratio falls.
  • Size. Assume an upper bound of 1–1.5 million Medicare-enrolled dependents, of whom 10–15% are in itemizing units above the floor. That gives a few hundred million dollars of deductions and a federal revenue gain of tens of millions of dollars a year, smaller if CPS tax-unit construction makes few elderly parents dependents.
  • Every change moves toward the law, and the hub's microsimulation will settle the size. I see no population bias that warrants a should-level finding.

Source-conflict ratchet (#10287). The PR's CI ran before #10287 and #10334 merged, so I checked it statically.

  • I applied CONFLICT_COMMENT_RE to the Python comment tokens of all five scanned files the PR touches:
    • itemized_medical_expenses.py
    • mt_medical_expense_deduction_joint.py
    • nd_renters_refund_income.py
    • nj_medical_expense_deduction.py
    • other_medical_expenses.py
  • Each has 0 matching lines at the head and 0 on main, so no count rises or drops. None of the five is in KNOWN_UNMARKED.
  • The edited YAML tests are outside the scanned directories, and no register or backlog entry cites the payer scope.
  • The known FL/SD LIHEAP failure can't arise from this run: the ratchet test didn't exist yet, and Count the FL and SD LIHEAP comments in the source-conflict ratchet baseline #10334 is on main.

Axiom line assessment

axiom: us/statute/26/213, TheAxiomFoundation/rulespec-us#1654 queued, with the payer-scope extension in issue comment 6269996226. The line is valid.

  • rulespec-us#1654 is OPEN and labelled pe-parity (last updated 2026-10-19 14:45 UTC, when the extension was posted).
  • The extension names this head (2e5fccfd1f) and is dispatch-ready:
    • Targets:
    • Corpus citations at the pinned axiom-corpus commit: us/statute/26/213/a, and New Mexico lines 426, 316 and 363.
    • Verbatim law, which I matched for §213(a), the three NMSA sections, NJ line 31 and NDCC (5)(c).
    • Three required outputs: filer-paid premiums, dependent-paid premiums, and North Dakota's base.
    • A review_finding.
    • Ten companion cases, hand-worked from the sources, with the facts of this PR's YAML. They don't come from PolicyEngine output.
  • Blockers are recorded: the §162(l)(3) corpus gap for the federal module, and the missing North Dakota authority in the pinned corpus.
  • The federal payer rule is effectively encoded already: rulespec-us's §213 module takes the taxpayer's paid expenses as a tax-unit input. So queuing the remaining §162(l) amendment and the state slices on Issue with NY EITC documentation page #1654 is reasonable.
  • See suggestion 3 for the stale fixture values in the issue body and the unblocked NM 7-2-37 slice.

CI status

gh pr checks 10270 (re-checked): 27 passing, 3 skipping, none pending or failing, at head 2e5fccf. The skipped entries are the umbrella jobs of a separate run.

Branch status

4 commits ahead and 45 behind main. git merge-tree --write-tree PolicyEngine/main 2e5fccfd1f merges cleanly (tree 25d77d86).

Sibling notes (not findings):

Verdict: APPROVE

@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.

Schedule A now counts only premiums the filer paid, per IRC 213(a) and Pub 502. Pre-tax (#10046) premiums aren't excluded twice, the 162(l) deduction isn't doubled, Medicare Part B is handled right, and the change is consistent with #10272's box 1. The NJ/NM/ND slices follow their own statutes. 16 expectations hand-check, and the merged tree is clean and passes the ratchet. Six suggestions, including tracking OH and MO, which still pool dependents' own premiums. 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