Skip to content

Base Missouri's capital gains subtraction on the filers' Form 1040 line 7a (RSMo 143.121.3(14)(a)) - #9899

Merged
MaxGhenis merged 3 commits into
mainfrom
mo-capital-gains-subtraction-filer-line-7a
Oct 12, 2026
Merged

MaxGhenis merged 3 commits into
mainfrom
mo-capital-gains-subtraction-filer-line-7a

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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-level capital_gains input 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_gains does 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

  • RSMo 143.121.3(14)(a): the individual capital gains subtraction begins in tax year 2025; subsection 3 limits subtractions to amounts included in federal AGI.
  • 2025 MO-1040 instructions, MO-A line 18, p.16: use federal Form 1040 line 7a, enter zero for a loss, and require inclusion in federal AGI.
  • Missouri DOR FAQ: when one spouse has a loss and the other a gain, allocate the positive combined amount only to the gain spouse. When both have positive gains, the model's weights allocate their own gains.
  • 2025 Schedule D: capital gain distributions enter line 13 and positive net gains flow through line 16 to Form 1040 line 7a.

Federal aggregate and precision

This PR leaves net_capital_gains and all federal Schedule D/NIIT helpers unchanged. #9883, now merged, sums filer components directly and does not read net_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 current filer_loss_limited_net_capital_gains helper 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_lines already 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.

File Passed Wall time (s) Peak RSS (GiB)
mo_capital_gains_subtraction.yaml 18 367.97 2.30
income_tax/integration.yaml 9 268.39 2.88
mo_agi_subtractions.yaml 7 332.15 1.99
mo_adjusted_gross_income.yaml 6 354.83 2.32
test_mo_capital_gains_subtraction_invariants.py 4 964.06 1.54

Before 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 core group 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/time could not access the required system counter.

make format passed before both commits; git diff --check passed.

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 Python core group.

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 a14160a2ec408fec74bc1106511ba25e071a4626 without 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 at f0092a2886206b0189bf38a4fbc1f9d7c37b4518 remains pending.

Hub microsimulation impact (current head)

A real microsimulation on the default dataset, main at the merge base 35f3c1f92a against this PR's head f0092a2886, for 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.

Output 2026 change 2026 records changed (weighted)
mo_capital_gains_subtraction +249.22M 45 (60,214)
mo_adjusted_gross_income -265.37M 40 (46,741)
mo_income_tax -12.47M 38 (37,839)
state_income_tax -12.47M 38 (37,839)
income_tax +0 0 (0)
household_net_income +12.47M 37 (37,839)
household_benefits +0 0 (0)

Comparison 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).

…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

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (f0092a2).
⚠️ Report is 414 commits behind head on main.

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

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).
~/reviews/mo-capital-gains-line-7a-2026-10-06/axiom-issue-draft.md was written by GPT-6.1 Sol (Subfleet research/hard) on 2026-10-06; its brief is axiom-issue-prompt.md in the same folder. It checked rulespec-us f468c8daeb (2026-10-04) and the corpus pin 8f7d60aaced2, and found:

  • us-mo/statute/143.121 is row 21 of scope 2026-07-16-pit-central-us-mo-143, which the selector of release us-rulespec-2026-08-08-obbb-alien-snap includes. The release signature was not revalidated.
  • The 2025 MO-1040 instructions, MO-A and the DOR FAQ are not ingested. There is only a discovery entry in manifests/us-mo-individual-income-tax-forms.yaml.
  • The existing us-mo/policies/income_tax/2026_noncombined_resident_core.yaml takes the federal capital gain as a caller-supplied input, is TY2026 only, and leaves out combined-return allocation. There is no us-mo/statutes tree.
  • It proposes us-mo/statutes/143.121.yaml and its test, a pasteable review_finding, and 9 TY2025 companion cases matching this PR's YAML at a14160a2ec.

Before filing:

