Skip to content

Add Indiana's, Massachusetts's and West Virginia's claim of right repayment deductions - #10196

Open
MaxGhenis wants to merge 31 commits into
mainfrom
in-ma-wv-claim-of-right
Open

MaxGhenis wants to merge 31 commits into
mainfrom
in-ma-wv-claim-of-right

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Indiana, Massachusetts and West Virginia each take a repayment of income held under a claim of right off the state base, whichever federal method applies. PolicyEngine had none of the three, so a repayment changed nothing in these states. This PR adds them.

Stacked on #10038 (branch federal-claim-of-right-1341), which models 26 U.S.C. 1341. Review the commits after dc10cc58ce except the merges of #10038's heads 2d36a76bca (its merge of main), 32b0c13a6a (Montana's miscellaneous itemized list takes the claim of right deduction from 2024, so Montana's tax now changes under the federal deduction method; under the credit method that deduction is zero) 6f34ccde23 (its second merge of main), d1c695b2f7 (itemizing branches inherit the claim of right method under core 3.33) and 17cad4b53b (changelog and docstring), which bring in no change of this PR's. Head d2a1b9e3ff.

  • in_claim_of_right_deduction (tax unit), with the person input in_claim_of_right_repayment_excluded_from_income. It joins every year block of gov.states.in.tax.income.deductions.deductions (IT-40 Schedule 2, code 630).
  • ma_claim_of_right_deduction (tax unit), with the person input ma_claim_of_right_repayment_excluded_from_income. It joins ma_part_b_taxable_income_deductions (Schedule Y line 14).
  • wv_claim_of_right_subtraction (person), with gov.states.wv.tax.income.subtractions.claim_of_right.threshold ($3,000). It joins gov.states.wv.tax.income.subtractions.subtractions (Schedule M, "IRC 1341 Repayments", line 42 in 2025).

The law

Indiana. IC 6-3-1-3.5(a)(22), as set out in HEA 1001-2021 section 71 (PDF p. 117):

(22) Subtract an amount as described in Section 1341(a)(2) of the Internal Revenue Code to the extent, if any, that the amount was previously included in the taxpayer's adjusted gross income for a prior taxable year.

The 2025 IT-40 instructions, deduction 630 (PDF p. 23) allow it if "You reported the income to Indiana in a previous year, You repaid some or all of it this year, and For federal tax purposes, you are eligible to: claim the repayment as an itemized deduction, or claim a credit based on the repayment amount." Example 1 deducts a $345 repayment of unemployment compensation although "he cannot claim miscellaneous itemized deductions for federal purposes. Regardless, he is still eligible to claim the deduction on his state tax return", less $15 because the earlier year's unemployment compensation deduction, refigured, falls by $15: $330. Example 2 deducts $3,400 repaid by a filer who claimed the federal credit. Repaid Social Security is "not eligible for a deduction (since Indiana has not previously taxed this income)". The 2018 instructions (PDF p. 23) say the same.

Massachusetts. M.G.L. c. 62, s. 3(B)(a)(14):

(14) The amount as is described in section 1341(a)(2) of the Code, to the extent, if any, that that amount (i) was previously included in Massachusetts taxable income and (ii) is not otherwise deductible under section 2(d)(1) of this chapter.

The 2025 Form 1 instructions (PDF p. 21) list "Repayment of unemployment compensation and supplemental unemployment benefits in a subsequent year" among the cases and say "If you are entitled to claim this deduction, enter the amount claimed in Schedule Y, line 14." Neither text has a $3,000 threshold or refers to the federal method.

West Virginia. The 2025 IT-140 instructions, Schedule M line 42 (PDF p. 29): "Enter the amount of money paid back under IRC 1341. ... The amount of income repaid MUST be more than $3,000.00 to qualify." The line is a decreasing modification (PDF p. 5). From 2020 it is its own line with the $3,000 text, which says "For more information, consult federal Publication 525" (2020 line 40, PDF p. 24); in 2017-2019 it shared a check-one line with long-term care insurance and the instructions said only "money paid back under IRC 1341" (2017 line 50, PDF p. 23). The model's West Virginia subtraction list starts in 2021. The January 2026 tax expenditure study (PDF p. 49) lists it with the same condition. The instructions do not depend on the federal method.

