Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • S-corp/partnership losses now included in AGI calculation via loss_ald
  • Section 461(l) excess business loss limitation correctly applied to business losses (self-employment + partnership/S-corp)
  • Capital losses handled separately under Section 1211 ($3,000 limit)

Changes

  • Modified policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/loss_ald.py:

    • Added partnership/S-corp losses to business loss calculation
    • Applied Section 461(l) threshold to business losses only (not capital losses)
    • Capital losses continue to be limited separately by Section 1211
  • Added policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/loss_ald.yaml:

    • Integration test from issue (MFJ with $838K S-corp loss)
    • Self-employment loss under threshold (single filer)
    • Combined SE and S-corp loss exceeding threshold
    • Business losses plus capital losses (separate limits)
    • MFJ higher threshold test
    • Section 461(l) sunset after 2026 test

Test

  • All 6 new loss_ald tests pass
  • All 189 IRS income tests pass
  • All 16 IRS integration tests pass (including capital_gains_losses.yaml)

Closes #7015

Closes #7015

- Add partnership/S-corp losses to loss_ald calculation
- Apply Section 461(l) threshold correctly to business losses only
- Capital losses now handled separately (Section 1211 $3,000 limit)
- Add comprehensive integration tests for excess business loss limitation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (66ccff2) to head (57f3b8a).
⚠️ Report is 439 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #7298       +/-   ##
============================================
+ Coverage   72.72%   100.00%   +27.27%     
============================================
  Files        3757         1     -3756     
  Lines       54115        21    -54094     
  Branches      267         0      -267     
============================================
- Hits        39353        21    -39332     
+ Misses      14742         0    -14742     
+ Partials       20         0       -20     
Flag Coverage Δ
unittests 100.00% <100.00%> (+27.27%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

- Add changelog entry for Section 461(l) excess business loss limitation
- Update WV HEPTC test to reflect correct AGI calculation with Section 461(l):
  - Partnership/S-corp losses now limited by Section 461(l) ($610,000 for MFJ)
  - Capital losses separately limited by Section 1211 ($3,000)
  - Total loss_ald = $613,000, resulting in AGI of -$613,000

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Partnership/S-corp losses not included in AGI; missing Section 461(l) excess business loss limitation

2 participants