-
Notifications
You must be signed in to change notification settings - Fork 201
Implement Washington State TANF #6818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Implement Washington State TANF #6818
Conversation
Starting implementation of Washington State TANF program. Documentation and parallel development will follow. Related issues: PolicyEngine#2858, PolicyEngine#1359, PolicyEngine#2205, PolicyEngine#2206, PolicyEngine#2207 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Created 20 integration test scenarios for WA TANF covering: - Single parent families with varying income levels - Two-parent families (one and two earners) - Various family sizes (1-10 people) - Earned income with $500 disregard and 50% work incentive - Unearned income (no disregards) - Mixed earned and unearned income - Maximum grant cap testing ($1,338 for 8+ members) - Income threshold boundary testing - Self-employment income scenarios Tests validate: - wa_tanf_payment_standard (by family size) - wa_tanf_countable_income (with disregards) - wa_tanf_eligible (eligibility determination) - wa_tanf (final benefit amount) All calculations documented with comments showing: - Payment standards from WAC 388-478-0020 - Income calculation: (Gross - $500) × 0.5 - Benefit formula: Payment Standard - Countable Income - Maximum grant cap application Related to issue PolicyEngine#6819 and PR PolicyEngine#6818 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This implementation adds Washington State TANF (Temporary Assistance for Needy Families) benefit calculation with ZERO hard-coded values, following issue PolicyEngine#6819. Variables implemented: - wa_tanf.py - Main benefit amount with maximum grant cap - wa_tanf_eligible.py - Overall eligibility combining income and resources - wa_tanf_income_eligible.py - Income eligibility test against gross earned income limits - wa_tanf_payment_standard.py - Payment standard by family size (1-10+) - wa_tanf_countable_income.py - Total countable income combining earned and unearned - wa_tanf_countable_earned_income.py - Earned income with $500 disregard and 50% work incentive - wa_tanf_countable_unearned_income.py - Unearned income without disregards - wa_tanf_gross_earned_income.py - Household gross earned income - wa_tanf_gross_unearned_income.py - Household gross unearned income Parameters created: - Payment standards by family size (WAC 388-478-0020, effective Jan 1, 2024) - Maximum grant cap of $1,338 for units with 8+ members - Gross earned income limits by family size (WAC 388-478-0035, effective Aug 1, 2024) - Earned income disregard of $500 (WAC 388-450-0170) - Work incentive percentage of 50% (WAC 388-450-0170) - Resource limit updated to $12,000 (WAC 388-470-0045, effective Feb 1, 2024) Benefit calculation formula: 1. Countable Earned Income = (Gross Earned Income - $500) × 0.5 2. Total Countable Income = Countable Earned Income + Unearned Income 3. Grant Amount = Payment Standard - Total Countable Income (capped at $1,338) All values are fully parameterized with proper references to Washington Administrative Code (WAC). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Washington TANF implementation includes: - Complete parameterization of benefit amounts and income limits - Income calculation variables (earned/unearned, countable income) - Eligibility determination logic - Comprehensive integration tests
All WA TANF variables are defined at SPMUnit level (family-based benefit), but tests were expecting person-level array outputs. Fixed all test outputs to use SPMUnit-level scalar values instead of person-level arrays. Changes: - Updated all test outputs from arrays (e.g., [706, 0, 0]) to scalars (e.g., 706) - Affected variables: wa_tanf, wa_tanf_eligible, wa_tanf_payment_standard, wa_tanf_countable_income - All 18 test cases corrected 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6818 +/- ##
============================================
+ Coverage 72.92% 100.00% +27.07%
============================================
Files 3252 7 -3245
Lines 46840 95 -46745
Branches 243 0 -243
============================================
- Hits 34159 95 -34064
+ Misses 12667 0 -12667
+ Partials 14 0 -14
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:
|
- Restructure gross_earned_income_limit.yaml to use top-level breakdown keys - Restructure payment_standard.yaml to use top-level breakdown keys - Update breakdown metadata to use range(1, 11) format - Fixes parameter validation errors preventing system initialization This change aligns with the standard parameter structure used in other states (e.g., Missouri TANF) for scale parameters with family size breakdowns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Create unit test files for 8 variables with formulas - Organized tests in benefit/, eligibility/, and income/ subdirectories - Each test file follows DC TANF pattern with edge cases - Tests cover boundary conditions, zero values, and state filtering - All 56 unit tests pass successfully Test files created: - wa_tanf.yaml - Main benefit with grant cap (9 tests) - wa_tanf_payment_standard.yaml - Payment standards by size (6 tests) - wa_tanf_eligible.yaml - Overall eligibility logic (5 tests) - wa_tanf_income_eligible.yaml - Income eligibility (9 tests) - wa_tanf_countable_earned_income.yaml - Earned income disregards (8 tests) - wa_tanf_countable_unearned_income.yaml - Unearned income (5 tests) - wa_tanf_gross_earned_income.yaml - Earned aggregation (6 tests) - wa_tanf_gross_unearned_income.yaml - Unearned aggregation (6 tests) Edge cases covered: - Zero income scenarios - Exactly at threshold values - One dollar over/under thresholds - Family size caps (size 15 capped at 10) - Grant cap application - State code filtering (WA vs other states) - Multiple earners in household 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Fix parameter date alignment: Update gross_earned_income_limit to start 2024-01-01 - Parameterize hard-coded family size cap (10) with maximum_family_size parameter - Fix income aggregation: Use federal tanf_gross_earned_income/tanf_gross_unearned_income - Update integration tests to use employment_income_before_lsr instead of employment_income - Fix test expectation: Family of 4 with $2,300 income is ineligible (over $2,166 limit) All 75 tests now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Applies code quality improvements from PA TANF (PolicyEngine#6764) and OH OWF (PolicyEngine#6788): Code Structure: - Delete 3 unnecessary intermediate variables with no state-specific logic - Use federal TANF variables directly via add() helper (OH pattern) - Add demographic and citizenship eligibility checks (PA/OH pattern) - Change defined_for to "wa_tanf_eligible" (PA/OH pattern) Comments & Documentation: - Add direct WAC regulation quotes in all formulas - Add step-by-step calculation breakdowns - Improve variable naming (remainder_after_flat_disregard) - Add policy context explaining WHY not just WHAT Parameters: - Reorder structure: description → values → metadata (OH pattern) - Remove publication_date field (PA/OH don't use it) - Clean up reference titles (remove quotes) Tests: - Add is_tax_unit_dependent: true for all children (OH pattern) - Fix demographic eligibility tests to include all 4 requirements - Fix single person test (must be pregnant for TANF eligibility) - Update to use federal tanf_gross_* variables Impact: - Deleted 5 files (3 variables, 2 tests) - Modified 17 files (6 variables, 6 parameters, 5 tests) - All 59 tests passing (was 75 with redundant tests) - Now fully aligned with PA/OH implementation patterns 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Changes parameter semantics to be clearer and match regulation language:
Before (confusing):
- Parameter: work_incentive_percentage = 0.5 (what we COUNT)
- Formula: remainder × 0.5
- Issue: If regulation changes to "subtract 40%", need to set parameter to 0.6
After (clear):
- Parameter: percentage_of_remainder_disregarded = 0.5 (what we DISREGARD)
- Formula: remainder - (remainder × 0.5)
- Benefit: Parameter value directly matches regulation ("subtract 50%" → 0.5)
Additional improvements:
- Inline single-use variables in payment_standard, income_eligible, and main benefit
- Use "share" instead of "percentage" in description (OH/PA pattern)
- Reference title includes subsection detail (OH pattern)
All 59 tests passing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Parameter Structure Reorganization: - Rename benefit/ → payment_standard/ (OH pattern) - Flatten structure: remove eligibility/ folder (PA pattern) - Group deductions: income/deductions/earned_income_disregard/ - Rename files for clarity: amount.yaml, maximum_amount.yaml - Move resource_limit.yaml to root level (PA pattern) Parameter Content Improvements: - Spell out "Temporary Assistance for Needy Families program" in all descriptions - Use agent-approved placeholders: "this amount", "this share" - Add dual references where values exist, remove non-showing references - Verify all references actually show the parameter values - Remove unverifiable historical $6,000 resource limit (keep only $12,000) - Fix $1,338 cap reference to DSHS manual (WAC doesn't show it) - Remove publication_date fields from all parameters Formula Improvements: - Consistent use of p = parameters(...) pattern - Remove single-use intermediate variables - Remove parentheses from single-reference variables - Add reference to wa_tanf_resources_eligible - Remove unverified 33% FPL comment Test Improvements: - Convert member lists to inline bracket format [member1, member2] - Update resource tests to use current $12,000 limit All 59 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Resource Limit Updates: - Restore historical $6,000 value (2022-01-01) verified in 2022 State Plan - Keep current $12,000 value (2024-01-01) from HB 1447 (2023 c 418) - Reference 2022 State Plan with page anchor (#page=13) - Reference HB 1447 legislation that increased the limit Income Limit Documentation: - Add comment explaining mathematical relationship to payment standards - Formula: Income Limit = (Payment Standard × 2) + $500 - Represents break-even point where countable income = payment standard - Note that WAC publishes as table, not formula (preserve structure) All 59 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add explanatory comment in income/limit.yaml showing that these values follow the formula: Income Limit = (Payment Standard × 2) + This represents the break-even point where countable income equals the payment standard, resulting in $0 benefit. While mathematically derived, WAC 388-478-0035 publishes these as a table rather than a formula, so we preserve the table structure here for regulatory accuracy. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, but LGTM! Really clean PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Summary
Implements Washington State Temporary Assistance for Needy Families (TANF) program with complete parameterization and comprehensive testing following PA TANF and OH OWF quality standards.
Closes #6819
Status
Key Changes
Implementation Summary
Formula (Per WAC 388-450-0170 and WAC 388-450-0162)
Earned Income Disregard: "$500 + 50% of Remainder"
Income Eligibility Limit: Derived from break-even point
Unearned Income: No disregards (full amount countable)
Benefit Calculation:
Files Added
Parameters (7 files) - Clean PA/OH structure
Variables (8 files) - Following PA/OH patterns
Tests (7 files, 59 test cases total)
Example Calculations
Basic Example: Family of 3 with Earned Income
Household: Single parent with 2 children
Income: $1,000/month employment income
Low Income Example: Under $500/month
Household: Family of 2
Income: $400/month earned
Key Insight: All earned income under $500/month is fully disregarded!
Maximum Grant Cap: Large Family
Household: Family of 10
Income: $800/month earned
Testing & Verification
Test Results
Test Coverage Breakdown
How to Run Tests
Implementation Highlights
Key Features
Design Decisions
Follows OH Pattern: Uses federal variables directly
add(spm_unit, period, ["tanf_gross_earned_income"])Follows PA Pattern: Comprehensive eligibility checks
is_demographic_tanf_eligibleis_citizen_or_legal_immigrantdefined_for = "wa_tanf_eligible"Parameter Structure: Clean, flat organization
Verified References: All parameter references actually show values
Formula Documentation: Income limits explained as break-even points
Known Limitations & Future Enhancements
Not Yet Implemented
Simplified Assumptions
References
Official Government Sources
Legislative Sources
DSHS Policy Manuals
State Plans
Branch Information
Branch:
wa-tanf-simpleRemote:
origin/integration/wa-tanf-2025-11-11Base:
masterStatus: ✅ All 59 tests passing, ready for review
Implementation by: @hua7450
Issue: #6819
🤖 Generated with Claude Code