Skip to content

Split charitable deduction AGI cap by organization type#7447

Open
MaxGhenis wants to merge 2 commits intoPolicyEngine:mainfrom
MaxGhenis:pr/charitable-deduction-split
Open

Split charitable deduction AGI cap by organization type#7447
MaxGhenis wants to merge 2 commits intoPolicyEngine:mainfrom
MaxGhenis:pr/charitable-deduction-split

Conversation

@MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Feb 23, 2026

Summary

  • Splits the non-cash charitable deduction AGI cap by organization type per 26 USC 170(b)(1)
  • Adds new input variable charitable_non_cash_donations_non_50_pct_orgs (defaults to 0 for backward compatibility)
  • Adds parameter ceiling/non_cash_to_non_50_pct_org.yaml = 0.3 (30% AGI cap)
  • Updates charitable_deduction.py to apply separate caps per org type, including proper interaction with OBBBA floor logic (2026+)
  • 5 new test cases, all 15 tests passing
  • Fixes pre-existing incorrect test comments (non_cash ceiling is 0.5, not 0.3)

Known simplifications (documented with TODOs)

26 USC 170(b)(1) defines 4 contribution categories with separate AGI caps:

  1. (G) Cash to 50% limit orgs: 60% AGI (post-TCJA) -- modeled via ceiling.all
  2. (B) Cash to non-50% limit orgs: 30% AGI -- not yet split from Basic prototype #1
  3. (C) Capital gain property to 50% limit orgs: 30% AGI (or 50% with basis-reduction election) -- modeled at 50% (the election)
  4. (D) Capital gain property to non-50% limit orgs: 20% AGI -- modeled at 30% using the general (B) limit

These simplifications are acceptable because:

  • Microdata (CPS/PUF) doesn't distinguish these categories
  • The 50%/30% split is the most impactful distinction
  • The variable defaults to 0, preserving backward compatibility

Test plan

  • All 10 existing charitable deduction tests pass unchanged
  • 5 new tests cover: 30% cap binding, mixed org types, overall ceiling binding, 30% cap alone, floor+split interaction
  • CI passes

Closes #6418

Generated with Claude Code

Implements 26 USC 170(b)(1)(A)-(B) distinction for non-cash charitable
donations. Non-cash donations to 50-percent limit organizations (churches,
hospitals, educational institutions, etc.) remain capped at 50% of AGI,
while donations to other organizations (e.g., private foundations) are
now correctly capped at 30% of AGI.

Adds:
- New input variable: charitable_non_cash_donations_to_non_50_percent_limit_orgs
- New parameter: ceiling/non_cash_to_non_50_pct_org (30% cap)
- Updated formula with separate caps per org type
- 5 new test cases covering the split behavior

Fixes PolicyEngine#6418

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (182c387) to head (4ac84f6).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7447   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           25        40   +15     
  Branches         0         1    +1     
=========================================
+ Hits            25        40   +15     
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 Sentry.
📢 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.

- Rename charitable_non_cash_donations_to_non_50_percent_limit_orgs
  to charitable_non_cash_donations_non_50_pct_orgs (shorter name)
- Add TODO comments documenting the full 4-category structure under
  26 USC 170(b)(1): cash 60%/30%, non-cash 50%/30% (or 20% for
  capital gain property to non-50% orgs per 170(b)(1)(D))
- Add notes that current 50% cap models the basis-reduction election
  under 170(b)(1)(C)(iii), and 30% cap uses the general limit from
  170(b)(1)(B) rather than the stricter 20% from 170(b)(1)(D)
- Fix pre-existing incorrect test comments (non_cash ceiling is 0.5,
  not 0.3)
- Update parameter YAML with dual references to (B) and (D)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Charitable deduction split

1 participant