Repository navigation
Conversation
… the forms - Federal income tax deduction (through 2023): attribute federal tax to the spouse who earned the income and cap each spouse at $5,000, instead of prorating the jointly capped amount by Montana AGI (2022 Form 2 instructions, Itemized Deductions Schedule, line 4). - Child and dependent care expense deduction (through 2023): phase out on the couple's combined Montana AGI and split the result equally only for spouses filing separately on the same form; a single filer and a joint return take the whole deduction (Form 2441-M lines 3-7). - Elderly homeowner/renter credit: count federal AGI without regard to losses (MCA 15-30-2337(9)(a); Form 2EC line 9). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions Each spouse filing separately on the same form deducts their own federal income tax up to $5,000, so both spouses itemize and Montana tax is 6,295.56. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chedule - A married person filing on a separate form (federal filing status SEPARATE) cannot take the child and dependent care expense deduction: "married couples shall file a joint return or file separately on the same form" (MCA 15-30-2131(1)(c)(vi)(A)); 2022 instructions, line 14. - The 2023 credit schedule was the Elderly Homeowner/Renter Credit Schedule; it became Schedule 2EC in 2024. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ouse mt_misc_deductions is a Person variable whose `adds` list included the TaxUnit casualty_loss_deduction. policyengine-core evaluates `adds` with calculate(..., map_to=person), which projects a tax-unit value onto every member, so the joint path (summing over the tax unit) counted a couple's casualty loss once per member, and each spouse filing separately got the full amount. Replace it with two Montana variables following the 2021-2023 Form 2 instructions, Itemized Deductions Schedule line 15: complete federal Form 4684 using Montana AGI in place of federal AGI; spouses filing separately each complete their own Form 4684 (and a deduction attributable to one spouse is claimed by that spouse). - mt_casualty_loss_deduction_joint (TaxUnit): the unit's loss above 10% of mt_agi_joint, counted once. - mt_casualty_loss_deduction_indiv (Person): each spouse's own loss above 10% of their own mt_agi_indiv; dependents' losses go to the head, as mt_agi_indiv does with dependents' income. - casualty_loss/applies ends the line in 2024, when Montana discontinued its Itemized Deductions Schedule (2024 instructions, p. 8). With the child care deduction moved out of the misc list (stacked on fix-mt-separate-filing-allocations), the list held only the casualty loss, so the list parameter and mt_misc_deductions are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erties Montana's line 15 has filers complete federal Form 4684, whose line 11 reduces each casualty by $100 before the 10%-of-AGI floor (line 17). IRS Publication 547: a joint return is one individual for the $100 rule; spouses filing separately each reduce their own loss by $100. Add the federal amount as gov.irs.deductions.itemized.casualty.per_casualty_reduction (26 U.S.C. 165(h)(1)) and apply it once per joint return and once per spouse's column. The model has one loss amount per person, so each return's (or column's) losses are treated as one casualty, as the Arkansas casualty deduction already does. Add grid property tests: both variants match a closed-form Form 4684 reference; the joint return counts the unit's loss once whatever the number of members; separate filers deduct only their own loss; the deduction is non-negative, bounded, monotone; single-filer variants agree; and it ends in 2024. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions' into fix-mt-casualty-loss-misc-deduction
From the adversarial review of #9888 (law, code and test lenses, all approving): - A dependent's casualty loss belongs on the dependent's own return, as the dependent's income does (adjusted_gross_income_person, and so Montana AGI, leaves it out; Pub. 547: only the owner claims the loss). The joint path now sums non-dependents' losses (tax_unit_non_dep_add) and the separate path counts only the head's or spouse's own loss, instead of moving dependents' losses into the head's column while their income stayed out of it. - Say what the suspension flag models: PE has no input distinguishing federally declared disaster losses, so, like the federal deduction, no personal casualty loss is deductible from 2018 unless gov.irs.deductions.itemized.casualty.active is on. - Cite former MCA 15-30-2131(1)(a) (MCA 2021), which allowed the items of IRC 161 (including 165 losses), on the parameter and variables. - Describe the Form 4684 computation per lines 10-18 rather than as one form per return, and fix the separate-path test headers. - Add the 2008 $100 value to per_casualty_reduction (2008 and 2009 Form 4684 line 11), so it is defined before 2009. - Tests: natural-input dependent cases on both paths, and a 2024 case with filing status 2a allowed that exercises the separate path's applies gate (it fails if the gate is removed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… losses off the filer's return 26 U.S.C. 165(h)(1) reduces each personal casualty loss by $100 (Form 4684 line 11) before the 10%-of-AGI floor (line 17); a joint return is one individual for the $100 rule (165(h)(4)(B)). Only the owner of the property claims the loss, so a tax unit dependent's loss belongs on the dependent's own return, as their income already does. - casualty_loss_deduction (federal, TY2015-2017 and reforms): non-dependent losses less gov.irs.deductions.itemized.casualty.per_casualty_reduction (from #9888), then the floor. - ny_casualty_loss_deduction: IT-196 line 20 uses the 2017 federal rules, so the same computation on federal AGI, ungated by the federal suspension. - al_casualty_loss_deduction: Ala. Code 40-18-15(a)(6) adopts 165(h) as in effect from time to time (40-18-1.1), and Schedule A line 19a takes Form 4684 after its disaster limit, so the deduction follows the federal suspension flag; the floor uses Alabama AGI, not below zero. - hi_casualty_loss_deduction: Hawaii's own $100 (HRS 235-2.4(l)(1)) on Hawaii AGI, and from 2026 Act 35, SLH 2026, makes 165(h)(5) operative. Adds YAML cases that fail on main and a Hypothesis/grid property test of the four copies against a closed-form reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion Main's max_(0, loss - al_agi * floor) gave every Alabama filer with negative AGI a deduction of 10% of |AGI| even with no loss; the zero clamp on the floor removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Review: Apply the Form 4684 $100 per-casualty reduction and drop dependents' losses in the federal, NY, AL and HI casualty deductionsPR #9912 (author: MaxGhenis, head SummaryThe PR fixes two errors in PolicyEngine's four copies of the Form 4684 Section A computation:
All four now compute
The law and the code agree. I checked § 165(h), Form 4684, Pub. 547, NY IT-196-I, the Alabama Code, Form 40 and Schedule A, the ADOR OBBBA summary, HRS § 235-2.4, Act 35 and the N-11 instructions at their anchored pages (see Verified correct).
Baseline changes:
What blocks approval is the rebase (S1). Replaying just these two commits onto Critical (must fix)None. Should addressS1. After #9888 is rebased, replay only this PR's two commits onto
SuggestionsBoth are optional. 1. After the rebase,
2. New York reads the federal $100 and 10% parameters for a rule that New York freezes at 2017.
Verified correct
Axiom line assessmentThe PR body has two lines:
Both are valid.
CI status
Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
This review covers only the two commits on top of #9888. The law and code agree: the $100 comes before the 10% floor and a joint return is one individual under § 165(h), NY uses the 2017 rules via IT-196, AL has its post-2018 gate, and HI applies HRS 235-2.4(l)(1). The tests pass and the axiom issues are dispatch-ready. One should item (see the comment above): after #9888 is fixed, rebase by replaying only this PR's two commits. The NY pre-TCJA deductions expectation must become 23,900, and main's #9849 reference block in hi_casualty_loss_deduction.py must go to avoid a duplicate reference. Then refresh the PR body.
Keep New York's recomputed AGI and medical floor. Preserve Montana's newer itemized deductions alongside the pending casualty changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exclude dependent losses from Delaware's casualty allocation denominator. Cover each spouse's own loss and unchanged allocations when a dependent adds a loss. Clarify the New York source comment without changing its income base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The federal, New York, Alabama and Hawaii casualty deductions now subtract the $100 casualty reduction before applying the 10% income floor. They exclude dependents’ own losses from the filers’ returns.
The branch retains pending #9888’s Montana casualty changes. Merge #9888 before this PR. The federal reduction parameter already exists on main.
Changes and sources
Invariants
The four revised deductions equal
gate × max(max(L − R, 0) − F × max(A, 0), 0), using the head’s and spouse’s pooled losses, the applicable reduction, floor and income base. Federal uses federal AGI; New York uses recomputed federal AGI; Alabama and Hawaii use state AGI.The deduction stays between zero and the reduced loss. Dependents’ losses cannot change it. It rises with loss and falls with its income base. State variables return zero outside their state. Copies agree when their gates, parameters and computed income bases agree. Delaware’s filer allocations also ignore dependents’ casualty losses.
Methodology choices
Tests
At commit
ea42a82b025b9f6a11268fa3acb38d695e921180, CI passed all 904 cases in 80 relevant test files: 72 YAML files with 829 cases and eight Python files with 75 cases.The seven property files passed 65 cases. The projection guard passed all ten cases, and the Montana claim-of-right file passed all 35 cases. Formatting, Ruff and the 46 release and certificate guard tests passed.
All 38 CI jobs passed, including baseline, Contrib, microsimulation, Python, package and partner checks. No jobs failed or skipped.
Local model setup exceeded 900 seconds without test results. A traced federal retry also remained in imports. No local behavioral passes are claimed.
Microsimulation impact
To be measured before merge.
Axiom
axiom: us/statutes/26/165/h TheAxiomFoundation/rulespec-us#1516 queued (federal Step 1 extended in this comment: the pinned release's scope, (c)(3) and (h)(3)(B), P.L. 119-108 versioning, and companion cases F1–F13 mirroring
casualty_loss_deduction.yaml)axiom: us-ny/statutes/TAX/615, us-al/statutes/40-18-15 (a)(6), us-hi/statutes/235-2/4 TheAxiomFoundation/rulespec-us#1521 queued (dispatch-ready
review_findings and companion cases mirroring the NY, AL and HI YAML tests)axiom: needed: us-de/policies/income_tax/spouse_itemized_deduction_allocation — extend TheAxiomFoundation/rulespec-us#1513 with casualty/dependent-loss companion cases.
🤖 Generated with Claude Code