Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7fb88f0
Floor Montana's joint-return medical and standard deductions on the r…
MaxGhenis Oct 6, 2026
bb978bf
Deduct Montana 2021-2023 medical and long-term care insurance premium…
MaxGhenis Oct 6, 2026
664331b
Update the joint medical floor property for premiums deducted in full
MaxGhenis Oct 6, 2026
4a5802c
Allow for float32 rounding in the Montana premium invariants
MaxGhenis Oct 6, 2026
541d6b5
Add Idaho health premium subtraction regressions and invariants
MaxGhenis Oct 9, 2026
16fcbfb
Fix Idaho health premium subtraction and deduction election
MaxGhenis Oct 9, 2026
cea9445
Correct Idaho benchmark tax component assertions
MaxGhenis Oct 9, 2026
f44901e
Set self-employment fact in dependent premium regression
MaxGhenis Oct 9, 2026
fe2e9b9
Fix Idaho premium subtraction payer attribution
MaxGhenis Oct 9, 2026
3e6a296
Fix claimant medical overlap for Idaho health premiums
MaxGhenis Oct 10, 2026
2e206a3
Correct claimant medical costs in Idaho itemized deductions
MaxGhenis Oct 10, 2026
5be0e8a
Preserve supplied medical deductions in Idaho premium overlap
MaxGhenis Oct 10, 2026
93ae855
Preserve authoritative federal itemized totals for Idaho
MaxGhenis Oct 10, 2026
d8d077d
Honor supplied Schedule A medical expenses for Idaho premiums
MaxGhenis Oct 10, 2026
1b71b7f
Clear deleted input provenance before recalculation
MaxGhenis Oct 10, 2026
b9324a0
Remove global input deletion patch from Idaho premiums fix
MaxGhenis Oct 10, 2026
f89b859
Use disjoint premium inputs for Idaho health insurance subtraction
MaxGhenis Oct 10, 2026
6657e93
Track federal-first medical input deletion limitation with strict xfail
MaxGhenis Oct 10, 2026
186995c
test: cover modeled Medicare premiums in Idaho subtraction
MaxGhenis Oct 10, 2026
d3f5681
test: gate Idaho deleted-input xfail on affected core versions
MaxGhenis Oct 10, 2026
b3c2802
Exclude SE health insurance deductions from Schedule A medical expenses
MaxGhenis Oct 10, 2026
f9f6daa
Cap New Jersey dependent medical exclusions per payer
MaxGhenis Oct 10, 2026
8cd9571
Exclude federally deducted Missouri premiums and round overlap ratio
MaxGhenis Oct 10, 2026
1951078
Document payer attribution and cover family premium inputs
MaxGhenis Oct 10, 2026
bba165d
Preserve ND and NM supplied medical expense subtotals
MaxGhenis Oct 10, 2026
f615f68
Merge #10023 premium input provenance dependency
MaxGhenis Oct 10, 2026
7c96cd8
Preserve supplied state medical subtotals using input provenance
MaxGhenis Oct 10, 2026
380afa5
Run individual Round 4 Python checks on the branch
MaxGhenis Oct 10, 2026
e685503
Restore documentation workflow after selective test dispatch
MaxGhenis Oct 10, 2026
c6e06d0
Document and test the state medical input deletion core gate
MaxGhenis Oct 11, 2026
9b38af4
Merge main after Idaho premium subtraction landed
MaxGhenis Oct 11, 2026
dfa0863
Require core 3.32.27 for medical input deletion provenance
MaxGhenis Oct 11, 2026
ba2f3b8
Merge updated main after targeted medical regressions
MaxGhenis Oct 11, 2026
d99c35f
Merge remote-tracking branch 'upstream/main' into fix-mt-medical-prem…
MaxGhenis Oct 11, 2026
f365d7e
Merge remote-tracking branch 'upstream/hub-schedA-se-premiums-1010' i…
MaxGhenis Oct 11, 2026
1e8a445
Net the self-employed deduction once across Montana lines 2 and 3
MaxGhenis Oct 11, 2026
6c17326
Drop #9903's changelog fragment, already released on main
MaxGhenis Oct 11, 2026
595cd1e
Describe line 3 netting in the changelog fragment
MaxGhenis Oct 11, 2026
801ff50
Merge remote-tracking branch 'upstream/main' into fix-mt-medical-prem…
MaxGhenis Oct 18, 2026
5416395
Drop #10055's changelog fragment, already released on main
MaxGhenis Oct 18, 2026
39a5e66
Net a return-level self-employed deduction on Montana joint lines 2-3
MaxGhenis Oct 18, 2026
b320855
Key the invariants test's state code by year
MaxGhenis Oct 18, 2026
306bffe
Choose the self-employed deduction supply mode per invariant batch
MaxGhenis Oct 18, 2026
f5e977b
Keep a supplied federal medical subtotal on Montana line 1
MaxGhenis Oct 18, 2026
7fdca0c
Remove eligible long-term care premiums from a supplied subtotal on l…
MaxGhenis Oct 18, 2026
f9204be
Take long-term care premiums inside a supplied subtotal as an input
MaxGhenis Oct 18, 2026
e63e73a
Document how a net Schedule A subtotal states its self-employed exclu…
MaxGhenis Oct 18, 2026
96d2f72
Take only medical premiums still in a supplied subtotal out of line 1
MaxGhenis Oct 18, 2026
1b0a771
Bound the supplied exclusion by the filers' medical premiums on line 1
MaxGhenis Oct 18, 2026
bf1661d
Define the seeded units before the net-subtotal differential
MaxGhenis Oct 18, 2026
9119ab8
Merge remote-tracking branch 'gh/main' into fix-mt-medical-premiums-i…
MaxGhenis Oct 18, 2026
715ac2c
Count only the taxpayer's own premiums in Montana's 2021-2023 deduction
MaxGhenis Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fix-mt-medical-premiums-in-full.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deduct Montana's 2021–2023 medical and long-term care insurance premiums paid by the head or spouse in full on the Itemized Deductions Schedule (lines 2 and 3), net of premiums taken as the self-employed health insurance deduction, and apply the 7.5% floor only to other medical and dental expenses.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
- name: Long-term care premiums qualify in full without the federal age-based limit
period: 2021
absolute_error_margin: 0.01
input:
age: 40
long_term_health_insurance_premiums: 3_000
state_code: MT
output:
# Montana line 3 deducts the premiums without the federal age-based
# limit on eligible long-term care premiums (26 U.S.C. 213(d)(10)).
mt_eligible_long_term_care_insurance_premiums: 3_000

