Skip to content

Comments

Fix TANF benefit cap across all 42 states#7435

Merged
MaxGhenis merged 1 commit intomainfrom
fix-tanf-negative-income-cap
Feb 19, 2026
Merged

Fix TANF benefit cap across all 42 states#7435
MaxGhenis merged 1 commit intomainfrom
fix-tanf-negative-income-cap

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Cap all state TANF benefit formulas to prevent negative countable income from inflating benefits above the maximum payment standard
  • Fixes NC TANF household size bare .sum() bug (summed across entire population instead of within SPM unit)
  • Adds min_(benefit, payment_standard) caps to 42 state TANF programs across both standard-named ({st}_tanf) and non-standard-named programs (AK ATAP, AR TEA, CT TFA, FL TCA, IA FIP, LA FITAP, MA TAFDC, MD TCA, MI FIP, MN MFIP, NE ADC, NH FANF, NJ WFNJ, NM Works, OH OWF, RI Works, UT FEP, VT Reach Up, WV Works, WY POWER)
  • Adds 7 YAML regression tests for negative income cap behavior

Impact

Metric Before After
Total TANF (microsim) $17.9T $32.1B
Max household TANF $12.9M $25,084
Max per-state TANF $117T (FL) $25K (CA)

The remaining gap ($32B vs ~$9B target) is a takeup issue — takes_up_tanf_if_eligible currently defaults to True for all eligible SPM units. Companion PR PolicyEngine/policyengine-us-data#542 adds a 22% TANF takeup rate to the calibration pipeline, which would bring the total to ~$5-7B pre-calibration.

Root cause

All state TANF formulas used max_(payment_standard - countable_income, 0) which correctly prevents benefits when income exceeds the payment standard, but does NOT prevent benefits from exceeding the payment standard when countable income is negative (e.g., from deductions, labor supply responses, or data issues). The fix adds min_(benefit, payment_standard) to cap the result.

Additionally, NC's nc_tanf_household_size used bare .sum() instead of spm_unit.sum(), summing eligible members across the entire population (42,874) instead of within each SPM unit.

Test plan

  • 7 new YAML tests for negative income cap (CA, PA, NY, FL, NC, MN, OH)
  • All existing TANF tests pass (IL 81, CO 26, DE 91, GA 99, NC 44, IN 49+, KS 50+)
  • Microsim max household TANF now $25K (was $12.9M)
  • Pre-takeup max per household verified at $25,084 across all states

🤖 Generated with Claude Code

…ome from inflating benefits

Fix NC TANF household size bare .sum() bug and add min_() caps to 38
state programs (AL, AK, AR, AZ, CA, CO, CT, DC, FL, HI, IA, IL, IN,
KS, LA, MA, MD, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY,
OH, OK, OR, PA, RI, SC, SD, TX, UT, VT, WV, WY).

Previously, negative countable income could produce benefits exceeding
$1M per household, inflating total TANF microsimulation from ~$9B
target to $17.9T. With this fix, max benefit per household is $25,084
(CA CalWORKs) and total TANF is ~$32B pre-takeup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxGhenis MaxGhenis force-pushed the fix-tanf-negative-income-cap branch from 7f838c8 to 23ec13f Compare February 19, 2026 05:52
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 0% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.65%. Comparing base (f073b57) to head (23ec13f).
⚠️ Report is 96 commits behind head on main.

Files with missing lines Patch % Lines
.../variables/gov/states/ca/cdss/tanf/cash/ca_tanf.py 0.00% 3 Missing ⚠️
...yengine_us/variables/gov/states/sc/tanf/sc_tanf.py 0.00% 3 Missing ⚠️
...ine_us/variables/gov/states/ak/dpa/atap/ak_atap.py 0.00% 2 Missing ⚠️
...ine_us/variables/gov/states/al/dhs/tanf/al_tanf.py 0.00% 2 Missing ⚠️
...ngine_us/variables/gov/states/ar/dhs/tea/ar_tea.py 0.00% 2 Missing ⚠️
...ine_us/variables/gov/states/az/hhs/tanf/az_tanf.py 0.00% 2 Missing ⚠️
...ne_us/variables/gov/states/co/cdhs/tanf/co_tanf.py 0.00% 2 Missing ⚠️
...ngine_us/variables/gov/states/ct/dss/tfa/ct_tfa.py 0.00% 2 Missing ⚠️
...ine_us/variables/gov/states/dc/dhs/tanf/dc_tanf.py 0.00% 2 Missing ⚠️
...gine_us/variables/gov/states/fl/dcf/tanf/fl_tca.py 0.00% 2 Missing ⚠️
... and 33 more
Additional details and impacted files
@@             Coverage Diff              @@
##              main    #7435       +/-   ##
============================================
- Coverage   100.00%   70.65%   -29.35%     
============================================
  Files            4     3877     +3873     
  Lines           76    55970    +55894     
  Branches         1      277      +276     
============================================
+ Hits            76    39547    +39471     
- Misses           0    16422    +16422     
- Partials         0        1        +1     
Flag Coverage Δ
unittests 70.65% <0.00%> (-29.35%) ⬇️

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.

@MaxGhenis MaxGhenis merged commit e42e57a into main Feb 19, 2026
19 of 23 checks passed
@MaxGhenis MaxGhenis deleted the fix-tanf-negative-income-cap branch February 19, 2026 06:54
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