Repository navigation
Leave dependents' losses out of the D.C. self-employment loss addition split - #9857
Conversation
…n split Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…against filers' own losses Review r1: a dependent's self-employment loss also raised the addition itself when filers had other business losses. Add a head-of-household case, make the property test independent of the model, correct the loss_ald comment, and update the changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9857 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 1 -3
Lines 76 26 -50
Branches 2 0 -2
=========================================
- Hits 76 26 -50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Review: Leave dependents' losses out of the D.C. self-employment loss addition splitPR #9857 (author: MaxGhenis, head Summary
The PR masks the loss to the head and spouse ( The fix is correct under D.C. law:
So a dependent's Schedule C loss never reaches the parents' line 6. The per-spouse split by each spouse's own loss also matches the Calculation J instruction to figure "each person's additions". I found no critical or should-address issues. The suggestions are a title and PR-body cleanup, optional extra boundary cases, and reference polish. The PR's known limitation, that the $12,000 is really a business gross-income test, is pre-existing, documented, and tracked in #9867. Source documents
Critical (must fix)None. Should addressNone. Suggestions
Verified correct
Pre-existing issues (not blocking, outside this PR's change)
Axiom line assessmentValid. The line
The stated blocker (confirm the corpus rows, then wait for the next encoder pin) is the normal reason for "queued". The issue matches the PR on dependents: "A dependent's business is on the dependent's own return and never enters the parents' addition". It deliberately encodes the gross-income test as written rather than PolicyEngine's loss-minus-$12,000 approximation, and documents that gap with #9867. The only nit is Suggestion 5. CI statusAll green: 37/37 checks pass ( Branch statusThe branch is 37 commits behind Verdict: APPROVE |
DTrim99
left a comment
There was a problem hiding this comment.
Approving: Schedule I Calc A adds back only losses on the filers' own federal return, and a dependent's losses belong on the dependent's own D-40, so leaving them out (and splitting per spouse as Calc J does) is correct. Formula and tests hand-checked and reproduced on the head; rulespec-us#1504 is dispatch-ready. Five optional suggestions in the comment above.
|
US + core hub merge audit, us#9857 at
|
What this fixes
dc_self_employment_loss_addition(Schedule I, Calculation A, line 6) adds back filers' self-employment losses over $12,000, and on a joint return splits the addition between the spouses in proportion to their own losses. Its loss total summed every tax-unit member, dependents included. Since #9647,loss_aldleaves out a dependent's losses, but this formula still counted them, which caused two errors:max(0, min(loss total, business losses in loss_ald) − 12,000). When filers had other business losses (rental, farm, partnership, estate), a dependent's self-employment loss raised the addition, for any filing status.Example: a head of household with a $5,000 self-employment loss, a $30,000 rental loss, and a dependent with a $20,000 self-employment loss. Main gives $13,000; the head's own $5,000 is under the threshold, so the addition is 0.
The loss total and the split now count the head and spouse only. I also corrected the comment on the
loss_aldcap: what remains after the capital-loss parts is all business losses, not self-employment losses only.Tests
dc_self_employment_loss_addition.yaml, three new cases (inserted after the first case). Main gives a different result in each; all pass here:[4,000, 0, 0][8,000, 0, 0][13,000, 0][0, 0][8,000, 4,000, 0][12,000, 6,000, 0]tests/core/test_dc_self_employment_loss_addition_invariants.py(new property test, below).Invariants
The test draws a seeded random population of 200 D.C. tax units (single, head of household, joint, joint with dependents):
It runs the population as drawn and again with dependents' self-employment income set to zero. The invariants:
On main, invariants 1, 3 and 4 fail (23 of 528 people, 19 of 200 tax units, 19 of 260 joint filers). Local cost (macOS, on a loaded host, not Linux CI): 25 s wall time including two model builds, peak 1.0 GB. It runs in the
coregroup ofmake test-other-python-rest.Test runs: the YAML file and the property test (both directly). The
states/dc/taxfolder andcontrib/dc_single_joint_threshold_ratio.yamlran one process at a time under the shared heavy lock: still running; results will be added here.Impact
A real microsimulation on the default dataset, main at the merge base
7b956eb401against this head4a616e36cb, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock.No change in any compared output.
dc_agiis $55.62bn (2025) and $58.49bn (2026) on both sides, anddc_income_taxis $3.55bn and $3.68bn.state_income_tax,income_tax,household_net_incomeandhousehold_benefitsare identical in every record.The change only affects D.C. units where a dependent reports a self-employment loss, and the default dataset doesn't move any of them. For units it does reach, the addition can only fall: the new loss total is never larger than the old one.
Other checks requested for this file
Net capital gain distributions inside the capital loss limit in AGI #9788 (merged) also edited this file; it changed only the capital-loss parts subtracted from
loss_ald. This branch is on top of it.limited_business_loss: the per-spouse AGI work (branchfix-agi-person-ald-split, not yet a PR) splitsloss_aldintolimited_business_lossplus the capital-loss deduction. On main,loss_ald − capital_losses_allowed_against_gains − limited_capital_loss, which this formula computes, equals that variable, so it can swap it in when it lands. That branch edits the last case of the test file; the new cases here sit earlier, and a three-way merge of the two versions has no conflict.Threshold (not changed here; D.C. Schedule I line 6: the $12,000 threshold is a business gross-income test, not a loss threshold #9867). The law ties the $12,000 to the business, not the loss.
So a covered business over $12,000 has its whole loss added back, and any other business has none added back. The model subtracts $12,000 from the loss because it has no gross-receipts input or business classification. Fixing that needs a methodology choice; D.C. Schedule I line 6: the $12,000 threshold is a business gross-income test, not a loss threshold #9867 has the details.
axiom: TheAxiomFoundation/rulespec-us#1504 queued
🤖 Generated with Claude Code