- name: Long-term care premiums taken as the self-employed health insurance deduction do not qualify
period: 2022
absolute_error_margin: 0.01
input:
long_term_health_insurance_premiums: 400
self_employed_health_insurance_ald_person: 400
state_code: MT
output:
mt_eligible_long_term_care_insurance_premiums: 0

- name: The deduction applies first to medical premiums, then to long-term care premiums
period: 2023
absolute_error_margin: 0.01
input:
health_insurance_premiums: 2_000
long_term_health_insurance_premiums: 1_500
self_employed_health_insurance_ald_person: 3_000
state_code: MT
output:
# 3,000 - 2,000 used on line 2 leaves 1,000 for line 3: 1,500 - 1,000.
self_employed_health_insurance_ald_excluded_premiums: 2_000
mt_eligible_medical_insurance_premiums: 0
mt_eligible_long_term_care_insurance_premiums: 500

- name: A deduction smaller than the medical premiums leaves long-term care premiums in full
period: 2023
absolute_error_margin: 0.01
input:
health_insurance_premiums: 5_000
long_term_health_insurance_premiums: 1_500
self_employed_health_insurance_ald_person: 3_000
state_code: MT
output:
mt_eligible_medical_insurance_premiums: 2_000
mt_eligible_long_term_care_insurance_premiums: 1_500

