Skip to content

Fix casualty loss reductions and dependent allocation - #9912

Open
MaxGhenis wants to merge 18 commits into
mainfrom
fix-casualty-loss-165h-reduction
Open

MaxGhenis wants to merge 18 commits into
mainfrom
fix-casualty-loss-165h-reduction

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

We apply the $100 per-casualty reduction before the 10% income floor in the federal, New York, Alabama and Hawaii deductions, and we leave dependents’ losses out of them. In Delaware, we allocate the federal casualty deduction to the filers who sustained the losses.

Main already holds the federal reduction parameter.

Changes and sources

Invariants

For each of the four deductions, we calculate gate × max(max(loss − reduction, 0) − floor × max(AGI, 0), 0) from the head’s and spouse’s losses. We use federal AGI for the federal deduction, New York’s recomputed federal AGI for New York, and state AGI for Alabama and Hawaii.

The result ranges from zero to the reduced loss, and dependents’ losses never change it. As losses rise, the deduction stays flat or rises, and as AGI rises, it stays flat or falls. The state variables return zero outside their state. The four formulas agree when their gates, parameters and income bases match.

Methodology choices

  • Treat each return’s pooled losses as one casualty, because the inputs record one amount per person and no event count. A return with several casualties then gets one $100 reduction rather than one per casualty.
  • Treat every reported loss as a non-disaster loss, since no input marks declared disasters. We allow none in the federal and Alabama deductions from 2018 or in Hawaii’s from 2026, and we leave personal casualty gains out.
  • Floor Alabama AGI at zero to keep the deduction within the reduced loss.
  • Read the current federal reduction and floor parameters for New York, so a reform to either can also change New York’s deduction.
  • Read the federal availability parameter for Alabama. Give Hawaii its own availability and reduction parameters, and read the federal 10% floor for Hawaii, so a reform to that floor can also change Hawaii’s deduction.
  • A dependent can claim an eligible loss on their own return. These formulas omit a separate deduction for people modeled as dependents within another filer’s tax unit.

Merge with main

We merged main at 8769cc75bc2efc7a3287834fc75a85c326343af6, which holds #9888’s Montana casualty change. The merge retains main’s Montana casualty formulas. We updated the comments in two Montana test files to apply the $100 reduction to the federal deduction. Their assertions stay the same. In Delaware, casualty losses join wagering losses in main’s filer-only expense list, and the test file keeps main’s two wagering cases beside the four casualty cases.

The federal calculation can also change D.C. and Delaware deductions, Wisconsin and Utah credit bases, and Virginia’s itemized deductions before the reduction. A change in federal tax can flow through to Montana’s deduction for federal income tax. The federal path is active in the 2015–2017 baseline and can reopen under reforms.

Tests

YAML file Cases
casualty_loss_deduction.yaml 12
al_casualty_loss_deduction.yaml 12
de_itemized_deductions_indv.yaml 20
hi_casualty_loss_deduction.yaml 13
mt_itemized_deductions_joint.yaml 17
mt_itemized_deductions_indiv.yaml 9
ny_casualty_loss_deduction.yaml 10
ny_pre_tcja_deductions.yaml 6

test_casualty_loss_deduction_properties.py runs eight tests. One Hypothesis test checks the reference formula, state gates, and agreement across active copies. Its explicit example, a joint return with $60 and $60 of losses, a dependent’s $20,000 loss and AGI of −$10,000, gives $20 in each active copy. Seven grid cases check the active copy-years within 2017, 2025, and 2026. Each checks boundary losses, monotonicity and that a dependent’s loss changes nothing.

Taking casualty losses out of Delaware’s filer-only list fails three of the four Delaware casualty cases. The case where only the dependent has a loss passes either way.

  • With Hawaii’s copy switched off before 2018, the Hawaii 2017 grid case and the Hypothesis test fail.
  • Counting dependents’ losses in the federal copy fails the Hypothesis test on its explicit joint example.
  • Using main’s federal formula fails all 12 federal cases, including Case 10 with $5,000 in 2017.
  • Using main’s Alabama formula fails “Capped at 0” with $50.
  • Using main’s Hawaii formula fails “larger AGI” with $50 and “AGI exceeds the filers’ loss, and a dependent’s loss is left out” with $900.
  • Counting dependents’ losses in Hawaii fails “AGI exceeds the filers’ loss, and a dependent’s loss is left out” with $800 and Case 10 with $2,400.

