Skip to content

Fix false childcare cycle: use correct CO CCAP income, switch 24 TANF states and SNAP to childcare_expenses#7412

Closed
MaxGhenis wants to merge 14 commits intoPolicyEngine:mainfrom
MaxGhenis:fix-childcare-cycle-artifact
Closed

Fix false childcare cycle: use correct CO CCAP income, switch 24 TANF states and SNAP to childcare_expenses#7412
MaxGhenis wants to merge 14 commits intoPolicyEngine:mainfrom
MaxGhenis:fix-childcare-cycle-artifact

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Root cause fix: CO CCAP's co_ccap_countable_income used SNAP income variables as a placeholder (with a TODO), creating a false dependency chain through the static graph. Replaced with actual income sources per 8 CCR 1403-1 Section 7.105.
  • 24 state TANF programs: Switched from spm_unit_pre_subsidy_childcare_expenses workaround to childcare_expenses (the accurate post-subsidy amount). States: AK, AL, AZ, DC, DE, GA, HI, IL, KS, KY, MD, ME, MN, MO, MT, NH, NM, OK, RI, TN, TX, VA, VT, WV.
  • SNAP dependent care deduction: Switched from pre_subsidy_childcare_expenses to childcare_expenses — the workaround is no longer needed since no childcare subsidy program (CA, CO, NE, MA) depends on SNAP income.
  • 65+ test files updated to match.

Why the cycle was false

The suspected cycle ran: tanf → state TANF → childcare deduction → childcare_expenses → childcare subsidies → SNAP → tanf. An audit found:

  1. The only path back to SNAP was through CO CCAP, which used snap_earned_income + snap_unearned_income as a placeholder
  2. California's childcare subsidies use their own income definition (no SNAP)
  3. Nebraska uses AGI
  4. Massachusetts explicitly exempts SNAP from countable income

With CO CCAP fixed to use the correct statutory income sources, the cycle no longer exists.

Test plan

  • Model loads without circular dependency errors (Microsimulation() succeeds)
  • All 205 SNAP tests pass
  • All 58 CO CCAP tests pass
  • All 11 childcare expense tests pass
  • make format applied
  • CI passes

🤖 Generated with Claude Code

MaxGhenis and others added 13 commits February 16, 2026 07:11
…-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 PolicyEngine#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>
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (56f72a9) to head (19296cd).
⚠️ Report is 69 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #7412    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           31        16    -15     
  Lines          408       274   -134     
  Branches         1         1            
==========================================
- Hits           408       274   -134     
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.

@MaxGhenis MaxGhenis changed the title Fix false childcare circular dependency across 24 TANF states and SNAP Fix false childcare cycle: use correct CO CCAP income, switch 24 TANF states and SNAP to childcare_expenses Feb 17, 2026
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>
@MaxGhenis MaxGhenis requested a review from hua7450 February 17, 2026 01:42
@MaxGhenis
Copy link
Contributor Author

Merged into #7401 — single PR now covers both TANF wiring and the childcare cycle fix.

@MaxGhenis MaxGhenis closed this Feb 17, 2026
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

Comments