Skip to content

Keep dependents’ capital income off state returns and fix filer tax - #9894

Open
MaxGhenis wants to merge 23 commits into
mainfrom
dependent-capital-income-state-lines
Open

MaxGhenis wants to merge 23 commits into
mainfrom
dependent-capital-income-state-lines

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

Federal AGI and taxable income use the filers' own amounts. A dependent reports their interest, dividends and capital gains on their own return. Form 8814 lets a parent elect to report certain amounts instead. PolicyEngine omits that election. IRS Form 8814

Some state adjustments summed capital income across everyone in the tax unit. A dependent's dividends could raise North Dakota's subtraction, and a dependent's eligible gains could raise Vermont's exclusion.

A North Dakota filer with $1,000 of qualified dividends keeps a $400 subtraction when their child has $5,000 of dividends. A Vermont filer with $10,000 of gains keeps a $5,000 flat exclusion when their child has $100,000 of eligible gains.

How the leaks were found

The state formulas that pooled these amounts used direct tax-unit sums or lists of income sources. A person-level mask can leave a dependent's amounts out of those sums. A tax-unit input still needs to exclude dependents when it calculates its own value.

What changes

State Income or calculation Change
Most states U.S. government interest us_govt_interest counts the head's and spouse's interest.
VA Subtractions Leave dependents’ income and refunds off the filers’ return. Cap each filer’s qualifying Virginia National Guard pay separately.
DC, DE, OH Per-person subtractions and deductions Main already leaves out a dependent's own amounts. Ohio still counts medical expenses a filer paid for a dependent.
ND Qualified dividends and net long-term gains nd_qdiv_subtraction and nd_ltcg_subtraction count the filers' own amounts.
VT Eligible gains, municipal interest and section 1202 Use the filers’ gains and interest. From 2026, include federally excluded section 1202 gain in additions and the exclusion bases. Use Form 4952 line 4e to allocate the percentage exclusion’s election.
AZ, SC, WI Net gains, losses and interest Use the filers’ gains and losses. Arizona caps the eligible long-term subtraction at the federal net gain on the filers’ return. Wisconsin also leaves a dependent’s tax-exempt interest out of additions. Wisconsin counts capital gain distributions when determining the Schedule WD capital loss.
WA Capital gains and millionaires tax Use the filers’ gains and tax-exempt interest. Remove net long-term gains included in federal AGI, including distributions, and add back the long-term loss used in federal AGI.
MT Capital gains, interest and taxable Social Security Use the filers’ return gains and losses, including capital gain distributions, for the preferential tax and the ordinary-income split. Leave dependents’ amounts out of the historical capital gain credit, interest exemption, Social Security worksheet and separate columns.
MA Parts A, B and C The filers use their own dividends, interest, gains and losses. They deduct only their own bank interest in years when the deduction applies.
IL, NH Interest and dividends Illinois counts the filers' own tax-exempt interest. New Hampshire counts their own interest and dividends through 2024.
IA, MN Social Security worksheets Use the filers’ benefits and tax-exempt interest. Minnesota uses the student loan interest deducted on Schedule 1.
UT Social Security and retirement credits The filers use their own tax-exempt interest. Only the head and spouse qualify as retirement-credit claimants.
WV, ME Credit income The filers use their own tax-exempt interest. Maine also uses their own Social Security benefits.
CA Young child tax credit The FTB 3514 line 23b loss test uses the filers' loss-limited gain and their Schedule D line 16.
GA, DE Retirement and pension exclusions A sole filer receives the return’s loss-limited gain or loss. Joint filers use their own components and the existing proportional joint loss allocation. How to allocate a mixed-sign joint loss is a separate policy question.
MI Senior subtraction The filer or filers use their own interest, dividends and gains.

The capital gain, Social Security and Guard pay corrections also affect returns without dependents.

State Correction
IA Add half the filers’ benefits on line 2 of the reportable Social Security worksheet, leave the Schedule 1 student loan deduction out of its adjustments, and apply the zero threshold for separate filers who lived together.
VA Cap each filer’s qualifying pay separately. Enter pay for eligible Virginia Guard service within the rank and 39-day limits in va_qualified_national_guard_pay. Include that pay in wages. A 2025 couple with $40,000 of wages each, inclusive of $6,000 and $2,000 of qualifying Guard pay, subtracts $5,500 and $2,000.
ND Use the filers’ Schedule D net gain for the 40% subtraction. Floor each capital gain distribution at zero before summing and floor the subtraction at zero. Include distributions reported without Schedule D.
VT Add federally excluded section 1202 gain to additions and the gain and income ceilings from 2026. Move the section 1202 portion of vt_other_additions to vt_federally_excluded_section_1202_gain. Include qualifying stock gains in the eligible asset input for the percentage option. Enter Form 4952 line 4e in vt_form_4952_net_capital_gain, including zero if the filers have no investment-property gains.
AZ Cap the eligible long-term gain subtraction at the return’s federal net gain.
GA, DE Give a sole filer the return’s loss-limited gain or loss, including a supplied return amount.
MN Use the deducted student loan interest on line 21 of Schedule 1.
WA Deduct net long-term gain included in federal AGI, including distributions. Limit the long-term loss add-back to the loss used in federal AGI.
MT Include capital gain distributions when calculating the preferential tax, rate threshold and ordinary tax.
WI Include distributions when netting Schedule WD gains and losses before applying the loss cap.

West Virginia's low-income family tax credit now cites the income definition in section 11-21-22a(d). West Virginia Code

Legal basis

  • North Dakota starts with the individual's federal taxable income. The line 6 worksheet uses Schedule D lines 15 and 16 and stops when either is zero or negative. Filers without Schedule D enter capital gain distributions on worksheet line 3. N.D.C.C. 57-38-30.3 · 2025 ND-1 booklet, pages 14–15
  • Vermont starts with the individual's federal AGI. Schedule IN-153 uses Part I lines 1–7 to carry net gain and the share of the Form 4952 election into Part II. From 2026, §5811(21)(A)(v) and (B)(ii)(II) include the section 1202 addition in the exclusion bases. Federal Form 4952 line 4e includes gain from property held for investment. This PR does not fully verify IN-153 lines 8 and 16, so it keeps the proportional allocation of the election. 32 V.S.A. 5811(21) · Schedule IN-153
  • Iowa's worksheet combines spouses' benefits on a joint return. Line 2 takes half of those benefits, and line 6 takes federal Form 1040 line 2a. 2022 IA 1040 instructions, page 10
  • Maine starts from federal AGI and adds interest and Social Security benefits that the filers received and left out of AGI. 36 M.R.S. 5213-A(1)(B) · 36 M.R.S. 5219-KK(1)(D)
  • Virginia applies the Guard pay cap to each person who serves. For 2023 and later, the cap is the lesser of pay for 39 calendar days and $5,500. Va. Code 58.1-322.02(8)
  • California compares the filers' net loss before utilization limits with the line 23b limit. FTB 3514 instructions
  • Other state sources include AZ 43-1022, SC 12-6-1150(A), WI 71.05(6) and Schedule WD, and WA RCW 82.87.040 and ESSB 6346 §302. Montana uses Form 2. The Massachusetts and Illinois sources are MA c.62 §2 and IL 35 ILCS 5/203(a)(2)(A).
  • The other income definitions include NH Rev 906.02, MN 290.0132 subd. 26, UT 59-10-1019 and 59-10-1042, and W. Va. Code 11-21-22a(d).

