Fix DC SE loss addition to cap at federally-deducted amount#7437
Open
PavelMakarchuk wants to merge 3 commits intomainfrom
Open
Fix DC SE loss addition to cap at federally-deducted amount#7437PavelMakarchuk wants to merge 3 commits intomainfrom
PavelMakarchuk wants to merge 3 commits intomainfrom
Conversation
The DC SE loss addition was using raw self_employment_income instead of the amount actually deducted in federal AGI via loss_ald. When combined with the federal §461(l) excess business loss limitation, this created absurdly large positive DC AGI on taxpayers with large negative SE income. Fixes #7408 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Case 6: Verifies SE isolation from loss_ald when capital losses are present ($305K loss_ald - $3K capital = $302K SE portion, addition = $290K). Case 7: Boundary test at exactly $12K DC threshold (addition = $0). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7437 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 1 -3
Lines 76 27 -49
Branches 1 0 -1
=========================================
- Hits 76 27 -49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hua7450
approved these changes
Feb 20, 2026
DTrim99
approved these changes
Feb 20, 2026
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
dc_self_employment_loss_additionat the SE loss actually deducted in federal AGI vialoss_ald, instead of using the rawself_employment_incomeExample (from policyengine-taxsim#684)
Single filer, DC, self-employment income = -$25,000,000:
Root cause
dc_self_employment_loss_additionused rawself_employment_incometo compute the addition. But federal AGI (DC's starting point) only contains the §461(l)-capped amount of SE loss. The addition should only add back what was actually subtracted.Fix
Isolate the SE portion of
loss_ald(which also includes capital losses) and cap the DC addition at that amount:Fixes #7408
Test plan
🤖 Generated with Claude Code