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>
Illinois (35 ILCS 5/203(a)(2)(P), Schedule M line 15) and Ohio (R.C. 5747.01(A)(12), Schedule of Adjustments line 29) take the repayment off federal AGI when the federal return claims section 1341 relief: the credit, or the Schedule A deduction on a return that itemizes. A new federal variable, claim_of_right_relief_claimed, says which. Ohio excludes income that qualified for its resident or nonresident credit when received (a new person-level input). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…perty tests for Illinois and Ohio claim_of_right_relief_claimed now also requires the section 1341 threshold, as claim_of_right_credit does, so a method flag entered on a return without a qualifying repayment claims nothing. The property tests found this: with the credit method fixed as an input, a $2,000 repayment got the Illinois subtraction. The new tests check, over a grid, that each subtraction is the repayment exactly when the federal return claims relief; that an eligible return always claims relief when the earlier year's tax fell; that Illinois tax equals a simulation using the existing Schedule M input and Ohio taxable income one with wages lower by the repayment; and that neither 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>
…estating tests - oh_claim_of_right_repayment_qualified_for_credit becomes oh_claim_of_right_repayment_not_deductible. R.C. 5747.01(A)(12)(a) also requires that the item was included in Ohio AGI (not only that it did not qualify for a 5747.05 credit), and (b) bars amounts that reduce Ohio AGI on another line; the input now covers all three. - Ohio's documentation says the federal-claim condition comes from the department's IT 1040 instructions; the statute requires only that the deduction be allowable. - Illinois's subtraction notes that from 2026 the section 68 limit reduces total itemized deductions, not the claim of right deduction taken. - The property test no longer restates the formulas. Every check compares simulations: each fixed federal method against a reference built from the existing Schedule M input (Illinois) or lower wages (Ohio), the model's own choice against that reference whenever the earlier tax fell, and tax never rising. Five single-line mutants each fail it. 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>
…section 68 reading - A YAML case shows the Ohio deduction can cost a couple the joint filing credit: the 2025 instructions exclude amounts deducted on the Schedule of Adjustments from each spouse's qualifying income, and a spouse left with $400 fails the $500 test. - The Illinois comment states that reading the 2026 'itemized deduction taken' as the whole Schedule A amount is the model's reading; section 68 has no allocation rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Ohio test Review r3 of #10195: a joint Ohio return can lose the joint filing credit (YAML case 8), so the docstring states the property for the tested grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ondition 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>
… branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub (Illinois and Ohio; state claim of right lane, session local_d0c92ac9).
|
…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 |
Summary
Illinois and Ohio each let a filer take a repayment of income held under a claim of right off federal AGI when the federal return claims section 1341 relief for it: Illinois by statute, Ohio by its department's instructions (its statute says only "allowable"; Max rules on which to follow, d1464). PolicyEngine had neither rule, so in both states a repayment changed nothing. 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. Headc60ee46243.claim_of_right_relief_claimed(federal, tax unit): the return has a repayment over $3,000 and either federal tax is computed under section 1341(a)(5) (the credit) or the return itemizes and deducts the repayment under (a)(4).il_claim_of_right_subtraction(tax unit): the repayment when relief is claimed. It joinsgov.states.il.tax.income.base.subtractions(Schedule M line 15).oh_claim_of_right_deduction(person): each filer's repayment when relief is claimed, less the part (A)(12) does not allow. It joinsgov.states.oh.tax.income.deductions.deductions(Schedule of Adjustments line 29 in 2025).oh_claim_of_right_repayment_not_deductible(person input): that part: income not included in Ohio AGI when received, income that qualified then for the Ohio resident or nonresident credit (R.C. 5747.05(A) or (B)), and amounts that reduce Ohio AGI on another line.The law
35 ILCS 5/203(a)(2)(P):
86 Ill. Adm. Code 100.2465(b) says the credit branch subtracts "the amount of the repayment that would otherwise have been deductible in that taxable year". The Schedule M instructions for line 15 repeat the statute in 2017 (PDF p. 2), 2021 (p. 3) and 2025 (p. 3).
Ohio R.C. 5747.01(A)(12):
The 2025 IT 1040 instructions, line 29 (PDF p. 23) list four conditions, the last being: "In the current tax year, you claimed either (i) an itemized deduction on your federal Schedule A for the amount repaid OR (ii) a tax credit on your federal 1040 based upon the amount repaid." The same division was (A)(13) in the October 2016 version.
Design notes
claim_of_right_relief_claimedcomputes it once from 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 outputs:claim_of_right_section_1341_eligible & (claim_of_right_credit_applies | (tax_unit_itemizes & claim_of_right_deduction > 0)). It requires eligibility, asclaim_of_right_creditdoes, so a method flag entered on a return without a qualifying repayment claims nothing (the property tests found this; see Tests).state_withheld_income_tax, not computed state tax, so state income tax does not feed back into the federal choice.il_schedule_m_subtractions(an existing catch-all input) now documents that it excludes line 15.Not modeled:
claim_of_right_repaymentcovers. From 2018 they are a disallowed miscellaneous itemized deduction (26 U.S.C. 67(g), redesignated 67(h) by P.L. 119-21), so they claim no federal relief and neither state allows them. Repayments deducted in arriving at AGI (business income, for example) are outside the input. Before 2018 they were a federal miscellaneous itemized deduction; Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 leaves that deduction unmodeled, and the Illinois subtraction and Ohio deduction lists start in 2021.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.mainis95eefa51e5; #10038 isdc10cc58ce; this branch9dbf3b4015(the later commit changes only documentation and references).mainTests
YAML, each expected value computed by hand from the cited form:
gov/irs/credits/claim_of_right/claim_of_right_relief_claimed.yaml, 5 cases: credit; deduction while itemizing; deduction with the standard deduction; no qualifying repayment; a method flag without one.gov/states/il/tax/income/subtractions/il_claim_of_right_subtraction.yaml, 8 cases, including the $3,000 boundary, a joint return with a dependent, and two integration cases with the method derived (base income, taxable income and tax at 4.95%).gov/states/oh/tax/income/deductions/oh_claim_of_right_deduction.yaml, 8 cases, including the excluded-income input, a joint return with a dependent, an integration case to Ohio taxable income, and a couple whose spouse falls below the joint filing credit's $500 test ($3,500 of wages, $3,100 repaid).tests/unit/test_il_oh_claim_of_right_properties.py(the Rest job'sremaininggroup). Why Python: the federal method and the itemizing choice come from #10038's branch computations, and each check compares separate simulations, which YAML cannot. Every reference is built without the new variables, so no check restates a formula.Invariants (stated and executed over a 216-return grid: state × repayment × earlier-year decrease × wages × charity)
il_schedule_m_subtractionsinput, and Ohio taxable income equals a simulation with no repayment and wages lower by it (where wages cover it). With the deduction method fixed on a return taking the standard deduction, both equal a simulation with no repayment.Mutation check: five single-line mutants (the helper ignoring itemizing, the helper ignoring eligibility, Illinois ignoring the federal claim, Ohio only under the credit, Ohio's deduction left out of its list) each fail the suite. The first version of the test caught a real gap: the helper did not check eligibility, so a method flag entered on a $2,000 repayment got the Illinois subtraction.
The cross-state test from #10038,
test_claim_of_right_section_1341_properties.py, asserted that under the federal credit method no state's tax changes. It now has an explicit, sourced map of the states whose own relief applies under the credit method (Arkansas, Hawaii, Illinois, Indiana, Massachusetts, New Jersey, Ohio, West Virginia) and the variable that carries each. Each listed state whose variable is in the model must lower the household's tax by more than $1; every other state, North Carolina and Montana included, must be unchanged. #10196, #10198 and #10200 carry the identical commit, so they merge in any order.Local runs at
9dbf3b4015(macOS; the later commit changes only documentation and references): the three YAML files pass (5, 8 and 8 cases; 21 in one process at 3.06 GB peak); the property file passes 3 tests in 8.1 s at 1.42 GB peak (32.3 s wall with import); the cross-state per-state test passes. Details:evidence/tests.md.Cost
The new property file adds about 6 s to the
remaininggroup, measured locally (not CI); its process peaks at 1.41 GB including the model import, which the group's process already holds. It builds six simulations of 216 single-person returns and frees them at teardown. For scale, theremaininggroup onmainhad 2,151 tests, 24:05 wall clock and 12.8 GB peak (run 37926760594, as reported in #10028).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 at198ac62974(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.il-oh.2025.json).claim_of_right_repaymentis $0 on every record (weighted sum $0), soclaim_of_right_relief_claimed,il_claim_of_right_subtractionandoh_claim_of_right_deductionare $0 everywhere.income_tax,state_income_tax,household_net_income,claim_of_right_credit_appliesoril_base_income,oh_agi.The change takes effect only for households that enter a repayment; the dataset has none.
Axiom
axiom: 35 ILCS 5/203(a)(2)(P) and Ohio R.C. 5747.01(A)(12) — 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.mainhas nous-il/statutes/35/5/203module and nous-oh/statutes/5747/01module.us-il/statute/35/5/203-current/block-1holds (P);us-oh/statute/5747.01holds (A)(12) but sits in a September lock newer than the pinned releaseus-rulespec-2026-08-08-obbb-alien-snap.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-10195.md, REQUEST CHANGES) and the response (reviews/response-10195.md): the Ohio input now covers all of (A)(12)'s exclusions; Ohio's federal-claim condition is attributed to the instructions and queued for Max (d1464); the cross-state test uses an explicit map; the property test no longer restates formulas; the Ohio drop is explained; the 2026 section 68 reading is stated.Review r2 (
reviews/out-10195-r2.md, REQUEST CHANGES on wording only, no numerical defect): the summary now attributes Ohio's condition to its instructions; the cent-rounding tie, the scope of small repayments and the Illinois 2026 reading are stated; the joint filing credit case is documented and tested.Reviews r2 and r3 ran on GPT-6.1 Sol. Review r3 (
reviews/out-10195-r3.md, APPROVE) left four wording nits, now fixed. 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