Repository navigation
Conversation
|
Overlap with #9898, which fixes the Maryland capital gains surtax base. It changes
|
7e433ee to
b195db5
Compare
…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>
a0c05af to
fa64576
Compare
…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>
…and and Wisconsin filer returns (#10187) * Leave dependents' unemployment compensation off CA, RI and WI filer returns Federal AGI leaves out a tax unit dependent's income (irs_gross_income masks dependents), but California's AGI subtractions, Rhode Island's AGI additions and Wisconsin's unemployment compensation subtraction summed person-level unemployment compensation over every tax unit member, so a dependent's compensation moved the filers' state AGI. Sum only the head and spouse with tax_unit_non_dep_add. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test that a dependent's unemployment compensation stays off CA, RI and WI returns CA Schedule CA column B, RI's 2020 IRC 85(c) add-back and WI's Schedule SB unemployment worksheet all start from the filers' own federal return. The new cases fail on main (7 of 12) and pass with the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cite the forms and statutes for CA, RI and WI on the filers' own return CA: 2024 Schedule CA (540) column A takes the filers' federal amounts; the 540 booklet gives a dependent their own filing requirement (pages 4, 13). RI: RIGL 44-30-12(b)(6) and the 2020 Schedule M line 2g and instructions. WI: Wis. Stat. 71.05(6)(b)8., the 2024 Schedule SB worksheet line 1, and the 2024 Form 1 dependent filing requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add invariants test for dependents' unemployment compensation in CA, RI and WI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review: scope the CA comment, fix reference pages, widen changelog - 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> * Cover California dependents' state tax refunds in the invariants test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Reflow the invariants test docstring Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Picking this up for the US hub. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
|
Picking this up for the US hub. I continue an earlier session's work: it picked this PR up on 2026-11-02 and stopped before pushing anything. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
Resolve 22 conflicts by keeping both sides' intent: - MA: main routes Schedule D long-term amounts through ma_long_term_capital_gains; make that sum the head and spouse only. - MN, VT, VA, MT: keep main's new lines (the 2020 charitable deduction, other additions and subtractions, the pension exemption, the floor on the capital gain credit) and this branch's dependent masks. - PA and mt_agi_joint: main already leaves dependents out; take main. - mt_agi_indiv: keep this branch's rule that a dependent's amounts are on the dependent's own return, rather than main's convention of moving them to the higher-income spouse. Main's two head-label cases stay as head-independence checks with the dependent's amounts left off. - Tests: keep both sides' cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6GA1FXMB3qVPzGgvWQ
…ains are part of CI failed on 'VT percentage exclusion beats flat when eligible gains are high': this branch caps VT-eligible gains at the filers' Schedule D net gain (IN-153 line 15), and the case supplied eligible gains with no federal long-term gains, so the net gain was zero. Eligible gains are a subset of the filer's long-term gains, so both cases now supply them; the expected values are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6GA1FXMB3qVPzGgvWQ
|
Picking this up for the US hub. I continue the earlier sessions' work on this PR; they pushed nothing. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
…na tax - test_source_conflicts counts 'the worksheet uses' as a comment about a conflict between sources. The IA, MN and MT Social Security comments describe no conflict, so they now say 'takes'. - mt_dependent_exemptions_person: an adult dependent's net 1,000 gain is on the dependent's own return, so the filers lose the 2% Montana capital gain credit main gave them on it: 1,894.57 + 20 = 1,914.57. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6GA1FXMB3qVPzGgvWQ
|
Ready for hub review Head: What the item asked, and how I resolved it
Tests (merged head, one file per process, three at a time)66 YAML files and 400 cases passed, none failed:
Highlights:
The property test Hand computations
Mutants (each in its own process, code restored after)
CIPull request run at At 00:32Z on 2026-11-04, 61 minutes after the push, the run was still The passed jobs include both shards that failed at Judgment calls
Proposed follow-ups
Generated by Claude Code |
|
Hub review in progress Reviewing head So far:
Final review posted below. Generated by Claude Code |
|
Ready for hub review The head has not moved since the hand-off ( FindingsP1. The body says households without dependents are unchanged, but three changes move themWhere. PR body, "Invariants": "Tax units without dependents get exactly what they got before. Failure scenario. The hub reads the invariant and limits its population check to tax units with dependents. These three changes then go unmeasured. Witness. I ran
Replacement for the body's Invariants bullet:
Add three rows to "What changes" for these, and rows for the other lines the changelog names but the table omits: CA P2. The body and hand-off say the EITC investment income test still counts dependents, but main fixed it in #9883Where. PR body, "Not in this PR": " Evidence. At this head, Replacement. Delete the "Federal EITC investment-income test" bullet from "Not in this PR", and drop the EITC follow-up. The property test's sentence "whose investment income test (eitc_relevant_investment_income) is not changed here" stays true and can stay. P2. The Virginia per-person Guard cap is a new legal reading, and the body cites nothing for itWhere. This changes the result for married couples with no dependents (see the P1 table). The PR body neither mentions it nor cites the statute. I couldn't reach law.lis.virginia.gov from this VM, so I couldn't check the quote. Before landing, the body should cite the subdivision with a link, and someone with access should confirm that the cap applies per person. P3. A test docstring still lists Montana under the dependent-moving conventionWhere. Replacement for lines 12-15:
P3.
|
| Case | main | head |
|---|---|---|
ND: head wages 50,000, qualified dividends 1,000; child qualified dividends 5,000. nd_qdiv_subtraction |
2,400 | 400 |
VT: head wages 150,000, long-term gain 10,000; child 100,000 eligible. vt_percentage_capital_gains_exclusion |
40,000 | 0 |
Same VT case. vt_capital_gains_exclusion |
40,000 | 5,000 |
Same VT case. vt_income_tax |
4,800.00 | 6,623.20 |
MD: head wages 400,000, long-term gain 10,000; child 50,000 long-term gain. md_capital_gains_surtax |
1,200 | 200 |
All-state sweep (scripts/sweep.py; 2022 and 2025; head with wages 60,000 and a child aged 15). The child had 50,000 of U.S. government interest, qualified dividends or long-term gains. Comparing state_income_tax with and without the child's income:
- On main the child's income moves the filer's tax in 40 states in 2022 and 38 in 2025.
- At the head it moves only AR, MS, NJ and NM, plus IA in 2022 (the structural cases and NM's gains). Each move matches main's to the dollar. In every other state the head gives the no-child value, and the no-child values are identical on main and at the head.
- So no state's tax moves further from the no-child value at the head than on main. Where the head's tax is higher than main's, main had cut the filer's tax for the child's income. Nothing this PR makes reachable gets worse, including the per-person
us_govt_interest_personlists in AL, AR, MS and NJ.
North Dakota against the hub's quote of 57-38-30.3(2)(d)(1). "The excess of the taxpayer's net long-term capital gain ... over the net short-term capital loss" is LT when ST ≥ 0 and LT + ST when ST < 0, with no exclusion when that is zero or less. max_(0, min_(LT, LT + ST)) at nd_ltcg_subtraction.py:39 gives exactly that, the whole clause, and matches the worksheet's "smaller of line 1 or line 2". Runs:
| Long-term | Short-term | Distributions | Result | Hand value |
|---|---|---|---|---|
| 5,000 | −2,000 | 1,200 | 40% × 3,000 | |
| 5,000 | +2,000 | 2,000 | 40% × 5,000 | |
| 1,000 | −3,000 | 0 | ||
| −3,000 | 0 | |||
| 700 | 280 | 40% × 700 |
Main gives −800 and −1,200 for the two loss cases, and 0 for the distributions. The code comment quotes only "the taxpayer's net long-term capital gain", but the formula applies the full clause.
Vermont against the hub's quote of 5811(21)(B)(ii). "Adjusted net capital gain income as defined in 26 U.S.C. § 1(h) reduced by ... qualified dividend income" is the Schedule D net capital gain less 28% gain and unrecaptured §1250 gain. The cap at vt_percentage_capital_gains_exclusion.py:39-43, min(line 15, line 16) − those two, is that amount, and the flat path's adjusted_net_capital_gain − filer qualified dividends nets the same way without an election. Limiting eligible gains to it is a reading of the form (IN-153 line 15), hence METHODOLOGY_CHOICE yes. Other readings this PR takes:
- the pro rata Form 4952 allocation;
mt_agi_indivdropping dependents' amounts where main moved them, under Make state income taxes independent of which spouse is labelled head #9981's modelling convention;- Virginia's per-person cap.
Hand values.
| Case | Computation | Result | Test |
|---|---|---|---|
| ND | 40% × 1,000 | 400 | nd_qdiv_subtraction.yaml passes |
MT mt_agi_indiv, labels swapped |
spouse 10,000 + 500 − 3,000 = 7,500; head 2,000 + 300 − 700 = 1,600; dependent 0 | [7,500, 1,600, 0] | passes |
| VT exclusion | flat min(12,600, 5,000) = 5,000; percentage 40% × min(12,600, net gain 12,600) = 5,040; cap 40% × 12,700 = 5,080 | 5,040 | passes |
For the VT case, adding long_term_capital_gains: 12_600 makes the inputs consistent: eligible gains are part of long-term gains. The expected values rightly stay. For MT's mt_dependent_exemptions_person.yaml, the 2022 credit rate is 0.02 (parameters/.../credits/capital_gain), and the adult dependent's net gain is 3,000 − 2,000 = 1,000. The removed credit is 20, so 1,894.57 + 20 = 1,914.57. Main's 1,894.57 came from the leak this PR fixes.
The merge (fef18d4b1d).
mt_agi_indiv.py:49-53now agrees with main's ownmt_agi_joint.py:17-25, which masks additions and subtractions withis_tax_unit_head_or_spouse.- Main's four
mt_agi_indiv.yamlcases keep their inputs and check head-label independence (cases 1 and 3 give the same [7,500, 1,600, 0]). Only the dependent's share changes. - Main's tie-split behaviour for Montana is gone on purpose.
move_dependent_amounts_to_filerkeeps its coverage for AR, DE, IA and MS intest_state_tax_head_spouse_swap_invariance.pyandms_agi.yaml. ma_long_term_capital_gains.py:26-33istax_unit_non_dep_addover main's three Count Form 4797 gains and losses on Massachusetts Schedule D #9991 inputs (long_term_capital_gains,non_sch_d_capital_gains,other_net_gain). All four readers pick it up.- The other resolutions keep both sides' lines, as the hand-off lists (VT, MN, VA, MT credit and Social Security).
Tests.
- All 43 changed YAML files pass: 244 cases, 0 failed, one
policyengine_core testprocess per file, 4 at a time. - The property test passes (2). Run against main's code from a copy, it fails on
nd_income_taxwith a dependent who has 989 of qualified dividends, so it detects the defect. - The new ND, VT and MD cases each give a different value on main (MD shown above).
Mutants, each in its own process on a scratch worktree, restored after each one (git status --porcelain empty):
| Mutant | Result | Killing case(s) |
|---|---|---|
M1 mt_agi_indiv back to move_dependent_amounts_to_filer |
5 of 5 fail | mt_agi_indiv.yaml |
M2 ma_long_term_capital_gains with add |
1 of 2 fails | ma_part_c_gross_income.yaml "A dependent's long-term gains are on the dependent's own return" |
M3 vt_additions with add |
1 of 1 fails | vt_additions.yaml |
| M4 (mine) ND floor removed | 1 of 6 fails | "No exclusion when the filers have a net long-term capital loss" |
| M5 (mine) ND distributions dropped | 1 of 6 fails | "Capital gain distributions reported without Schedule D count" |
| M6 (mine) VT netting cap removed | 2 of 10 fail | the two netting cases in vt_percentage_capital_gains_exclusion.yaml |
M7 (mine) us_govt_interest with add |
1 of 1 fails | us_govt_interest.yaml |
M8 (mine) mt_capital_gain_credit mask removed |
1 of 4 fails | "A dependent's gains give no credit on this return" |
The #9898 overlap. #9898 is still open (head 3427c3acd0). It shares only md_capital_gains_surtax.py and md_capital_gains_surtax.yaml with this PR. I ran this PR's MD case on #9898's head and it passed, giving 200. On main it fails, giving 1,200 (see above). #9898's md_net_capital_gain.py:47-63 masks dependents too. So whichever lands second can take #9898's two files without losing this case's behaviour.
CI. Pull request run 41739892815 at f692e33256 concluded success, with all 36 jobs success. Nothing was cancelled or skipped.
Scope.
- No file under
.github/orpolicyengine_us/tests/policy/baseline/partners/. - Open PRs sharing files: Tax Maryland's capital gains surtax on net capital gain as the Internal Revenue Code defines it #9898 (the two MD files) and Fix CalEITC child counts for ITIN holders #10322 (
ca_yctc.yamlonly, a test-file conflict to resolve at merge). - Count a Montana casualty loss once per joint return and only for the spouse who had it #9888, Count dependents' medical bills in Montana's separate-filing medical deduction #10276, Fix Montana disability exclusion repeal, elderly credit receipt timing and occupancy tests #10331 and Start Vermont's 2017 taxable income from federal taxable income (former 32 V.S.A. § 5811(21)) #10595 match by search but share no file. Count dependents' medical bills in Montana's separate-filing medical deduction #10276 uses
mt_agi_indivonly as a test input.
Body lines. impact: the hub will measure and axiom: (hub files pe-parity before landing) are both present. The diff moves baseline outputs, for households with dependents and for the three no-dependent cases in P1. So the population check should cover the IA 2021–22 Social Security recipients, VA two-earner Guard couples, and ND filers with a net long-term loss, as well as tax units with dependents' capital income.
What I couldn't check
- Primary sources. This VM's proxy refused ndlegis.gov, legislature.vermont.gov, tax.nd.gov, tax.vermont.gov, govinfo.gov, uscode.house.gov, ecfr.gov and irs.gov. Fetches returned 403 or failed to resolve. So I checked ND and VT only against the text the review brief quotes. I couldn't check the 2025 ND-1 booklet, Schedule IN-153 (the line 15 cap and the line 5-7 pro rata Form 4952 allocation), Iowa's 2022 worksheet, Va. Code 58.1-322.02(8), or the other statutes the body lists (AZ, SC, WI, MD, WA, MT, MA, IL, NH, MN, UT, ME, WV, PA).
- Microsimulation impact on population data; the hub measures it.
- The hand-off's local timings and logs, which I didn't rerun beyond the runs above.
Generated by Claude Code
|
Picking this up for the US hub. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
The swap-invariance docstring still listed Montana with the states that move the dependents' income to the spouse with more income of their own; mt_agi_indiv now leaves those amounts off both columns. Its reference comment still cited the 26 U.S.C. 1(g)(5)(B) rule it no longer borrows, so it now names only the Form 8814 election, which the model does not implement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpcqEDJ2tmDgRbDecMcN7j
|
Ready for hub review Head: What the round 1 review asked for, and what I did
Item 10 in detail:
The no-dependent sweep behind item 5I ran 9 profiles, every one with no dependents, in each of 50 states plus DC, for 2021, 2022 and 2025. The profiles cover:
"Main" is the merge base
Witnesses in the new rowsI reran the review's three witnesses at this head and at the merge base:
IA and ND match the review exactly. For VA, the subtraction and the 316.25 change match the review, but my tax levels are 448.50 higher than its 2,207.05 → 1,890.80, a 7,800 difference in Virginia taxable income. The review didn't list all its inputs, so I couldn't find the difference. The row uses my values and states my inputs. Tests at the head (one process per file, at most three at a time)
No Property file cost (the body's new line). I ran it alone on this session's Linux VM, with 4 vCPU and no other test running:
Mutants: none. This round changes no code, only a docstring, a comment and the body. CINot finished at the 60-minute mark; the runners were congested. This is the only run at this head: the Pull request run 41861379473 at At 16:48Z, 60 minutes after my 15:47Z push, the run was
The hub needs to read the run's conclusion. Judgment calls
Proposed follow-upVirginia National Guard subtraction: model the rank limit and the 39-day pay limit. Va. Code 58.1-322.02(8) limits the subtraction to "the amount of income derived from 39 calendar days of such service" (or the dollar cap), and to ranks O3 and below before 2023 and O6 and below from 2023. The model caps only at $3,000 / $5,500 per person, and has no rank or service-day input. Generated by Claude Code |
|
Hub review in progress Round 2 review of head
Test runs and mutants are still running. Generated by Claude Code |
|
Ready for hub review Round 2, a delta review against the round 1 review at "Five" is right. Every sweep row and witness in the new "What changes" rows reproduces to the cent at the head and at the merge base. Three text fixes remain, none of them in code. I approve on the understanding that the hub applies them before landing:
FindingsP2. The invariants' first bullet says state income tax ignores dependents' capital income, but five states still moveWhere. PR body, "Invariants", first bullet: "These state lines and the state income tax equal their values with the dependents' capital income set to zero." Failure scenario. The hub checks the population run against this bullet. Zeroing dependents' capital income then still moves state tax in AR, MS, NJ, NM and pre-2023 IA, and nothing in the invariant says to expect that. The body lists these states under "Not in this PR", but the invariant reads "For every tax unit". Witness (
The three inputs are qualified dividends, long-term gains and taxable interest. So the bullet needs the exception. AL doesn't move for capital income in this case, although "Not in this PR" lists it as structural. Replacement:
P3. The Virginia witness doesn't say that its wages include the Guard payWhere. PR body, "What changes", VA row: "a couple aged 40, each with wages 40,000 and Guard pay 6,000. What I found. Where round 1's 448.50 came from. Round 1's 2,207.05 → 1,890.80 reproduces exactly when one spouse is 65 and the other 40. Virginia's age deduction then takes 7,800 off Virginia taxable income, and 7,800 × 5.75% = 448.50. The session's 2,655.55 → 2,339.30 reproduces with both spouses aged 40 (
Every row has Replacement for the witness sentence:
P3. The changelog fragment leaves out that North Dakota now counts capital gain distributionsWhere. Replacement for the fragment's second sentence:
Checked and soundThe invariant: "five" is right, and the count is complete.
Witnesses (
IA worksheet reader. Readers of the five no-dependent lines.
I found no reader that this PR makes worse. The defect reproduces at the merge base and is fixed at the head. I reran the body's two TY2025 cases (
Federal AGI is 160,000 in every VT column. These match the body's table. In the P2 witness the head earns 60,000 with no capital income of their own, so the ND, VT and MD subtractions were 0 on both trees. Tests at the head, one process per file:
These are local runs on a 4 vCPU Linux VM, not CI. The property file's 1,275 MiB matches the body's 1.25 GiB. Mutants. The hand-off listed none, since the round changed no code. I added five aimed at the round 2 rows. Each ran in its own process on the checked-out head, and each file was restored with
The ND floor and VT netting mutants were round 1's M4 and M6, both killed then. This round's commit changes no formula, so I didn't rerun them. Body claims checked.
Baseline movement. The diff moves baseline outputs. It moves tax units with dependents who have capital income, Social Security or Guard pay. It also moves units with no dependents in five ways:
The population check should cover each. If the microdata carry no CI. Pull request run 41861379473 at Scope.
METHODOLOGY_CHOICE yes, for the same readings round 1 named:
What I couldn't check
Generated by Claude Code |
|
Picking this up for the US hub. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
The fragment summed up Vermont and North Dakota in a phrase each, leaving out Vermont's Form 4952 netting and North Dakota's capital gain distributions, so it now names each in its own sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ready for hub review Head: What the brief asked and how it's resolved
The body's invariants bullet and Virginia witness, which the hub rewrote, are untouched. The body names neither the fragment's wording nor a CI run at a specific head, so this commit makes none of its sentences false, and I didn't PATCH it. CIPull request run 41949737927 at Judgment calls
Proposed follow-upNone. Generated by Claude Code |
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>
PR Review: Leave dependents' capital income out of state lines on the filers' returnSummaryThe core change is sound. A tax unit dependent's interest, dividends and capital gains are already left out of federal AGI ( I checked the new person variable that the #10667 review recommended:
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:
CI is 36/36 green. I found no critical issue. Four should-fix items remain:
Critical (must fix)None. Should addressS1. Several new dependent masks are unpinned (mutation rule). Reverting each of these lines to
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.
Fix: compute the Social Security term from the filers' own benefits, for example S3. Two references break the CLAUDE.md reference rules.
S4. The axiom line is invalid and doesn't match the head.
Fix: write the line in the required form, e.g. Suggestions
Verified correctThe federal person variable.
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.
Hand-checked expectations from the PR's YAML (arithmetic shown):
Law, per state. I read these this session:
The rest start from the filer's own federal AGI, taxable income or Schedule D:
None of these states taxes the family unit or has its own analogue of Form 8814. Code checks.
Tests and guards.
Axiom line assessmentInvalid; see S4. The body's line CI status
Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
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.
What was wrong
irs_gross_incomemultiplies every income source by~is_tax_unit_dependent, so a tax unit dependent's interest, dividends and capital gains never enter the filer's federal AGI or taxable income. The dependent reports them on their own return (2025 Form 8814, line 4; the model does not implement the Form 8814 election, 26 U.S.C. 1(g)(7)).Many state lines that adjust the filers' federal AGI or taxable income summed a capital-income input over every tax unit member (
add(tax_unit, ...)oradds = [...]). So a child's dividends, gains or interest moved the parents' state tax.The two reported cases, on
main:mainnd_qdiv_subtractionvt_percentage_capital_gains_exclusionvt_capital_gains_exclusionvt_income_tax(federal AGI 160,000 in every column)How the leaks were found
Static scan. Every
add,aggrandadds/subtractsaggregator over a tax unit invariables/gov/states, with parameter-driven source lists resolved over all their dated values. 50 tax-unit sums include a person-level capital-income input. Child-care and TANFspm_unitsums count family income by design and are out of scope.Household sweep (every state, TY2021–2026). Five filer profiles: single worker at 60,000, a 70-year-old with Social Security and a pension, a 400,000 earner, an 82-year-old, and a 22,000 earner. Each has a dependent child aged 15 with 50,000 (300,000 for long-term gains) of one input:
The sweep compares the filer's
state_income_taxwith and without the child's income, alongside federal AGI and federal tax. It ran on Use the filers' Schedule D for the tax on net capital gain #9855's head so the federal Schedule D leak Use the filers' Schedule D for the tax on net capital gain #9855 fixes stays out. A drill-down then listed every state variable that moved. Every change below was found this way. The same sweep, re-run on Use the filers' Schedule D for the tax on net capital gain #9855's head plus this PR, leaves only the cases under "Not in this PR".What changes
All fixes count only the head and spouse, using
tax_unit_non_dep_addfor tax-unit sums and a dependent mask for per-person lines. The last four rows are corrections that also reach tax units without dependents; a no-dependent household sweep at this head (9 profiles, every state, 2021, 2022 and 2025) movedstate_income_taxonly through them.us_govt_interest, which most states subtract. It wasadds = ["us_govt_interest_person"]over every member; tax-unit lists (incl. #9699's) add it as is. In the sweep a dependent's U.S. government interest moved the filer's tax in 38 states; after this PR it moves none except AL and IA before 2023 (structural), KY (#9699), and the MN, NM and OK credit paths under "Not in this PR".va_subtractions(whole list) andva_subtractions_person(dependents get none). The list's other person items are already head/spouse-masked or AGI-prorated; a dependent's unemployment, railroad benefits and state tax refunds also stop being subtracted.dc_income_subtractions,de_subtractions,oh_deductions(per-person, summed into the filers' state AGI). Only the dependent's U.S. government interest is dropped; see "Not in this PR".nd_qdiv_subtraction,nd_ltcg_subtractionvt_percentage_capital_gains_exclusion,vt_additionsaz_long_term_capital_gains_subtractionsc_net_capital_gain_deductionwi_capital_gain_loss_subtraction,wi_capital_loss,wi_additionsmd_capital_gains_surtaxwa_capital_gains_tax,wa_millionaires_tax_base_incomemt_capital_gains_tax_joint,..._applicable_threshold_joint,mt_regular_income_tax_joint,mt_capital_gain_credit,mt_interest_exemption_person,mt_agi_joint,mt_taxable_social_security_jointma_part_a_gross_income,ma_part_a_agi,ma_part_c_gross_income, the four Part A dividend and exemption lines, the bank interest exemptionil_base_income_additionsnh_taxable_incomeia_reportable_social_securitymn_social_security_subtractionut_ss_benefits_credit_max,ut_retirement_credit_max,ut_ctc_potentialwv_low_income_family_tax_credit_agime_sales_and_property_tax_fairness_credit_incomepa_eligibility_incomeca_yctc, which now reads the filers' ownfiler_loss_limited_net_capital_gainsand Schedule D line 16 (filer_schedule_d_lines)ga_retirement_exclusion_countable_capital_gains, which now readsfiler_loss_limited_net_capital_gains_personincome_sources.yaml, which now listsfiler_loss_limited_net_capital_gains_personmi_interest_dividends_capital_gains_deductionfiler_loss_limited_net_capital_gains_person: each head's or spouse's own gains and losses plus capital gain distributions, with the filers' net loss limited and shared in proportion. A dependent has none and takes no part in the loss limit, unlikeloss_limited_net_capital_gains_person.ia_reportable_social_security0 → 5,000;ia_income_tax0.00 → 190.93 (main→ this PR). The line changes in 2025 too, where it moved no tax in the sweepia_reportable_social_securitymilitary_service_income, which the model doesn't add to federal AGI).va_national_guard_subtraction5,500 → 11,000;va_income_tax2,655.55 → 2,339.30va_national_guard_subtraction,va_national_guard_subtraction_personnd_ltcg_subtraction−1,200 → 0.nd_income_taxstays 249.11, becausend_subtractionsfloors its total at zero; the floor moves tax only when other ND subtractions absorb the negative amount. Distributions do move tax: 2022, wages 60,000 and distributions 5,000 givend_ltcg_subtraction0 → 2,000 andstate_income_tax319.14 → 278.34nd_ltcg_subtractionvt_percentage_capital_gains_exclusion4,000 → 800;state_income_tax1,732.12 → 1,864.12vt_percentage_capital_gains_exclusionWhere one of these formulas also summed a dependent's other amounts on the same line, they get the same rule:
Three fixes in formulas edited anyway:
nd_ltcg_subtractionfloors at zero and includes capital gain distributions. The Form ND-1 line 6 worksheet says "If zero or less, stop here; no exclusion is allowed", and puts distributions without Schedule D on line 3. Before, a filer's net long-term loss made a negative subtraction.ut_retirement_credit_maxcounts only the head and spouse as claimants. An elderly dependent no longer adds a credit.wv_low_income_family_tax_credit_aginow cites W. Va. Code 11-21-22a(d), the definition it implements, instead of 11-21-12(b).Legal basis
Each line adjusts the individual's own federal AGI or taxable income, or the claimant's and spouse's own income. I read these sources this session:
Not in this PR
nm_net_capital_gains_deductionhas the same pooling. It waited for Split the New Mexico net capital gains deduction between separate filers #9689, Fix AR, MT and NM income tax gaps found in TAXSIM comparison sweep #9585 and Require Arkansas joint filing with a negative spouse income and use tax table bands #9696, which have all merged (follow-up).us_govt_interest.Tests
main).mt_agi_indivcases, renamed. An earlier round found that each of its 35 such cases gives a different value onmain; the later ones weren't rerun there.policyengine_us/tests/core/test_dependent_capital_income_state_tax_invariants.py(Hypothesis, 5 derandomized examples of 10–30 ND and VT tax units, each run with and without its dependents' capital income).nd_income_tax,vt_income_tax, federal AGI and federal taxable income match between the twins.nd_qdiv_subtraction,nd_ltcg_subtraction(with its zero floor and distributions),vt_percentage_capital_gains_exclusion,vt_additionsandus_govt_interestequal an independent reference over the filers' own amounts.mainHypothesis shrinks to a dependent with $1 of qualified dividends, giving a filer subtraction of $0.40.coregroup already pays; 1.25 GiB peak RSS.Microsim impact
Not run here; the hub measures impact.
Invariants
For every tax unit, and any capital income its dependents have, as checked by the property test, the YAML twins and the sweep:
main: in AR, MS and NJ, in IA before 2023, and in NM through its capital gains deduction.tax_unit_non_dep_addequalsaddwhen no member is a dependent.Axiom note: TheAxiomFoundation/rulespec-us#1424 is queued (extended with the state capital-income cases: TheAxiomFoundation/rulespec-us#1424 (comment)).
us-nd:policies/income_tax/resident_core_liability_pipeline(N.D.C.C. 57-38-30.3(2)(d); inputsnd_pit_2026_federal_net_long_term_capital_gainandnd_pit_2026_allocated_qualified_dividends_taxed_below_regular_rates; companion testfederal capital loss offset precedes north dakota allocation cap).us-wa:statutes/82/82.87/82/87/040#washington_capital_gains_excise_tax(entityPerson).us-vt:policies/income_tax/pilot_liability_pipelinetakes completed normal tax.Merge with main (2026-11-03)
Main has moved since October. 22 files conflicted:
pa_eligibility_incomeand MTmt_agi_joint: main had already left dependents out (Wire military retirement pay and survivors into federal and state tax (#10181) #10182, Fix AR, MT and NM income tax gaps found in TAXSIM comparison sweep #9585), so the merge takes main's version.ma_long_term_capital_gains(Count Form 4797 gains and losses on Massachusetts Schedule D #9991). That variable now sums the head and spouse only, which keeps this PR's rule for Part A, Part C and the loss-against-dividends lines.mt_agi_indiv: main (Make state income taxes independent of which spouse is labelled head #9981) moves dependents' amounts to the higher-income spouse's column, as a modelling convention. This PR keeps them off both columns, since they are on the dependent's own return. Main's two head-label cases stay as head-independence checks, with the dependent's amounts left off.mt_dependent_exemptions_person.yamlexpects 1,914.57. An adult dependent's net 1,000 gain no longer gives the filers the 2% Montana capital gain credit: 1,894.57 + 20.impact: the hub will measure
axiom: (hub files pe-parity before landing)
Generated by Claude Code