CI at this head is pending.

Microsimulation impact

impact: pending a comparison at the final head.

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: us-de/policies/income_tax/spouse_itemized_deduction_allocation TheAxiomFoundation/rulespec-us#1513 queued (extend it with casualty and dependent-loss companion cases)

🤖 Generated with Claude Code

MaxGhenis and others added 8 commits October 6, 2026 07:08
… 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>
@DTrim99

DTrim99 commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Apply the Form 4684 $100 per-casualty reduction and drop dependents' losses in the federal, NY, AL and HI casualty deductions

PR #9912 (author: MaxGhenis, head 43eed2a0f8). This review covers only #9912's two commits on top of #9888: 266f3e245f (the $100 reduction and dependents) and 43eed2a0f8 (the Alabama negative-AGI test). The branch also carries #9877 and #9888. #9877 merged on 2026-10-12. #9888 was reviewed separately (REQUEST_CHANGES, one should-address item about its rebase), and none of its findings are repeated here.

Summary

The PR fixes two errors in PolicyEngine's four copies of the Form 4684 Section A computation:

  • They skipped the $100 per-casualty reduction (26 U.S.C. 165(h)(1), Form 4684 line 11).
  • They summed casualty_loss over every tax-unit member, dependents included.

All four now compute gate × max(max(head and spouse losses − $100, 0) − 10% × max(AGI, 0), 0):

Variable AGI for the 10% floor $100 Gate
casualty_loss_deduction (federal) federal positive_agi federal per_casualty_reduction casualty.active (false from 2018)
ny_casualty_loss_deduction federal positive_agi (IT-201 line 19) federal none (2017 federal rules every year)
al_casualty_loss_deduction al_agi, now floored at 0 federal casualty.active (new: rolling conformity to 165(h)(5))
hi_casualty_loss_deduction hi_agi, floor clamped at 0 new Hawaii parameter, 100 new non_disaster_losses_allowed: true from 2018, false from 2026 (Act 35, SLH 2026)

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

  • All 52 YAML cases in the five touched files pass on the extracted head tree, and so do the 7 property tests.
  • Twelve expectations check by hand.
  • CI is 35/35 green.
  • Both axiom issues are open, labelled pe-parity and dispatch-ready.

Baseline changes:

  • New York itemizers with a loss lose $100 in every year, and a dependent's loss no longer counts.
  • Alabama drops to $0 for non-disaster losses from 2018. For example, TY2024 with $50,000 wages and a $20,000 loss: al_income_tax goes from $1,242.95 to $1,992.95.
  • Hawaii drops to $0 from 2026, and loses $100 before that.
  • The federal deduction changes only for TY2015–2017 and under reforms.

What blocks approval is the rebase (S1). Replaying just these two commits onto main gives two conflicts of their own. In one of them neither side's number is right: the New York total must become 23,900. There are two optional suggestions.

Critical (must fix)

None.

Should address

S1. After #9888 is rebased, replay only this PR's two commits onto main, recompute the New York total, and refresh the PR body.

Suggestions

Both are optional.

1. After the rebase, main's Delaware payer allocation (#9878) under-allocates a spouse's casualty loss when a dependent also has one.

  • Where: on main, de_itemized_deductions_indv.py:67-68:
    • total_expense = person.tax_unit.sum(expense)
    • allocated += amount * _share(head_or_spouse * expense, total_expense)
  • The interaction:
    • casualty_loss_deduction is mapped to casualty_loss, and the denominator counts every member.
    • That was right while the federal amount included dependents' losses.
    • After this PR it covers only the head's and spouse's losses, so part of a spouse's own deduction gets prorated by income instead.
  • Example (derived from the code, not run): a 2017 MFS-on-combined-return case. Head wages $60,000 and loss $20,000; spouse wages $40,000; dependent loss $10,000.
    • Federal deduction = (20,000 − 100) − 10,000 = 9,900.
    • The head is allocated 9,900 × 20/30 = 6,600. The remaining 3,300 is split 60/40, so the head ends with 8,580 and the spouse with 1,320.
    • Pub. 547 (2017), PDF p. 10: "If one spouse owns the property, only that spouse can figure a loss deduction on a separate return." So the split should be 9,900 / 0.
  • Reach: Delaware only. It needs a dependent with a loss, and a nonzero federal deduction, which means TY2015–2017 or an active reform.
  • Fix: for the casualty entry, sum casualty_loss over the head and spouse only (person.tax_unit.sum(head_or_spouse * expense)). Keep the all-member denominator for the deductions whose federal amounts still include dependents' payments.