Not in this PR

  • Main leaves dependents out of Arkansas, Mississippi, New Jersey and Iowa income through #10667. Main also leaves them out of Alabama income through #9943.
  • New Mexico still pools a dependent's gains and losses in nm_net_capital_gains_deduction. The separate-return rule also combines amounts across spouses' tax units.
  • Related work covers Hawaii's alternative tax, Vermont's federal qualified-dividend reduction, Kentucky's per-person subtractions and Massachusetts's senior circuit breaker. #9855 · #9864 · #9699
  • Household-income definitions in the OK sales tax relief, NM modified gross income, VT renter credit, WV and WI homestead, RI property tax relief and AZ property tax credit can count other members' income.
  • Washington's model omits a dependent's own capital gains excise tax liability.
  • Vermont's flat exclusion needs a separate comparison with Schedule IN-153 line 8 when a filer makes a Form 4952 election.

Tests

  • The PR changes 53 YAML test files versus main. Thirteen cases in seven of those files cover the Virginia Guard pay cap, Vermont’s section 1202 and Form 4952 rules, and capital gain distributions in North Dakota, Washington, Montana and Wisconsin.
  • The dependent cases include a $10,000 long-term gain with a child's $8,000 short-term loss. The filer keeps a $4,400 deduction in South Carolina and a $3,000 subtraction in Wisconsin.
  • A Maine filer with $8,000 of pension, $18,000 of Social Security and $500 of tax-exempt interest has $26,500 of fairness-credit income, even when a child receives survivor benefits.
  • The tax-total cases give $2,170 in Massachusetts, $1,847.725 and $1,914.57 in Montana, and $6,623.20 in Vermont.
  • The Hypothesis test compares pairs of North Dakota and Vermont tax units with and without their dependents' capital income. It checks state income tax, federal AGI, federal taxable income and the changed state lines.
  • The YAML cases also cover the Vermont, Arizona, sole-filer, Iowa, Virginia, Minnesota and Washington calculations, traced by hand. At 88519eea, 673 checks passed across 57 files, and the Hypothesis file took 37 seconds.
  • Before the merge with main, the Rest Python shards took 17:58 to 28:49 in CI run 41949737927.
  • CI at 88519eea: all 36 checks passed.
  • The seven files with new cases and 46 other files that use the changed variables passed all 257 checks on the branch and again on a merge with main. The North Dakota and Vermont Hypothesis file passed. All eight mutation checks failed for the intended reason. Full CI for the branch is pending.

Microsim impact

impact: not yet compared with main.

Invariants

  • The North Dakota and Vermont property cases give the same state tax, federal AGI and federal taxable income when dependents' capital income is set to zero. The YAML cases cover other state lines.
  • Main already covers the former pooling paths in AR, MS, NJ, IA and AL. New Mexico's deduction and the household-income paths listed above can still move with a dependent's income.
  • The worksheet, cap and allocation changes above can affect filers without dependents. On other lines, summing the filers’ own amounts gives the same result as summing the tax unit when it has no dependents.

Axiom note. Issue #1424 covers the federal election and dependent-pooling examples. The filer-only worksheet, Guard pay, section 1202, Form 4952 and capital gain distribution corrections need companion cases. rulespec-us#1424

Merge with main (2026-11-29)

Eleven files conflicted.

Conflict Resolution
test_state_tax_head_spouse_swap_invariance.py Delaware moves dependents' amounts. Arkansas, Iowa, Mississippi and Montana leave them off both columns. The Michigan veteran cases stay.
ca_yctc.yaml Both sides' cases stay. The formula keeps main's 2019 start and the filer-only loss test.
dc_income_subtractions.yaml Both sides' cases stay under distinct names.
de_subtractions.yaml Both sides' cases stay under distinct names.
de_pension_exclusion.yaml Main's survivor annuity cases and the dependent capital loss case stay.
md_capital_gains_surtax.yaml Main's cases stay, including its dependent case.
dc_income_subtractions.py Main's filer mask applies to the whole list.
de_subtractions.py Main's filer mask applies to the whole list.
md_capital_gains_surtax.py Main's surtax uses its filer-only net capital gain.
oh_deductions.py Main's filer mask preserves medical expenses a filer paid for dependents.
ut_ctc_potential.py Main's formula uses the filers' Utah total income and tax-exempt interest.

Ohio, Michigan, Pennsylvania and Massachusetts kept both sides where their changes came together. The Maine cases share the fairness test file on main. The PR's mt_agi_indiv keeps dependents' amounts off both spouses' columns while preserving the spouse-label checks.

axiom: needed

🤖 Generated with Claude Code

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Overlap with #9898, which fixes the Maryland capital gains surtax base. It changes md_capital_gains_surtax to 2% of IRC 1222(11) net capital gain (via a new md_net_capital_gain), tests federal AGI against the threshold, and leaves dependents out of every input, as this PR does.

@MaxGhenis
MaxGhenis force-pushed the dependent-capital-income-state-lines branch 2 times, most recently from 7e433ee to b195db5 Compare October 12, 2026 11:55
MaxGhenis and others added 9 commits October 12, 2026 08:57
…turn

A tax unit dependent's interest, dividends and capital gains are on the
dependent's own return, and federal adjusted gross income (irs_gross_income)
leaves them out. State lines that adjust the filers' federal AGI or taxable
income summed them over every member, so a child's dividends, gains or
interest moved the parents' state tax.

Count only the head and spouse (tax_unit_non_dep_add, or a dependent mask on
per-person lines) in AZ, DC, DE, IA, IL, MA, MD, ME, MN, MT, ND, NH, OH, PA,
SC, UT, VA, VT, WA, WI and WV, and in us_govt_interest, which most states
subtract.

