Repository navigation
Apply New York's pre-TCJA 10% medical expense floor (IT-196 line 3) - #9931
Merged
Merged
Conversation
NY Tax Law § 615(a) defines NY itemized deductions as federal deductions "as such deductions existed immediately prior to the enactment of Public Law 115-97". Pre-TCJA 26 U.S.C. 213(a) allowed medical expenses above 10% of AGI; TCJA § 11027 set the federal 7.5% floor, which NY does not follow. Form IT-196 line 3 multiplies federal AGI by 10% on every form from 2018 through 2025. ny_itemized_deductions_max and the Line 40 limitation used the federal medical_expense_deduction (7.5% floor since 2017). Add ny_medical_expense_deduction (10% of positive AGI, from a new NY floor parameter) and use it in both, so the medical deduction still cancels between worksheet lines 1 and 2. Fix the pre-TCJA components test (medical 2,500 -> 0, max 26,500 -> 24,000), move the phase-out tests' medical input to the NY variable, and add boundary, year, non-NY and integration cases plus Hypothesis invariants (bound, differential against the published 10%, order against the federal deduction, monotonicity, composition, Line 40 invariance). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 6, 2026
…erands Review of #9931: the parameter backdated 10% to 2017, when Form IT-201-D line 1 still took federal Schedule A line 4 (7.5% under Pub. L. 115-97 § 11027). The floor is now 0.1 from 2013, 0.075 for 2017, and 0.1 from 2018. Added 2016 and 2017 cases. The invariants test scaled float32 slack by the result, so expenses within rounding of a large floor failed. Slack now scales with each comparison's largest operand, with the reviewer's counterexamples pinned as @example and 2017 added to the published-floor years. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9931 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 3 -1
Lines 76 53 -23
Branches 2 0 -2
=========================================
- Hits 76 53 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
US + core hub merge audit, us#9931 at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New York itemized deductions used the federal medical expense deduction, whose floor
gov.irs.deductions.itemized.medical.floorhas been 7.5% since 2017. New York keeps the pre-TCJA 10% floor. This PR addsny_medical_expense_deduction: itemized medical expenses above 10% of federal AGI, set by a new NY parameter.ny_itemized_deductions_maxand the IT-196 Line 40 limitation both use it.Law and forms (verified 2026-10-06)
https://www.tax.ny.gov/pdf/<year>/inc/it196_<year>_fill_in.pdf#page=1for 2018, 2019, 2020, 2021, 2022, 2023, 2024 and 2025. Line 2 is "Enter amount from Form IT-201 or IT-203, line 19" (federal AGI), except 2020–2022, where it is line 19a. Line 19a is recomputed federal AGI: line 19 plus Form IT-558 adjustments (2021 IT-201-I, PDF p. 14), which PolicyEngine does not model, so federal AGI is used for every year.itemized_medical_expenses).Changes
parameters/gov/states/ny/tax/income/deductions/itemized/medical/floor.yaml: 0.1 from 2018-01-01, the first year of § 615(a)'s pre-TCJA reference and of Form IT-196. It cites § 615(a), pre-TCJA § 213(a), and IT-196 line 3 for 2018 and 2025.variables/.../itemized/pre_tcja/ny_medical_expense_deduction.py:max_(0, itemized_medical_expenses - floor * positive_agi), NY only. This mirrors the federal formula and the siblingny_misc_deductionandny_casualty_loss_deduction.ny_itemized_deductions_max: addsny_medical_expense_deductioninstead ofmedical_expense_deduction.ny_itemized_deductions_phase_out: worksheet line 2 (deductions not subject to the limitation) usesny_medical_expense_deduction. Medical enters lines 1 and 2 equally, so it still cancels out of line 3. If line 2 had kept the federal amount, line 3 would come out understated by the floor difference.Other NY consumers: I grepped all of
policyengine_us/formedical_expense_deductionanditemized_medical_expenses. The only NY consumers were these two variables, and no NY reform, contrib module, parameter list, NYC or Yonkers code reads them.Tests
ny_pre_tcja_deductions.yaml, "NY itemized deductions max includes all pre-TCJA components": medical 10,000 at AGI 100,000 was 10,000 − 7,500 = 2,500. Under IT-196 it is 10,000 − 10,000 = 0, so max goes from 26,500 to 24,000.ny_itemized_deductions_phase_out.yaml: themedical_expense_deductioninputs are renamed tony_medical_expense_deduction. Expected values are unchanged.ny_medical_expense_deduction.yaml(10 cases), every expected value computed from IT-196 lines 1–4:ny_itemized_deductions13,000, and the Line 40 worksheet with medical in both lines (reduction 120,000).upstream/main:ny_itemized_deductions_maxcame out 15,000 against 13,000, and 375,000 against 250,000;Invariants (
tests/core/test_ny_medical_expense_deduction_invariants.py, Hypothesis plus a seeded 200-unit population, 2018/2021/2024/2025)These hold for every tax unit, single or joint, in NY or elsewhere, with AGI from −200k to 6M:
ny_medical_expense_deduction≤itemized_medical_expenses, and the deduction is 0 outside NY.medical_expense_deduction.ny_itemized_deductions_max−ny_medical_expense_deductiondoesn't depend on medical expenses.ny_itemized_deductions_phase_outdoesn't depend on medical expenses.Comparisons allow 1e-6 relative error, because the model stores float32. Mutation check: a 0.075 floor breaks invariant 2, and a phase-out left on the federal deduction breaks invariant 6.
Ran locally by the author, targeted files only: the three YAML files and the invariants file passed. At this head the YAML files hold 12 (
ny_medical_expense_deduction.yaml), 6 (ny_pre_tcja_deductions.yaml) and 7 (ny_itemized_deductions_phase_out.yaml) cases; the independent review counted six collected tests in the invariants file. CI runs all of them at this head. These code-health and metadata files also pass:test_known_dead_reference_urls,test_no_concatenated_reference_urls,test_reference_urls,test_rest_python_groups,test_parameter_filesandtest_build_metadata.Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
6b80a8e447against this PR's headb1cad7c17e, for 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.ny_itemized_deductionsny_taxable_incomeny_income_taxstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsny_medical_expense_deductionis new in this PR, so it has no base-side value to compare; its effect shows inny_itemized_deductions.Comparison files are in
fixes/9931-impact/on the hub host.Impact
From 2018, for NY itemizers with medical expenses above 7.5% of federal AGI, the deduction falls by min(expenses − 7.5% × A, 2.5% × A), where A = max(federal AGI, 0); when A is 0 nothing changes. The floor parameter is 10% from 2013, 7.5% for 2017 (the federal Schedule A floor NY then followed) and 10% from 2018 (pre-TCJA 26 U.S.C. 213(a), Form IT-196 line 3). This corrects the model to the statute and the form.
Overlap with other branches
#9912 edits the same case in
ny_pre_tcja_deductions.yaml: casualty becomes (15,000 − 100) − 10,000 = 4,900, and max goes from 26,500 to 26,400. Whichever PR merges second needs a rebase. With both applied the case is 5,000 + 0 + 12,000 + 2,000 + 4,900 = 23,900, with comment lines# NY Medical (Form IT-196 lines 1-4): 10,000 - (100,000 * 0.10) = 0and# NY Casualty: (15,000 - 100) - (100,000 * 0.10) = 4,900.The hub's Form 4952 branch
wip/hub-fix-163d-r2(no PR yet) edits lines next to this PR in three files:ny_itemized_deductions_phase_out.py,ny_itemized_deductions_phase_out.yamlandny_pre_tcja_deductions.yaml(git merge-treereports conflicts). Each resolution keeps both sides:ny_medical_expense_deduction, and the investment interest lines becomeinvestment_interest_expense_deduction;The NY-itemizing branch
fix-ny-itemizes-federal-gatetouches none of these files.axiom: TheAxiomFoundation/rulespec-us#1525 queued (N.Y. Tax Law § 615(a) medical component; blocked on corpus ingestion of pre-TCJA 26 U.S.C. 213 and Form IT-196, and on a signed-encoder run)
🤖 Generated with Claude Code