2. New York reads the federal $100 and 10% parameters for a rule that New York freezes at 2017.

  • Where: ny_casualty_loss_deduction.py:32, 44, 48 read gov.irs.deductions.itemized.casualty.per_casualty_reduction and .floor at the current period.
  • Law: IT-196-I (2025), PDF p. 3: line 20 "is calculated using the federal rules that applied to tax year 2017."
  • Why it's a suggestion:
    • The values agree in every year (100 and 10% since 2010), so no baseline result changes.
    • The PR body gives this same reason for Hawaii's own parameter ("A reform to the federal parameter should not move Hawaii"), but a reform to the federal $100 would move New York.
    • ny_misc_deduction already reads the federal misc floor the same way, and Allow non-disaster casualty and theft losses in California and Minnesota itemized deductions #10068's California and Minnesota copies read the federal parameter too, so this matches the existing pattern.
  • Options: add a New York parameter, or note the coupling in the variable's documentation.

Verified correct

  • Federal law (26 U.S.C. 165, Cornell LII, with its amendment notes):

    • (h)(1) as amended by P.L. 119-108 § 2(b), for taxable years beginning after December 31, 2024: "$100 ($500 in the case of any qualified disaster-related personal casualty losses …)". Before that the text read "$500 ($100 for taxable years beginning after December 31, 2009)". Either way, $100 applies to every loss PE models.
    • (h)(2)(A): the 10%-of-AGI floor.
    • (h)(3)(B): the loss is measured after (h)(1).
    • (h)(4)(B): "a husband and wife making a joint return for the taxable year shall be treated as 1 individual."
    • (h)(5)(A): losses "in a taxable year beginning after December 31, 2017" are allowed only if "attributable to a Federally declared disaster … or a State declared disaster". P.L. 119-21 § 70109 removed the 2026 end date and added State disasters, for taxable years beginning after 2025.
    • 2017 Form 4684, p. 1: line 11 "Enter $100", line 17 "Enter 10% of your adjusted gross income", line 18 "If zero or less, enter -0-".
    • 2025 Form 4684, p. 1, Section A: "For tax years beginning after 2017 … deductible only if the loss is attributable to a federally declared disaster". Line 14 carries the limit. The 2021 form reads the same.
    • Pub. 547 (2017), p. 10:
      • Joint filers are "one individual in applying the $100 rule".
      • "If you and your spouse have a casualty or theft loss and you file separate returns, each of you must reduce your loss by $100."
      • Example 1: $14,800 − $100 − 10% × $80,000 = $6,700.
    • Pub. 547, p. 4 requires proof "That you were the owner of the property". That supports leaving dependents' losses off the filer's return.
  • New York.

    • IT-196-I (2025), p. 3: "the amount of each separate casualty or theft loss is more than $100, and … the total amount of all losses during the year (reduced by the $100 limit …) is more than 10% of the amount on Form IT-201, line 19".
    • p. 4: worksheet line 11 "Limitation per casualty" has 100 preprinted, and line 17 is "10% of your federal AGI from Form IT-201, line 19".
    • The 2024 instructions are identical on the same pages.
    • The deduction stays ungated by the federal suspension.
  • Alabama.

    • Ala. Code § 40-18-15(a)(6), current text from the Legislature's code service: "Casualty and theft losses … as determined in accordance with subsections (c)(3) and (h) of 26 U.S.C. § 165".
    • § 40-18-1.1(b): "the term '26 U.S.C.' means the Internal Revenue Code … as in effect from time to time".
    • 2025 Form 40 booklet, p. 20 says "A casualty or theft loss is determined in the same manner as on your federal return". It names two exceptions, the timing rule and "reduced by 10% of the Alabama adjusted gross income". It says to enter "the amount of loss as shown on line 15 or line 16 (Section A) of Form 4684". Both lines come after the $100 and the disaster limit.
    • The 2021 booklet, p. 20 has the same text. Schedule A (2025), p. 1 has lines 19a-c.
    • The ADOR OBBBA Executive Summary, p. 8 lists I.R.C. § 165(h)(5) as "Tied to Federal: Yes", with "Corresponding State Authority: §40-18-15(a)(6)".
    • So gating Alabama on casualty.active from 2018 is right, including the 2021 expectation moving from 1,900 to 0.
    • The negative-AGI clamp is a reasoned choice where the form is silent. It matches positive_agi and Hawaii's line 21.
  • Hawaii.

    • HRS § 235-2.4(l) (DOTAX compilation as of 12/31/2025, p. 12): "(1) The amount prescribed by section 165(h)(1) … shall be a $100 limitation per casualty" and "(3) Section 165(h)(5) … shall not be operative".
    • Act 35 (HB 2329 CD1), Section 3:
      • It reletters (l) as (k) and keeps the $100 (p. 22).
      • It strikes (l)(3) (p. 23).
      • Section 7(1) applies Section 3 "to taxable years beginning after December 31, 2025" (p. 34).
    • Announcement 2026-06, p. 2: "Hawaii will conform to IRC section 165(h)(5), which disallows personal casualty loss deductions, except those attributable to federal or state declared disasters."
    • 2025 N-11 instructions:
      • p. 18: Hawaii decoupled for 2018–2025, and Worksheet A-5 line 19 takes "the 2017 federal Form 4684, line 16".
      • p. 19: the $100 and 10% tests.
      • p. 34: Worksheet A-5, with line 21 "If zero or less, enter zero".
    • The 2022 instructions match at pp. 18 and 32.
  • Code patterns (every changed file):

  • Parameters:

    • hi/.../casualty_loss/per_casualty_reduction.yaml is 100 from 2018, uses the amount template ("Hawaii reduces … by this amount …"), and has currency-USD, period: year, a label, and five corroborating references.
    • non_disaster_losses_allowed.yaml uses the boolean template ("…, if this is true."), with unit: bool and values true 2018 / false 2026, which matches Act 35's effective date.
    • Every new URL returns HTTP 200, and every anchor shows the cited text.
  • Callers at the head:

    • The federal variable feeds itemized_deductions, the limitation exclusions, CA's excluded list, the DE, DC, MO, VA and MN lists, and the MN Walz reform. All read the amount, and it changes only in TY2015–2017 or under active reforms. For the post-rebase Delaware interaction, see Suggestion 1.
    • ny_casualty_loss_deduction feeds ny_itemized_deductions_max and the phase-out. al_ feeds Alabama's sources.yaml. hi_ feeds Hawaii's sources and hi_reduced_itemized_deductions.
    • No partner test sets casualty_loss.
  • Documented convention (raised for Montana in Count Montana casualty losses once per return and only for the spouses who had them, less $100 and 10% of Montana AGI #9888; not repeated as a finding): PE has one loss per person and no casualty count, so the $100 applies once per return. The PR documents this in all four formulas and the YAML headers.

    • Head loss 80 plus spouse loss 90 from two storms (NY or HI, 2025) gives 70. The law gives 0, and the parent gave 170.
    • One $170 casualty correctly gives 70.
  • Tests run on the extracted head tree, one file per process (local policyengine-core 3.26):

    • federal casualty_loss_deduction.yaml 12/12;
    • al_casualty_loss_deduction.yaml 12/12;
    • hi_casualty_loss_deduction.yaml 13/13;
    • ny_casualty_loss_deduction.yaml 9/9;
    • ny_pre_tcja_deductions.yaml 6/6;
    • tests/unit/test_casualty_loss_deduction_properties.py 7/7 in 74 s, of which the Hypothesis test is 3.9 s and the rest is mostly model load.
  • The property test works:

    • Hypothesis runs with derandomize=True, and hypothesis is already a dev dependency.
    • The grid has a guard against a vacuous pass (table.max() > 0).
    • Its reference, dependents and $100-threshold checks would all fail on the parent's formulas.
  • Reproduced on the head and on the parent (Count Montana casualty losses once per return and only for the spouses who had them, less $100 and 10% of Montana AGI #9888 head e352ed05bb):

    Scenario Parent Head
    NY 2025 joint; wages 60k/40k; losses 10k + 5k 5,000 4,900
    NY 2025; only the dependent child had a loss (15k); parent wages 100k 5,000 0
    NY 2022 single; wages 100k; loss 15k (federal stays 0) 5,000 4,900
    AL 2017; al_agi −10,000; no loss / loss 300 1,000 / 1,300 0 / 200
    AL 2021; al_agi 1,000; loss 2,000 (non-disaster) 1,900 0
    AL 2024; wages 50k; loss 20k: deduction / al_itemized_deductions / al_income_tax 15,000 / 18,825 / 1,242.95 0 / 3,825 / 1,992.95
    HI; hi_agi 20,000; loss 5,000: 2025 / 2026 3,000 / 3,000 2,900 / 0
    Federal 2017 single; wages 50k; loss 10k 5,000 4,900
    Federal 2017 joint; wages 50k; losses 3k + 4k; dependent loss 9k 11,000 1,900
  • Hand checks (12):

    1. Federal Case 4: (10,000 − 100) − 5,000 = 4,900.
    2. Federal Case 9: AGI is 60,000 because the dependent's wages are excluded, so (8,000 − 100) − 6,000 = 1,900.
    3. Federal Case 12 (separate return): (5,000 − 100) − 2,000 = 2,900.
    4. AL Case 1 (2017): (2,000 − 100) − 100 = 1,800.
    5. AL Case 8 (joint): (3,000 − 100) − 1,000 = 1,900.
    6. AL Case 10: the floor clamps to 0, so 300 − 100 = 200.
    7. AL Case 12: 0. The parent gave 1,000 = 10% × 10,000.
    8. HI "larger loss": (300 − 100) − 100 = 100.
    9. HI Case 10: the dependent's loss is excluded, so (1,000 − 100) − 500 = 400.
    10. HI Case 11: line 21 is "If zero or less, enter zero", so the result is 200.
    11. NY Case 6, Pub. 547 Example 1: 6,700.
    12. ny_itemized_deductions_max: 5,000 + 2,500 + 12,000 + 2,000 + 4,900 = 26,400 at the head. After the rebase it becomes 23,900 (S1).
  • Test hygiene:

    • Test periods are plain.
    • The YAML parameter overrides are one casualty.active: true per tree (federal, AL, HI). That is well within the memory budget.
    • The 2018 federal case guards the suspension.
  • Changelog: changelog.d/fix-casualty-loss-165h-reduction.fixed.md is a top-level file of type fixed, and its text matches the change, including the Alabama and Hawaii gates.

Axiom line assessment

The PR body has two lines:

  • us/statutes/26/165/h TheAxiomFoundation/rulespec-us#1516 queued (federal Step 1 extended in this comment …)
  • us-ny/statutes/TAX/615, us-al/statutes/40-18-15 (a)(6), us-hi/statutes/235-2/4 TheAxiomFoundation/rulespec-us#1521 queued

Both are valid.

  • or_income_tax_after_refundable_credits -> or_income_tax #1516: OPEN and labelled pe-parity. The linked comment (2026-10-06 16:38 UTC) is dispatch-ready on the Add AMT parameters for 2020-2023 #1467 model:

    • module path us/statutes/26/165/h.yaml;
    • corpus citations re-pinned to scope us/statute/2026-08-03-rulespec-title-26-current-union in the signed release, adding (c)(3) and (h)(3)(B);
    • verbatim § 165(h), Form 4684 and Pub. 547;
    • five required outputs, with P.L. 119-108 and (h)(5) versioning;
    • companion cases F1–F13 derived from Form 4684 arithmetic. F1–F10 mirror the head's federal YAML.
  • MA excess exemption not applied to long-term capital gains #1521: OPEN and labelled pe-parity, last updated 2026-10-06 20:48 UTC (after the head commit). It has:

    • module paths for NY, AL and HI;
    • corpus scopes and gaps (Act 35 and IT-196-I need ingestion);
    • verbatim sources;
    • a review_finding for each step;
    • companion cases N1–N9, A1–A7 and H1–H8, which match the head's cases.

    It leaves out AL Cases 10–12 and HI Case 13. Those are PE methodology (the negative-AGI clamp) and reform cases, so this is fine.

  • Blockers: both issues and the PR body record them. Each signed run needs approval, the state modules import the unsigned federal module, and corpus ingestion is pending.

CI status

Branch status

Verdict: REQUEST_CHANGES

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

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.

MaxGhenis and others added 2 commits November 13, 2026 08:52
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>
@MaxGhenis MaxGhenis changed the title Apply the Form 4684 $100 per-casualty reduction and drop dependents' losses in the federal, NY, AL and HI casualty deductions Fix casualty loss reductions and dependent allocation Nov 13, 2026
MaxGhenis and others added 2 commits November 13, 2026 09:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 5 commits November 28, 2026 21:08
Keep the Montana implementation from main. Apply Delaware’s shared filer expense filter to casualty and wagering losses and preserve both sets of cases.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Explain how a reform to the federal floor can change Hawaii’s deduction.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Exercise Hawaii in 2017 and add a joint example with a dependent loss and negative AGI.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Check the federal deduction in both years and choose inputs that expose the old Alabama and Hawaii calculations.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Correct the Montana comparisons and describe Delaware's expense and income shares.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>

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

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 9912
Reviewed head SHA: 76e2e73
Merge base SHA: 8769cc7
Mode: incremental from 43eed2a
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-9912-review-sources.json
Review status: COMPLETE

Source Documents

Critical

None.

Should Address

A1 — The Delaware axiom line names rulespec-us#1513, but that issue has no casualty or dependent-loss companion cases (OPEN)

  • Location: PR body, Axiom section, third line: axiom: us-de/policies/income_tax/spouse_itemized_deduction_allocation TheAxiomFoundation/rulespec-us#1513 queued (extend it with casualty and dependent-loss companion cases).
  • Trigger: commit 214a4a4 (carried through the main merge as FILER_ONLY_DEDUCTIONS) changes Delaware's spouse allocation of the casualty deduction and adds four DE YAML cases.
  • Expected: CLAUDE.md "Axiom Parity" says a queued issue "must be dispatch-ready and labelled pe-parity. It needs the module path and corpus citation, the verbatim law, the required outputs, and companion tests from the same external source as your YAML tests."
  • Observed: #1513 is OPEN and labelled pe-parity, but it was last updated on 2026-10-06, before the Delaware commit (2026-11-13). Its body and comments never mention casualty (grep -i casualty finds nothing; saved at pr-9912-axiom-1513.txt). Its only allocation output is the generic de_itemized_deductions_specific_allocation. The axiom line itself says the extension still has to be done ("extend it with …"). So the queued issue is not dispatch-ready for this PR's Delaware change.
  • Impact: process and parity only; no modeled result changes. The Delaware RuleSpec module would be encoded without fixtures for the casualty or dependent-loss allocation.
  • Source: snapshot CLAUDE.md:151-155; gh issue view 1513 --repo TheAxiomFoundation/rulespec-us.
  • Fix: add a #1513 comment with the casualty step and companion cases. They should come from the same sources as the DE YAML: Pub. 547's owner rule, and PIT-RES 2025 instructions p. 7 (specific allocation, else income proration) and p. 12. Then drop "extend it with" from the axiom line.
  • Proposed severity: SHOULD ADDRESS (an axiom-line problem, per the brief).

Coordinator assessment: This is the only blocking item. The model changes are correct and tested. A comment on #1513 with the casualty step and companion cases from Pub. 547 and the PIT-RES 2025 instructions, plus removing "extend it with" from the axiom line, clears it.

Suggestions

S1 — The § 165 GovInfo link floats to the latest edition, but its comment says "2024 Code" (OPEN)

  • Location: casualty_loss_deduction.py, the reference tuple: # 26 U.S.C. 165 (2024 Code) above https://www.govinfo.gov/link/uscode/26/165?type=usc&year=mostrecent&link-type=html. The PR body uses the same URL.
  • Observed: the link is right today. It redirected on 2026-12-02 to USCODE-2024-title26-…-sec165.htm, which has (h)(1) "$500 ($100 for taxable years beginning after December 31, 2009)", the (h)(2)(A) 10% floor and (h)(4)(B). It also has the pre-OBBBA (h)(5), "Limitation for taxable years 2018 through 2025". The companion citation, P.L. 119-21 § 70109 at physical page 93, is correct: it strikes ", and before January 1, 2026" and adds State declared disasters. But year=mostrecent will move to the 2025 edition when GovInfo publishes it, and the "2024 Code" label will then be wrong. The 2024 edition also leaves out later (h)(1) amendments, which the prior review saw on LII as P.L. 119-108. They don't change the $100 for any loss PE models.
  • Impact: citation durability only; no modeled result changes.
  • Fix: pin year=2024 in the link, or change the label to "most recent edition".
  • Proposed severity: SUGGESTION.

S2 — The PR body still has two placeholders that are now stale (OPEN)

  • Location: PR body, "CI at this head is pending." and "impact: pending a comparison at the final head."
  • Observed: CI is 35/35 SUCCESS at 76e2e73. S1 item 3 of the prior review asked the author to fill in or remove the Impact placeholder. It was replaced by another "pending" placeholder, while the PR still changes baseline results for New York, Alabama (from 2018) and Hawaii (from 2026).
  • Impact: reviewer-facing accuracy only.
  • Fix: update the CI line. Then either add the comparison or delete the Impact line. The repository has no rule requiring an impact line.
  • Proposed severity: SUGGESTION.

Evidence Gaps

No material gaps reported.

Notes

  • This round covers the seven author commits since the 10-12 review and two merges of main.
  • The round-1 should-address item is RESOLVED. #9888 merged on 11-15, and the PR's diff against its merge base now holds only the casualty files. ny_pre_tcja_deductions.yaml expects 23,900. hi_casualty_loss_deduction.py has one reference tuple. The body no longer asks for #9877 or #9888 to merge first.
  • Suggestion 1 (Delaware allocation with a dependent's loss) is RESOLVED. casualty_loss_deduction is now filer-only in both numerator and denominator. A couple with a $20,000 and a $10,000 loss gets [13,266.67, 6,633.33, 0] with or without a dependent's $30,000 loss. That follows 30 Del. C. § 1109(a), Pub. 547's owner rule and the PIT-RES Line 13 specific allocation.
  • Suggestion 2 (NY reads the federal parameters) is RESOLVED by documentation.
  • New behavior verified: Hawaii's 10% floor comes from operative § 165(h)(2)(A) under HRS § 235-2.4(l), which is documented. Hawaii 2017 is (loss − $100) − 10% of AGI. The four corrected fixtures and the Montana cleanup check by hand. With the merge-base formulas swapped in, all four fixtures and all four new Delaware cases fail, so they discriminate.
  • Merging with current main (72 commits ahead) is clean. The casualty tests pass on the merged tree, apart from the files run 1 didn't reach before its deadline.
  • For #1521, companion A2's AL input differs from YAML Case 2 (11,000 vs 9,500). Both give $0 under the law, so refreshing A2 is optional housekeeping.

Validation Summary

Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot), split because of machine load. Run 1 (the federal casualty file and the DE, HI and MT itemized folders) reached its 540 s deadline with 182 of 570 items passed and 0 failed. Run 2 passed the NY, AL and MT casualty YAMLs (89 of 89) and the casualty property and code-health pytest files (18 of 18). Every PR-touched file that was reached passed, and CI's full suite is green at this head. The same runs on a merge with current main gave 0 failures. Sources: 26 U.S.C. 165 and P.L. 119-21 § 70109, 30 Del. C. § 1109, the PIT-RES 2025 instructions, Pub. 547 (2017) and HRS § 235-2.4; manifest check passed. CI: 35/35 checks pass at 76e2e73.

Timing

setup seconds: 6.00s; scope seconds: 60.00s; parallel review seconds: 1142.80s; policy role seconds: 269.50s; code role seconds: 1142.80s; adjudication seconds: 90.00s; consolidation cleanup seconds: 46.60s; elapsed seconds: 1334.00s

Review Severity

COMMENT. Open findings: 0 critical, 1 should address, 2 suggestions.

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