Skip to content

Conversation

@hua7450
Copy link
Collaborator

@hua7450 hua7450 commented Jan 11, 2026

Summary

Implements Alabama Family Assistance (TANF) program.

Fixes #4012


Alabama TANF Income Rules

Regulatory Authority

  • Alabama DHR Family Assistance Eligibility Requirements (DHR-FAD-595)
  • Alabama DHR Public Assistance Payment Manual Section 3215 (Income Deductions)

1. INCOME ELIGIBILITY TESTS

Income Test

  • Limit: Countable income must be ≤ Payment Standard for family size
  • No gross income test: Alabama uses only a single net income test
  • No asset limit: Alabama has eliminated the asset test for TANF

Source: Alabama DHR Family Assistance Eligibility Requirements


2. INCOME DEDUCTIONS & EXEMPTIONS (IMPLEMENTED)

A. Work-Related Expense Deduction

Income Type Deduction
All earned income 20% of gross earnings

Source: Alabama DHR Public Assistance Payment Manual - Section 3215.B Work Expenses

B. Child Care Expense Deduction

Expense Type Deduction
Child care expenses Actual costs paid

Source: Alabama DHR Public Assistance Payment Manual - Section 3215.B Dependent Care Expenses


3. INCOME STANDARDS BY FAMILY SIZE

Family Size 2002-01-01 2023-10-01
1 $165 $264
2 $190 $304
3 $215 $344
4 $245 $392
5 $275 $440
6 $305 $488
7 $335 $536
8 $365 $584
9 $395 $632
10 $425 $680
11 $455 $728
12 $485 $776
13 $515 $824
14 $545 $872
15 $575 $920
16 $605 $968

Note: 60% increase effective October 2023.

Sources:


4. BENEFIT CALCULATION

Formula:

Benefit = Payment Standard − Countable Income

Where Countable Income =

Countable Earned Income + Unearned Income

And Countable Earned Income =

Gross Earned Income − (Gross Earned Income × 20%) − Child Care Expenses

Calculation Steps:

  1. Start with gross earned income (employment + self-employment)
  2. Subtract 20% work expense deduction
  3. Subtract child care expenses = Countable Earned Income
  4. Add unearned income = Countable Income
  5. Subtract countable income from Payment Standard = Benefit

Family Size Cap

  • Maximum family size: 16 persons (families larger than 16 receive the 16-person payment standard)

Source: Alabama 2024 TANF State Plan - Payment Standards


5. NOT IMPLEMENTED IN THIS PR

The following Alabama TANF rules are not implemented in this PR:

  • Self-Employment Operating Expense Deduction (40%): Self-employment income should have 40% deducted as operating expenses before the 20% work expense deduction is applied (Section 3215.A)
  • $10 Minimum Benefit: Benefits must be at least $10; if calculated benefit is less than $10, the family is ineligible (Section 3116)
  • 100% Earnings Disregard for New Employment: All earnings from new employment are disregarded for the first 12 months that wages are received (Section 3215-C)
  • Full-Time Student Earnings Disregard: All earned income of dependent children who are full-time students is disregarded (Section 3215-C.1)
  • Income Deeming Rules: Income deeming from senior parents of minor parents, alleged fathers, and stepparents (Sections 3125-B, 3125-D, 3125-E)
  • Incapacitated Adult Care Expense Deduction: Care expenses for incapacitated adults (parent/stepparent) living in the same home (Section 3115.B)

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c18ebd3) to head (0d24349).
⚠️ Report is 430 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7151   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         6    +4     
  Lines           22        77   +55     
=========================================
+ Hits            22        77   +55     
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 hua7450 marked this pull request as ready for review January 13, 2026 05:29
@PavelMakarchuk
Copy link
Collaborator

PR Review - Alabama Family Assistance (TANF) Implementation

🔴 Critical Issues (Must Fix Before Merge)

None identified. The implementation correctly follows Alabama DHR regulations.


🟡 Should Address

1. Missing Family Size Cap Boundary Tests

  • Tests show size 18 (exceeds cap), but missing:
    • Size 16 exactly (at cap) → should get $968
    • Size 17 (one over cap) → should also get $968
  • This verifies the min_(unit_size, p.max_unit_size) capping logic works correctly