Design notes

  • Independent of the federal method. None of the three reads claim_of_right_credit_applies or federal itemizing. Under the federal credit method, section 1341(b)(3) keeps the federal deduction out of everything else; these states give their own relief anyway, so the repayment lowers state tax under either method.
  • Indiana and Massachusetts: any amount. Both texts refer to the deduction "described in section 1341(a)(2)", not to the $3,000 test in (a)(3). Indiana's own example deducts $345. For Massachusetts this is a reading: neither the statute nor the Form 1 instructions state a threshold or a federal condition, and the instructions' examples include repaid unemployment compensation, but no example settles a repayment of $3,000 or less.
  • West Virginia's $3,000 is its own parameter, because its instructions state the amount. The model tests the head's and spouse's total, as IRS Publication 525 (which the instructions cite) does for section 1341.
  • "Previously included." Indiana and Massachusetts deduct only income they taxed when received. Each gets a person-level leaf input for the part they did not: for Indiana, repaid Social Security or the extra earlier-year unemployment compensation deduction (Example 1's $15); for Massachusetts, income not in Massachusetts taxable income. Both default to zero.
  • West Virginia's senior modification is unchanged. Line 47's box (c) is "all income ... not reported on lines 35 through 48" (2025 instructions, PDF p. 29), and W. Va. Code 11-21-12(c)(9) allows $8,000 of income included in federal AGI. A repayment is not income, so it does not reduce that base: a 70-year-old with $9,000 of wages who repays $4,000 gets the full $8,000 senior modification plus the $4,000 repayment modification. (The model's existing excluded_income_sources list also removes 529 contributions, line 39, from box (c); that predates this PR and is left as it is.)
  • Spouses. Indiana and Massachusetts sum the head's and spouse's amounts; West Virginia keeps each spouse's own repayment in their Schedule M column. A dependent's repayment belongs on the dependent's own return.
  • Two fixes in passing: in_other_deductions no longer lists the repayment deduction in its documentation (it is now computed), and the Massachusetts 529 deduction's comment cites (B)(a)(19), not (14). A user who entered a repayment in in_other_deductions and now also enters claim_of_right_repayment would deduct it twice; the documentation says so. No dataset sets either.

Not modeled: West Virginia's statutory authority. The expenditure study cites W. Va. Code 11-21-12(c)(4), whose current text concerns refunds of income taxes; the rule is modeled from the instructions.

Household on main, #10038 and this branch (2025, single, age 40)

Script: ~/reviews/us-hub/claim-of-right-states/scripts/households.py; outputs evidence/households_*.json. main 95eefa51e5; #10038 dc10cc58ce; this branch 56c7e98f43.

Household main #10038 This branch
Indiana: wages $40,000, repays $3,400 (Example 2), decrease $400 Federal $2,671.50; IN $1,170 Federal $2,271.50 (credit); IN $1,170 IN $1,068 ($102 lower: 3% of $3,400)
Indiana: wages $40,000, repays $2,000 IN $1,170 IN $1,170 IN $1,110
Massachusetts: wages $60,000, repays $2,000 MA $2,680 MA $2,680 MA $2,580
Massachusetts: wages $60,000, repays $10,000, decrease $2,200 Federal $5,071.50; MA $2,680 Federal $2,871.50 (credit); MA $2,680 MA $2,180
West Virginia: wages $40,000, repays $10,000, decrease $2,200 Federal $2,671.50; WV $1,098.90 Federal $471.50; WV $1,098.90 WV $765.90

Tests

YAML, each expected value computed by hand from the cited form:

  • gov/states/in/tax/income/deductions/in_claim_of_right_deduction.yaml, 11 cases: Indiana's Examples 1 ($330) and 2 ($3,400), repaid Social Security, the standard-deduction filer under the federal deduction method, a joint return with a dependent, Indiana AGI and tax at 3%, the same $870 tax under each of three fixed federal methods, and the same $870 from the existing in_other_deductions input.
  • gov/states/ma/tax/income/deductions/ma_claim_of_right_deduction.yaml, 10 cases, including a $2,000 repayment, Part B taxable income ($2,000 FICA cap plus the deduction, $4,400 exemption), the same $43,600 under each of three fixed federal methods, and a $60,000 repayment that takes Part B income to zero.
  • gov/states/wv/tax/income/subtractions/wv_claim_of_right_subtraction.yaml, 10 cases, including $3,000 exactly, two spouses at $2,000 each, WV AGI and taxable income, the senior modification left at $8,000 (WV AGI then -$3,000, taxable income $0), and the same $28,000 taxable income under each of three fixed federal methods.

Invariants (stated, and asserted in YAML)

  1. Method independence. Each state's result is the same with the federal credit method fixed, the deduction method fixed with itemizing, and the deduction method fixed with the standard deduction.
  2. Amounts. Indiana's and Massachusetts's deductions are the whole repayment at every amount, less what the state did not tax; West Virginia's is the repayment above $3,000 and zero at or below it.
  3. Dollar for dollar. Indiana and West Virginia AGI fall by exactly the deduction, and Massachusetts Part B income by the deduction until it reaches zero.
  4. Differential. Indiana's tax with a repayment equals its tax with the same amount entered through the existing in_other_deductions input.

No Python test: review r1 showed YAML exercises each of these, and the remaining CI group is already near its memory limit. Mutation check against the YAML: West Virginia's threshold made inclusive, West Virginia gated on the federal method, Massachusetts's deduction dropped from Part B, and Indiana's limited to repayments over $3,000 each fail it.

The cross-state test from #10038 now has an explicit, sourced map of the states whose own relief applies under the federal credit method; each listed state whose variable is in the model must lower the household's tax by more than $1, and every other state, North Carolina and Montana included, must be unchanged. #10195, #10198 and #10200 carry the identical commit.

Local runs at 56c7e98f43 (macOS): the three new YAML files pass (11, 10 and 10 cases; 31 in one process at 2.80 GB peak), and so do the existing files the list edits touch (West Virginia subtractions and the senior citizen or disability deduction files, Massachusetts Part B deductions and exemption, Indiana AGI: 30 cases). The cross-state per-state test passes. Details: evidence/tests.md.

Microsimulation

2025, default dataset (populace_us_2024 at populace-us-2024-spm-20260909), run 2026-10-13 under the shared heavy-run lock: #10038's head dc10cc58ce against this branch at 56c7e98f43 (later commits only merge #10038's later heads and change tests or documentation). Driver and outputs: ~/reviews/us-hub/claim-of-right-states/impact/ (multi.sh; compare.in-ma-wv.2025.json).

  • claim_of_right_repayment is $0 on every record (weighted sum $0), so in_claim_of_right_deduction, ma_claim_of_right_deduction and wv_claim_of_right_subtraction are $0 everywhere.
  • No record changes in income_tax, state_income_tax, household_net_income, claim_of_right_credit_applies or in_agi, ma_part_b_taxable_income, wv_agi.

The change takes effect only for households that enter a repayment; the dataset has none.

Axiom

axiom: IC 6-3-1-3.5(a)(22), M.G.L. c. 62 s. 3(B)(a)(14) and West Virginia's Schedule M IRC 1341 modification — not yet queued. The rulespec-us pe-parity issue is drafted and held; filing waits for Max's go (decision d1459), or the US hub may file it under d1142.

  • No module encodes any of the three; us-ma/statutes/62/3.yaml encodes the exemptions but not (B)(a)(14).
  • Corpus: us-in/statute/6-3-1-3.5 holds (a)(22); us-ma/statute/62/3/block-2 holds (B)(a)(14); the West Virginia instructions have no corpus row, so that part needs an ingest first.

Review

Independent review r1 (Opus 5.5, as the GPT-6.1 Sol lanes were held; ~/reviews/us-hub/claim-of-right-states/reviews/out-10196.md, REQUEST CHANGES) and the response (reviews/response-10196.md): the repayment no longer reduces West Virginia's senior base (the statute and box (c) count income); West Virginia has its own threshold, applied to the return's total per Publication 525; the cross-state test uses an explicit map; the Python file became YAML; the West Virginia history, the Massachusetts reading and the Indiana double-count risk are stated.

Review r2 (reviews/out-10196-r2.md): APPROVE, with three nits now fixed (Massachusetts's zero floor stated and tested, the changelog's Indiana warning, the Indiana table note).

Reviews r2 and r3 ran on GPT-6.1 Sol. Review r3 (reviews/out-10196-r3.md, APPROVE) left two nits, now fixed: the Massachusetts YAML comments cite Form 1 line 11a, and the run record covers the ten-case file. A delta review of the changes since (r4, Opus 5.5, reviews/out-delta-r4.md) approves this head.

Follow-ups

🤖 Generated with Claude Code

MaxGhenis and others added 17 commits October 9, 2026 08:50
G.S. 105-153.5(a)(2)d, added by S.L. 2016-5 for 2014 and later, lets North
Carolina itemizers deduct repayments of income included in AGI in an earlier
year under a claim of right (Form D-400 Schedule A line 8). Repayments above
$3,000 are deductible in full; smaller ones are reduced by 2% of federal AGI
less other miscellaneous itemized deductions, which the 2016 and 2025 NCDOR
worksheets both reproduce. PE had no input for these repayments, so it adds
claim_of_right_repayment (person level; only the head's and spouse's count)
and moves North Carolina's uncapped itemized items into a parameter list.

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

Review r1 (subfleet 20261009-090558-nc-itemized-review):
- S.L. 2026-31 section 1.8 rewrites G.S. 105-153.5(a)(2)d for taxable years
  beginning on or after January 1, 2026: the repaid amount must have been
  included in AGI "as modified in G.S. 105-153.5 and G.S. 105-153.6" in the
  earlier year. New person input
  nc_claim_of_right_repayment_excluded_from_income (the part NC deducted when
  received, such as repaid Social Security) and a dated parameter apply it.
- Count only the head's and spouse's other miscellaneous expenses against
  the pre-2018 floor; a dependent's are on the dependent's return.
- The property grid now varies property taxes (so the $20,000 cap binds) and
  adds a 2026 grid for the excluded part.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h Carolina's 1341(a)(5) bar and G.S. 105-266.2 payment (WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es that exclude them (AZ, KS, WI, MO, OR, VA); property tests

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to keep it at two seconds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urn-level prior-year inputs, California and Montana flows

- The branches that fix the claim of right method start from inputs only, and
  the itemization branches settle the method in the parent first, so a tax
  liability calculated before the method is known cannot leak into them.
- Ties are compared to the cent, so a one-cent difference picks the credit.
- The prior-year federal decrease and NC increase are return-level inputs
  defined on chapter 1 and Article 4 tax.
- California leaves out the federal deduction (Schedule CA Part II line 16);
  Montana deducts it through 2023 (Form 2 itemized line 18).
- Section 67(g) is now 67(h); document the Arizona and NC coverage limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r2 found that with itemization branching off, tax_liability_if_not_itemizing
used the parent's method when calculated first but chose its own after
income_tax. The itemizing branches now take the method as an input. A branch
keeps its parent's cache when an override equals the value the parent already
holds, so ordinary simulations still share it. Adds the review's Texas
household as an order test under both itemization settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… branches only when someone qualifies

Review r3 showed that keeping a parent's cache when an override equals the
parent's current value can reuse tax calculated before another input
changed. Branches again drop inherited values whenever the parent knows an
overridden variable. The itemizing branches add the claim of right method as
an override only when some tax unit repays more than $3,000, so simulations
without a qualifying repayment keep sharing the parent's cache. Adds the
review's stale-parent sequence as a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th use tax

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate property test

Under the federal credit method, section 1341(b)(3) keeps the repayment out of
every state that only follows the federal deduction, so their tax must not
change. States with their own claim of right relief may lower tax under either
method. The test now reads which states have their own rule from the model's
variable names (<state>_claim_of_right_...), so a state PR adds its variables
without editing this list.

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

These three take a repayment of income held under a claim of right off the
state base whichever federal method applies:

- Indiana (IC 6-3-1-3.5(a)(22), IT-40 Schedule 2 code 630): any amount, less
  what Indiana did not include in Indiana AGI when received.
- Massachusetts (M.G.L. c. 62, s. 3(B)(a)(14), Schedule Y line 14): any
  amount, less what Massachusetts did not tax when received.
- West Virginia (Schedule M, IRC 1341 Repayments): repayments over $3,000.
  The line sits inside the senior citizen modification's excluded range, so
  it is excluded from that base too.

Also corrects the Massachusetts 529 deduction's paragraph to (B)(a)(19).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…im of right relief

Over a grid with independent simulations: each state's tax is the same under
every federal method and itemizing choice; the deduction lowers Indiana and
West Virginia AGI and Massachusetts Part B income dollar for dollar (West
Virginia only above $3,000); Indiana tax equals a simulation using the
existing in_other_deductions input; and no state's tax rises.

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

Reviews of #10195, #10196 and #10198 found that reading own-rule states from
variable names weakened the cross-state test: North Carolina and Montana lost
their exact check, nothing asserted that a state's own relief actually lowered
its tax, and any future <state>_claim_of_right_ input would exempt a state.

Now an explicit, sourced map names each state whose relief applies under the
federal credit method and the variable that carries it. Under that method each
listed state whose variable is in the model must lower the household's tax by
more than $1, and every other state's tax must not change. The same commit is
on every state branch, so they still merge in any order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 13, 2026
…eral credit

Reviews of #10195, #10196 and #10198 found that reading own-rule states from
variable names weakened the cross-state test: North Carolina and Montana lost
their exact check, nothing asserted that a state's own relief actually lowered
its tax, and any future <state>_claim_of_right_ input would exempt a state.

Now an explicit, sourced map names each state whose relief applies under the
federal credit method and the variable that carries it. Under that method each
listed state whose variable is in the model must lower the household's tax by
more than $1, and every other state's tax must not change. The same commit is
on every state branch, so they still merge in any order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…old, YAML in place of Python

- The IRC 1341 repayments modification no longer reduces the senior citizen
  modification's base. Line 47 box (c) is "all income ... not reported on
  lines 35 through 48" and W. Va. Code 11-21-12(c)(9) counts $8,000 of income
  included in federal AGI; a repayment is not income. YAML case 7 now gives
  an $8,000 senior modification.
- West Virginia gets its own $3,000 threshold parameter (the instructions
  state it), applied to the head's and spouse's total as IRS Publication 525,
  which the instructions cite, does.
- The Python property file is replaced by YAML: each state's tax under the
  federal credit method, the deduction method with itemizing and the
  deduction method with the standard deduction (same hand-computed value
  three times), and Indiana's existing in_other_deductions path. Four
  single-line mutants each fail the YAML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 13, 2026
…eral credit

Reviews of #10195, #10196 and #10198 found that reading own-rule states from
variable names weakened the cross-state test: North Carolina and Montana lost
their exact check, nothing asserted that a state's own relief actually lowered
its tax, and any future <state>_claim_of_right_ input would exempt a state.

Now an explicit, sourced map names each state whose relief applies under the
federal credit method and the variable that carries it. Under that method each
listed state whose variable is in the model must lower the household's tax by
more than $1, and every other state's tax must not change. The same commit is
on every state branch, so they still merge in any order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 13, 2026
…eral credit

Reviews of #10195, #10196 and #10198 found that reading own-rule states from
variable names weakened the cross-state test: North Carolina and Montana lost
their exact check, nothing asserted that a state's own relief actually lowered
its tax, and any future <state>_claim_of_right_ input would exempt a state.

Now an explicit, sourced map names each state whose relief applies under the
federal credit method and the variable that carries it. Under that method each
listed state whose variable is in the model must lower the household's tax by
more than $1, and every other state's tax must not change. The same commit is
on every state branch, so they still merge in any order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 13, 2026 02:34
- Massachusetts: a YAML case where the deduction exceeds Part B income
  (wages $60,000, repayment $60,000) shows Part B income stops at zero.
- West Virginia case 7 also asserts West Virginia AGI (-$3,000) and taxable
  income ($0).
- The changelog tells Indiana users to move a repayment from
  in_other_deductions to claim_of_right_repayment so it is not counted twice.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the add/add conflicts with #10028's squash (557b539) by
keeping this branch's 26 U.S.C. 1341(a)(5) bar on the North Carolina
deduction, its added NC cases and the method fixture in the NC property
grid, and keeps both sides' Arizona itemized deduction cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 13, 2026 12:09
MaxGhenis and others added 2 commits October 13, 2026 08:59
…rom 2024

From 2024 Montana Form 2 line 2 takes the federal itemized deductions
(2024 instructions, Worksheet A line 1: Form 1040 line 12), which include
Schedule A line 16. The miscellaneous list was empty from 2024, so a
Montana itemizer lost the federal claim of right deduction. Review r5b
(P3-1) found it.

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

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

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub (Indiana, Massachusetts and West Virginia; state claim of right lane, session local_d0c92ac9).

MaxGhenis and others added 2 commits October 14, 2026 02:47
Resolves the period_branch.py conflict with #9913 (5c51e0d) by taking
main's _input_keys docstring, which no longer says whether Core's clone
copies or shares the input-key set.

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

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

Copy link
Copy Markdown
Contributor Author

Hand-off update (2026-10-14): new head 8633699921, MERGEABLE. It merges #10038's 6f34ccde23 (its second merge of main). The PR's own changes are unchanged since the approving review. Local runs at this head: YAML 31, all passing. Everything else in the hand-off comment above still holds; the hub-file line is re-appended with this head.

MaxGhenis and others added 3 commits October 14, 2026 03:14
From 2026 tax_unit_itemizes opens the itemizing branch for the section 68
limitation (#10136) with only tax_unit_itemizes overridden. From
policyengine-core 3.33 (#560), set_input on a branch drops the values stored
after the overridden variable was first stored anywhere in the simulation,
so that branch lost the inherited section 1341 method and chose its own as a
filer forced to itemize. Its itemized deductions then decided itemization on
a liability tie, or always with itemization branching off: CI failed two 2026
grid points, and a 2026 household with branching off came out at $4,988
instead of $4,100.

get_itemization_branch builds the itemizing and non-itemizing branches for
all three callers, adding the method as an input whenever someone qualifies,
so they share one branch and none chooses a method. A 2026 test covers that
household in every calculation order under both itemization settings; it
fails before this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… method) into the in-ma-wv-claim-of-right branch

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

main compiled the North Carolina claim of right fragment into CHANGELOG.md
when #10028 merged, so the copy left on this branch would print it again.
The period_branch module docstring said set_input on a branch clears
nothing, which policyengine-core 3.33 changed (review r8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o the in-ma-wv-claim-of-right branch

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

Copy link
Copy Markdown
Contributor Author

Hand-off update (2026-10-14, supersedes the earlier one today): head d2a1b9e3ff merges #10038's final head 17cad4b53b (handed to the hub). Local runs at the d1c695b2f7 merge, under policyengine-core 3.33.3 (the version CI resolves): YAML 31, all passing; 17cad4b53b adds no code. The PR's own changes are unchanged since the approving review. The hub-file line is re-appended with this head.

@DTrim99

DTrim99 commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Add Indiana's, Massachusetts's and West Virginia's claim of right repayment deductions

PR #10196 (author: MaxGhenis, head d2a1b9e3ff, merge-base a2f63c1235). Stacked on #10038 (head 17cad4b53b). I reviewed its incremental diff, 17cad4b53b..d2a1b9e3ff: 15 files (+873/−13) in 7 commits (474c403aa6, eb4d8d02e9, b4bc8ae7f7, fa22039cd3, c01afd9b55, 3407bf4f96, 56c7e98f43). Its other 5 commits are merges of #10038's heads. Axiom: "IC 6-3-1-3.5(a)(22), M.G.L. c. 62 s. 3(B)(a)(14) and West Virginia's Schedule M IRC 1341 modification — not yet queued".

Summary

Indiana, Massachusetts and West Virginia each let a filer who repays income held under a claim of right take the repayment off the state base, whichever federal method applies. The model had none of the three. The PR adds:

  • Indiana: in_claim_of_right_deduction (tax unit), under IC 6-3-1-3.5(a)(22) and IT-40 Schedule 2 code 630.
    • It is the head's and spouse's repayments, of any amount, less the new person input in_claim_of_right_repayment_excluded_from_income.
    • It joins every year block of gov.states.in.tax.income.deductions.deductions.
  • Massachusetts: ma_claim_of_right_deduction (tax unit), under c. 62 § 3(B)(a)(14) and Schedule Y line 14.
    • The same formula, less the new ma_claim_of_right_repayment_excluded_from_income.
    • It joins ma_part_b_taxable_income_deductions.
  • West Virginia: wv_claim_of_right_subtraction (person), Schedule M "IRC 1341 Repayments" (line 42 in 2025).
    • Each spouse's own repayment, when the head's and spouse's total exceeds the new gov.states.wv.tax.income.subtractions.claim_of_right.threshold ($3,000 from 2017).
    • It joins gov.states.wv.tax.income.subtractions.subtractions.
  • Tests: 31 YAML cases in three variable-named files, and an explicit relief map in Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038's cross-state property test.

The state work is right:

  • The law checks out. These sources say what the code and PR body quote, at the pages given:
    • IC 6-3-1-3.5(a)(22) and the 2025 and 2018 IT-40 booklets.
    • c. 62 §§ 1–3, TIR 06-4, and the 2025 Form 1 instructions and Schedule Y.
    • The 2017, 2020, 2021 and 2025 IT-140 booklets and West Virginia's January 2026 tax expenditure study.
  • Each state's relief is independent of the federal method, and nothing double counts.
    • No federal reads. None of the new formulas reads claim_of_right_credit_applies, federal itemizing or a federal itemized amount.
    • Indiana and West Virginia start from federal AGI, which the Schedule A deduction never reduces. The base input already excludes repayments deducted above the line.
    • Massachusetts: its Part B list holds no federal itemized amount.
    • No cycle. The state withholding estimates that feed the federal SALT deduction read federal AGI only.
  • The West Virginia senior modification is handled correctly. A repayment is not income, so it doesn't shrink box (c), which matches W. Va. Code § 11-21-12(c)(9).
  • The arithmetic is right. I hand-checked all 31 YAML expectations, the PR body's five households and the cross-state rows for the three states. A run at the head reproduces every body figure.
  • The tests pass. All 27 CI checks are green. Locally these pass:
    • the 31 new cases;
    • 31 cases in eight existing files that read the edited lists;
    • the cross-state test.

Three should-fixes:

  1. The axiom line isn't valid, as on Add Arkansas's claim of right deduction (Ark. Code § 26-51-457) #10203 and Model Hawaii's claim of right deduction and credit (section 1341 as operative in Hawaii from 2022) #10200.
  2. The Indiana input's documentation describes the unemployment adjustment backwards.
  3. Nothing pins West Virginia's $3,000 from above. With the threshold set to $3,999, all 10 West Virginia cases still pass.

One suggestion follows. This branch also inherits #10038's unresolved Should 1, so it can be approved only after #10038 is fixed and this branch merges #10038's new head.

Critical (must fix)

None.

Should address

1. The axiom line isn't valid, and no rulespec-us issue covers the three provisions.

  • Where: the body's "## Axiom" section: "axiom: IC 6-3-1-3.5(a)(22), M.G.L. c. 62 s. 3(B)(a)(14) and West Virginia's Schedule M IRC 1341 modification — not yet queued. The rulespec-us pe-parity issue is drafted and held; filing waits for Max's go (decision d1459), or the US hub may file it under d1142."
  • The rule. main's CLAUDE.md, "Axiom Parity (required for policy changes)", requires one line: encoded-correct, <rulespec PR> encoded, <rulespec issue> queued or n/a: <reason>.
    • needed is reserved for external contributors.
    • A queued issue must be open, labelled pe-parity and dispatch-ready.
  • Nothing to point to yet.
  • The body's corpus notes are right. In the axiom-corpus provisions snapshot:
    • us-in/statute/6-3-1-3.5 holds the (a)(22) text.
    • us-ma/statute/62/3/block-2 holds (B)(a)(14).
    • West Virginia has statute and income maintenance manual rows only, so the IT-140 instructions need an ingest first.
    • So the Indiana and Massachusetts parts can be dispatch-ready now. Only West Virginia has a blocker.
  • Fix:
    • File a dispatch-ready pe-parity issue on the Add AMT parameters for 2020-2023 #1467 model:
      • Module paths:
        • Indiana: the (a)(22) subtraction, within or beside NYC EITC #1700's proposed us-in/statutes/6-3-1-3/5.yaml.
        • Massachusetts: (B)(a)(14), added to us-ma/statutes/62/3.yaml.
        • West Virginia: a policy module for Schedule M line 42, after the ingest.
      • Corpus citations: us-in/statute/6-3-1-3.5 and us-ma/statute/62/3/block-2. For West Virginia, record two blockers:
        • the IT-140 instructions have no corpus row;
        • the statute the expenditure study cites, § 11-21-12(c)(4), is the income tax refund modification.
      • Verbatim law: (a)(22) from HEA 1001-2021, PDF p. 117; § 3(B)(a)(14); the 2025 IT-140 line 42 instruction, PDF p. 29 (all quoted under Verified correct).
      • Required outputs:
        • the Indiana and Massachusetts deductions (Money);
        • for West Virginia, a Judgment (the head's and spouse's total exceeds $3,000) and each spouse's modification (Money).
      • Companion tests, from the sources the YAML uses:
        • Indiana Example 1: $345 with $15 excluded → $330
        • Indiana Example 2: $3,400 under the federal credit → $3,400
        • Indiana: $4,000 of repaid Social Security → 0
        • Massachusetts: $2,000 → $2,000 (DOR: "without regard to the amount paid")
        • Massachusetts: $10,000 with $2,500 untaxed → $7,500
        • West Virginia: $3,000 → 0
        • West Virginia: $3,001 → $3,001
        • West Virginia: spouses' $2,000 + $2,000 → $2,000 each
    • Then change the line to axiom: IC 6-3-1-3.5(a)(22), M.G.L. c. 62 § 3(B)(a)(14), W. Va. IT-140 Schedule M line 42 TheAxiomFoundation/rulespec-us#NNNN queued.

2. in_claim_of_right_repayment_excluded_from_income describes the unemployment adjustment backwards.

  • Where: variables/gov/states/in/tax/income/deductions/claim_of_right/in_claim_of_right_repayment_excluded_from_income.py:12-14: "... or the extra Indiana unemployment compensation deduction the earlier return would have had without the repaid amount."
  • What the booklet says. 2025 IT-40 booklet, PDF p. 23, deduction 630:

    "Note. An adjustment will need to be made if an unemployment compensation deduction was claimed on the return in the year the income was reported. To do this, reduce the amount previously reported by the amount repaid; refigure the deduction based on the reduced amount. Subtract the difference from the repayment amount to be deducted. ... Ryan claimed a $73 unemployment compensation deduction on his 2024 state tax return. He refigured the deduction based on the reduced $1,355 compensation ($1,700 minus $345), which reduced the deduction by $15."

  • Which way it runs.
    • The example. Without the repaid amount, the earlier deduction is smaller ($58), not larger. The $15 is the part of the earlier deduction that the repaid amount produced: $73 claimed − $58 refigured.
    • Always this way. The line 10 worksheet (PDF p. 19) deducts unemployment compensation less the smaller of it and half of (federal AGI − $12,000). So taking compensation out never raises the deduction.
  • Why it matters.
    • Read literally, the documentation gives zero for Example 1, so the user would deduct $345 instead of $330.
    • The code and Case 1 are right; only the guidance users read is wrong.
  • Fix: "... or the part of the earlier year's Indiana unemployment compensation deduction that the repaid amount produced: the deduction claimed minus the deduction refigured without the repaid amount (IT-40 deduction 630, Example 1: $73 − $58 = $15)."

3. West Virginia's $3,000 threshold is tested only at $3,000: no case sits just above it.

Suggestions

1. Cite DOR's statements, which settle Massachusetts's any-amount reading.

  • The body leaves it open: "For Massachusetts this is a reading: neither the statute nor the Form 1 instructions state a threshold or a federal condition ... but no example settles a repayment of $3,000 or less."
  • DOR settles it.
    • Differences Between MA and Federal Tax Law for Personal Income, "Claim of Right Deduction":

      "For federal purposes, a 'claim of right' deduction is allowed only if the amount repaid was more than $3,000. Massachusetts allows the deduction without regard to the amount paid, provided the amount was previously included in Massachusetts taxable income and the repayment is not otherwise deductible in determining Massachusetts income."

    • TIR 06-4 (April 12, 2006), which the Form 1 instructions cite for line 14.
      • It describes the federal over-$3,000 computation, then adds in footnote 2: "An equivalent provision is unnecessary in Massachusetts, as a progressive income tax structure is forbidden by Article 44 of the Massachusetts Constitution."
      • Its Example 1 deducts $5,000 of repaid wages.
  • Fix:
    • Add both pages to ma_claim_of_right_deduction.py's references (lines 16–22).
    • Replace the body's "this is a reading" sentence with DOR's.
  • The start date needs no gate.
    • The date. TIR 06-4 dates the deduction from tax years beginning on or after January 1, 2005 (Acts 2005, c. 163, § 5).
    • Why no gate. The variable has no start date, but the model can't compute Massachusetts tax that early: 2004 and 2005 runs stop on a missing federal parameter (gov.irs.gross_income).

Verified correct

  • Indiana law. Each citation shows the stated text:

    Source Content
    HEA 1001-2021, PDF p. 114 "SECTION 71. IC 6-3-1-3.5 ... (a) In the case of all individuals, 'adjusted gross income' (as defined in Section 62 of the Internal Revenue Code), modified as follows". (a)(3) subtracts $1,000 per filer, which is why in_agi subtracts exemptions.
    HEA 1001-2021, PDF p. 117 "(22) Subtract an amount as described in Section 1341(a)(2) of the Internal Revenue Code to the extent, if any, that the amount was previously included in the taxpayer's adjusted gross income for a prior taxable year."
    2025 IT-40 booklet, PDF p. 23 Deduction 630's three conditions, ending "claim the repayment as an itemized deduction, or claim a credit based on the repayment amount". Example 1: $345, although "he cannot claim miscellaneous itemized deductions for federal purposes. Regardless, he is still eligible". "While no corresponding state credit for the repayment of previously taxed income is available, a deduction based on the amount repaid is." Example 2: $3,400 with the federal credit. Repaid Social Security "is not eligible for a deduction". "Enter code 630 on Schedule 2 under line 11".
    2025 IT-40 booklet, PDF p. 19 Line 11, "Other Deductions", entered by three-digit code, and the line 10 unemployment worksheet. With p. 23, this supports the list parameter's "#page 19,23" title.
    2018 IT-40 booklet, PDF p. 23 The same deduction 630 text and examples.
  • Massachusetts law. Each citation shows the stated text:

    Source Content
    c. 62 § 3 (B)(a)(14) as the body quotes. (B)(a)(19) is the 529 deduction, so the PR's comment fix is right.
    c. 62 § 2 (d)(1): "The deductions allowable under section sixty-two and four hundred and four ... of the Code". claim_of_right_repayment already excludes repayments deducted in arriving at AGI, so condition (ii) holds.
    c. 62 § 1 (c): "the Internal Revenue Code of the United States, as amended on January 1, 2024 and in effect for the taxable year". Section 1341(a)(2) is unchanged, so the fixed date doesn't matter.
    TIR 06-4 "available for tax years beginning on or after January 1, 2005"; "the new claim of right deduction may be taken only if amounts repaid were not otherwise deductible under that subsection" (§ 2(d)(1)).
    2025 Form 1 instructions, PDF p. 21 Line 14, Claim of Right Deduction, with the unemployment example: "If you are entitled to claim this deduction, enter the amount claimed in Schedule Y, line 14. For more information, see TIR 06-4."
    2025 Schedule Y Line 14, "Claim of right deduction".
    2025 Form 1 instructions, PDF p. 11 Line 17: "If line 16 exceeds line 10, enter 0 in line 17". The excess exemption worksheet uses line 18 minus line 17. So a deduction above Part B income doesn't carry to Part A, as ma_part_b_taxable_income_before_exemption and Case 10 have it.
    2025 Form 1 instructions, PDF p. 12 The Massachusetts AGI worksheet for No Tax Status and the Limited Income Credit subtracts only "Schedule Y, lines 2 through 9b and line 10". ma_agi sums the Part A, B and C AGIs and never reads Part B deductions, so line 14 rightly leaves it alone.
  • West Virginia law. Each citation shows the stated text:

    Source Content
    2025 IT-140 booklet, PDF p. 29 Line 42: "Enter the amount of money paid back under IRC 1341. ... The amount of income repaid MUST be more than $3,000.00 to qualify. Enter the qualifying amount on Schedule M Line 42. For more information, consult IRS Publication 525." Line 47: "Box (c) Enter all income (for each spouse, if joint return) not reported on lines 35 through 48. Box (d) Add lines 29 through 34".
    2025 IT-140 booklet, PDF p. 5 Schedule M line 42, "IRC 1341 Repayments", among the decreasing modifications, with a Column A (You) and a Column B (Spouse) field.
    2025 IT-140 booklet, PDF p. 6 Line 47 box (c): "Income not included in lines 35 to 46 (NOT TO EXCEED $8000)"; box (d): "Add lines 29 through 34". Line 50 carries total subtractions to IT-140 line 3.
    2021, PDF p. 24 and 2020, PDF p. 24 Line 40, with the same text and "MUST be more than $3000.00".
    2017, PDF p. 23 "Enter the amount of long-term care insurance premiums or money paid back under IRC 1341. Mark the appropriate box." The form's line 50 (PDF p. 9) is "Check one: Long-Term Care Insurance / IRC 1341 Repayments". That carries section 1341's $3,000 floor without stating it, and the model's list starts in 2021.
    W. Va. Code § 11-21-12 No subdivision of (c) mentions section 1341. (c)(4) is "The amount of any refund or credit for overpayment of income taxes", as the body says. (c)(9): "Federal adjusted gross income in the amount of $8,000 received from any source ... to the extent includable in federal adjusted gross income", reduced only by the modifications under (c)(1), (2) and (5)–(8).
    January 2026 tax expenditure study, PDF p. 49 "DECREASING MODIFICATION FOR IRC 1341 REPAYMENTS", "STATUTE: W.Va. Code §11-21-12(c)(4)", "Amount paid back under IRC 1341 provided that the amount of income must be more than $3,000 to qualify", "$20,000 per year". PDF p. 50: "A taxpayer can take a decreasing modification for State income tax purposes on the current year's return for the amount repaid if that amount is more than $3,000."
  • The senior modification (Case 7).

    • Box (c) counts income, and a repayment is not income.
    • The statute's (c)(9) base is federal AGI, which the repayment never reduces. The only reductions it lists are (c)(1), (2) and (5)–(8).
    • So the $8,000 senior modification plus the $4,000 repayment modification is right.
    • The model's box (c) subtracts its excluded_income_sources list, which doesn't include the repayment.
  • The federal methods and (b)(3).

    • Both methods. Each state allows its relief under the deduction and the credit method:
      • Indiana, by Example 2 (the credit) and Example 1 (no federal deduction).
      • Massachusetts, because (B)(a)(14) adopts only the (a)(2) description and DOR applies it "without regard to the amount paid".
      • West Virginia, because line 42 doesn't mention the method.
    • No branch dependency. No new formula reads a federal method or itemizing variable. At the head, the cross-state household's state tax is identical with the credit method fixed, the deduction method fixed and the method derived.
    • No double count.
      • Indiana and West Virginia start from federal AGI, which the Schedule A deduction never touches.
      • claim_of_right_repayment excludes repayments deducted above the line.
      • Massachusetts's Part B list holds FICA, bank interest, rent, charity, the 529 deduction and now its own deduction, but no federal itemized total.
    • No cycle. in_withheld_income_tax, ma_withheld_income_tax and wv_withheld_income_tax, which feed the federal SALT deduction, read adjusted_gross_income_person only.
  • Threshold and aggregation.

    • Indiana and Massachusetts have no threshold. Both texts adopt section 1341(a)(2), not (a)(3), and Indiana's Example 1 deducts $345.
    • West Virginia:
      • A strict > applies to tax_unit_claim_of_right_repayment: the head's and spouse's total, without dependents. That follows Publication 525's "consider the total amount being repaid on the return".
      • Each spouse's own repayment goes in their column.
    • The exclusion inputs default to zero, and the deduction is floored at zero per person (max_(repayment - excluded, 0)).
  • Tests: hand checks (2025 rates: Indiana 3.0%; West Virginia 2.22%, 2.96%, 3.33% and 4.44% to $60,000; Massachusetts 5% with a $4,400 exemption):

    Expectation By hand
    IN case 1 345 − 15 = 330. 345 isn't over 3,000, so claim_of_right_section_1341_eligible is false.
    IN cases 2, 4 3,400 under the credit method; 10,000 under the deduction method with the standard deduction
    IN cases 3, 5, 6 4,000 − 4,000 = 0; 300 + (3,000 − 500) = 2,800, leaving out the child's 1,000; Ohio: 0
    IN case 7 40,000 − 345 − 1,000 = 38,655; 3.0% = 1,159.65
    IN cases 8–11 40,000 − 10,000 − 1,000 = 29,000; 3.0% = 870 under each method and through in_other_deductions
    MA cases 1–5 2,000 (no threshold); 10,000 under the credit; 10,000 − 2,500 = 7,500; 1,000 + 1,500 = 2,500, leaving out the child's 700; New Hampshire: 0
    MA case 6 FICA is 7.65% × 60,000 = 4,590, capped at 2,000; 2,000 + 5,000 = 7,000; 60,000 − 7,000 = 53,000; less 4,400 = 48,600
    MA cases 7–10 60,000 − 12,000 − 4,400 = 43,600 under each method. 60,000 − 62,000 is negative, so case 10 gives 0 (Form 1 line 17).
    WV cases 1–5 10,000 > 3,000; 3,000 gives 0; 10,000 under the credit; 2,000 + 2,000 = 4,000 > 3,000 gives [2,000, 2,000, 0], total 4,000; Virginia: 0
    WV case 6 40,000 − 10,000 = 30,000; less the 2,000 exemption = 28,000
    WV case 7 Senior: min(8,000, 9,000) − 0 = 8,000. Subtractions 4,000 + 8,000 = 12,000. WV AGI 9,000 − 12,000 = −3,000, so taxable income is 0.
    WV cases 8–10 28,000 under each method
    Body: Indiana Federal 1,192.50 + 12% × 12,325 = 2,671.50; with the credit, 2,671.50 − 400 = 2,271.50. Indiana: 35,600 × 3% = 1,068, against 1,170; with a 2,000 repayment, 37,000 × 3% = 1,110.
    Body: Massachusetts 51,600 × 5% = 2,580 for a 2,000 repayment. For 10,000: federal 5,071.50 − 2,200 = 2,871.50; Massachusetts 43,600 × 5% = 2,180, against 2,680.
    Body: West Virginia Federal 2,671.50 − 2,200 = 471.50. 222 + 444 + 3.33% × 3,000 = 765.90, against 1,098.90 at 38,000.
    Cross-state rows (wages 60,000, gifts 25,000) Indiana 1,770 → 1,470 (300). Massachusetts: deductions 27,000 → 37,000; 28,600 × 5% = 1,430 → 930 (500). West Virginia: 1,964.70 at 58,000 → 1,520.70 at 48,000 (444). The same under each method.

    The cases cover method independence, the joint split, a dependent's repayment, state AGI and taxable income, the senior interaction and Part B's zero floor. A state deduction has no section 1341(b)(1) refund to test. West Virginia lacks $3,001 (Should 3).

  • Code patterns.

    • All five new variables have defined_for set to their state.
    • The threshold is a parameter. Indiana and West Virginia join list parameters. Massachusetts follows the existing formula sum.
    • Labels, units and periods are set.
    • References follow the house rules: one entry per document, and the "#page 19,23" and "#page 5,29" titles are quoted, with the first page in the href.
    • The documentation change in in_other_deductions and the Massachusetts 529 comment fix are right.
  • Python coverage and cost.

    • The property test. The change adds no simulation; the cross-state test still builds three. In CI it took 14.53 s, against 14.69 s on Add Arkansas's claim of right deduction (Ark. Code § 26-51-457) #10203's run.
    • The YAML. It has no parameter overrides. In CI the files ran in light batches: Indiana and Massachusetts at 8.9 GB and 6.4 GB peak in states-shard-1, and West Virginia at 3.4 GB in states-shard-4.
  • Changelog. changelog.d/in-ma-wv-claim-of-right.added.md is top-level and typed added. It warns Indiana users about in_other_deductions.

  • No partner test file is touched.

  • Local runs (policyengine-core 3.32.29; CI uses 3.33.3), on the head tree:

    • The new YAML: 31 cases pass.
    • Existing files: 31 cases in eight files that read the edited lists pass: in_agi.yaml, in_agi_tax.yaml, the two Massachusetts Part B files, wv_529_plan_deduction.yaml and three senior modification files.
    • The cross-state test: test_states_under_each_federal_method passes (26.1 s).
    • A probe reproduces the body's five households, the cross-state rows and the boundary pairs above.
    • Microsimulation. I didn't rerun it. The body reports that claim_of_right_repayment is zero on every record, so nothing changes. That fits a new input that defaults to zero.

Cross-cutting checks

  1. Law first: verified (tables above).
    • DOR settles Massachusetts's any-amount reading (Suggestion 1).
    • West Virginia's rule has no statute; the study's (c)(4) citation is the refund modification, as the body discloses.
  2. The (a)(4)/(a)(5) choice and (b)(3): each state's relief applies under both methods. No federal amount or method is read, nothing double counts and there is no cycle.
  3. Threshold and aggregation:
    • Indiana and Massachusetts have no threshold.
    • West Virginia's strict $3,000 applies to the head's and spouse's total, with each spouse's repayment in their own column. It is untested from above (Should 3).
  4. State conformity:
    • Indiana starts from federal AGI and subtracts under its own (a)(22).
    • Massachusetts allows its own Part B deduction. The Code is fixed at January 1, 2024, which leaves section 1341(a)(2) unchanged.
    • West Virginia gives a decreasing modification from its instructions.
    • Refundability and ordering: all three are deductions, so neither arises.
    • Years: Indiana and West Virginia follow the model's list years, from 2021. Massachusetts has no start date, but the model can't compute years before its 2005 start.
  5. Inputs:
  6. "Other states" corrections: none in this PR.
  7. Tests: all 31 cases and the body's households hand-checked. West Virginia lacks a $3,001 case (Should 3).
  8. Code patterns: right.
  9. Axiom: invalid (Should 1).
  10. CI and branch: green, and the merge is clean.

Inherited from #10038

#10038's posted findings are in this branch unchanged. Fix them in #10038, then merge its new head here.

  • Should 1: California leaves the federal deduction out of CA itemized deductions.
  • Suggestions 1–5:
    • Gate NC on section 1341 eligibility.
    • Tighten the input docs and add "Federal" to a label.
    • Drop the 67(b)(9) reference.
    • Add NY IT-196 line 34 to the follow-up.
    • Fix the WI comment and the stale status.

Axiom line assessment

Invalid (Should 1).

  • Why "not yet queued" doesn't qualify. It isn't one of the allowed forms. The author is staff, so needed doesn't apply either.
  • No target yet.
    • rulespec-us has no issue for IC 6-3-1-3.5(a)(22), c. 62 § 3(B)(a)(14) or West Virginia's line 42.
    • main (172bf04e4d) has no module for them. us-ma/statutes/62/3.yaml covers only the § 3(B)(b) exemptions.
  • The corpus is ready for two of the three.
    • us-in/statute/6-3-1-3.5 and us-ma/statute/62/3/block-2 hold the verbatim text.
    • West Virginia's IT-140 instructions need an ingest.
  • The model for the fix. Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038's line rulespec-us#1657 queued is valid.

CI status

All 27 checks pass (gh pr checks 10196, run 38545529291, attempt 1, on head d2a1b9e3ff).

  • Core version. CI used policyengine-core 3.33.3.
  • The YAML cases ran, all passing:
    • "Baseline (states-shard-1)" ran in_claim_of_right_deduction.yaml (11 cases, batch 5) and ma_claim_of_right_deduction.yaml (10 cases, batch 6).
    • "Baseline (states-shard-4)" ran wv_claim_of_right_subtraction.yaml (10 cases, batch 13).
  • The property tests ran. "Rest (Python, shard-1 + variables)" ran all 47 tests in test_claim_of_right_section_1341_properties.py, including test_states_under_each_federal_method (PASSED, 14.53 s), in the remaining group (2,340 passed, 11 skipped).
  • Partner tests. The PR touches no partner test files, and the Household API Partners job passes.

Branch status

Own findings: 0 critical, 3 should, 1 suggestion. Changes are requested for this PR's three should-fixes (the axiom line, the Indiana input documentation and West Virginia's $3,001 case) and for the inherited #10038 Should 1. Approve once those are fixed, #10038 is fixed, and this branch merges #10038's new head.

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; details in the full report above. This PR's own findings are 0 critical and 3 should. (1) The axiom line "not yet queued" is not an allowed form, and no rulespec-us issue or module covers IC 6-3-1-3.5(a)(22), c. 62 § 3(B)(a)(14) or WV Schedule M line 42. Please file a dispatch-ready pe-parity issue: the IN and MA corpus rows exist, and WV needs an IT-140 ingest. (2) The documentation of in_claim_of_right_repayment_excluded_from_income describes the IT-40 unemployment adjustment backwards. Example 1's $15 is the deduction originally claimed minus the deduction refigured without the repayment ($73 − $58). (3) West Virginia's $3,000 threshold is tested only at exactly $3,000; with the threshold set to $3,999, all 10 WV cases still pass. Please add a $3,001 case. This branch also carries #10038's unresolved Should 1 (California), so approve once these are fixed, #10038 is fixed, and this branch picks up #10038's new head. The law for all three states checks out, and all 31 YAML cases and the five households in the body were hand-checked.

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.

2 participants