In formulas edited anyway: North Dakota's net long-term capital gain
exclusion is floored at zero and includes capital gain distributions (Form
ND-1 line 6 worksheet); Utah's retirement credit counts only the head and
spouse as claimants; the West Virginia low-income family credit cites W. Va.
Code 11-21-22a(d).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…UT cases

The Montana and Utah Social Security credit cases now carry the exact
half-cent amounts (1,765.725, 1,847.725 and 259.475) instead of values
rounded past the 0.001 margin.

In two existing Utah retirement credit cases person2 (age 64) is a tax unit
dependent, so their tax-exempt interest is on their own return and no longer
enters the modified AGI: 750 instead of 737.5, and 675 instead of 662.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Missouri lines

From the independent review of the first commit:

- Alabama AGI sums every member's interest, so it now also subtracts
  dependents_us_govt_interest (new, next to us_govt_interest, for state
  income definitions that count dependents' income). Without it the
  filer-only us_govt_interest left a dependent's U.S. government interest
  taxed (parent wages 100,000, child 5,000 of Treasury interest: AL AGI
  105,000 instead of 100,000).
- Virginia's National Guard subtraction leaves a dependent's pay out of both
  the cap and the per-person shares, so the filer keeps the full amount.
- Michigan's senior interest, dividends and capital gains deduction counts
  only the head's and spouse's income (MCL 206.30(1)(p): "included in
  adjusted gross income").
- Missouri's capital gains subtraction takes a dependent's gains out of
  net_capital_gains, and its per-person split allocates among the head and
  spouse only.

The Utah retirement credit case with SINGLE status now names its roles
(one head, two dependents), and the property test drops the Vermont
restriction now that #9855 is on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e lines

From the second independent review:

- Iowa's reportable Social Security worksheet adds one-half of the benefits
  (line 2) before the base amount, as both the 2021 and 2022 IA 1040
  worksheets do. The first test's 4,000 came from the formula; the
  worksheet gives 14,000.
- Missouri subtracts the filers' positive Form 1040 line 7a
  (filer_loss_limited_net_capital_gains), so capital gain distributions
  count, a loss nets against them, and a supplied tax unit amount less the
  dependents' gains is kept and goes to the head.
- Vermont's percentage exclusion limits eligible gains to the filers' net
  gain (Schedule IN-153 line 15 starts from Part I line 4). The eligible
  gains input is now documented as part of long_term_capital_gains, and two
  cases that set it alone now set both.
- California's young child tax credit measures the filers' own net loss, so
  a child's capital loss no longer takes the parent's credit.
- Virginia caps National Guard pay per person (Va. Code 58.1-322.02(8),
  "received by any person"), so two qualifying spouses subtract up to
  $5,500 each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…E and MT lines

From the third independent review:

- Vermont's percentage exclusion nets eligible gains against Schedule
  IN-153 Part I line 4 built from the filers' Schedule D lines 15, 16, 18
  and 19, before the Form 4952 election, then takes off the election's
  share on gains (lines 5-7 and 16: line 4g x 4e / (4b + 4e)). A 100,000
  eligible gain with 100,000 of qualified dividends and a 100,000 election
  now gives 20,000, as the form does.
- Virginia's Guard subtraction defaults to each filer's capped pay summed,
  and the per-person split shares the unit amount by capped pay, so a
  supplied unit amount (such as the 39-day limit) is allocated again.
- New filer_loss_limited_net_capital_gains_person allocates the filers'
  loss-limited gains among the head and spouse only. Georgia's retirement
  exclusion and Delaware's pension exclusion use it, so a dependent's loss
  no longer reduces an eligible filer's gains (IT-511: "Income or losses
  should be allocated to the person who owns the item").
- Montana's separate-return AGI no longer adds a dependent's Montana amounts
  to the head's, as the joint branch already leaves them out; the two cases
  that expected that allocation now expect the head's own amounts.
- The Montana Social Security worksheet cases use wages instead of a
  pension, whose Montana exemption the worksheet does not apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the dependent-capital-income-state-lines branch from a0c05af to fa64576 Compare October 12, 2026 12:57
MaxGhenis added a commit that referenced this pull request Oct 13, 2026
…gelog

- ca_agi_subtractions: tax-unit-level items such as us_govt_interest are added
  as they are (#9894 makes that one filer-only).
- WI Schedule SB worksheet is on file page 3 in 2021 and page 2 in 2022; the
  RI reference is the individual 2022 Schedule M, not the RI-1041's.
- The changelog also names California's state tax refund subtraction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PavelMakarchuk added a commit that referenced this pull request Nov 6, 2026
Mississippi AGI read loss_limited_net_capital_gains_person, which nets and
limits capital gains and losses over every tax unit member. With the
dependent's column zeroed, a dependent's gains changed the parent's
Mississippi AGI and could lift the parent's loss above the 26 USC 1211(b)
limit. Mississippi now reads filer_loss_limited_net_capital_gains_person
(copied byte for byte from #9894), which limits only the head's and
spouse's own net loss and gives a dependent nothing.

- Add ms_agi cases for a child's gain smaller and larger than the
  parent's loss, a child's loss against the parent's gain, and spouses
  sharing a limited loss.
- Add a Worksheet D case with an age-eligible dependent who has income.
- Merge same-document references (AR, IA, NJ, MS) into one href each.
- Point the Worksheet D reference at PDF page 23 of the 2025 booklet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Leave dependents' capital income out of state lines on the filers' return

Summary

The core change is sound. A tax unit dependent's interest, dividends and capital gains are already left out of federal AGI (irs_gross_income, capital_losses_allowed_against_gains, filer_schedule_d_lines). This PR stops about 20 state lines from pooling them back in. The filer-only pieces are the head-and-spouse sums from tax_unit_non_dep_add, the per-person masks in DC, DE and OH, and the new filer_loss_limited_net_capital_gains_person for GA and DE.

I checked the new person variable that the #10667 review recommended:

  • It applies the 26 U.S.C. 1211(b) limit to the filers' combined net loss only: $3,000, or $1,500 for a separate return, through filer_loss_limited_net_capital_gains.
  • The per-person shares sum to that limited total, and a dependent gets 0.
  • It does not repeat Leave tax unit dependents' income out of Arkansas, Mississippi, New Jersey and Iowa income #10667's bug. A head-only probe at this head shows the difference. With a parent's −5,000 loss and a child's +20,000 gain, the pooled variable gives the parent −5,000, past the $3,000 limit. The new variable gives −3,000.

Every state line that treats long-term gain separately nets the filers' own short- and long-term amounts in the order its form uses: AZ, MT, ND, SC, VT and WI. No changed state brings a dependent's income onto the parents' return except through the federal Form 8814 election, which the model doesn't implement. The four corrections that don't need a dependent are each right against the source:

  • Iowa's worksheet line 2;
  • Virginia's National Guard cap, now per person;
  • North Dakota's floor at zero and capital gain distributions;
  • Vermont's IN-153 netting and Form 4952 share.

CI is 36/36 green. I found no critical issue. Four should-fix items remain:

  1. Several changed masks are not pinned by any test.
  2. A dependent's Social Security still reaches Maine's fairness-credit income, in a formula this PR rewrote.
  3. Two reference entries break the CLAUDE.md reference rules.
  4. The body's axiom: line isn't in the required form, and California integration test #1424 doesn't cover the four no-dependent corrections.

Critical (must fix)

None.

Should address

S1. Several new dependent masks are unpinned (mutation rule). Reverting each of these lines to add(...) fails no test. The PR's cases give the child only gains, or only the one item that another line already covers. Nothing in the PR's YAML or in the existing files for these variables puts a dependent's short-term loss, dividends against a filer loss, collectibles gain, bank interest, student loan interest or ALDs into these states. The property test covers ND and VT only, and it never draws investment_income_elected_form_4952.

File Unpinned line(s) A case that would kill the revert
sc_net_capital_gain_deduction.py stcg Head LT +10,000, child ST −8,000: 44% × 10,000 = 4,400. Pooled gives 44% × 2,000 = 880.
wi_capital_gain_loss_subtraction.py stcg_net Same household: 30% × 10,000 = 3,000. Pooled gives 600.
mt_capital_gains_tax_joint.py, mt_capital_gains_tax_applicable_threshold_joint.py, mt_regular_income_tax_joint.py (2024+) stcg Child ST loss against the head's LT gain (TY2025)
ma_part_c_gross_income.py, ma_part_c_agi.py, ma_part_a_agi.py (ST and collectibles lines), ma_short_term_loss_against_dividends.py and ma_long_term_loss_against_dividends.py (both lines each) as listed Child ST loss with head LT gain; child dividends with a head ST or LT loss; child collectibles gain
ma_part_b_taxable_income_deductions.py bank interest TY2021–2023 only, while exemptions.interest.in_effect is true: child taxable interest with head interest under the cap
mn_social_security_subtraction.py student_loan_interest Child with student loan interest
mt_taxable_social_security_joint.py mt_applicable_ald_deductions, student_loan_interest_ald, mt_subtractions Child with an ALD or a Montana subtraction
wa_millionaires_tax_base_income.py both lines TY2028, when millionaires_tax.in_effect turns on: child LT gain or tax-exempt interest. The file has no dependent case at all.
vt_percentage_capital_gains_exclusion.py the filer masks on the Form 4952 election and on qualified dividends in the line 7 share Head election with child qualified dividends
ca_yctc.py the limited_capital_gains line alone Parent ST −40,000 and child LT +50,000. Pooled limited = +10,000, while the filers' limited amount is −3,000 and line 16 is −40,000. That fails line 23b, so the credit is 0.

Fix: add one case per row, in the variable-named YAML files. The first two are one-household additions to the existing SC and WI files, and the probe values above are hand-checked.

S2. A dependent's Social Security still reaches Maine's fairness-credit income. me_sales_and_property_tax_fairness_credit_income.py now reads tax_unit_non_dep_add(tax_unit, period, p.income_sources). Its comment says the income is the head's and spouse's. But the list item tax_exempt_social_security is a TaxUnit variable, tax_unit_social_security − tax_unit_taxable_social_security, and tax_unit_social_security adds social_security over every member. So it's added as is, and a child's survivor benefits still count.

  • 36 M.R.S. 5213-A(1)(B) adds Social Security in the same way it adds interest. It adds "(2) Interest received to the extent not included in federal adjusted gross income" and "(3) Payments received under the federal Social Security Act and railroad retirement benefits to the extent not included in federal adjusted gross income". 5219-KK(1)(D) uses the same definition.
  • Under the PR's own reading, that the additions are the filer's because federal AGI is, a dependent's benefits are out too. The body says that formulas which also summed a dependent's other amounts "get the same rule", and IA, MN and MT got it for Social Security.
  • Example, TY2025, the ME twin household plus a child with social_security_survivors: 10,000: income at this head is 8,000 + 28,000 + 500 = 36,500. The filers' own amount is 26,500.
  • This is not a regression, since main had the same.

Fix: compute the Social Security term from the filers' own benefits, for example tax_unit_non_dep_add(["social_security"]) − add(["taxable_social_security"]), in place of the list's TaxUnit item. Add the child-survivor case to me_sales_and_property_tax_fairness_credit_income.yaml.

S3. Two references break the CLAUDE.md reference rules.

  • nd_ltcg_subtraction.py adds two entries for one document, the 2025 ND-1 booklet, that differ only by #page=14 (line 6) and #page=15 (worksheet). CLAUDE.md: "URLs that differ only by #page= are one source". The pages themselves are right: I confirmed the line 6 text on file page 14, and the worksheet and the line 13 text on page 15. Fix: one entry ...booklet.pdf#page=14 with a # PDF pages 14-15 comment above it.
  • vt_percentage_capital_gains_exclusion.py cites only IN-153-2024.pdf#page=2 (Part II). The new netting and Form 4952 share come from Part I lines 1–7 on page 1, which is where line 10 ("Enter the amount from Part I, Line 4") and line 16 ("Part I, Line 7") point. Fix: #page=1 with a # PDF pages 1-2 comment.

S4. The axiom line is invalid and doesn't match the head.

  • The body's line is axiom: (hub files pe-parity before landing). That is none of the CLAUDE.md forms (encoded-correct, encoded, queued, n/a: <reason>).
  • The "Axiom note" names Encode IRC §1(g)(7) parent's election (the rule that decides whether a child's items reach a parent's return) TheAxiomFoundation/rulespec-us#1424. It is OPEN, labelled pe-parity, and dispatch-ready for 26 U.S.C. 1(g)(7). Its 2026-10-06 extension for this PR has verbatim law and companion cases 1–4 (ND, VT and WA) from the form lines and statutes, which matches the dependent-pooling part.
  • It does not cover the four corrections added since then, which change tax for units with no dependents:
    • Iowa's worksheet line 2;
    • the Virginia per-person cap (Va. Code 58.1-322.02(8));
    • North Dakota's floor and capital gain distributions (57-38-30.3(2)(d)(1); ND-1 line 6 worksheet);
    • Vermont's IN-153 netting and Form 4952 share.

Fix: write the line in the required form, e.g. axiom: TheAxiomFoundation/rulespec-us#1424 queued. Extend #1424, or file a pe-parity issue, with dispatch-ready cases for the four corrections. For ND, first check whether us-nd:...resident_core_liability_pipeline's net long-term gain input already floors at zero and includes distributions, which would make that part encoded-correct.

Suggestions

  1. Changelog and body scope. The changelog lists PA, and the body's table has PA and MT mt_agi_joint rows. But at this head pa_eligibility_income.py changes only its reference: main had already left dependents out (Wire military retirement pay and survivors into federal and state tax (#10181) #10182), as it had for MT joint AGI (Fix AR, MT and NM income tax gaps found in TAXSIM comparison sweep #9585). Consider leaving PA out of the fragment's state list.
  2. Stale "Not in this PR" and Invariants. Leave tax unit dependents' income out of Arkansas, Mississippi, New Jersey and Iowa income #10667 (merged 2026-11-07) now leaves dependents out of AR, MS, NJ and IA income, and Leave tax unit dependents' income out of Alabama AGI #9943 fixed AL. The PR's own AL test expects al_agi 100,000 and passes. Refresh the body's exception list after merging main.
  3. Mixed-sign allocation in filer_loss_limited_net_capital_gains_person. With a head +5,000 and a spouse −10,000, the shares are +3,000 and −6,000. They sum to the −3,000 limit, but the eligible head's GA or DE countable gain is 3,000, not their own 5,000. It is the same convention as the pooled variable and is defensible. Consider a sentence in the documentation and one YAML case that pins it.
  4. Vermont flat exclusion. IN-153 Part I line 8 also subtracts the line 7 Form 4952 share before the $5,000 cap. The PR applies the share only to the percentage path. This is pre-existing and worth a follow-up.
  5. Python test cost note. The body gives local timings for the new property test. CLAUDE.md also asks to check the affected CI group's existing timing and memory reports; here that is core. Cite the core group's CI timing artifact.

Verified correct

The federal person variable. filer_loss_limited_net_capital_gains_person:

  • own_gains is ~dependent × (capital_gains + max(0, non_sch_d_capital_gains)). Its sum equals filer_schedule_d_lines(...).line_16 for component inputs.
  • filer_loss_limited_net_capital_gains is max(−loss_limit[filing_status], line_16), with SEPARATE = 1,500.
  • In the loss branch, Σ(limited × own/Σown) = limited.
  • Carryovers are already inside long_term_capital_gains: long_term_capital_loss_carryover is a memo item that Schedule D line 14 includes.
  • The file is byte-identical to the copy Leave tax unit dependents' income out of Arkansas, Mississippi, New Jersey and Iowa income #10667 put on main, so the add/add merges cleanly. There is no reinvented variable, and readers are GA and the DE list, plus MS on main.

Probe at this head (TY2025, head of household, head aged 63, child aged 10). Each case also ran a twin with the child's amounts set to zero.

  • P, parent loss plus child gain. Head: wages 60,000, LT −5,000. Child: LT +20,000, all VT-eligible. Federal AGI is 57,000 = 60,000 − 3,000.
    • AZ, SC, ND and VT subtractions: 0, because the filers' net is a loss.
    • WI: wi_capital_loss 3,000 = min(3,000, 5,000).
    • GA ga_retirement_exclusion_countable_capital_gains and DE de_pension_exclusion_income: [−3,000, 0]. The pooled variable gives [−5,000, 20,000].
    • MT capital gains tax: 0.
  • Q, child loss plus parent gain. Head: wages 60,000, LT +10,000, all VT-eligible. Child: ST −8,000. Federal AGI is 70,000.
    • AZ 2,500 (25% × 10,000), SC 4,400, ND 4,000, WI subtraction 3,000.
    • GA and DE: [10,000, 0].
    • VT: percentage 4,000 and exclusion 5,000 (the flat amount is larger).
    • MT capital gains tax 410 (4.1% × 10,000).
  • state_income_tax equals the twin's to the cent in all 8 states for P and Q: AZ, SC, ND, WI, GA, VT, DE and MT.

Hand-checked expectations from the PR's YAML (arithmetic shown):

  1. filer_loss_limited_net_capital_gains_person [−2,400, −600, 0]. The filers' net is −10,000, limited to −3,000 (joint), and shared 0.8/0.2; the child has 0. This is a parent loss with a child gain.
  2. The same variable gives [5,000, 0] for head +5,000 and child −10,000. GA gives [5,000, 0]. DE de_pension_exclusion_income gives [15,000, 0] = pension 10,000 + 5,000. These are child losses with parent gains in GA and DE.
  3. AZ child-loss case: the filers' net is 10,000 > 0, so 25% × 10,000 = 2,500. ND child-loss case: 40% × min(2,000, 2,000) = 800. WI wi_capital_loss: the filers' net is +1,000, so 0.
  4. ND worksheet cases: line 15 = −2,000 gives 0 ("If zero or less, stop here"). Distributions of 1,000 give 400.
  5. VT netting: 40% × min(10,000, 10,000 − 4,000) = 2,400. Form 4952 share: 100,000 − 100,000 × 100,000 / 200,000 = 50,000, and 40% is 20,000.
  6. IA unit test 1: 20,000 + 38,000 + 2,000 = 60,000; less 32,000 is 28,000; half is 14,000, below 20,000. IA dependent case: 15,000 + 20,000 − 25,000 = 10,000, half 5,000.
  7. MA Part C household: Part B is 60,000 − 2,000 (payroll tax deduction) − 6,800 (HoH exemption) − 1,000 (dependent) = 50,200, × 5% = 2,510. Part C is 2,000 × 5% = 100. Less the $440 child and family credit, that is 2,170.
  8. UT retirement credit: 450 − (30,000 + 500 − 25,000) × 0.025 = 312.5, and 900 − (40,000 + 1,000 − 32,000) × 0.025 = 675.
  9. Others:
    • SC 4,400; WI 3,000; MD 2% × 10,000 = 200 (AGI 410,000 > 350,000).
    • NH 3,000 − 2,400 = 600.
    • ME 8,000 + 18,000 + 500 = 26,500; WV 8,000 + 500 = 8,500.
    • VA Guard 5,500 × 2 = 11,000, and the dependent's 5,500 neither counts nor uses up the cap.
    • MT mt_capital_gain_credit 2% × 2,000 = 40; mt_dependent_exemptions_person 1,894.57 + 2% × 1,000 = 1,914.57.

Law, per state. I read these this session:

  • VT. Schedule IN-153 (2024). Line 1 is the "smaller of Line 15 or 16 from federal Form 1040, Schedule D", and line 4 subtracts lines 18 and 19. Lines 5–7 are the Form 4952 share, 4g × 4e / (4b + 4e). Line 10 is "the amount from Part I, Line 4", line 15 "Entry cannot be less than zero", and line 17 = line 15 − line 16. The code matches.
  • ND. 2025 booklet worksheet: "Enter amount from 2025 Schedule D (Form 1040), line 15. If zero or less, stop here; no exclusion is allowed". Distributions without Schedule D go "on line 3 of this worksheet". Line 13 multiplies "the qualified dividends from Form 1040 or 1040-SR, line 3a, by 40 percent".
  • IA. 2022 IA 1040 instructions, Step 4 worksheet:
    • line 1 is box 5 of the SSA-1099, "If you filed a joint federal return, enter the totals for both spouses";
    • line 2 is "Enter one-half of line 1 amount";
    • line 13 is "the smaller of line 2 or line 12".
  • VA. Va. Code 58.1-322.02(8): "The wages or salaries received by any person ... not to exceed ... $5,500", which is a per-person cap.
  • NH. Rev 906.02(c): a joint return only for spouses filing a joint federal return. A dependent is a separate individual.
  • ME. 36 M.R.S. 5213-A(1)(B) and 5219-KK(1)(D) start from the individual's federal AGI.

The rest start from the filer's own federal AGI, taxable income or Schedule D:

  • AZ 43-1022(22): "included in federal adjusted gross income";
  • SC 12-6-1150; WI Schedule WD; MD's surtax on FAGI over $350,000;
  • WA RCW 82.87.040: "an individual's" gains, with spouses combined;
  • MT Form 2; MA c.62 §2; IL 203(a)(2)(A); MN via IRC 86; UT 59-10-1019, 1042 and 1047; WV 11-21-22a(d);
  • PA forgiveness, which counts the claimant and spouse; CA FTB 3514 line 23b; GA IT-511, "allocated to the person who owns the item"; DE 30 Del. C. 1106; MI MCL 206.30(1)(p).

None of these states taxes the family unit or has its own analogue of Form 8814.

Code checks.

  • Vectorization and entities. The code uses where, max_, min_, np.divide with where= masks, and & on booleans. The if "us_govt_interest_person" in p... checks test a parameter list (scalar), not data.
  • tax_unit_non_dep_add adds TaxUnit items such as ut_taxable_income, adjusted_gross_income and wv_additions as is. Person-level items are masked.
  • Periods and keys. Every variable is YEAR. There is no new state-gated int or enum key, so the NH Add New Hampshire state supplementation for 2026 #10156 pattern doesn't arise.
  • The VT netting inputs (capital_gains_28_percent_rate_gain, the unrecaptured section 1250 gain) are already filer-only.
  • Readers of us_govt_interest are all state tax subtraction lists. Per-person readers of us_govt_interest_person in DC, DE and OH are masked. VA's list is filer-only via va_subtractions and va_subtractions_person.

Tests and guards.

Axiom line assessment

Invalid; see S4. The body's line axiom: (hub files pe-parity before landing) is not in a CLAUDE.md form. rulespec-us#1424 is OPEN, labelled pe-parity and dispatch-ready, and its #9894 extension covers the dependent-pooling half of the change. It does not cover the four corrections that need no dependent: IA worksheet line 2, the VA per-person Guard cap, ND's floor and distributions, and VT's IN-153 netting and Form 4952 share.

CI status

gh pr checks 9894: 36 of 36 pass at be20e6f, run 41949737927. None is failing or pending. The merged tree has not run in CI.

Branch status

  • Position. 14 ahead and 63 behind main, with merge base abc67b9.
  • Conflict. git merge-tree --write-tree PolicyEngine/main be20e6f810 reports one conflict, in the docstring of policyengine_us/tests/core/test_state_tax_head_spouse_swap_invariance.py. Main's Leave tax unit dependents' income out of Arkansas, Mississippi, New Jersey and Iowa income #10667 says Delaware and Montana move dependents' amounts, and that AR, IA and MS leave them off. This PR says Montana leaves them off. Resolve it as: Delaware moves; AR, IA, MS and MT leave them off. The test logic already checks only de_agi_indiv against the moving allocation (MOVES_DEPENDENT_AMOUNTS).
  • Other files changed on both sides merge cleanly:
  • Re-run CI after resolving the conflict, since main's 63 commits haven't run against this PR's tax-total expectations (MA 2,170, MT 1,847.725 and 1,914.57, VT 6,623.20). I found no main change to those states' 2022–2025 paths.

Verdict: REQUEST_CHANGES

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes per the review above: 0 critical, 4 should (unpinned dependent masks in several states; Maine's fairness-credit income still counts a dependent's Social Security; two references split or incomplete; axiom line not in a valid form and #1424 doesn't cover the four no-dependent corrections), 5 suggestions. The core filer-only loss limitation is sound.

MaxGhenis added a commit that referenced this pull request Nov 14, 2026
Restore every file outside the DC, Delaware and Ohio change to its version on main, and drop the capital-income changelog fragment. The branch held an older copy of #9894's first two commits, plus Massachusetts, Iowa and Montana follow-ups to them, and #9894 carries the current version of that work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Nov 14, 2026
Main already counts the Ohio medical deduction once per return, and the Massachusetts change now lives in #9894, so the fragment names the DC, Delaware and Ohio subtractions, Ohio's 529 deduction and the DC disability income exclusion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits November 30, 2026 10:32
Resolve the conflicts with main from the cloud build of this branch.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the filers' tax-exempt Social Security for both credits.
Test that state lines use the filers' own amounts.
Document how the joint loss limit scales gains and losses.
Update the North Dakota and Vermont references and the changelog.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…ions

Apply the federal return amount to Arizona's gain limit and the
sole-filer allocation. Include Vermont's section 1202 addition and limit
Washington's loss add-back to the amount used federally. Correct the
Iowa and Minnesota worksheets and restrict Virginia's per-person cap to
qualifying Guard wages.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@MaxGhenis MaxGhenis changed the title Leave dependents' capital income out of state lines on the filers' return Keep dependents’ capital income off filers’ state returns and correct related calculations Nov 30, 2026
MaxGhenis and others added 4 commits November 30, 2026 09:12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep other Vermont additions in the existing return input. Use military service income and the Virginia tax-unit cap on filers' pay. Exercise the Minnesota worksheet with a supplied deduction for a dependent.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits December 1, 2026 07:12
Apply Virginia’s cap per eligible filer. Use return gains and distributions in North Dakota, Washington, Montana and Wisconsin. Include section 1202 gains in Vermont’s exclusion base and use Form 4952 investment gains for its election allocation.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Keep dependents’ capital income off filers’ state returns and correct related calculations Keep dependents’ capital income off state returns and fix filer tax Dec 1, 2026

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 9894
Reviewed head SHA: 01cbff3
Merge base SHA: 094934a
Mode: incremental from be20e6f
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-9894-review-sources.json
Review status: PARTIAL

Source Documents

Critical

C1 — Arizona's long-term gain subtraction now nets a filer's short-term loss, which the Form 140 worksheet excludes (OPEN)

  • Location: policyengine_us/variables/gov/states/az/tax/income/subtractions/capital_gains/az_long_term_capital_gains_subtraction.py, formula: federal_net_gain = tax_unit("filer_loss_limited_net_capital_gains", period) and ltcg_in_agi = max_(0, min_(long_term_capital_gains, federal_net_gain)). Introduced in 46e4a44. Before that commit, the subtraction was the full long-term gain whenever the filers' net was positive (where(net_capital_gains > 0, max_(0, long_term_capital_gains), 0)), which the prior review approved.
  • Trigger: any filer with a long-term gain and a short-term loss. No dependent is needed. The PR's own tests assert the new values:
    • TY2025, single, wages 60,000, LT +10,000, ST -8,000: the code (and the new YAML case) gives 25% x 2,000 = 500. The form gives 25% x 10,000 = 2,500.
    • TY2024, LT +50,000, ST -10,000: the YAML expectation changed from 12,500 to 10,000. The form gives 12,500.
    • integration_2025.yaml (MCTCP senior case): az_subtractions changed from 31,000 to 24,750 and az_income_tax from 653.75 to 810. The old figures follow the form.
  • Source: 2025 Arizona Form 140 instructions (azdor.gov FORMS_INDIVIDUAL_2025_140i.pdf). On PDF page 13, line 22 is "the total amount of net long-term capital gain or (loss) reported on federal Schedule D", separate from line 21, the net short-term amount. Line 24 is 25% of line 23. The "Worksheet for Net Long-Term Capital Gain Subtraction" says: "Do not include any short-term capital gains or (losses) in this worksheet". Its line 1 is the "total net long-term capital gain or (loss) from assets acquired after December 31, 2011 and included in federal adjusted gross income". A.R.S. 43-1022(2)(c) says "twenty-five percent of the net long-term capital gain included in federal adjusted gross income". The department's form reads that as the Schedule D long-term net, not reduced by short-term losses. The code's comment ("Federal Form 1040 line 7a nets short- and long-term gains") is the reading the worksheet rules out.
  • Impact: Arizona tax rises by 2.5% x 25% x min(short-term loss, long-term gain) in every claimed year from 2015 on (+$50 in the TY2025 case above, +$156.25 in the integration case). This is a regression from the prior head, not a dependent-pooling fix.
  • Fix: restore the prior-head rule: the filers' Schedule D long-term net, floored at zero, when the filers' net is positive. Revert the three test expectations (12,500, 2,500, 653.75 with 31,000). Drop the changelog line "Limit Arizona's long-term capital gain subtraction to gain in federal adjusted gross income." Note: the prior head's zero result when the overall federal net is a loss is pre-existing. The worksheet arguably still allows a subtraction there, but that is not part of this finding.
  • Proposed severity: CRITICAL. This is an executed wrong state tax in claimed years, asserted by the PR's tests, against the official form.

Coordinator assessment: I've kept this critical. It is an executed wrong Arizona tax in every claimed year from 2015, asserted by the PR's own updated expectations, and a regression from the head the prior review approved. The 2025 Form 140 worksheet says "Do not include any short-term capital gains or (losses)", and A.R.S. 43-1022(2)(c) is the department's basis for that. Restoring the prior-head rule and the three expectations (12,500; 2,500; 31,000 / 653.75) fixes it.

Should Address

A1 — Virginia Guard subtraction silently stops reading military_service_income (OPEN)

  • Location: policyengine_us/variables/gov/states/va/tax/income/subtractions/va_national_guard_subtraction.py:4-9 (capped_va_national_guard_pay reads only va_qualified_national_guard_pay); new input va_qualified_national_guard_pay.py (no formula, default 0). Changelog line: "Apply Virginia's National Guard pay subtraction cap to each filer with qualifying Virginia Guard wages."
  • Trigger (executed, pr-9894-code-diag/va_military.py): TY2025 VA single, wages 50,000, military_service_income 3,000 (the only Guard input before this PR). Main: va_national_guard_subtraction 3,000, va_income_tax 1,888.40. Head: 0 and 2,060.90 (+172.50).
  • Expected: a narrowing to Virginia Guard pay is defensible (the statute covers Virginia Guard pay only, and military_service_income also covers active duty and reserve), and the YAML pins it ("Ordinary active-duty pay does not qualify"). But the input switch is not stated anywhere a user or data pipeline would see it. The changelog doesn't say that military_service_income no longer feeds the subtraction, and 3fb9b01's message ("Use military service income") is reversed by ab0c7d8.
  • Impact: every existing VA household or dataset row that carries Guard pay in military_service_income loses up to $5,500 per filer of subtraction with no notice.
  • Fix: name the new input and the dropped one in the changelog fragment (or keep a documented fallback). Proposed severity: should-address.

Coordinator assessment: The policy review found the narrower base legally right. Va. Code 58.1-322.02(8) covers only Virginia National Guard pay, so the old base overstated the subtraction for other military pay. What remains is disclosure. A household entering Guard pay the old way loses up to $5,500 of subtraction ($1,888.40 vs $2,060.90 of VA tax in the executed case), and no dataset fills the new input. Please say so in the changelog, and consider a note in military_service_income.

A2 — Washington's base treats short-term gains and losses differently when long-term amounts offset them (OPEN)

  • Location: policyengine_us/variables/gov/states/wa/tax/income/millionaires_tax/wa_millionaires_tax_base_income.py. It deducts federal_long_term_gain = max_(0, min_(lines.line_15, lines.line_16)), so only the long-term gain left after short-term losses comes out. But it adds back long_term_loss_addback, which includes the long-term loss that offsets short-term gain. Introduced in 46e4a44 and ab0c7d8.
  • Trigger (TY2028 on, when millionaires_tax.in_effect): the PR's YAML pins both sides.
    • "Washington removes the long-term gain remaining after a short-term loss": LT +10,000, ST -5,000 gives 1,205,000 - 5,000 = 1,200,000. The short-term loss drops out of the base.
    • "A long-term loss can offset short-term gains in federal AGI": ST +10,000, LT -60,000 gives 1,510,000. The short-term gain stays in the base.
    • Read symmetrically (take every long-term item out, keep every short-term item), the first case is 1,205,000 - 10,000 = 1,195,000.
  • Source: ESSB 6346 session law, sec. 302 (PDF page 9). Subsection (1) deducts "any long-term capital gains that have been included in computing federal adjusted gross income". Subsection (2) adds "any long-term capital losses that have been included in computing federal adjusted gross income". The text uses parallel wording for gains and losses. The cited Schedule D instructions (i1040sd--2025.pdf#page=10) support the loss-deduction ordering only, not netting a short-term loss against the long-term gain being deducted. Washington has issued no guidance (the tax starts in 2028), so the legally correct value is UNVERIFIED. The Arizona form in policy-1 rejects the same netting for similar "included in federal adjusted gross income" wording. That is evidence by analogy only.
  • Impact: for filers with a short-term loss and a long-term gain, the millionaires tax base rises by up to min(short-term loss, long-term gain).
  • Fix: deduct the long-term gain that went into federal AGI including the part that absorbed short-term losses, which makes the treatment match the loss add-back. Or add a source or comment that justifies the asymmetry.
  • Proposed severity: SHOULD ADDRESS. This is an unsupported interpretation in enacted future-year law; the legal outcome is unverified.

Suggestions

S1 — Arizona's long-term gain leaves out capital gain distributions (OPEN)

  • Location: az_long_term_capital_gains_subtraction.py formula: long_term_capital_gains (tax_unit_non_dep_add, no non_sch_d_capital_gains) is capped by filer_loss_limited_net_capital_gains, which includes distributions.
  • Trigger (executed, pr-9894-code-diag/az_dist.py): TY2025 AZ single, wages 60,000, non_sch_d_capital_gains 1,000. AGI 61,000, filer_loss_limited_net_capital_gains 1,000, but az_long_term_capital_gains_subtraction 0 (min(0, 1,000) x 25%), where 250 would follow if distributions count as long-term gain in AGI. Meanwhile ND, MT, WA and VT now take Schedule D line 15 with distributions through filer_schedule_d_lines.
  • This is pre-existing on main and not a regression. Proposed severity: suggestion (use filer_schedule_d_lines(...).line_15, or document the exclusion).

Evidence Gaps

  • The S1 mask-revert mutation run was still going when this review was assembled. At that point it had executed 16 of 22 mutants: 15 were killed (SC, WI, MA Part A/B/C and both dividend-loss files, MN Social Security, three MT taxable Social Security lines). One survived: wa_millionaires_tax_base_income.py:24 (tax_unit_non_dep_add → add on long_term_capital_gains). That mask feeds washington_capital_gains, which only counts when the filer owes the Washington capital gains tax, and no case gives a dependent long-term gains in that situation. Please add one. The remaining 6 mutants (WA line 27, two VT lines, CA YCTC and others) had not run. Log: /tmp/policyengine-command-runs/ea33c0bb2b64/pr-9894-code-diag/mutants.log.

Notes

  • This round covers the six author commits since the 11-07 review and three merges of main.
  • Should 2 (Maine fairness income counted a dependent's Social Security): A child with $9,000 of survivor benefits gives 81,050 on main and 71,800 at the head, and the new case expects 26,500, under 36 M.R.S. 5213-A(1)(B)(3) and 5219-KK(1)(D).
  • Should 3 (references): RESOLVED.
  • Should 1 (unpinned dependent masks): every row in the prior table now has a dependent YAML case. See the gap above for the mutation results so far, including one unpinned mask.
  • Should 4 (axiom line) is still open. The body now says axiom: needed, which CLAUDE.md reserves for external contributors. rulespec-us#1424 still has no companion cases for the corrections that need no dependent, and that set has grown: AZ, MT, WI, WA, the VT section 1202 change, and the IA and MN student loan interest changes. Please extend #1424 or file a dispatch-ready pe-parity issue, and restore a queued line.
  • Suggestions 1–3 are resolved, and suggestion 4 is withdrawn (the Vermont flat path already reflects a Form 4952 election). Suggestion 5 (core-group CI timing) is still open.
  • New behavior verified against sources:
    • Vermont. The section 1202 addition under 32 V.S.A. 5811(21)(A)(v) from 2026.
    • Montana. The lesser of Schedule D lines 15 and 16 (2025 Form 2 p. 17).
    • North Dakota. Distributions now sit inside line 15.
    • Wisconsin. Schedule WD line 18.
    • Iowa. The Social Security worksheet adds back student loan interest and zeroes the base for separate filers who lived together.
    • Minnesota. The M1M worksheet uses student loan interest deducted, not paid.
    • Virginia. The per-filer Guard cap (3,000 and 5,500).
  • Executed in 15 states: a dependent with capital gains, Social Security and Guard pay gives the same result as the household with that income set to zero.
  • Households without dependents match main in IA, MN, WI, ME, GA, DE, MS, SC and MA. They differ on purpose in AZ (policy-1), MT, ND, WA, VA (code-1) and joint VT.
  • All three merges keep every main file, and the PR merges cleanly with main.

Validation Summary

Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot), split into two bounded runs because the machine was shared: 1,706 YAML checks passed and 0 failed across the 16 touched state folders, CA young child, and the federal AGI, capital gains and Social Security folders. The two Python invariant files were not reached locally; CI passes them. Diagnostics executed the dependent and no-dependent households on main and the head in 15 states, plus the VA and AZ distribution cases. Sources: the 2025 Arizona Form 140 instructions and A.R.S. 43-1022, ESSB 6346, Va. Code 58.1-322.02, 36 M.R.S. 5213-A and 5219-KK, 32 V.S.A. 5811, and the MT, ND, WI, IA and MN forms; manifest check passed. CI: 36/36 checks pass at 01cbff3.

Timing

setup seconds: 6.00s; scope seconds: 60.00s; parallel review seconds: 1197.30s; policy role seconds: 369.60s; code role seconds: 1197.30s; adjudication seconds: 240.00s; consolidation cleanup seconds: 718.90s; elapsed seconds: 2073.00s

Review Severity

REQUEST_CHANGES. Open findings: 1 critical, 2 should address, 1 suggestions.

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.

3 participants