Repository navigation
Take the 2020 charitable deduction for non-itemizers above the line - #10186
Merged
Merged
Conversation
CARES Act sec. 2204 added 26 U.S.C. 62(a)(22) for taxable years beginning in 2020: up to $300 ($150 married filing separately) of cash charitable contributions by an individual who does not itemize, deducted on 2020 Form 1040 line 10b in arriving at AGI. The model took it from AGI with the 2021 170(p) deduction instead. - New charitable_contributions_ald in the 2020 above-the-line list, so AGI and every MAGI built from the list (Social Security, UC exclusion, IRA and student loan worksheets, which all subtract line 10b) see it. - tax_unit_itemizes takes the itemized and standard deductions it compares from the branch with each choice in 2020, since AGI now depends on the choice. - non_itemizers_amount (170(p)) is zero in 2020. - charitable_deduction_for_non_itemizers is no longer listed among itemized deductions for 2020 and 2021, where it was added on top of the full charitable deduction once charitable_deduction stopped netting it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1040 Unit cases for each filing status cap, itemizers, noncash gifts, 2019 and 2021; integration cases worked from Form 1040 lines 9-15, the Social Security Benefits and Unemployment Compensation Exclusion worksheets, an itemization choice the deduction flips, and the 2020 and 2021 itemizers who no longer count the gifts twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…upled Taking the deduction above the line moves it into every state AGI that starts from federal AGI. States that did not adopt 62(a)(22) for 2020 add it back: - California: Schedule CA (540) Part I, Section C, line 22, column B. - Indiana: IC 6-3-1-3.5(a)(26), Information Bulletin 119 (code 120). - Kentucky: Schedule M line 5, by each spouse's share of federal AGI. - Minnesota: Schedule M1NC line 6, through M1M line 16. - North Carolina: D-400 Schedule S, Part A, line 16. - New York: IT-558 addition A-003 (recomputed federal AGI). Massachusetts Part B AGI, which subtracts the federal ALD list, disallows it (TIR 20-9, B(6)). Arizona's 2020 standard deduction increase for charitable contributions subtracts it (worksheet line 5C). charitable_contributions_ald returns 0 in years that do not list it, so these additions never reach the itemization choice outside 2020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
Michigan Treasury: for 2020 the cash contribution deduction is a deduction from AGI 'and therefore Total Household Resources as well'; for 2021 it is not. Line 30 now lists charitable_contributions_ald in 2020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeded and Hypothesis households in seven states, 2020 and 2021: the deduction is min(cash gifts, Form 1040 line 10b cap) for non-itemizers and zero otherwise; AGI is wages less it; Schedule A totals are exactly their components; the simulation's income tax is that of the chosen branch and the lower of the two; California and New York add it back and Massachusetts Part B AGI keeps it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-ald # Conflicts: # policyengine_us/variables/gov/states/ca/tax/income/ca_additions.py # policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py
- 62(a)(22) caps the 2020 deduction at $300 for every return; the 2020 Form 1040 instructions' $150 for married filing separately has no basis in the statute, which governs (PolicyEngine statute-first rule, 2026-10-19). - Count only the head's and spouse's cash gifts to 170(b)(1)(A) organizations (resolved_charitable_cash_donations_50_pct); a dependent's gifts are on the dependent's own return. New charitable_contributions_ald_person gives each filer's part, by their own gifts, for per-person AGI; Kentucky adds back that part. - Without branching (as CI runs YAML tests), the 2020 itemization choice counts what not itemizing takes off AGI with the standard deduction. - The tuition and fees MAGI subtracts line 10b (2020 Pub. 970 Worksheet 6-1 line 2). - New York: ny_recomputed_federal_agi (IT-201 line 19a) adds back IT-558 A-003; NY AGI, the IT-196 floors and limitation, and the credits read it (2020 IT-196, IT-213, IT-214, IT-216, IT-221). - Minnesota: AMT income adds back M1NC line 6 (2020 M1MT line 4); the Social Security worksheet step 8 leaves out line 10b (2020 M1M p.8). - Michigan's 2020 MI-1040CR line 30 cite is file page 28. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_itemization_branch (tools/general.py) gives the itemizing and not_itemizing branches to tax_unit_itemizes and both tax liability variables, so every caller asks for the same inputs and shares one branch. #10038 adds the same helper with a claim of right override; whichever lands second keeps that version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CVRP counts income before adjustments (Implementation Manual), so line 10b does not lower it. - Kentucky adds back each filer's part in ky_agi; ky_additions stays a pure input, so supplying it no longer drops the addback. - Minnesota: Laws 2023, ch. 1, sec. 22(c)(2) and (d)(2), retroactive for 2020, make the 62(a)(22) amount an addition and part of AMT income. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 20, 2026 04:11
- Without branching, the 2020 itemization choice compares everything each choice takes from gross income: taxable_income_deductions_if_itemizing (Schedule A, wagering losses, the QBI deduction it allows) against taxable_income_deductions_if_not_itemizing plus the AGI reduction. - New York: get_ny_recomputed_branch, a branch with the 2020 charitable deduction zeroed and the federal itemization choice kept, so the NY and NYC EITC match the federal credit recomputed with IT-201 line 19a (IT-215) and the Empire State child credit's pre-TCJA federal credit uses line 19a (IT-213 Worksheet A). - NYC household, school, child care and income tax elimination credits read ny_recomputed_federal_agi; it is no longer limited to New York units, since NYC tests set residence without the state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The New York branch sets adjusted gross income to line 19a (federal AGI as reported plus IT-558 A-003) instead of zeroing the deduction and recomputing, which also moved taxable Social Security; this also covers a supplied adjusted_gross_income. - For the Empire State child credit it keeps income tax before credits as reported (IT-213 Worksheet A lines 7-8); the EITC branch does not read it, because New York City income tax enters the federal SALT deduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IT-213 Worksheet C line 7 carries federal Schedule 8812 line 13, whose lines 12-13 use the earned income credit as reported, so the child credit's branch keeps eitc with the reported federal tax (Sol review r4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-ald # Conflicts: # policyengine_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt_taxable_income.yaml
Contributor
Author
|
Handing this PR to the US + core hub.
🤖 Generated with Claude Code |
10 tasks done
Preserve North Carolina's state-specific other additions alongside the 2020 charitable deduction add-back. Keep Minnesota's other additions in the new 2020 source list. Record the separate-filer charitable cap choice in the source-conflict backlog and clarify the NYC school credit citation.
Contributor
Author
|
US + core hub merge audit, us#10186 at
|
This was referenced Oct 22, 2026
Merged
MaxGhenis
added a commit
that referenced
this pull request
Oct 22, 2026
Main's #10186 (2020 above-the-line charitable deduction) changed North Carolina additions and the source-conflict register; the merge is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
added a commit
that referenced
this pull request
Oct 22, 2026
Main's #10186 appended two 2020/2021 charitable cases to mi_household_resources.yaml after this PR's cases; both sets are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
This was referenced Nov 2, 2026
MaxGhenis
pushed a commit
that referenced
this pull request
Nov 3, 2026
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>
MaxGhenis
pushed a commit
that referenced
this pull request
Nov 3, 2026
Main moved the files this PR edits: the 2020 non-itemizer charitable allowance left the federal itemized list (#10186), California's limitation now leaves out its FTB 3526 investment interest and Minnesota's leaves out investment interest (#10645), Kentucky subtracts second-residence interest from 2026 (#10003), Wisconsin's credit builds from named Schedule A components (#10311), Mississippi counts the miscellaneous deduction once (#10096), and the Michigan, Iowa and Pennsylvania source lists gained other subtractions and additions, military retirement and disability benefits (#10302, #10354, #10182, #10185). Each resolution keeps main's change and reapplies this PR's wagering-loss treatment on top. Wisconsin's component list already leaves out wagering losses, so its subtraction is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 3, 2026
MaxGhenis
added a commit
that referenced
this pull request
Nov 7, 2026
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sol reviews r1 to r4 addressed; Sol delta review r5 pending. Marked ready so CI runs the full suite (the host's heavy lock is reserved until 2026-10-21).
Summary
For taxable years beginning in 2020 only, CARES Act § 2204 added 26 U.S.C. § 62(a)(22) and § 62(f). They let an individual who does not itemize deduct up to $300 of cash gifts to § 170(b)(1)(A) organizations in arriving at AGI (2020 Form 1040 line 10b). The model took it below the line, with the 2021 § 170(p) deduction, so 2020 AGI was too high for non-itemizing donors. That fed through every AGI-based test, every MAGI built from the above-the-line list, and every state that starts from federal AGI.
This PR also fixes a related bug. Since 1d42fc4 (#5973),
charitable_deductionno longer nets out the non-itemizer amount, butgov.irs.deductions.itemized_deductionsstill listedcharitable_deduction_for_non_itemizersfor 2020–2021. So itemizers counted up to $300 (2020) or $300/$600 (2021) of cash gifts twice. The double count also reached the state itemized deductions built onitemized_deductions_less_saltortotal_itemized_taxable_income_deductions(DC, IA, ID, KS, KY, MD, ME, MN, MS, NE, NM, OK, OR, VA, the WI credit).Law (verified against the primary sources)
Changes
Federal
charitable_contributions_ald(TaxUnit, 2020 block ofgov.irs.ald.deductions):~tax_unit_itemizes × min(head's and spouse's cash to 170(b)(1)(A) organizations, $300). The cap isgov.irs.ald.charitable_contributions.cap, $300 in 2020 and 0 otherwise. It usesresolved_charitable_cash_donations_50_pctfrom Model full 5-tier charitable deduction limits under IRC § 170(b) #10192, summed withtax_unit_non_dep_add, so a dependent's gifts stay on the dependent's own return. It returns 0 in years that don't list it.charitable_contributions_ald_person: each filer's part, in proportion to their own gifts.above_the_line_deductions_person(Give each spouse their own above-the-line deductions in per-person AGI #9890) attributes the deduction by it.Itemization choice. In 2020 AGI depends on the choice, so
tax_unit_itemizestakes:That makes the deduction comparison choose the lower taxable income. It matters without branching, which is how CI runs the YAML tests (
update_itemization.sh), and in the tie fallback. A main-sim computation would be a cycle: AGI → ALD → choice → itemized deductions, andstandard_deduction→bonus_guaranteed_deduction→ AGI.get_itemization_branch(tools/general.py) gives all three callers the same branch. Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 adds the same helper with a claim-of-right override; whichever lands second keeps 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 version.non_itemizers_amount(§ 170(p)) is 0 in 2020.charitable_deduction_for_non_itemizersis no longer in the 2020–2021 itemized list.The tuition and fees MAGI subtracts line 10b. Every MAGI that iterates the above-the-line list now subtracts it too, as the 2020 worksheets require: SS, UC, IRA, student loan, person and Medicaid AGI.
States (2020): each line was verified from the state's own 2020 source.
ca_additions)in_add_backs)ky_additions)additions.sourcesblock); AMT income adds it back; the SS worksheet step 8 leaves it outnc_additions)ny_recomputed_federal_agi(IT-201 line 19a = federal AGI + IT-558 A-003). Read by: NY AGI; the IT-196 floors and limitation; the NY household, Empire State child, child care and real property tax credits; the disability exclusion; the NYC household, school, child care and tax-elimination credits.get_ny_recomputed_branchsets federal AGI to line 19a and keeps the federal itemization choice; for the Empire State child credit it also keeps the federal tax and EITC as reported. From it, the NY and NYC EITC take the federal credit recomputed with line 19a (IT-215), and the child credit takes its pre-TCJA federal credit (IT-213 Worksheet A keeps Form 1040 line 18 as reported; Worksheet C line 7 carries Schedule 8812 line 13, which uses the EITC as reported)Other states that start from federal AGI conformed. In CA, IN, KY, MN and NC, an audit of every other 2020 reader of federal AGI found that each uses federal AGI as reported (line 11) and so needs no change. The exceptions are fixed here: CA's CVRP counts income before adjustments, and MN's AMT and Social Security worksheet differ as above (Minnesota's retroactive Laws 2023, ch. 1, sec. 22). The audit is at
~/reviews/charitable-ald-2020/state-agi-readers.md. The research table is at~/reviews/charitable-ald-2020/state-conformity.md; rows inferred from conformity dates are labelled.Follow-ups (not in this PR; chips):
Invariants (
tests/core/test_charitable_contributions_ald_invariants.py)min(filers' cash, $300)for a non-itemizer, 0 for an itemizer, and 0 in 2021. Dependents' gifts are excluded.The tests use a seeded population and Hypothesis draws. Cost: 3 tests, 24.8 s, 2.65 GB peak RSS (local macOS, not a CI measurement).
Tests
charitable_contributions_ald.yaml: 12 cases, including $300 MFS and gifts to non-170(b)(1)(A) organizations.integration.yaml: 14 cases worked line by line from the 2020 Form 1040:ny_eitc,nyc_eitc,ny_ctc_pre_2024, the NYC household, school and child care credits,ca_additions,in_add_backs,ky_additions,mn_additions,mn_amt_taxable_income,mn_social_security_subtraction(2020 worksheet constants inline),nc_additions,ny_recomputed_federal_agi,ma_part_b_agi, the AZ increase, andmi_household_resources.Impact
No change to any year with records in the default dataset (2020 and 2021 microsimulations read every input as zero). Household examples:
Coordination
itemized_deductions.yaml: Add North Carolina's wagering losses itemized deduction from 2025 (G.S. 105-153.5(a)(2)e) #10110, Count gambling winnings in federal gross income and fix the wagering losses deduction #10070, Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 and the claim-of-right states each add an item to all three blocks, which this PR collapses into one. Whichever lands second keeps one block plus the new items.tax_unit_itemizes.pyandtools/general.py: Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 adds the sameget_itemization_branch; keep its claim-of-right version.axiom: TheAxiomFoundation/rulespec-us#1725 queued (§ 62(a)(22)/(f) for 2020 with the $300 cap for every return, and the 2021 version of § 170(p); blocked on corpus ingest TheAxiomFoundation/axiom-corpus#843)
🤖 Generated with Claude Code
CI repair (2026-10-20): Merged current main (
bda23eac4c) and reproduced the exact three-row failure with CI's branching-disabled setting. Main's comparison omitted the non-itemizer charitable deduction; removing its erroneous duplicate from Schedule A exposed this related bug. For rows 65–67, deductions of $12,699/$12,701/$12,800 beat the $12,550 standard deduction alone but lose to $12,850 including the $300 cash deduction, causing $33.22/$32.78/$11.00 excess tax. The model comparison now counts the capped charitable deduction, including the 2026 limitation path and equal-tax fallback. The invariant and its tolerances remain intact.Validation: 32 ALD Python tests and the repair YAML's 12 cases passed locally, one file per foreground process;
make formatpassed. CI confirmed all 32 ALD Python tests and all 213 cases in the full PR's 22 changed YAML files. The formerly failing Rest job is green; further Contrib checks remain in progress.