Repository navigation
Conversation
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>
…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>
…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>
…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>
- 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>
…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>
|
Hand-off to the US + core hub (Indiana, Massachusetts and West Virginia; state claim of right lane, session local_d0c92ac9).
|
…ht branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off update (2026-10-14): new head |
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>
…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>
|
Hand-off update (2026-10-14, supersedes the earlier one today): head |
PR Review: Add Indiana's, Massachusetts's and West Virginia's claim of right repayment deductionsPR #10196 (author: MaxGhenis, head SummaryIndiana, 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:
The state work is right:
Three should-fixes:
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 address1. The axiom line isn't valid, and no rulespec-us issue covers the three provisions.
2.
3. West Virginia's $3,000 threshold is tested only at $3,000: no case sits just above it.
Suggestions1. Cite DOR's statements, which settle Massachusetts's any-amount reading.
Verified correct
Cross-cutting checks
Inherited from #10038#10038's posted findings are in this branch unchanged. Fix them in #10038, then merge its new head here.
Axiom line assessmentInvalid (Should 1).
CI statusAll 27 checks pass (
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
left a comment
There was a problem hiding this comment.
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.
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 afterdc10cc58ceexcept the merges of #10038's heads2d36a76bca(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) and17cad4b53b(changelog and docstring), which bring in no change of this PR's. Headd2a1b9e3ff.in_claim_of_right_deduction(tax unit), with the person inputin_claim_of_right_repayment_excluded_from_income. It joins every year block ofgov.states.in.tax.income.deductions.deductions(IT-40 Schedule 2, code 630).ma_claim_of_right_deduction(tax unit), with the person inputma_claim_of_right_repayment_excluded_from_income. It joinsma_part_b_taxable_income_deductions(Schedule Y line 14).wv_claim_of_right_subtraction(person), withgov.states.wv.tax.income.subtractions.claim_of_right.threshold($3,000). It joinsgov.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):
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):
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
claim_of_right_credit_appliesor 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.excluded_income_sourceslist also removes 529 contributions, line 39, from box (c); that predates this PR and is left as it is.)in_other_deductionsno 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 inin_other_deductionsand now also entersclaim_of_right_repaymentwould 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; outputsevidence/households_*.json.main95eefa51e5; #10038dc10cc58ce; this branch56c7e98f43.mainTests
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 existingin_other_deductionsinput.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)
in_other_deductionsinput.No Python test: review r1 showed YAML exercises each of these, and the
remainingCI 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_2024atpopulace-us-2024-spm-20260909), run 2026-10-13 under the shared heavy-run lock: #10038's headdc10cc58ceagainst this branch at56c7e98f43(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_repaymentis $0 on every record (weighted sum $0), soin_claim_of_right_deduction,ma_claim_of_right_deductionandwv_claim_of_right_subtractionare $0 everywhere.income_tax,state_income_tax,household_net_income,claim_of_right_credit_appliesorin_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-parityissue is drafted and held; filing waits for Max's go (decision d1459), or the US hub may file it under d1142.us-ma/statutes/62/3.yamlencodes the exemptions but not (B)(a)(14).us-in/statute/6-3-1-3.5holds (a)(22);us-ma/statute/62/3/block-2holds (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