Repository navigation
Model Hawaii's claim of right deduction and credit (section 1341 as operative in Hawaii from 2022) - #10200
Model Hawaii's claim of right deduction and credit (section 1341 as operative in Hawaii from 2022)#10200MaxGhenis wants to merge 38 commits into
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>
…pending Max's ruling) Act 56 (SLH 2023) made section 1341 operative in Hawaii for taxable years beginning after December 31, 2021, and Act 35 (SLH 2026) keeps it. Hawaii tax is the lesser of the tax with a deduction for a repayment over $3,000 and the tax without it less the decrease in prior-year Hawaii tax (Form N-364), which is a refundable credit (Schedule CR line 9). Hawaii makes its own comparison with branches on hi_income_tax, independent of the federal method. Before 2022, and for repayments of $3,000 or less, a repayment is a miscellaneous itemized deduction above 2% of Hawaii AGI while Hawaii allows those (HRS 235-2.4(b); Act 35 ends that from 2026). For 2022-2025 this follows the statute: section 67(b)(9) keeps the section 1341 deduction outside the 2% floor. The 2022-2025 N-11 instructions list the items the other way round, and Form N-364 adds the repayment to Hawaii AGI when the federal deduction was taken; those readings go to Max. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Over a grid for 2021, 2025 and 2026, against simulations that fix Hawaii's method as an input: Hawaii tax is the lesser of the two methods (ties to the deduction) and the branches equal those simulations; the deduction and credit are all or nothing and never both, with no credit before 2022; Hawaii tax does not depend on the federal method, never rises with a repayment, and never rises as the repayment or the prior-year decrease grows. Four single-line mutants (ties to the credit, a floor on the section 1341 deduction, the credit left out of the refundable list, section 1341 operative from 2021) each fail. 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>
…ouncement 2026-06 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>
…anch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub (Hawaii; state claim of right lane, session local_d0c92ac9).
|
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: Model Hawaii's claim of right deduction and credit (section 1341 as operative in Hawaii from 2022)PR #10200 (author: MaxGhenis, head SummaryAct 56 of 2023 makes section 1341 operative in Hawaii for taxable years beginning after December 31, 2021. When a filer repays more than $3,000 of income Hawaii taxed in an earlier year, Hawaii tax is the lesser of two amounts, figured at Hawaii rates (Form N-364):
Before 2022, and for repayments of $3,000 or less, a repayment is a miscellaneous itemized deduction above 2% of Hawaii AGI, while Hawaii allows those (through 2025). The PR adds:
The Hawaii work is right:
One should-fix comes from main's #10202.
A second should-fix: the axiom line isn't valid, as on #10203. Five suggestions follow. 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 combined result with main's #10202 isn't stated or tested, and the body describes the old credit order.
2. The axiom line isn't valid, and no rulespec-us issue covers Hawaii's section 1341.
Suggestions1. For the d1461 ruling: the sources favor the implemented readings 1 and 2.
2. Put the cases in variable-named files and pin the final tax.
3. Drop the page from a single-page reference title.
4. Update the body's cost line.
5. (Optional) Pool the repayment with the model's other miscellaneous expenses.
Verified correct
Cross-cutting checks
Inherited from #10038#10038's posted findings are in this branch unchanged: Should 1 (California leaves the federal deduction out of CA itemized deductions) and Suggestions 1–5 (gate NC on 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 stale status). Fix them in #10038, then merge its new head here. Axiom line assessmentInvalid (Should 2).
CI statusAll 27 checks pass (
Branch status
Own findings: 0 critical, 2 should, 5 suggestions. Changes are requested for this PR's Should 1 (the combined result with #10202) and Should 2 (the axiom line), 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 2 should. (1) The combined result with main's #10202 is neither stated nor tested. The merge is clean, and on the merged tree the credit is used before nonrefundable credits, as HRS 235-91.5 requires. That only matters for 2022 (the nonrefundable Hawaii EITC): a head of household with $22,500 of wages, a $10,000 repayment and a $600 decrease gets $0 relief merged versus $600 at this head. No test reads hi_income_tax, so neither the ordering nor the (b)(1) refund is pinned. Please state the combined result and add tests. (2) The axiom line "not yet queued" is not an allowed form, and no rulespec-us issue covers HRS 235-2.3(b)(40). Please file a dispatch-ready pe-parity issue; only the floor addendum needs to wait on d1461. This branch also carries #10038's unresolved Should 1 (California), so approve once both items are fixed, #10038 is fixed, and this branch picks up #10038's new head. The Hawaii law checks out (Acts 56 and 35, HRS 235-2.4(b), N-364, Schedule CR), and all 10 YAML cases and 5 households were hand-checked.
…-claim-of-right # Conflicts: # policyengine_us/tests/unit/test_claim_of_right_section_1341_properties.py
Held for Max's ruling on the Hawaii floor and AGI add-back readings (decision d1461). Do not merge before it.
Summary
From 2022 Hawaii applies 26 U.S.C. 1341 on its own: Hawaii compares the tax with a deduction for an eligible repayment over $3,000 with the tax without that deduction less the decrease in prior-year Hawaii tax. The decrease is a refundable credit. Before 2022, and for repayments of $3,000 or less, a repayment is a miscellaneous itemized deduction above 2% of Hawaii AGI while Hawaii allows those deductions (through 2025). PolicyEngine had none of this, so a repayment changed nothing in Hawaii. This PR adds it.
Stacked on #10038 (
federal-claim-of-right-1341), whose reviewed head60cb3dd35a4f025af95cbde0deae952b48b366d6is now merged here. That parent fixes California's federal deduction carry-through and gates North Carolina relief on section 1341 eligibility. This branch also merges currentmain, including #10202's Hawaii credit ordering. Neither merge rebases the branch. The shared property-test conflict keeps this PR's state entries and the parent's removal of California fromSTATES_WITHOUT_THE_DEDUCTION.hi_claim_of_right_prior_year_tax_decrease(tax unit; Form N-364 lines 4–6) andhi_claim_of_right_repayment_excluded_from_income(person; income Hawaii did not tax when received).hi_claim_of_right_repayment,hi_claim_of_right_section_1341_eligible, andhi_claim_of_right_credit_applies, which compares final Hawaii income tax in two override branches (hi_income_tax_if_claiming_claim_of_right_credit,..._deduction), as Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 does federally and as the model already does for Virginia's and Delaware's EITC.hi_claim_of_right_deductionjoins Hawaii's itemized sources;hi_claim_of_right_creditjoins Hawaii's refundable credits from 2022.gov.states.hi.tax.income.claim_of_right.section_1341_operative(from 2022) andgov.states.hi.tax.income.deductions.itemized.miscellaneous_deductions_allowed(through 2025).Changes after review
mainand state the combined result with Apply Hawaii refundable credits before nonrefundable credits #10202 below. Added final-tax YAML cases for the 2022 nonrefundable EITC interaction, David's $22,500 household, a no-repayment baseline, a fixed-credit branch, and a 2025 section 1341(b)(1) refund.axiom:line. The issue separates the implementable comparison and credit from the floor addendum awaiting d1461.60cb3dd35ahead, including its California and North Carolina fixes, and retained both sides of the shared property-test changes.The law
Combined result with #10202
HRS 235-91.5 requires refundable credits to be used before nonrefundable credits, notwithstanding contrary credit provisions. The 2022 N-11 instructions implement this by subtracting refundable credits at line 34 and capping nonrefundable credits at the remaining adjusted tax liability. #10202 implements that order for Hawaii, and the merge puts this PR's credit into that calculation. Credit ordering no longer awaits a d1461 ruling.
For the credits currently modeled, this interaction affects only 2022: the claim of right credit begins then, and Hawaii's EITC is nonrefundable through 2022 and refundable from 2023. The method comparison reads final
hi_income_tax, so it includes any EITC displaced by the credit.For a 2022 head of household with one child aged 5, no TANF receipt, a $10,000 repayment and a $600 prior-year Hawaii decrease:
At $22,500, the fixed credit branch starts with $728 of tax and subtracts $710 of refundable credits: the $110 food/excise credit plus the $600 claim of right credit. Adjusted tax liability is $18, so the EITC is capped at $18 and final tax is zero. Without the repayment, the EITC uses the full $618 remaining after the food/excise credit, again leaving zero tax. The deduction branch also ends at zero, so the strict comparison keeps the deduction. The new tests pin the baseline, the chosen method, and the fixed-credit calculation. At the former head, before #10202, this household received $600 of additional relief; that historical result is superseded by the merged ordering.
The credit can still produce a section 1341(b)(1) refund. A 2025 single filer with $40,000 of wages, a $10,000 repayment and a $3,000 Hawaii decrease has $1,570.21 of tax before this credit and no other Hawaii credit; the credit wins and
hi_income_taxis −$1,429.79. A new final-tax case asserts that refund.The readings for Max (d1461)
The floor and N-364 AGI add-back remain held for Max's ruling. This update changes neither reading.
2022–2025 floor. This PR follows the statute: section 67(b)(9), operative through HRS 235-2.4(b), keeps the section 1341 deduction over $3,000 outside the 2% floor, while the smaller repayment remains in the floored pool. The 2022 and 2025 N-11 lists put the over-$3,000 deduction under expenses subject to the floor and the $3,000-or-less deduction outside it, reversing the federal categories.
Two source points support the implemented reading. First, HRS 235-2.5(a) makes a reference from an operative federal provision to an inoperative one inoperative too. The inference is that section 67(b)(9)'s reference to section 1341 could not exempt the larger repayment before section 1341 became operative; Act 56 removes that reason from 2022. Second, the 2017 federal Schedule A instructions put repayments of $3,000 or less on line 23 within the floor and larger repayments on line 28 outside it. Both Hawaii entries point to the repayment discussion in 2017 Publication 525, which sends wage repayments back to Schedule A and its instructions. The inference is that the N-11 categories were transposed, rather than that Hawaii intended a separate floor rule.
From 2026 the floor question disappears under the statute reading because Act 35 disallows miscellaneous deductions. Treating an otherwise qualifying over-$3,000 section 1341 deduction as miscellaneous would instead disallow it entirely.
N-364 line 2's AGI add-back. N-364 directs a filer who took the federal deduction to add the repayment to Hawaii AGI, reasoning that the deduction entered federal taxable income. But N-11 line 7 starts from federal AGI, and a Schedule A deduction does not reduce that amount. PolicyEngine's Hawaii itemized list also never includes the federal claim of right deduction. For the itemized repayments this model covers, an AGI add-back would therefore add income that was never subtracted. An add-back could matter for a repayment deducted in arriving at AGI, but
claim_of_right_repaymentexcludes those repayments. The model keeps the Hawaii deduction at zero under section 1341(a)(5) without adding the repayment to AGI.Design notes
total_misc_deductions(unreimbursed employee expenses and tax preparation fees). This PR applies the 2% floor to the repayment alone. Combining those expenses and the floored repayment into one Worksheet A-6 pool is deferred follow-up scope. Hawaii's existing itemized limitation (hi_reduced_itemized_deductions) reduces the repayment deduction as it does other nonexempt itemized deductions.claim_of_right_repayment, so their Hawaii section 1341 relief is not modeled here.Household examples (2025, single, age 40)
These examples were originally compared at historical
main95eefa51e5, #10038dc10cc58ce, and this branch612ea5e94e. The new YAML assertions also pin their final Hawaii tax on the merged branch.Tests
The original ten YAML cases are split into
hi_claim_of_right_credit_applies.yaml(four cases) andhi_claim_of_right_deduction.yaml(six cases), undergov/states/hi/tax/income/claim_of_right/. They cover each fixed Hawaii method, the $3,000 threshold, the 2% floor, 2021 before section 1341 was operative, 2026 after miscellaneous deductions end, income Hawaii never taxed, a joint return counting both spouses, each chosen method, and another state. The two chosen-method cases now also asserthi_income_tax: $1,529.86 and $4,124.26.New
hi_income_tax.yamlcases pin the combined 2022 ordering, the $22,500 no-repayment baseline and deduction tie, the fixed-credit branch's displaced EITC, and the 2025 refund described above.tests/unit/test_hi_claim_of_right_properties.pyretains its 11 property tests over a 108-return grid for each of 2021, 2025 and 2026 (repayment × Hawaii decrease × wages × charity). Separate simulations test the lesser-of comparison and each branch, deduction/credit exclusivity, independence from the federal method, no increase over no-repayment tax, and monotonicity as repayment or decrease grows. Python is needed because these checks compare independent branch simulations.The shared
tests/unit/test_claim_of_right_section_1341_properties.pyretains this PR's explicit state entries while carrying the reviewed parent's California change.Historical mutation checks made each of four single-line mutants fail the property suite: ties to the credit, a 2% floor on the section 1341 deduction, the credit omitted from the refundable list, and section 1341 operative from 2021.
Current foreground validation, run one file per process with the prescribed thread caps: macOS, Python 3.13.9, policyengine-core 3.33.2.
hi_claim_of_right_credit_applies.yaml: 4 passed;hi_claim_of_right_deduction.yaml: 6 passed; newhi_income_tax.yaml: 5 passed;test_hi_claim_of_right_properties.py: 11 passed; sharedtest_claim_of_right_section_1341_properties.py: 47 passed. No new Python property cases were added.make formatalso passes.The same five new final-tax cases at original head
a046804c7agive 4 failed, 1 passed; on the merged tree they give 5 passed. The 2025 refund already worked at the original head and is now pinned by an independent expected amount. Exact failure values (rounded here to cents) and merged expectations:Saved before/after output is in this job's untracked
hub-evidence/10200-*.log; the PR's pre-update body is saved ashub-evidence/10200-body-before.md. Historical full CI at former heada046804c7apassed all 27 checks (run 38545546945), but its merge ref predated #10202 and did not test the combined ordering.Cost
David reported about 10 seconds for the property file in CI run 38545546945 (3.76 seconds of fixture setup and 6.30 seconds of teardown). The Rest shard-1
remaininggroup ran for 14:30 wall time and peaked at 7.82 GB on a 16 GB runner, against 7.76 GB in #10038's run. These are the reviewer's reported Linux figures for the former head, not a measurement of the updated branch. Earlier local measurement was about 6 seconds and 1.88 GB peak including model import; the property fixture makes 15 simulations of 108 returns and frees them at teardown.Review history
The earlier r1, r2 and delta approvals described former heads. David's October 14 review requested the combined-order tests and a valid queued parity issue, plus the inherited parent fix. The Changes after review section records this update's response. The earlier proposal to leave credit ordering to d1461 is superseded by HRS 235-91.5 and #10202; the floor and AGI add-back remain pending.
Changing an input after calculating can leave stale results in PolicyEngine generally because core does not invalidate calculated values; this is not specific to the Hawaii branches.
Microsimulation
At this head: no change (hub, 2026-10-19). 2025, default dataset,
mainat the merge basef9b55fc4ddagainstb565542902, under the shared heavy lock.claim_of_right_repaymentis $0 on every record of both sides, and no record changes inhi_income_tax,ca_income_tax,nc_income_tax,state_income_tax,income_tax,household_net_income,household_benefits(federal income tax is $2,418,712,434,080 on both sides). The new variables (claim_of_right_credit_applies,claim_of_right_relief_claimed,claim_of_right_deduction,claim_of_right_credit,hi_claim_of_right_deduction,hi_claim_of_right_credit) exist only on the branch, so they are not compared. Comparison:~/reviews/us-hub/fixes/10200-impact/compare.2025.json. The run described next is the earlier one.Historical 2025 microsimulation (default
populace_us_2024dataset atpopulace-us-2024-spm-20260909, run October 13) compared #10038dc10cc58cewith this branchd1b8b2b124. Every record had zeroclaim_of_right_repayment, so Hawaii's deduction and credit were zero throughout and no record changed inincome_tax,state_income_tax,household_net_income,claim_of_right_credit_appliesorhi_income_tax. Driver and outputs remain in~/reviews/us-hub/claim-of-right-states/impact/. The hub's run at the current head is the paragraph above.Axiom
axiom: TheAxiomFoundation/rulespec-us#1796 queued
The former d1459 draft hold is superseded by this queued issue. Act 56 (SLH 2023) / HRS 235-2.3(b)(40) is queued for the Hawaii section 1341 comparison and refundable credit. The 2022–2025 floor placement under HRS 235-2.4(b) is a separate addendum awaiting Max's d1461 ruling; it does not block dispatch of the comparison and credit. rulespec-us still pins Hawaii's conformity at December 31, 2024 and defers itemized deductions (
us-hi/policies/income_tax/resident_core_liability_pipeline.yaml); the parity issue records that existing scope and confirms the pinned corpus contains the section 1341 exception.🤖 Generated with Claude Code