Skip to content

Fix TANF asset modeling and immigration timing#7989

Open
MaxGhenis wants to merge 6 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/tanf-asset-audit
Open

Fix TANF asset modeling and immigration timing#7989
MaxGhenis wants to merge 6 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/tanf-asset-audit

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Apr 13, 2026

Summary

This PR tightens TANF baseline modeling in three areas:

  • populates cited countable-resource formulas for DC, Washington, and Montana using the asset inputs we can defensibly observe in CPS
  • fixes monthly TANF eligibility formulas that were reading annual immigration variables on the wrong period
  • models DC TANF work noncompliance as a partial cash sanction instead of an all-or-nothing eligibility veto

What changed

  • DC TANF now distinguishes applicants from enrolled recipients for work requirements:
    • dc_tanf_eligible requires work compliance for non-enrolled applicants (per DC Code § 4-205.19b), preserving the POWER routing for work-noncompliant applicants
    • enrolled recipients who fail work requirements stay eligible but receive a benefit sanction (per DC Code § 4-205.19f)
    • dc_tanf applies the sanction rate: 6% from 2017-10-01 (30% of the 20% adult portion) and 25% from 2026-10-01 (D.C. Law 26-55)
    • sanction references cite DC Code § 4-205.19f(g) and § 4-205.18(e)
  • DC, WA, and MT countable-resource formulas now use cited rules and the best available CPS inputs:
    • liquid assets are modeled directly
    • WA and MT approximate countable vehicle resources using average vehicle value (excludes one vehicle); this is an upper bound when vehicles differ in value — a highest_vehicle_value input would allow the exact rule
    • WA and MT continue to exclude non-homestead real property until we have a defensible input for it
  • Monthly TANF eligibility call sites now use period.this_year when reading annual immigration variables across the state TANF formulas touched here, plus Idaho TAFI.

Validation

  • policyengine-core test policyengine_us/tests/policy/baseline/gov/states/dc/dhs/ -c policyengine_us (170 tests pass)
  • uv run pytest -q policyengine_us/tests/core/test_dc_tanf_work_sanction.py
  • uv run ruff check $(git diff --name-only -- '*.py')

Known limitations

Remaining gap work

This PR does not solve the larger TANF eligibility miss in CPS baseline construction. That follow-up is tracked in #7988.

Current worst remaining FY2024 admin-vs-modeled average monthly recipient gaps after this patch:

  • Oregon: 0 vs 18,196
  • Kansas: 0 vs 2,933
  • Maryland: 4,852 vs 12,919
  • New York: 97,049 vs 128,335
  • New Hampshire: 4,852 vs 2,499

DC is now close enough that it no longer belongs in that blocker set:

  • DC: 4,852 vs 5,056

The remaining problem is structural, not takeup priors: TANF application-month income and assistance-unit modeling on CPS still need a deeper pass.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 92.91339% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.71%. Comparing base (3c2c641) to head (f547037).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...states/ak/dpa/atap/eligibility/ak_atap_eligible.py 0.00% 1 Missing ⚠️
...lity/ca_tanf_immigration_status_eligible_person.py 0.00% 1 Missing ⚠️
...s_child_care_immigration_status_eligible_person.py 0.00% 1 Missing ⚠️
...lity/il_tanf_immigration_status_eligible_person.py 0.00% 1 Missing ⚠️
..._financial/ma_tafdc_immigration_status_eligible.py 0.00% 1 Missing ⚠️
...states/pa/dhs/tanf/eligibility/pa_tanf_eligible.py 0.00% 1 Missing ⚠️
...ance_unit/tx_tanf_categorically_eligible_person.py 0.00% 1 Missing ⚠️
...tates/wa/dshs/tanf/eligibility/wa_tanf_eligible.py 0.00% 1 Missing ⚠️
...ates/wi/dcf/works/eligibility/wi_works_eligible.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #7989      +/-   ##
===========================================
- Coverage   100.00%   90.71%   -9.29%     
===========================================
  Files            2       85      +83     
  Lines           33     1152    +1119     
===========================================
+ Hits            33     1045    +1012     
- Misses           0      107     +107     
Flag Coverage Δ
unittests 90.71% <92.91%> (-9.29%) ⬇️

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.

- Restore work requirement as eligibility gate for non-enrolled applicants
  while enrolled recipients get a benefit sanction (per DC Code § 4-205.19b
  vs § 4-205.19f)
- Remove redundant min_() in dc_tanf benefit formula
- Update sanction references to cite DC Code sections
- Fix Idaho TAFI immigration period (period → period.this_year)
- Add bias documentation to WA/MT vehicle approximation comments
- Add enrolled sanction pathway test case

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

2 participants