Skip to content

Fix federal, Oregon, and Hawaii non-itemizer charitable deductions - #11313

Open
MaxGhenis wants to merge 7 commits into
mainfrom
or-170p-standard-deduction
Open

MaxGhenis wants to merge 7 commits into
mainfrom
or-170p-standard-deduction

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Agent-written for Max, by a Codex cloud task and Claude Code for Max Ghenis; no person has reviewed it yet.

What and why

Oregon uses the federal section 170(p) amount for eligible federal non-itemizers who take Oregon’s standard deduction in any year where charitable_deduction_for_non_itemizers is listed on gov.irs.deductions.deductions_if_not_itemizing (from 2021 onward; excluded in 2020 when the deduction sat above the line). In every year, Oregon compares its standard deduction and itemized deduction lines alone before adding eligible federal charity, and applies the statutory spouse restriction for linked separate filers: if either spouse itemizes (or cannot take the standard deduction), both spouses must itemize (or_deductions.py). Oregon itemizers claim their eligible gifts through Schedule OR-A. ORS §§ 316.012, 316.048, 316.695(1)(c)(A), (F)(i) · 2021 Publication OR-17, pages 17, 70 and 95 · 2025 Form OR-40 instructions, page 16

  • Under the reading in Oregon taxable income leaves out the charitable deduction for non-itemizers (26 U.S.C. 170(p)) in 2021 and from 2026 #11279, Oregon starts from federal taxable income under ORS 316.012(2) and 316.048. Under ORS 316.695(1), Oregon adds back the federal standard or itemized deduction and applies the Oregon deduction. Both official Oregon Legislature URLs load and were verified directly (ORS chapter 316 and Oregon Laws 2026 chapter 142 § 38). ORS chapter 316 · Oregon Laws 2026 chapter 142
  • Federal non-itemizers deduct section 170(p) under section 63(b)(4). Federal itemizers exclude that amount under section 63(d)(2). A federal itemizer who takes Oregon’s standard deduction gets zero under section 170(p). Oregon adds back their federal itemized deduction and applies its own standard deduction. 26 U.S.C. 63, 2024 edition
  • The Department of Revenue limits 2021 subtraction code 363 to federal non-itemizers. Its note for Oregon itemizers directs them to Schedule OR-A. 2021 Publication OR-17, page 70
  • Congress capped the deduction at $300, or $600 for a joint return, in 2021. P.L. 119-21 § 70424 raises those caps to $1,000 and $2,000 for tax years beginning after 2025. The federal helper counts eligible current-year cash gifts by the filer and a spouse on a joint return (retaining the missing_head fallback for headless units; the general minor-head role inference fix is in a companion PR and the two no-flag minor-filer cases land after it). The model also limits the deduction to 100% of the nonnegative federal contribution base in 2021 under the temporary election and 60% from 2026. Section 170(p) excludes the itemized floor and carryovers. 26 U.S.C. 170, 2024 edition · P.L. 119-21
  • Hawaii computes its non-itemizer amount using the applicable cash ceiling and Hawaii AGI (verified with both higher and lower Hawaii AGI cases). Overlap note: open PR Add joint federal and state itemization and correct deduction worksheets #11157 also touches hi_deductions.py and hi_itemizes.py.
  • Judgment calls:
    1. Exact ties: When Oregon standard and itemized deductions are equal, the model takes the itemized line in every year, following 2021 OR-17 p. 95 ("Use the standard deduction only if it’s larger").
    2. 2026 Oregon itemizer assumption: Pending published 2026 Form OR-40 / Publication OR-17 instructions, this PR carries forward the 2021 exclusion so a federal non-itemizer who itemizes for Oregon does not also keep the separate § 170(p) amount. The Legislative Revenue Office counted the deduction as a revenue loss through Oregon’s rolling connection to federal taxable income. LRO Report #3-25

Oregon reads tax_unit_itemizes. The joint election in #11157 sets that input in each branch. Oregon uses the federal charity calculation for gift eligibility. Its inputs cannot distinguish gifts to supporting organizations and donor-advised funds, which taxpayers exclude under section 170(p).

A caller can set tax_unit_itemizes or charitable_deduction_for_non_itemizers directly. Whenever charitable_deduction_for_non_itemizers is listed on gov.irs.deductions.deductions_if_not_itemizing (from 2021 onward), Oregon treats a negative charity override as zero and adds a positive override when a federal non-itemizer takes Oregon’s standard deduction. A reform of gov.irs.deductions.itemized.charity.non_itemizers_amount reaches Oregon in any year from 2021 onward (including a 2025 cap reform); in 2020 the deduction is above the line so a below-the-line override is ignored. Multnomah County’s Preschool for All tax reads Oregon taxable income, so the change reaches residents above the county tax’s thresholds.