2. DOR guidance points the draft found.

  • The FAQ's own example: line 7a is $10,000 (taxpayer −$5,000, spouse +$15,000), entered as 18Y $0 and 18S $10,000.
  • The FAQ conflicts with itself on timing. Its opening and combined-return answers say 2025, and "When can I claim?" says 2026. RSMo 143.121.3(14)(a) and the 2025 MO-1040 instructions, line 18 both start in 2025.
  • The proportional split between spouses needs no extra authority. Each filer's own amount is their gains plus floored distributions, and line 7a is max(−limit, their sum), so there are three cases:
    • both own amounts positive: line 7a is their sum, so each share equals that spouse's own amount;
    • one positive: everything goes to that spouse, which is the FAQ case;
    • otherwise line 7a ≤ 0 and there is nothing to split.

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 mocg7a-* outputs to reuse. The hub's run is the only one.

4. Follow-up still live on main 7dc07567eb: loss_limited_net_capital_gains_person pools dependents.

  • When the tax unit nets positive, each person keeps their own unlimited amount, so a dependent's gain lets a parent's loss pass through unlimited.
  • Repro, GA 2025: the head is aged 66, with pension 30,000 and LTCG −10,000; the child has LTCG +20,000.
    • The head's amount is −10,000. Their own line 7a is −3,000.
    • ga_retirement_exclusion falls from 27,000 to 20,000.
    • Script: ~/reviews/mo-capital-gains-line-7a-2026-10-06/ga_check.py. I ran it on b79705b4bd; the variable, its tax-unit parent and the GA reader are unchanged on 7dc07567eb.
  • Readers: the GA retirement exclusion, the DE pension exclusion sources and MS income sources.
  • I offered it as a chip on 10/6 (task_024999d1, "Keep dependents out of per-person capital loss allocation"); no session has picked it up.

5. Sweep check of #9883 (now merged). I ran 504 sweep households, TY2021–2026 in TX, MN, NM and WI. With #9883 merged onto b79705b4bd, none of them moves the head's federal EITC, MN CWFC, NM EITC, WI EITC or AGI. On main those had moved by up to $4,427, $2,187.60, $1,106.75 and $177.08. Evidence: ~/reviews/mo-capital-gains-line-7a-2026-10-06/eitc-9883-check/.

🤖 Generated with Claude Code

@MaxGhenis MaxGhenis closed this Oct 11, 2026
@MaxGhenis MaxGhenis reopened this Oct 11, 2026
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 11, 2026 23:21
@MaxGhenis
MaxGhenis merged commit fb4ddeb into main Oct 12, 2026
45 of 49 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#9899 at f0092a2886206b0189bf38a4fbc1f9d7c37b4518 (squash): Base Missouri's capital gains subtraction on the filers' Form 1040 line 7a (RSMo 143.121.3(14)(a)).

  • Review: independent GPT-6.1 Sol review APPROVE at this head (its four should-fix items fixed; 13 cases recomputed).
  • Gates checked live at merge:
    • gh pr checks exits 0;
    • the latest Pull request run at the head concluded success;
    • MERGEABLE;
    • not a draft;
    • no reviewer's latest review requests changes;
    • the semantic-overlap guard;
    • head pinned.
  • Impact (hub full-file microsimulation, merge base 35f3c1f92a against this head, in the description): 2026: mo_capital_gains_subtraction +249.2M (45 records); mo_adjusted_gross_income -265.4M (40 records); mo_income_tax -12.5M (38 records); state_income_tax -12.5M (38 records); household_net_income +12.5M (37 records).
  • Axiom: [pe-parity] Missouri §143.121.3(14)(a): derive filer-reported capital gains and combined-spouse subtraction (PE-US #9899) TheAxiomFoundation/rulespec-us#1705 queued

@MaxGhenis
MaxGhenis deleted the mo-capital-gains-subtraction-filer-line-7a branch October 12, 2026 09:49
MaxGhenis added a commit that referenced this pull request Oct 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant