Skip to content

Offset SSTB and non-SSTB Schedule C results in federal AGI - #9995

Open
PavelMakarchuk wants to merge 3 commits into
mainfrom
fix-schedule-c-category-losses-agi
Open

PavelMakarchuk wants to merge 3 commits into
mainfrom
fix-schedule-c-category-losses-agi

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Collaborator

Fixes #9989

What and why

irs_gross_income counts each Schedule C category's profit on its own (self_employment_income and sstb_self_employment_income are separate entries in gov.irs.gross_income.sources, each floored at zero), but loss_ald took the loss only from the net total_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_ald now takes each category's profit and loss on its own, the same way irs_gross_income counts 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.

Test plan

  • Three YAML tests in 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 on main (07227ea252) and pass with this change.
  • IRS YAML shard (test_batched.py policyengine_us/tests/policy/baseline/gov/irs --mode per-subdir --workers 1): 1,692 passed, 0 failed (local macOS run)
  • Other YAML files that reference loss_ald or sstb_self_employment_income (49 files): 361 passed, 0 failed
  • ruff format and ruff check (ruff 0.15.5, as in uv.lock)
  • Changelog fragment in 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

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>
PavelMakarchuk and others added 2 commits October 8, 2026 09:33
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>
@PavelMakarchuk

Copy link
Copy Markdown
Collaborator Author

Fixed the two red checks:

  • Full Suite - Rest: tests/core/test_dependent_losses_agi_invariants.py::test_units_without_dependents_match_all_member_formula (2024, 2025) failed because its all-member reference netted self_employment_income and sstb_self_employment_income per person before splitting income from loss. With this PR loss_ald takes each Schedule C category on its own, as irs_gross_income does, so the reference now uses each input on its own. The nine Python test files that reference loss_ald or sstb_self_employment_income pass (78).
  • Full Suite - Baseline (states-shard-3): the Mississippi HSA test that was red on main at the time; main is merged in (it was fixed by Update the Mississippi HSA test for joint-column combination (main is red) #9992).

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.

Federal AGI drops a Schedule C loss when the same person has Schedule C profit in the other SSTB category

1 participant