2. Missing Historical Parameter Tests (Pre-October 2023)

  • Most tests use 2024-01 (post-60% increase)
  • Missing tests with 2023-01 period to verify old values work:
    • Size 1: $165 (not $264)
    • Size 3: $215 (not $344)

3. Missing Unit Test File for al_tanf_countable_income

  • Variable exists and uses adds pattern
  • While adds variables don't strictly require tests, a simple unit test would improve coverage

4. Missing Payment Standard Size Coverage

  • Only sizes 1, 3, 5, 6, 18 tested
  • Missing 11 of 16 payment standard values (sizes 2, 4, 7-15)

🟢 Suggestions

  1. Single-element reference tuple: al_tanf_payment_standard.py uses a tuple with trailing comma for single reference - could simplify to plain string

  2. Period access style: al_tanf_payment_standard.py uses period for spm_unit_size - period.this_year is preferred for stock/count variables (works correctly either way)

  3. Precision boundary test: Add test with income exactly at payment standard boundary (e.g., $344.00 vs $344.01)


✅ What's Implemented Correctly

Component Verification
20% work expense deduction ✓ Matches Section 3215.B
Child care expense deduction ✓ Actual costs, no cap
Payment standards (sizes 1-16) ✓ All 16 values present
60% benefit increase (Oct 2023) ✓ Mathematically verified ($165→$264 = 1.6×)
Family size cap at 16 ✓ Correctly parameterized
No asset test ✓ Correctly omitted per Alabama rules
Single net income test ✓ Countable ≤ payment standard
Benefit formula max(payment_standard - countable, 0)
No hard-coded values ✓ All values from parameters
Variable naming ✓ All use al_tanf_* prefix
Pattern usage ✓ Correct adds, add(), max_(), min_()
Federal eligibility reuse ✓ Uses is_demographic_tanf_eligible

Validation Summary

Check Result
Regulatory Accuracy ✅ Implementation matches DHR regulations
Reference Quality ✅ All references present with page anchors
Code Patterns ✅ All patterns correct
Test Coverage ⚠️ Missing boundary and historical tests
CI Status ✅ All checks passing

60% Benefit Increase Verification

The October 2023 benefit increase was mathematically verified:

Size Pre-Oct 2023 Post-Oct 2023 Ratio
1 $165 $264 1.600
2 $190 $304 1.600
3 $215 $344 1.600
16 $605 $968 1.600

All 16 values show exactly 60% increase ✓


Documented Simplifications (Acknowledged)

The PR correctly documents these as NOT modeled:

  1. Self-employment 40% operating expense deduction
  2. $10 minimum benefit rule
  3. 100% earnings disregard for new employment (12 months)
  4. Full-time student earnings disregard
  5. Income deeming rules
  6. Incapacitated adult care expense deduction

These are appropriate simplifications.


Test Coverage: 55 Tests Passing

File Tests
al_tanf.yaml 12
al_tanf_countable_earned_income.yaml 9
al_tanf_eligible.yaml 11
al_tanf_income_eligible.yaml 9
al_tanf_payment_standard.yaml 5
integration.yaml 9

Manual Calculation Verification

Scenario 3 ($400 earnings, family of 3):

  • Gross earned: $400
  • Work expense (20%): $400 × 0.2 = $80
  • Countable earned: $400 - $80 = $320
  • Payment standard (size 3): $344
  • Benefit: $344 - $320 = $24

Scenario 6 ($600 earnings - $200 childcare, family of 5):

  • Gross earned: $600
  • Work expense: $600 × 0.2 = $120
  • After work expense: $480
  • After childcare: $480 - $200 = $280
  • Payment standard (size 5): $440
  • Benefit: $440 - $280 = $160

Next Steps

To auto-fix issues: /fix-pr 7151

Or address manually:

  1. Add tests for sizes 16 and 17 (cap boundary)
  2. Add tests with period: 2023-01 for pre-increase values
  3. Add simple unit test for al_tanf_countable_income

🤖 Generated with Claude Code - Complete Review Plugin

@PavelMakarchuk PavelMakarchuk merged commit 217a081 into PolicyEngine:main Feb 1, 2026
9 checks passed
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.

Alabama Family Assistance (FA) TANF program

2 participants