Wire up all 51 state TANF programs, fix childcare cycle artifact, add takeup#7401
Open
Wire up all 51 state TANF programs, fix childcare cycle artifact, add takeup#7401
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7401 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 31 19 -12
Lines 408 342 -66
Branches 1 5 +4
=========================================
- Hits 408 342 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
57676e9 to
ffd5636
Compare
Collaborator
|
11 additional state TANF programs exist in the codebase but are not included in
This would bring the total from 39 to 50 (all states + DC except Montana, which is still in PR). |
…-circuit
- Add `takes_up_tanf_if_eligible` variable (bool, SPMUnit, default True)
- Wire all 39 implemented state TANF programs into tanf.py:
26 with standard naming ({st}_tanf) and 13 with program-specific
names (ak_atap, ct_tfa, fl_tca, ia_fip, md_tca, mi_fip, mn_mfip,
nj_wfnj, nm_works, ri_works, vt_reach_up, wi_works, wv_works)
- Apply takeup in TANF formula: value * takes_up
- Remove tanf_reported short-circuit that blocked reform microsimulations
- Update tests for new behavior
Companion to PolicyEngine/policyengine-us-data#536 which adds
state-level TANF takeup rates to microdata construction.
Closes #7400
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FL TCA's payment standard depends on housing_cost, which cycles back through rent → housing_assistance → hud_annual_income → tanf. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FL TCA payment standard now uses pre_subsidy_rent instead of housing_cost, avoiding the cycle: tanf -> fl_tca -> housing_cost -> rent -> housing_assistance -> hud_annual_income -> tanf. This is more accurate: TANF agencies assess shelter obligation based on what applicants owe, not the net amount after housing subsidies from a separate agency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All FL TCA tests now use pre_subsidy_rent instead of rent/housing_cost, matching the formula change in fl_tca_payment_standard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same pattern as FL TCA fix: use pre_subsidy_rent + other housing components instead of housing_cost to break the cycle tanf -> az_tanf -> housing_cost -> rent -> housing_assistance -> hud_annual_income -> tanf. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The baseline test used FL because it had no TANF implementation, but now that fl_tca is wired up, this household receives TANF. Set takes_up_tanf_if_eligible to false since this test is about ECPA, not TANF. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MI household resources includes tanf. Now that mi_fip is wired up, this family receives TANF which increases their household resources and changes the home heating credit. Suppress TANF since this test is about the home heating credit, not TANF. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rams Changed 22 state TANF childcare deduction formulas to use spm_unit_pre_subsidy_childcare_expenses instead of childcare_expenses, breaking the cycle: TANF → childcare_expenses → childcare subsidies → SNAP → tanf. Also fixed VT Reach Up housing allowance to use pre_subsidy_rent instead of housing_cost, breaking the same type of cycle as FL TCA and AZ TANF. States affected (childcare): AL, AK, AZ, DC, DE, GA, HI, IL, KY, MD, ME, MN, MO, NH, NM, OK, RI, TN, TX, VA, VT, WV States affected (housing): VT Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…NH broadcast - Add ky_ktap, mt_tanf, nh_fanf, tn_ff to STATE_TANF_VARIABLES (39 → 43) - Fix MT TANF childcare deduction to use spm_unit_pre_subsidy_childcare_expenses - Fix NH FANF childcare deduction entity broadcast (any_full_time SPMUnit→Person) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…43 → 51) All 51 US jurisdictions now have TANF programs wired up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The childcare "cycle" (TANF → childcare_expenses → childcare subsidies → SNAP → TANF) was an implementation artifact, not a real policy interaction. Root cause: CO CCAP's co_ccap_countable_income used SNAP income variables as a placeholder (with a TODO comment), creating a false dependency chain. California, Nebraska, and Massachusetts childcare subsidies never included SNAP in their income definitions. Changes: - Replace CO CCAP placeholder with actual income sources per 8 CCR 1403-1 - Switch 24 state TANF programs from spm_unit_pre_subsidy_childcare_expenses to childcare_expenses (the accurate post-subsidy amount) - Switch SNAP dependent care deduction from pre_subsidy_childcare_expenses to childcare_expenses (workaround no longer needed) - Update 65+ test files to match Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract hardcoded income source list from co_ccap_countable_income.py into a YAML parameter at gov.states.co.ccap.income.countable_income.sources, following the same pattern as MA CCFA and federal TANF income definitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6 tasks
CO CCAP used snap_fpg for its FPG calculation, creating a cycle: tanf → childcare_expenses → co_ccap_subsidy → co_ccap_fpg_eligible → snap_fpg → snap_unit_size → is_snap_ineligible_student → tanf_person → tanf Replaced with spm_unit_fpg (existing HHS FPG variable using spm_unit_size) divided by 12 for monthly values. No new variable needed — reuses the existing annual FPG with time-based indexing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
292f2f9 to
ea20939
Compare
hua7450
requested changes
Feb 17, 2026
Collaborator
hua7450
left a comment
There was a problem hiding this comment.
Minor changes, others looks good.
| @@ -36,8 +36,7 @@ def formula(spm_unit, period, parameters): | |||
| ) | |||
| if mask.any(): | |||
| fpg_rate[mask] = p.entry.fpg_rate[county[mask]] | |||
| # SNAP FPG is monthly. | |||
| fpg = spm_unit("snap_fpg", period) | |||
| fpg = spm_unit("spm_unit_fpg", period.this_year) / MONTHS_IN_YEAR | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| fpg = spm_unit("spm_unit_fpg", period.this_year) / MONTHS_IN_YEAR | |
| fpg = spm_unit("spm_unit_fpg", period) |
And all others
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.
Summary
Wires up all 51 state TANF programs into the
tanfvariable, adds takeup support, removes thetanf_reportedshort-circuit, and fixes two CO CCAP issues that created circular dependencies.Closes #7400
Changes
TANF wiring and takeup
tanf.py: Removedtanf_reportedshort-circuit; added all 51 state programs; applied takeup multipliertakes_up_tanf_if_eligible.py: New bool variable (default True; set by microdata for microsim)Childcare cycle fix (false cycle removed)
An audit revealed that the pre-subsidy childcare workaround across 24 state TANF programs was unnecessary. The suspected cycle ran: TANF → state programs → childcare deduction →
childcare_expenses→ childcare subsidies (CO CCAP) → SNAP → TANF.Root cause: CO CCAP's
co_ccap_countable_incomeused SNAP income as a placeholder instead of its actual statutory income sources. No childcare subsidy program (CA, CO, NE, MA) includes SNAP in its income definition, so no cycle existed through this path.Fix: Replaced the placeholder with the actual income sources from 8 CCR 1403-1 §7.105, extracted to a YAML parameter at
gov.states.co.ccap.income.countable_income.sources.Result: All 24 state TANF programs and SNAP's dependent care deduction now use
childcare_expenses(post-subsidy) instead of the pre-subsidy workaround, which is more accurate.CO CCAP FPG cycle fix (real cycle fixed)
A separate real cycle existed through CO CCAP's FPG eligibility check: TANF →
childcare_expenses→co_ccap_subsidy→co_ccap_fpg_eligible→snap_fpg→snap_unit_size→is_snap_ineligible_student→tanf_person→ TANF.CO CCAP was borrowing SNAP's FPG variable, which depends on SNAP unit size (which excludes ineligible students based on TANF receipt).
Fix: Replaced
snap_fpgwithspm_unit_fpg / MONTHS_IN_YEARin all three CO CCAP variables that used it (co_ccap_fpg_eligible,co_ccap_base_parent_fee,co_ccap_add_on_parent_fee).spm_unit_fpgusesspm_unit_size(justnb_persons()) with no SNAP or TANF dependency.Files changed
parameters/gov/states/co/ccap/income/countable_income/sources.yamltakes_up_tanf_if_eligible.pytanf.py,co_ccap_countable_income.py,snap_dependent_care_deduction.py,co_ccap_fpg_eligible.py,co_ccap_base_parent_fee.py,co_ccap_add_on_parent_fee.py, 24 state childcare deduction variablesspm_unit_pre_subsidy_childcare_expensesinputs, updated FPG mocksCompanion PR
policyengine-us-data#536 adds state-level TANF takeup rates to microdata construction.
Test plan
🤖 Generated with Claude Code