Repository navigation
Add North Carolina's claim of right repayment itemized deduction (G.S. 105-153.5(a)(2)d) - #10028
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>
|
Context from the session that opened this PR, for the US + core hub, which now owns it. I will not push to this branch. Reviews (GPT-6.1 Sol via Subfleet). Files are in
Evidence is in
Known gaps, documented in the variable and the body:
Follow-ups:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10028 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 3 -1
Lines 76 56 -20
Branches 2 2
=========================================
- Hits 76 56 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
US + core hub merge audit, us#10028 at
|
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>
…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>
…41) and North Carolina's rules that depend on it (#10038) * Add North Carolina's claim of right repayment itemized deduction 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> * From 2026 limit North Carolina's claim of right deduction to income NC 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> * Model the section 1341 claim of right deduction and credit; wire North Carolina's 1341(a)(5) bar and G.S. 105-266.2 payment (WIP) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the federal claim of right deduction and credit out of state rules that exclude them (AZ, KS, WI, MO, OR, VA); property tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Document the unmodeled pre-2018 small repayment deduction; changelog fragment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix the federal method in the North Carolina worksheet property test to keep it at two seconds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove a stray empty log file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review: isolate the method branches, compare to the cent, return-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> * Keep the simulation's claim of right method in the itemizing branches 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> * Merge main into North Carolina claim of right deduction * Merge PR 10028's branch (with main) into the section 1341 branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restore conservative branch invalidation; fix the method in itemizing 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> * Merge main into the section 1341 branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test both NC contrib credits stacked on the claim of right payment with use tax Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into the section 1341 branch 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> * Carry the claim of right deduction into Montana itemized deductions from 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> * Merge main into the section 1341 branch 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> * Give every itemizing branch the simulation's claim of right method 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> * Drop #10028's merged changelog fragment; date period_branch's set_input 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> * Clarify federal claim of right input documentation * Keep claim of right threshold references specific to its value * Explain Wisconsin claim of right worksheet interpretation * Carry the federal claim of right deduction into California itemized deductions * Require section 1341 eligibility for North Carolina repayment relief * Merge remote-tracking branch 'gh/main' into federal-claim-of-right-1341 * Align NC refundable claim-of-right accounting with state tax invariants * Apply statute-first claim-of-right treatment in AL MO OR WI and VA * Complete Montana repayment deductions and federal taxable income base * Preserve Alabama federal deduction credit treatment before 2021 * Document Alabama credit-list verification boundary * Correct entities in Montana repayment regression fixtures * Remove duplicate household inputs from Montana fixtures * Merge remote-tracking branch 'gh/main' into federal-claim-of-right-1341 * Fix Montana state-tax adjustment before taxable-income floor * Correct tax-unit inputs in Montana property test * Merge main into federal-claim-of-right-1341 Merge upstream main at 86d3ae6. Keep California's federal section 1341 deduction carryover and $11,000 regression alongside main's mortgage insurance premium exclusion cases. Keep Wisconsin's repayment in the itemized deduction credit base under Wis. Stat. 71.07(5)(a)6-7, while excluding federally deductible mortgage insurance premiums as introduced by upstream commit 7545b2c (#10003). Preserve both sets of references and regression cases without changing either parent's expected values. * Merge main into federal-claim-of-right-1341 Preserve the 2020 above-the-line charitable deduction and 2021 non-itemizer treatment while retaining section 1341 method-aware itemization branches. Keep the single Schedule A parameter block with the claim-of-right deduction. Add six hand-calculated 2020/2021 regressions combining charitable deductions and both section 1341 methods, including comparisons with itemization branching disabled. * Merge current main into federal-claim-of-right-1341 * Merge main into federal-claim-of-right-1341 Conflicts resolved: - Wisconsin itemized deduction credit: keep main's explicit Schedule 1 component list (#10311) and add claim_of_right_deduction to it, so the section 1341 repayment stays in the credit base as this PR intends under Wis. Stat. 71.07(5)(a)6-7. - Alabama and Wisconsin YAML tests: keep both sides' cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Montana: add the state-income-tax addback after the line 3 floor from 2025 The 2024 Form 2 Worksheet A reduces the federal deduction by the capped state-income-tax addback before line 3's zero floor. The 2025 form stops adjusting line 2 and reports the addback on Schedule I line 4, a Montana addition after the floor, as MCA 15-30-2120(1) treats the (2)(j) item alongside the other additions. A new boolean parameter is true in 2024 and false from 2025 (2026 follows the 2025 form by convention), and both mt_taxable_income_joint and mt_federal_deductions read it. Adds 2025 and 2026 YAML witnesses (the review's AGI 10,000 / itemized 20,000 household gives 4,250 in 2025), keeps the 2024 pre-floor witnesses, limits the property test to 2024, and points the misc_deductions comment at mt_taxable_income_joint, which is what reads the federal base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Alabama: apply the regulation's payment-credit list from 2015 Ala. Admin. Code r. 810-3-15-.20(1)(d)2 subtracts all credits shown as payments on the federal return, and its current text dates from a 2010 amendment, so it governs every year the parameter covers, not only 2021 on. The legacy pre-2021 list (total AOC, no section 1341 credit or net PTC) is dropped, and the 2020 case that pinned it now expects 5,000 - 1,000 - 1,500 - 1,000 - 750 = 750. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update the four source-conflict candidates this PR resolves main's backlog still described the code before this PR: AL, MO and WI as following the worksheets and OR as unknown. The head follows the statute or regulation in all four, so set pe_us.follows to statute and state to ruled, replace the notes that said a model change was still needed, start AL's years in 2015 (the corrected credit list now applies from the parameter's first year), and cite ORS 316.685(1)(b), the EITC-only disregard the OR code follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Replace two dead Montana references The 2017 Montana Form 2 with Legal References now 404s at its original address; cite the Wayback Machine copy of 2024-01-07, whose PDF p. 6 Schedule III lines 25, 26 and 28 the reviewer confirmed. Drop the "2023 HB 109" reference: its URL mixes HB0199 and HB0109, returns 404, and what it was meant to support could not be confirmed; MCA 15-30-2120 is already cited for the deduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Rebuild the Missouri and Oregon section 1341 witnesses from a repayment Both cases set claim_of_right_credit as an input that neither formula reads, so they only checked that income_tax passes through. They now use the federal integration case 4 household (2025, $40,000 wages, $10,000 repayment, $2,200 prior-year decrease), where the credit method wins and flows through income_tax: 2,671.50 - 2,200 = 471.50. Missouri deducts 25% x 471.50 = 117.875 and Oregon subtracts 471.50. Adding the credit back in either formula fails its case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Run the section 1341 property grid in 2020 too main's #10186 made the 2020 itemization choice compare two branches with different AGI (the 2020 above-the-line charitable deduction), and no invariant in this file ran on that path. Add 2020 to YEARS (last, so the tests that read YEARS[0] and YEARS[1] keep 2025 and 2026) and run the calculation-order test in 2020 as well. Every existing assertion is kept; all 58 tests pass. Locally the file went from 182 s to 220 s and its peak RSS from 3.2 GB to 3.5 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Changelog: state the Montana and Alabama scope for every filer The claim-of-right fragment described the Montana work as repayment treatment, but from 2024 every Montana filer's taxable income now starts from the federal base (all six mt_taxable_income_joint cases changed), and every Alabama AOC claimant now subtracts only the refundable part. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge remote-tracking branch 'origin/main' into federal-claim-of-right-1341 * Pin Montana's QBI add-back before the zero floor with a reachable 2026 case The old 2025 case supplied a positive QBI deduction at a binding floor, which the model can't produce before 2026. From 2026 the 199A(i) $400 minimum can exceed taxable income, so a derived household now pins the order: MCA 15-30-2101(22) and 15-30-2120(2)(i) add the deduction back to federal taxable income before Form 2's line 7 floor, giving 0, not 400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pin aca_ptc to 0 in Oregon's section 1341 witness Once #10093 nets the premium tax credit in Oregon's subtraction, this household's modeled credit would zero the subtraction. Pinning it keeps the case isolating the section 1341 credit at 471.50. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop the unreachable 2025 branches from the Montana property test YEARS is (2024,), so the Schedule 1-A draw and the year >= 2025 branches never ran; YAML cases cover 2025 and 2026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Document mt_federal_deductions as display-only mt_taxable_income_joint computes its own deduction term from taxable_income_deductions, which also holds the QBI deduction and the Schedule 1-A deductions, so the two differ (e.g. 15,750 against 21,750 in the 2025 tip case) and the formula can't read this variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Start the Alabama credit-list item at 2018, the first worksheet compared The code applies the regulation's list from 2015, but worksheets before 2018 went unchecked, so the item can't claim a conflict for 2015-2017. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Explain Montana's QBI add-back order from Form 2, not section 63 The comment argued from federal taxable income having no floor, which would also remove the line 3 floor the code keeps for Montana's other additions. The order follows the form: line 2 leaves the QBI deduction out, and line 3 floors line 1 minus line 2 at zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main Main removed gov.household.household_refundable_credits and gov.household.household_tax_before_refundable_credits, which no formula read after it dropped the abolish-tax structural reforms. This branch had added North Carolina to both. The merge keeps the removal; this branch's North Carolina entries stay in gov.household.household_refundable_state_credits and the gov.states.household lists. Main's new North Carolina use tax case under the payroll tax repeal enters nc_income_tax, which this branch's state list no longer reads: the list now counts North Carolina tax before refundable credits. The case now enters nc_income_tax_before_refundable_credits, and its totals stay at 1,020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 #10094 also adds an entry to source_conflicts/candidates.yaml. Git merges the two cleanly, and the merged register keeps unique ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
North Carolina itemizers may deduct repayments of income that they included in AGI in an earlier year under a claim of right (Form D-400 Schedule A line 8). PolicyEngine had no input for these repayments and left the deduction out. This PR adds:
claim_of_right_repayment, a person-level input: the amount repaid this year of income included in AGI in an earlier year because it appeared the person had an unrestricted right to it (26 U.S.C. 1341), excluding repayments deducted in arriving at AGI;nc_claim_of_right_repayment_excluded_from_income, a person-level input used from 2026: the part of that repayment North Carolina deducted from AGI when it was received, such as repaid Social Security benefits;nc_claim_of_right_deduction, North Carolina's deduction under G.S. 105-153.5(a)(2)d;gov.states.nc.tax.income.deductions.itemized.other_sources, a parameter list of the itemized items outside the $20,000 mortgage and property tax cap (charitable, medical, and now claim of right). It replaces a hard-coded list innc_itemized_deductions, preserving the existing charitable and medical sources and adding the default-zero repayment deduction. Historical microdata comparisons showed no change; impact at the final merged head remains pending for the hub.The law
N.C. Gen. Stat. § 105-153.5(a)(2)d, added by S.L. 2016-5 § 2.1.(a) for taxable years beginning on or after January 1, 2014 (§ 2.1.(d)):
S.L. 2026-31 § 1.8 (PDF pp. 5–6, approved July 2, 2026) rewrites the first sentence for taxable years beginning on or after January 1, 2026: "an amount included in adjusted gross
incomeincome, as modified in G.S. 105-153.5 and G.S. 105-153.6, in an earlier taxable year". The statute page on ncleg.gov did not yet show this on October 9, 2026.NCDOR's Repayment of Claim of Right Worksheet, 2025 Form D-401 instructions, PDF p. 20 (the same on PDF p. 20 for 2021 through 2024), for repayments of $3,000 or less: line 3 is 2% of federal AGI ("If negative, enter the number zero"), and line 4, the deduction, is line 1 minus line 3.
Term (ii) is read from the 2016 worksheet (PDF p. 13), the first year NCDOR printed one. Other miscellaneous itemized deductions absorb the 2% floor first: line 5 = 2% of AGI − the other federal miscellaneous deductions (not below zero), and line 6 = repayment − line 5 (not below zero). Section 67(g) disallows those other deductions from 2018. That is why the 2018-and-later worksheet subtracts the whole floor. The formula encodes the statute, so it reproduces both worksheets: it subtracts the head's and spouse's miscellaneous expenses only while
gov.irs.deductions.itemized.misc.appliesis true.Design notes
Historical household comparisons (2025, North Carolina, single)
The earlier
mainand claim-branch runs are saved in~/reviews/us-hub/nc-itemized-other/evidence/households_{main,claim}.json(scripthouseholds.pythere). These are prior-run examples, rather than measurements repeated at the final merged head.mainNC income taxTests
Current tested head:
81528e0207591db0a453552cfba4d8c1c12a43c6. The first three YAML files ran individually, and the remaining six ran in one permitted baseline batch; the repeated standalone standard-deduction run is counted once. Python test files ran individually, all in the foreground. The lightweight untracked wrapper completes each test module, session and fixture teardown, then skips interpreter finalization. The six-file YAML batch reported 23 passed; its outer/usr/bin/time -lexited 1 afterward because the sandbox deniedsysctl kern.clockrateduring timing-resource reporting.The incomplete
test_parameter_yaml_keys.pyattempts are preserved and excluded from pass counts: the initial pytest 9 attempt stopped with a Python segmentation fault (exit 139); a shared-startup retry was interrupted (exit 130); an isolated importlib retry was interrupted before assertions (exit 2); and a default-import-mode retry with a conftest cutoff stopped after partial progress (exit 2). None produced a complete test result. The fatal traceback references pytest capture and logging; the crash cause remains unconfirmed. The completed code-health runs used workspace-local pytest 8.4.2, matching the lock, with the existing shared policyengine-core 3.32.15 dependencies, defaultprependimport mode,--confcutdir=policyengine_us/tests/code_health, unbuffered and uncaptured output (-u -s), and no custom periodic traceback thread. These environment and invocation changes do not establish the crash cause. Version evidence is saved inhub-evidence/pytest-env-versions.log; the completed results are reported below.The
test_rest_python_groups.pyinvocation additionally setPYTEST_DISABLE_PLUGIN_AUTOLOAD=1, inherited by its child collectors; pytest built-in and module-local fixtures remain available. Its children only collect placeholders with--collect-only --noconftest: they neither import the collected test modules nor execute their cases. The guard checksmake -noutput and uses a stub pytest command with synthetic success, failure and kill outcomes to test group orchestration. Its workflow checks read YAML; it runs no Rest groups, SPM tests or microsimulations.nc_claim_of_right_deduction.yamlnc_itemized_deductions.yamlnc_standard_or_itemized_deductions.yamlnc_standard_deduction.yamlnc_income_tax.yamlnc_income_tax_before_refundable_credits.yamlwagering_losses_deduction.yamltaxable_income_deductions_if_itemizing.yamlar_gambling_loss_deduction.yamltest_nc_claim_of_right_properties.pytest_parameter_yaml_keys.pytest_reference_urls.pytest_no_concatenated_reference_urls.pytest_rest_python_groups.pyYAML total: 45 passed across nine unique files. The six-file batch accounts for 23 passing cases in 62.04 s of pytest time; the repeated standalone standard-deduction run adds no cases to this total.
Python total: 133 passed across five files (property 7, parameter keys 34, reference URLs 32, no-concatenated URLs 48, Rest groups 12). Together with 45 YAML cases across nine files, 178 current-head cases passed across all fourteen targeted files.
Partner contract tests were neither run nor edited. Static inspection of the 144 partner YAML files found neither new repayment input, and no partner movement attributable to this PR was identified.
Standalone
test_parameter_yaml_keys.py: 34 passed in 3,169.53 s of pytest time; 3,267.67 s from wrapper start through module completion; 285,949,952 bytes maximum RSS; module exit status 0. This is a local sandbox measurement. Evidence:hub-evidence/pytest_parameter_yaml_keys.pytest8.{log,metrics.json}.Standalone
test_reference_urls.py: 32 passed in 2,491.45 s of pytest time; 2,594.51 s from wrapper start through module completion; 753,172,480 bytes maximum RSS; module exit status 0. Evidence:hub-evidence/pytest_reference_urls.{log,metrics.json}.Standalone
test_no_concatenated_reference_urls.py: 48 passed in 1,149.98 s of pytest time; 1,181.61 s from wrapper start through module completion; 60,555,264 bytes maximum RSS; module exit status 0. Evidence:hub-evidence/pytest_no_concatenated_reference_urls.{log,metrics.json}.Standalone
test_rest_python_groups.py: 12 passed in 1,872.34 s of pytest time; 1,909.60 s from wrapper start through module completion; 40,943,616 bytes maximum RSS; module exit status 0. Evidence:hub-evidence/pytest_rest_python_groups.{log,metrics.json}.nc_claim_of_right_deduction.yaml, 17 cases from the worksheets and the statute:nc_income_taxintegration case.test_nc_claim_of_right_properties.py, intests/unit(the Rest job'sremainingPython group). It runs a 720-point grid (repayment × AGI × other miscellaneous expenses × charity × property tax), one vectorized simulation each for 2016 and 2025, and a 240-point 2026 grid. The Python file compares the model with independent line-by-line implementations of the 2016 and 2025 worksheets over these finite grids. It also checks bounds, monotonicity, additivity outside the cap, and tax direction across grid points, including the standard-deduction crossover. The worksheet comparisons follow the worksheets' line structure.Invariants checked over the finite grids
Current property-test cost
Standalone
test_nc_claim_of_right_properties.py: 7 passed in 9.14 s of pytest time; 298.33 s from wrapper start through module completion, including startup; 975,110,144 bytes maximum RSS, measured with Darwinresource.getrusage; module exit status 0. The long startup reflected slow sandbox filesystem access. This local run is not a CI cost estimate. Metrics are saved inhub-evidence/pytest_property.metrics.json, with the pytest summary inhub-evidence/pytest_property.log.Historical test and cost evidence
The following measurements predate this merge and are retained as context:
remaininggroup on main (run 37926760594) collected 2,151 tests, including 11 skipped: 1,315.161 s of test time, 24:05.67 wall clock, 12,816,372 kB maximum RSS on the 16 GB runner.test_ar_gambling_properties.pyaccounted for 32 cases and 4.636 s in that CI group.Prior locked runs (
~/reviews/us-hub/nc-itemized-other/evidence/):mainff479aa74a: the NC and gambling YAML files, 28 passed.3b57231636, YAML:nc_claim_of_right_deduction.yamlplus those files, 45 passed in 9.24 s.test_nc_claim_of_right_properties.pyplus four parameter, reference and Rest-group code-health files, 133 passed in 29.84 s; 49.11 s wall clock and 1,244,741,632-byte maximum RSS for the combined run. These are combined-run measurements.Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
35f3c1f92aagainst this PR's head81528e0207, for 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.nc_itemized_deductionsnc_income_taxstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsVariables this PR adds (
nc_claim_of_right_deduction) have no value on the base side, so the table leaves them out.Comparison files are in
fixes/10028-impact/on the hub host.Historical microsimulation evidence
The prior body and evidence logs attribute four real microsimulation runs on the default dataset (
hf://datasets/policyengine/populace-us/populace_us_2024.h5@populace-us-2024-spm-20260909, 79,729 tax units):mainff479aa74aand this branch3b57231636, for 2025 and 2026. They ran one at a time under the shared lock (~/reviews/pe-us-merge-backlog-2026-10-02/impact/lockrun.sh). Record-by-record comparisons are in~/reviews/us-hub/nc-itemized-other/evidence/impact-ncit-c-{2025,2026}.json. The saved run JSONs and run logs do not record commit SHAs; attribution toff479aa74aand3b57231636comes from the prior PR body, evidence summary, and r3 review. These results are historical evidence and do not replace the hub's impact run at the current head.mainstate_income_tax,nc_income_tax,nc_taxable_income,nc_itemized_deductions,nc_standard_or_itemized_deductions,household_net_income)Those historical comparisons show no change because the dataset has no claim-of-right repayments.
claim_of_right_repaymentandnc_claim_of_right_deductionare zero on every record. The change matters for households that report a repayment, as in the table above. The parameter-list refactor changed no record in those historical runs.Axiom
axiom: TheAxiomFoundation/rulespec-us#1656 queued
RuleSpec parity issue #1656 was filed by MaxGhenis on October 11, 2026 at 14:05:53 UTC with the
pe-paritylabel. It covers the claim-of-right repayment deduction in G.S. 105-153.5(a)(2)d and the wagering-loss deduction in (a)(2)e, including their dated amendments, prerequisites and companion cases. It was filed from the existing draft at~/reviews/us-hub/nc-itemized-other/axiom/nc-105-153.5-a2-d-e-issue.md. Encoding remains pending. The hub corrected the issue's status line to "queued" on 2026-10-11.The draft records the prior RuleSpec/corpus checks:
main207486d8b5,us-nc/statutes/105/105-153.5/a.yamlisstatus: deferred: it encodes the $3,000 threshold and leaves#deduction_amountdeferred.Follow-ups (not in this PR)
The PR remains a draft. The hub owns the confirmation review at the pushed head, marking ready, CI, landing, and re-stacking #10038 afterward.
nc-wagering-losses-deduction, stacked on this one. It awaits its federal prerequisites and hub review. It cannot land before Federal gross income omits gambling winnings but still deducts wagering losses; OBBBA 90% wagering loss limit (2026+) not modeled #9637 is fully fixed:Guards on that branch fail until all three are fixed.
🤖 Generated with Claude Code