Skip to content

Add North Carolina's wagering losses itemized deduction from 2025 (G.S. 105-153.5(a)(2)e) - #10110

Draft
MaxGhenis wants to merge 22 commits into
mainfrom
nc-wagering-losses-deduction
Draft

MaxGhenis wants to merge 22 commits into
mainfrom
nc-wagering-losses-deduction

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Agent-written for Max, by a Codex cloud task and Claude Code for Max Ghenis; no person has reviewed it yet.

Summary

North Carolina allows taxpayers to itemize eligible wagering losses from tax year 2025. This PR applies the IRC § 165(d) rules adopted by North Carolina and includes the result in state itemized deductions outside the $20,000 mortgage and property tax cap. A taxpayer can take the federal standard deduction and still itemize in North Carolina.

The federal wagering fix (#10070) and the North Carolina claim of right deduction (#10028) are both merged. This PR adds the deduction, its effective date, North Carolina's adopted loss-share schedule, the 2025 itemized list entry, tests and a changelog fragment.

The law

S.L. 2026-41 § 44.2 added G.S. 105-153.5(a)(2)e for tax years beginning on or after January 1, 2025. North Carolina allows wagering losses deductible under IRC § 165(d) to the extent they were not deducted in arriving at AGI. Session law, PDF pp. 607–608

NCDOR's example has $10,000 of winnings in AGI and $12,000 of losses. The taxpayer can claim $10,000 on Form D-400 Schedule A, line 9. NCDOR notice

North Carolina adopts the Internal Revenue Code as enacted on July 5, 2025. From 2026, the federal allowable deduction is 90% of losses, limited to gains. S.L. 2026-31 § 12(a), PDF p. 42 · P.L. 119-21 § 70114, PDF p. 96

Household comparison

A 2025 single North Carolina filer has $60,000 of wages, $10,000 of gambling winnings, $12,000 of gambling losses and $5,000 of charitable gifts. Main and this branch both model $70,000 of AGI.

Main This branch
NC deduction $12,750 standard $15,000 itemized ($10,000 wagering + $5,000 charity)
NC taxable income $57,250 $55,000
NC income tax $2,433.13 $2,337.50 ($55,000 × 4.25%)

Test plan

  • nc_wagering_losses_deduction.yaml passes all 15 cases, including the federal-only reform, both negative input cases, federal standard deduction with North Carolina itemization, and a saturated mortgage cap. nc_itemized_deductions.yaml passes all seven cases, including the 2024 override.
  • test_nc_wagering_losses_properties.py: a 196-point grid; all 13 properties pass. With AGI given, it checks the lower bound, the upper bound and the exact net gain for a filer who itemizes either way. With modeled AGI, it checks that gambling never lowers North Carolina taxable income in 2025 and 2026.
  • The shared mortgage cap and the claim of right credit method still behave as on main.
  • Both new YAML cases fail when the wagering entry is removed, and the cap case fails when the cap is applied to wagering losses.
  • The 16 focused YAML files pass on the fixed head and after a throwaway merge with main. The property tests, four code-health guards, and Ruff pass on the fixed head.

axiom: TheAxiomFoundation/rulespec-us#1656 queued

🤖 Generated with Claude Code

MaxGhenis and others added 17 commits October 9, 2026 08:50
G.S. 105-153.5(a)(2)d, added by S.L. 2016-5 for 2014 and later, lets North
Carolina itemizers deduct repayments of income included in AGI in an earlier
year under a claim of right (Form D-400 Schedule A line 8). Repayments above
$3,000 are deductible in full; smaller ones are reduced by 2% of federal AGI
less other miscellaneous itemized deductions, which the 2016 and 2025 NCDOR
worksheets both reproduce. PE had no input for these repayments, so it adds
claim_of_right_repayment (person level; only the head's and spouse's count)
and moves North Carolina's uncapped itemized items into a parameter list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…C taxed

Review r1 (subfleet 20261009-090558-nc-itemized-review):
- S.L. 2026-31 section 1.8 rewrites G.S. 105-153.5(a)(2)d for taxable years
  beginning on or after January 1, 2026: the repaid amount must have been
  included in AGI "as modified in G.S. 105-153.5 and G.S. 105-153.6" in the
  earlier year. New person input
  nc_claim_of_right_repayment_excluded_from_income (the part NC deducted when
  received, such as repaid Social Security) and a dated parameter apply it.
- Count only the head's and spouse's other miscellaneous expenses against
  the pre-2018 floor; a dependent's are on the dependent's return.
- The property grid now varies property taxes (so the $20,000 cap binds) and
  adds a 2026 grid for the excluded part.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G.S. 105-153.5(a)(2)d, added by S.L. 2016-5 for 2014 and later, lets North
Carolina itemizers deduct repayments of income included in AGI in an earlier
year under a claim of right (Form D-400 Schedule A line 8). Repayments above
$3,000 are deductible in full; smaller ones are reduced by 2% of federal AGI
less other miscellaneous itemized deductions, which the 2016 and 2025 NCDOR
worksheets both reproduce. PE had no input for these repayments, so it adds
claim_of_right_repayment (person level; only the head's and spouse's count)
and moves North Carolina's uncapped itemized items into a parameter list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…C taxed

Review r1 (subfleet 20261009-090558-nc-itemized-review):
- S.L. 2026-31 section 1.8 rewrites G.S. 105-153.5(a)(2)d for taxable years
  beginning on or after January 1, 2026: the repaid amount must have been
  included in AGI "as modified in G.S. 105-153.5 and G.S. 105-153.6" in the
  earlier year. New person input
  nc_claim_of_right_repayment_excluded_from_income (the part NC deducted when
  received, such as repaid Social Security) and a dated parameter apply it.
- Count only the head's and spouse's other miscellaneous expenses against
  the pre-2018 floor; a dependent's are on the dependent's return.
- The property grid now varies property taxes (so the $20,000 cap binds) and
  adds a 2026 grid for the excluded part.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
S.L. 2026-41 section 44.2 (approved July 7, 2026) adds G.S.
105-153.5(a)(2)e for taxable years beginning on or after January 1, 2025:
North Carolina itemizers may deduct the wagering losses allowed under
section 165(d), to the extent not deducted in arriving at AGI (2025 Form
D-400 Schedule A line 9, per NCDOR's July 23, 2026 notice and September 11,
2026 FAQs). nc_wagering_losses_deduction is the federal
wagering_losses_deduction from 2025.

Do not merge before federal gross income counts gambling winnings
(#9637). Until then PE's AGI omits the winnings
this deduction offsets, so the deduction would take North Carolina tax
further below the correct amount for every gambler with losses. For one
who itemizes either way and whose losses at least equal the winnings, main
is right by accident and this change alone would understate NC taxable
income by the winnings.
test_gambling_never_lowers_taxable_income_with_modeled_agi fails until then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1 (subfleet 20261009-090558-nc-itemized-review): the NC deduction
takes the federal section 165(d) amount, so it inherits two more federal
defects besides gambling winnings missing from AGI (#9637):
- no 90% share of losses from 2026 (P.L. 119-21 section 70114, in NC's July
  5, 2025 Code);
- dependents' gambling summed onto the filer's deduction, although federal
  gross income leaves dependents' income out.
Each now has a guard that fails until it is fixed federally: YAML cases for
$8,000 of 2026 losses ($7,200) and a dependent's gambling ($0), and a
law-based min(share x losses, winnings) property. The property grid now
varies property taxes so the standard-deduction crossover is exercised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…losses deduction

Fixes #9637.

- gambling_winnings joins gov.irs.gross_income.sources (26 U.S.C. 61(a), Schedule 1 line 8b).
- wagering_losses_deduction is min(rate x losses, winnings) for the head and spouse; the rate is 1 through 2025 and 0.9 from 2026 (P.L. 119-21 sec. 70114).
- The deduction moves into the Schedule A list (line 16) and the pre-2018 section 68(c) exclusions.
- States: AL, CA, DC, DE, HI, KS, MI, MN, MS, MT, NY, PA, VA, WI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eform's formula

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From 2026 the deduction is 90% of losses and no longer a whole number;
sums near 30,000 resolve to about 0.002 in float32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments only: the guards' inputs, expectations and assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n, Kentucky 2018, Montana allocation

- Alabama and pre-2023 Iowa gross income count the head's and spouse's
  gambling winnings (new person variables), not a dependent's.
- Delaware allocates wagering losses over the head's and spouse's losses only.
- Kentucky allowed no wagering losses for 2018 (2019 Ky. Acts ch. 151).
- Montana allocates each spouse's own losses first.
- Document what the gambling inputs hold; move the integration cases into
  the deduction's YAML file; add section 68 cases; fix reference titles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto nc-wagering-losses-deduction

# Conflicts:
#	policyengine_us/parameters/gov/states/mt/tax/income/deductions/itemized/misc_deductions.yaml
#	policyengine_us/parameters/gov/states/nc/tax/income/deductions/itemized/other_sources.yaml
MaxGhenis and others added 3 commits November 30, 2026 12:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8999568) to head (58240fe).
⚠️ Report is 410 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #10110   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           24        16    -8     
=========================================
- Hits            24        16    -8     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MaxGhenis and others added 2 commits December 1, 2026 05:08
Use the state's adopted loss share, floor the deduction at zero, and include wagering losses in itemized deductions starting in 2025.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

1 participant