- name: Outside Montana the amount is zero
period: 2022
absolute_error_margin: 0.01
input:
long_term_health_insurance_premiums: 1_000
state_code: ID
output:
mt_eligible_long_term_care_insurance_premiums: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
- name: Premiums paid with after-tax dollars qualify in full
period: 2022
absolute_error_margin: 0.01
input:
health_insurance_premiums: 4_000
state_code: MT
output:
mt_eligible_medical_insurance_premiums: 4_000

- name: Medicare Part B premiums qualify alongside other premiums
period: 2022
absolute_error_margin: 0.01
input:
health_insurance_premiums_without_medicare_part_b: 1_000
medicare_enrolled: true
medicare_part_b_premium: 2_000
state_code: MT
output:
# The 2022 Form 2 instructions for line 2 make Medicare Part B premiums
# 100 percent deductible on this line.
medical_expense_health_insurance_premiums: 3_000
mt_eligible_medical_insurance_premiums: 3_000

- name: Pre-tax premiums do not qualify
period: 2022
absolute_error_margin: 0.01
input:
employment_income: 50_000
pre_tax_health_insurance_premiums: 3_000
state_code: MT
output:
# Premiums paid through a cafeteria plan are excluded from wages and are
# not counted as medical expenses.
medical_expense_health_insurance_premiums: 0
mt_eligible_medical_insurance_premiums: 0

- name: Premiums fully taken as the self-employed health insurance deduction do not qualify
period: 2022
absolute_error_margin: 0.01
input:
is_self_employed: true
self_employment_income: 40_000
health_insurance_premiums: 6_000
state_code: MT
output:
self_employed_health_insurance_ald_person: 6_000
mt_eligible_medical_insurance_premiums: 0

- name: Premiums above the self-employed health insurance deduction qualify
period: 2022
absolute_error_margin: 0.01
input:
health_insurance_premiums: 6_000
# The deduction claimed on Schedule 1, line 17, after its earnings limit.
self_employed_health_insurance_ald_person: 2_000
state_code: MT
output:
# Only the 2,000 deducted in Montana AGI is excluded: 6,000 - 2,000.
mt_eligible_medical_insurance_premiums: 4_000

- name: A deduction above the medical premiums excludes no more than the premiums
period: 2022
absolute_error_margin: 0.01
input:
health_insurance_premiums: 1_000
long_term_health_insurance_premiums: 2_000
self_employed_health_insurance_ald_person: 2_500
state_code: MT
output:
# The deduction covers all 1,000 of the medical premiums; the other 1,500
# covers long-term care premiums on line 3.
mt_eligible_medical_insurance_premiums: 0
mt_eligible_long_term_care_insurance_premiums: 500

- name: Self-employed person with a loss deducts none of the premiums in AGI
period: 2023
absolute_error_margin: 0.01
input:
is_self_employed: true
self_employment_income: -5_000
health_insurance_premiums: 3_000
state_code: MT
output:
self_employed_health_insurance_ald_person: 0
mt_eligible_medical_insurance_premiums: 3_000

- name: Outside Montana the amount is zero
period: 2022
absolute_error_margin: 0.01
input:
health_insurance_premiums: 4_000
state_code: ID
output:
mt_eligible_medical_insurance_premiums: 0
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
period: 2021
input:
other_medical_expenses: 1_000
mt_agi_indiv: 20_000
health_insurance_premiums: 2_000
mt_agi_indiv: 10_000
state_code: MT
is_tax_unit_head_or_spouse: true
is_tax_unit_head_or_spouse: false
output:
mt_medical_expense_deduction_indiv: 0

Expand Down Expand Up @@ -58,4 +59,114 @@
members: [head, spouse]
state_code: MT
output:
mt_medical_expense_deduction_indiv: [3_250, 750]
# Line 1 floors only the other expenses; line 2 adds the premiums net of
# each spouse's own self-employed health insurance deduction, in full.
# Head: max(0, 500 - 7.5% x 30,000) + (6,000 - 1,000) = 0 + 5,000.
# Spouse: max(0, 500 - 7.5% x 10,000) + (3,000 - 2,000) = 0 + 1,000.
mt_medical_expense_deduction_indiv: [5_000, 1_000]

