Repository navigation
Base Missouri's capital gains subtraction on the filers' Form 1040 line 7a (RSMo 143.121.3(14)(a)) - #9899
Conversation
…ne 7a RSMo 143.121.3(14)(a) subtracts income reported as a capital gain for federal income tax purposes; the Missouri DOR reads that as the positive amount on federal Form 1040 line 7a. The subtraction read the tax-unit net_capital_gains, which sums every member's Schedule D gains and losses, so a dependent's loss cut the parent's subtraction and a dependent's gain took a share of it. It also left out capital gain distributions, which line 7a includes. The tax-unit amount is now max(0, filer_loss_limited_net_capital_gains) times the rate, and the person allocation covers only the head and spouse with a positive gain of their own (distributions included), with the head taking it if no filer has one. 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 #9899 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 2 -2
Lines 76 35 -41
Branches 2 0 -2
=========================================
- Hits 76 35 -41
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:
|
|
Context for the US + core hub from the session that opened this PR (local_bbf31ca6, 2026-10-06), so it has what that session left behind. Nothing here is pushed to the branch, and the hub keeps the PR. 1. Axiom parity draft, ready to refresh and file (not filed).
Before filing:
2. DOR guidance points the draft found.
3. Microsimulation. My 2026 main-vs-branch run never started: the driver was still waiting for the heavy lock when the session stopped on 10/6. There are no 4. Follow-up still live on main
5. Sweep check of #9883 (now merged). I ran 504 sweep households, TY2021–2026 in TX, MN, NM and WI. With #9883 merged onto 🤖 Generated with Claude Code |
|
US + core hub merge audit, us#9899 at
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Missouri's capital gains subtraction now uses only the head's and spouse's own capital gains, including capital gain distributions. Dependents' gains and losses stay on their own returns, and distributions no longer disappear from the subtraction. On a joint return with a $10,000 head gain, a $2,000 spouse loss and a $5,000 dependent gain, the subtraction is $8,000, entirely allocated to the head.
The base is
rate × max(0, Σ filers (capital_gains + max(0, non_sch_d_capital_gains))). The person-level source normally sums short- and long-term gains; an explicit person-levelcapital_gainsinput also reaches federal gross income and is respected here. Only filers with positive own gains receive allocation. A zero denominator gives zero allocation; the former head fallback is removed.A supplied tax-unit
net_capital_gainsdoes not enter federal AGI and therefore does not create a Missouri deduction. The regression with $50,000 wages and a supplied $20,000 aggregate keeps both federal AGI and Missouri AGI at $50,000. A second case supplies actual person-level gains as well, ensuring an inconsistent aggregate cannot enlarge the subtraction.Law and forms
Federal aggregate and precision
This PR leaves
net_capital_gainsand all federal Schedule D/NIIT helpers unchanged. #9883, now merged, sums filer components directly and does not readnet_capital_gains; the original body's claim that it subtracts dependents from that aggregate was incorrect. #9796 is merged and #9840 is still open. The currentfiler_loss_limited_net_capital_gainshelper preserves a differing supplied aggregate, which is useful for its federal consumers but unsuitable for determining the gain included in federal AGI here.Current main's
filer_schedule_d_linesalready avoids ordinary dependent-driven float32 cancellation for component-derived aggregates. Missouri independently sums filers, avoiding both that aggregate path and supplied aggregate overrides. Two YAML guards use a dependent gain of $67,108,864 and a filer gain/loss of $1.Tests
All required files passed, one file per foreground process, on macOS with Python 3.13.9. Local timings include full model setup and teardown on a heavily loaded host; these are not Linux CI measurements.
mo_capital_gains_subtraction.yamlincome_tax/integration.yamlmo_agi_subtractions.yamlmo_adjusted_gross_income.yamltest_mo_capital_gains_subtraction_invariants.pyBefore the model fix, the subtraction YAML with the new regressions had 3 failed, 15 passed against the merged draft formulas: the supplied-aggregate cases returned $20,000 rather than $0/$1,000, and a directly supplied person gain returned $0 rather than $2,000. Those failures are preserved in the untracked evidence.
The strengthened Python file used 57.45 seconds of CPU time. Its standalone cost includes the existing full-system import; the existing Rest Python
coregroup is documented as 142 seconds in the Makefile based on earlier Linux CI runs. This run does not establish combined-group memory use. The original Python benchmark attempt was interrupted before any case completed after 1,076.54 seconds wall time; peak memory was unavailable because/usr/bin/timecould not access the required system counter.make formatpassed before both commits;git diff --checkpassed.The Python file tests relationships across vectorized populations and simulations with dependent capital inputs zeroed. This exercises dependency isolation and allocation accounting across generated households beyond individual YAML examples. Its independent reference checks the federal capital contribution before Missouri's zero floor, including guaranteed $3,000 single and $1,500 married-filing-separately loss-limit cases. The tolerance is $0.05 with
rtol=0, appropriate for float32 spacing at the generated amounts. The existing six Hypothesis examples and three seeded-year batches are retained; no extra simulations or CI runners are added. It remains in the existing Rest Pythoncoregroup.Partner files were inspected for Missouri state names/codes, FIPS/TAXSIM identifiers, variables and parameter paths. Only school-meal cases were found, with no capital inputs or Missouri tax outputs. No exposed partner contract case was identified; no partner tests were edited.
Reviews
The existing Opus review approved
a14160a2ec408fec74bc1106511ba25e071a4626without running tests. This update addresses SF1 (body's #9883 claim), SF2/SF4 (remove the head fallback and test supplied aggregates), SF3 (direct filer calculation with large-dependent guards), and the loss-limit/tolerance nits. The hub's delta review atf0092a2886206b0189bf38a4fbc1f9d7c37b4518remains pending.Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
35f3c1f92aagainst this PR's headf0092a2886, for 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.mo_capital_gains_subtractionmo_adjusted_gross_incomemo_income_taxstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsComparison files are in
fixes/9899-impact/on the hub host.Axiom
axiom: TheAxiomFoundation/rulespec-us#1705 queued
No dedicated parity issue for this PR was found. RuleSpec now has a Missouri TY2026 noncombined income-tax core that subtracts supplied positive federal capital gains. The hub should assess/file the remaining parity work for TY2025, deriving filer gains/distributions and combined-spouse attribution under RSMo 143.121.3(14)(a).
Follow-ups
The pre-existing Missouri spouse ALD allocation issue (SF5) remains outside this PR. Form 8814 elections that move a child's distributions onto a parent's return are not modeled (TheAxiomFoundation/rulespec-us#1424).