Repository navigation
Offset SSTB and non-SSTB Schedule C results in federal AGI - #9995
Open
PavelMakarchuk wants to merge 3 commits into
Open
PavelMakarchuk wants to merge 3 commits into
PavelMakarchuk wants to merge 3 commits into
Conversation
irs_gross_income counts each Schedule C category's profit on its own, but loss_ald took the loss only from the net total_self_employment_income, so a loss in one category next to a profit in the other never reached AGI. loss_ald now takes each category's profit and loss on its own. Fixes #9989. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The all-member reference in test_dependent_losses_agi_invariants netted self_employment_income and sstb_self_employment_income per person before splitting income from loss, so it disagreed with loss_ald once loss_ald takes each category on its own (#9989). Use each input on its own, as irs_gross_income does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Fixed the two red checks:
|
This branch has not been deployed
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.
Fixes #9989
What and why
irs_gross_incomecounts each Schedule C category's profit on its own (self_employment_incomeandsstb_self_employment_incomeare separate entries ingov.irs.gross_income.sources, each floored at zero), butloss_aldtook the loss only from the nettotal_self_employment_income. A loss in one category next to a profit in the other was dropped: a non-SSTB loss of 5,000 and an SSTB profit of 5,000 gave AGI 5,000.loss_aldnow takes each category's profit and loss on its own, the same wayirs_gross_incomecounts them. Per the 2024 Schedule C (lines 31 and 32a), both results go on Schedule 1 line 3, which flows to Form 1040 lines 8, 9 and 11, so AGI is 0. #9989 has the verbatim form quotes.I, lossLand thresholdT, the allowed net isI − min(L, I + T) = max(I − L, −T)whether or not the categories are netted first.dc_self_employment_loss_additionalso uses the net of the two categories. D.C.'s addition is a separate rule, so this PR leaves it as is.limited_business_loss.pywith the same two lines. Whichever merges after this one needs the same change there.Test plan
self_employment_income.yaml. Expected values come from the 2024 Schedule C, Schedule 1 and Form 1040 arithmetic in Federal AGI drops a Schedule C loss when the same person has Schedule C profit in the other SSTB category #9989 (AGI 0, 0 and 50,000). All three fail onmain(07227ea252) and pass with this change.test_batched.py policyengine_us/tests/policy/baseline/gov/irs --mode per-subdir --workers 1): 1,692 passed, 0 failed (local macOS run)loss_aldorsstb_self_employment_income(49 files): 361 passed, 0 failedruff formatandruff check(ruff 0.15.5, as inuv.lock)changelog.d/axiom: TheAxiomFoundation/rulespec-us#1542 queued (§62(a)(1) composition, deferred in
us/statutes/26/62.yaml; the signed encoder run needs approval)🤖 Generated with Claude Code