Test plan

  • Pass all 11 required test files locally at head f0fa23a2b0 (434 passed, 0 failed): or_deductions.yaml (36), or_itemized_deductions.yaml (22), or_taxable_income.yaml (1), integration.yaml (9), or_multnomah_pfa_tax.yaml (12), charitable_deduction_for_non_itemizers.yaml (20), tax_unit_itemizes.yaml (12), hi_deductions.yaml (28), hi_standard_deduction.yaml (19), core/test_override_branches.py (24), code_health/test_source_conflicts.py (251).
  • Killed all three P1 mutants on or_deductions.py: reverting the federal-list year gate failed 2 cases (2025 override and 2025 cap reform), reverting pre-charity comparison failed 4 cases (F4, 2021 compare, 2021 tie, 2026 tie), and reverting the linked-spouse restriction failed 3 cases (2021, 2025, and 2026 linked pairs).
  • Passed ruff check, ruff format --check, and git diff --check; updated changelog fragment to document the linked-spouse restriction outside 2021.
Case Calculation Expected
F1 2,910 > 1,000 -> 2,910 + 1,000 $3,910
F2 2,910 > 1,000 -> 2,910 + 0 (federal itemizer) $2,910
F3 6,000 >= 2,910 -> itemized 6,000 $6,000
F4 3,500 >= 2,910 -> itemized 3,500 (compares before charity) $3,500
H1 2,910 > 625 (1,000 − 0.5% × 75,000) -> 2,910 + 1,000 $3,910
H2 5,820 > 1,250 (2,000 − 0.5% × 150,000) -> 5,820 + 2,000 $7,820
H5 2,350 > 500 before code 363 -> 2,350 + 300 $2,650
H6 4,700 > 1,000 before code 363 -> 4,700 + 600 $5,300
H7 2,835 > 1,000 -> 2,835 + 0 (baseline 2025 cap is $0) $2,835

The H5 and H6 federal itemized totals include the gift and model-estimated Oregon withholding. They total $4,412.375 and $9,287.375, below the respective federal standard deductions plus charity of $12,850 and $25,700. 2021 Form 1040 · 2021 Publication OR-17, page 142

H3 and H4 check model integration with the existing withholding-based Oregon amounts. They use the existing federal standard deductions of $16,100 and $32,200. The 12% brackets run to $50,400 and $100,800, followed by 22%. The checks use the existing Oregon standard deductions, rates and brackets, $8,750 federal-tax subtraction cap, and $263 exemption credit. Final annual-return amounts remain open (#11772). IRS Rev. Proc. 2025-32 · Oregon 2026 withholding formulas, page 6

  • H3. Federal taxable income falls from $58,900 to $57,900. Federal tax falls from $7,670 to $1,240 + $4,560 + $7,500 × 22% = $7,450. Oregon taxable income is $75,000 − $7,450 − $3,910 = $63,640. Oregon tax is $4,550 × 4.75% + $6,850 × 6.75% + $52,240 × 8.75% − $263 = $4,986.50.
  • H4. Federal tax is $2,480 + $9,120 + $15,000 × 22% = $14,900, above Oregon’s $8,750 cap. Oregon taxable income is $150,000 − $8,750 − $7,820 = $133,430. Oregon tax is $9,100 × 4.75% + $13,700 × 6.75% + $110,630 × 8.75% − $526 = $10,511.125. The 2026 kicker rate is zero.

Follow-ups

axiom: TheAxiomFoundation/rulespec-us#2977 queued

Apply the federal charitable deduction to the Oregon standard deduction when the filer takes the federal standard deduction.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8999568) to head (cf3aa34).
⚠️ Report is 376 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #11313   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           24        13   -11     
=========================================
- Hits            24        13   -11     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MaxGhenis and others added 2 commits November 30, 2026 11:40
Count the federal non-itemizer charitable deduction for the filer and a
joint spouse only, apply the 60% contribution-base ceiling from 2026, give
linked separate Oregon returns one election, add the deduction only with a
positive Oregon standard deduction, and floor a negative override at zero.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Subtract the federal charitable deduction for non-itemizers from Oregon taxable income Fix federal non-itemizer charitable deductions and apply them in Oregon Nov 30, 2026
Apply the 2021 cash ceiling and use Hawaii adjusted gross income for Hawaii's deduction. Count minor filers' own gifts and apply Oregon's 2021 deduction comparison and statutory years.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@MaxGhenis MaxGhenis changed the title Fix federal non-itemizer charitable deductions and apply them in Oregon Fix federal, Oregon, and Hawaii non-itemizer charitable deductions Dec 1, 2026
MaxGhenis and others added 2 commits December 1, 2026 06:53
policyengine_us/variables/gov/states/hi/tax/income/deductions/hi_deductions.py uses the effective Hawaii election and applies the Hawaii AGI charity limit.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…e charity, and enforce linked-spouse rule

Round 3 review fix on #11313:
- Replace hard-coded 2021/2026+ year gate in or_deductions.py with membership of charitable_deduction_for_non_itemizers in gov.irs.deductions.deductions_if_not_itemizing.
- Compare Oregon standard and itemized deductions before adding federal 170(p) charity in every year (itemized wins on exact ties per OR-17).
- Apply Oregon's zero-standard-deduction spouse restriction (ORS 316.695(1)(c)(F)(i)) to linked separate filers in all years instead of combined-dollar elections outside 2021.
- Update F4, 2025 override, PFA threshold, and Hawaii binding-ceiling regressions; update changelog fragment.

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review December 4, 2026 14:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant