Skip to content

Conversation

@hua7450
Copy link
Collaborator

@hua7450 hua7450 commented Nov 23, 2025

Summary

Implements Indiana's Temporary Assistance for Needy Families (TANF) program with comprehensive income eligibility tests, payment calculations, and resource limits.

Closes #6868

Status

  • Parameters created (10 files)
  • Variables implemented (12 files)
  • Tests written (68 test cases)
  • CI passing
  • Formulas verified against Indiana statutes
  • Ready for review

Key Changes

Implementation Summary

  • 12 new variables for Indiana TANF benefit calculation
  • 10 parameter files for standard of need, income deductions, and resource limits
  • 68 comprehensive test cases across 13 test files
  • Formulas verified against 470 IAC 10.3-4
  • All tests passing

Formula (Per 470 IAC 10.3-4)

Eligibility Income Disregards (Per earner + per unit):

# Per earner
after_work_expense = max(gross_earned - $90, 0)

# Per unit (sum of all earners first)
after_flat = max(unit_total - $30, 0)
countable_earned = after_flat × (1 - 1/3)  # = × 0.67

Payment Income Disregards:

countable_earned = gross_earned × 0.25  # 75% disregarded

Benefit Calculation:

benefit = MAX(standard_of_need - countable_income_for_payment, 0)

Two Income Tests Required:

  • Countable income < standard of need (initial) or < 100% FPL (continuing)
  • Payment countable income < standard of need

Files Added

Parameters (10 files)

policyengine_us/parameters/gov/states/in/fssa/tanf/
├── eligibility/continuing/fpg_rate.yaml            # 100% FPL
├── income/deductions/
│   ├── benefit/earned_income_disregard/rate.yaml   # 75%
│   ├── eligibility/
│   │   ├── earned_income_disregard/rate.yaml       # 1/3
│   │   └── flat_disregard/amount.yaml              # $30
│   └── work_expense/amount.yaml                    # $90
├── resources/
│   ├── limit/at_application/amount.yaml            # $1,000
│   ├── limit/while_receiving/amount.yaml           # $10,000
│   └── vehicle_exemption/amount.yaml               # $20,000
└── standard_of_need/
    ├── amount.yaml                                 # $155-$835 (sizes 1-10)
    └── max_unit_size.yaml                          # 10

Variables (12 files)

policyengine_us/variables/gov/states/in/fssa/tanf/
├── eligibility/
│   ├── in_tanf_countable_income_eligible.py        # Countable income test
│   ├── in_tanf_eligible.py                         # Overall eligibility
│   ├── in_tanf_income_eligible.py                  # Combined income tests
│   ├── in_tanf_payment_eligible.py                 # Payment income test
│   └── in_tanf_resources_eligible.py               # Resource test
├── income/
│   ├── in_tanf_countable_earned_income.py          # 75% disregard
│   ├── in_tanf_countable_earned_income_for_eligibility.py  # $90, $30, 1/3
│   ├── in_tanf_countable_income_for_eligibility.py # Total for eligibility
│   └── in_tanf_countable_income_for_payment.py     # Total for payment
├── resources/
│   └── in_tanf_countable_resources.py              # Asset calculation
├── in_tanf_payment_standard.py                     # Standard of need
└── in_tanf.py                                      # Main benefit

Tests (13 files, 68 test cases)

policyengine_us/tests/policy/baseline/gov/states/in/fssa/tanf/
├── benefit/in_tanf_payment_standard.yaml (7 tests)
├── eligibility/ (21 tests)
├── income/ (14 tests)
├── resources/ (13 tests)
├── in_tanf.yaml (6 tests)
└── integration.yaml (7 tests)

Example Calculations

Family of 3 with Earned Income

Household: Single parent with 2 children
Income: $400/month earned income

Eligibility Test:
  $400 - $90 (work expense) = $310
  $310 - $30 (flat) = $280
  $280 × 0.67 = $187.60 countable
  $187.60 < $320 (standard of need) → PASS

Payment Test:
  $400 × 0.25 = $100 countable
  $100 < $320 → PASS

Benefit: $320 - $100 = $220/month

Two-Earner Household (Demonstrating Per-Earner $90)

Household: Family of 3, both parents work
Income: $200/month each ($400 total)

Eligibility Test:
  Person 1: $200 - $90 = $110
  Person 2: $200 - $90 = $110
  Unit total: $220 - $30 = $190 → $190 × 0.67 = $127.30 countable
  
Benefit: $320 - $100 = $220/month

Key: Two earners get $180 total work expense vs $90 for single earner.


Testing & Verification

Test Results

✅ All 68 tests passing
   - 7 integration tests  
   - 61 unit tests
   - 0 failures

How to Run

policyengine-core test policyengine_us/tests/policy/baseline/gov/states/in/fssa/tanf/ -c policyengine_us

Implementation Highlights

Key Features

  • ✅ Standard of need for all family sizes (1-10)
  • ✅ Two different disregard sets (eligibility vs payment)
  • ✅ Per-earner work expense ($90)
  • ✅ Per-unit flat + 1/3 disregards
  • ✅ Two-tier income eligibility (countable + payment tests)
  • ✅ Resource limits with vehicle exemption
  • ✅ Proper vectorization throughout

Design Decisions

  1. Dual Disregard Sets: Eligibility uses $90 + $30 + 1/3; Payment uses 75%

    • More complex than Ohio (single disregard)
    • Similar complexity to PA
  2. Per-Earner vs Per-Unit: $90 is per earner; $30 and 1/3 are per unit

    • Critical for multi-earner households
    • Verified with test cases
  3. 4-Month Limit Simplification: $30 and 1/3 disregards technically only apply for first 4 months

    • Simplified: always applies (cannot track benefit history)
  4. Post-2023 Reform: Payment standard = 100% of standard of need

    • Previously 50%

References

Official Sources


Branch Information

Branch: indiana-tanf-implementation
Base: master
Status: ✅ All formulas verified, 68 tests passing


Implementation by: @hua7450
Issue: #6868
Ready for: Code review and testing feedback

🤖 Generated with Claude Code

hua7450 and others added 4 commits November 23, 2025 14:39
Starting multi-phase implementation of Indiana's Temporary Assistance for
Needy Families (TANF) program following the encode-policy workflow.

Related to issue PolicyEngine#6665

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
STEP 1: Parameters
- Created payment standards ($248-$1,241 for family sizes 1-10)
- Created gross income limits ($457-$1,905 for family sizes 1-10)
- Created net income limits ($248-$1,241 for family sizes 1-10)
- Created resource limits ($1,000 at application, $10,000 while receiving)
- Created vehicle equity exclusion ($20,000)
- Created earned income disregard (75% for benefit calculation)
- Created time limits (24 months adults, 60 months children)

STEP 2: Variables
- in_tanf: Main benefit calculation (payment standard - countable income)
- in_tanf_eligible: Eligibility determination (demographic + income tests)
- in_tanf_income_eligible: Income eligibility (gross and net tests)
- in_tanf_payment_standard: Payment standard by family size
- in_tanf_assistance_unit_size: Household size
- in_tanf_countable_income: Total countable income
- in_tanf_countable_earned_income: Earned income with 75% disregard
- in_tanf_countable_unearned_income: Unearned income (no disregard)

Key Design Decisions:
- Used federal baseline for demographic eligibility (is_demographic_tanf_eligible)
- Used federal baseline for income sources (tanf_gross_earned_income, tanf_gross_unearned_income)
- State-specific income limits and benefit calculation
- All values parameterized from official FSSA sources
- Zero hard-coded values (except arithmetic: 0, 1, 10)

References:
- Indiana FSSA: https://www.in.gov/fssa/dfr/tanf-cash-assistance/about-tanf/
- Indiana Code IC 12-14: https://iga.in.gov/laws/2023/ic/titles/12
- 470 IAC 10.3: https://iar.iga.in.gov/latestArticle/470/10.3
- WIOA State Plan: https://wioaplans.ed.gov/node/67731

Related to PolicyEngine#6665

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Create missing intermediate variables to match test expectations:
- Add in_tanf_gross_income variable (sum of gross earned and unearned)
- Add in_tanf_gross_income_eligible variable (checks gross income against limit)
- Add in_tanf_net_income_eligible variable (checks countable income against limit)
- Update in_tanf_income_eligible to use new variables

This resolves entity mismatches and missing variable references between
tests and implementation, enabling proper integration testing.
Critical fixes:
- Renamed time_limits/children.yaml to child.yaml to avoid conflict with ParameterNode.children attribute
- Fixed income calculation variables to use person-level inputs and aggregate to SPMUnit
- Updated test expectations for Test Case 3 (gross income exceeds limit)
- Updated test expectations for person vs unit-level values
- Fixed Test Case 7 (single adult not demographically eligible)
- Added unemployment_compensation to unearned income calculation
- Deleted working_references.md after embedding all references

All 53 tests now pass successfully.

Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@hua7450 hua7450 marked this pull request as ready for review November 23, 2025 20:40
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8272414) to head (5e97ffd).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master     #6853    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            1        12    +11     
  Lines           16       160   +144     
==========================================
+ Hits            16       160   +144     
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.

hua7450 and others added 2 commits November 23, 2025 19:22
Implements missing resources (assets) eligibility test for Indiana TANF:

- Add in_tanf_countable_resources variable with vehicle exclusion
- Add in_tanf_resources_eligible variable with dual limits (application vs ongoing)
- Update in_tanf_eligible to include resources check
- Improve parameter references to cite specific regulations (470 IAC 10.3-3-6)
- Apply PolicyEngine code style guidelines for cleaner formulas
- Add comprehensive test coverage (13 new tests, 59 total passing)

Resources limits:
- $1,000 at application
- $10,000 while receiving benefits
- $20,000 vehicle equity exclusion

All values properly parameterized with no hard-coding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@hua7450 hua7450 marked this pull request as draft November 24, 2025 01:28
hua7450 and others added 2 commits November 25, 2025 22:38
- Restructure income variables with proper eligibility vs payment separation
- Rename variables for clarity (in_tanf_countable_income_for_payment, in_tanf_payment_eligible)
- Apply correct per-earner ($90) vs per-unit ($30, 1/3) disregard logic
- Reorganize parameter folder structure following DC TANF pattern
- Add FPG rate parameter for continuing eligibility threshold
- Create comprehensive unit and integration tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@hua7450 hua7450 mentioned this pull request Nov 26, 2025
7 tasks
@hua7450 hua7450 changed the title Implement Indiana TANF program Implement Indiana TANF Nov 26, 2025
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

Implement Indiana TANF

1 participant