- name: Medical insurance premiums are deducted in full on line 2, not under the floor
period: 2022
absolute_error_margin: 0.01
input:
other_medical_expenses: 1_000
health_insurance_premiums: 2_000
mt_agi_indiv: 20_000
state_code: MT
is_tax_unit_head_or_spouse: true
output:
# Line 1: max(0, 1,000 - 7.5% x 20,000) = max(0, 1,000 - 1,500) = 0.
# Line 2: 2,000 in full.
# Flooring the premiums with the other expenses would give
# 3,000 - 1,500 = 1,500.
mt_medical_expense_deduction_indiv: 2_000

- name: Long-term care insurance premiums are deducted in full on line 3
period: 2023
absolute_error_margin: 0.01
input:
long_term_health_insurance_premiums: 1_500
mt_agi_indiv: 50_000
state_code: MT
is_tax_unit_head_or_spouse: true
output:
mt_medical_expense_deduction_indiv: 1_500

- name: Premiums taken as the self-employed health insurance deduction are not deducted again
period: 2021
absolute_error_margin: 0.01
input:
is_self_employed: true
self_employment_income: 30_000
health_insurance_premiums: 5_000
other_medical_expenses: 4_000
mt_agi_indiv: 25_000
state_code: MT
is_tax_unit_head_or_spouse: true
output:
self_employed_health_insurance_ald_person: 5_000
# Line 1: 4,000 - 7.5% x 25,000 = 2,125. Line 2: 0.
mt_medical_expense_deduction_indiv: 2_125

- name: Each spouse filing separately on the same form deducts their own premiums
period: 2022
absolute_error_margin: 0.01
input:
people:
person1:
is_tax_unit_head: true
health_insurance_premiums: 3_000
other_medical_expenses: 2_000
mt_agi_indiv: 20_000
person2:
is_tax_unit_spouse: true
health_insurance_premiums: 1_000
long_term_health_insurance_premiums: 800
mt_agi_indiv: 10_000
person3:
is_tax_unit_dependent: true
health_insurance_premiums: 600
tax_units:
tax_unit:
members: [person1, person2, person3]
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
# Head: line 1 max(0, 2,000 - 7.5% x 20,000) = 500, line 2 3,000.
# Spouse: line 2 1,000, line 3 800.
mt_medical_expense_deduction_indiv: [3_500, 1_800, 0]

- name: Long-term care premiums taken as the self-employed health insurance deduction are not deducted again
period: 2022
absolute_error_margin: 0.01
input:
long_term_health_insurance_premiums: 400
self_employed_health_insurance_ald_person: 400
other_medical_expenses: 1_000
mt_agi_indiv: 10_000
state_code: MT
is_tax_unit_head_or_spouse: true
output:
# The deduction took all 400 of the long-term care premiums in Montana
# AGI, so line 3 is 0. Line 1: 1,000 - 7.5% x 10,000 = 250.
mt_medical_expense_deduction_indiv: 250

- name: A reform that allows separate filing in 2024 keeps premiums under the floor
period: 2024
reforms: policyengine_us.tests.policy.baseline.gov.states.mt.tax.income.enable_mt_mfss_2024_reform.enable_mt_mfss_2024_reform
absolute_error_margin: 0.01
input:
health_insurance_premiums: 4_000
long_term_health_insurance_premiums: 1_000
other_medical_expenses: 2_000
mt_agi_indiv: 60_000
state_code: MT
is_tax_unit_head_or_spouse: true
output:
# The Itemized Deductions Schedule ended after 2023, so lines 2 and 3 do
# not apply: (4,000 + 2,000) - 7.5% x 60,000 = 1,500. Applying them would
# give 0 + 4,000 + 1,000 = 5,000.
mt_married_filing_separately_on_same_return_eligible: true
mt_medical_expense_deduction_indiv: 1_500
Loading
Loading