Repository navigation
Integrate modeled state unemployment insurance into income flows - #9558
Conversation
Rebase of PR #8303 onto current main under new ownership (original author has left PolicyEngine). Adds modeled_state_unemployment_compensation (sums al_ui, nj_unemployment_insurance, ny_ui, ok_ui, pa_uc, ut_ui) and total_unemployment_compensation (reported-wins fallback), repoints the direct consumers of unemployment_compensation - including the household_benefits parameter list - and extends the five state UI integration suites with income-flow, reported-preservation, and no-double-count cases. Resolves the uprating/adds computation-mode conflict Pavel flagged on #8303 via Option A: unemployment_compensation stays a pure uprated survey input, so CPS-reported values and future-year uprating are untouched and modeled UI reaches income flows only when no reported amount is present. NJ UI, modeled on main after #8303 was opened, is included in the modeled aggregate as part of the rebase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9558 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 2 -2
Lines 76 26 -50
Branches 2 0 -2
=========================================
- Hits 76 26 -50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
The new total UI variable is vectorized correctly, but the migration misses parameter-driven means tests. snap_unearned_income_person still reads unemployment_compensation from the SNAP unearned-income source list, so the new modeled benefit enters household resources without entering SNAP income. In the PR's Pennsylvania example, $10,218 of modeled UI with no reported UI contributes $0 rather than $851.50/month to that list. This was verified by tracing the formulas and source list, not by running a full SNAP simulation locally.
Please migrate applicable remaining raw-UI income consumers without double-counting or cycles, and add a low-income integration test that exercises the benefit interaction. SNAP's treatment is specified in 7 CFR 273.9(b)(2)(ii). Also resolve the two failing coverage checks; the actual hosted model suites pass, and the selective project-coverage comparison should not be presented as a whole-repository regression.
Nonblocking: clarify whether an explicitly reported zero should trigger modeled entitlement, and cover NJ, asymmetric household inputs, and monthly aggregation.
…sation Per review: migrate every income-source list under parameters/gov/ (SNAP, TANF, SSI, WIC, school meals, Head Start, HUD, CBO, CCAP, state tax lists and the VA subtraction) and four contrib reform benefit lists from the reported unemployment_compensation input to total_unemployment_compensation. Document the reported-zero rule, fold two always-true source appends into direct substitutions, and add low-income SNAP, NJ, asymmetric-household, monthly and reported-zero tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Fixes applied (02fec91): Pavel's reviewParameter-driven consumers migrated. Every
Low-income integration test. It uses your Pennsylvania example: $10,218 modeled, nothing reported, no earnings, January 2025. Under 7 CFR 273.9(b)(2)(ii):
Non-blocking items, all covered. The new
Reported zero. This is documented in Coverage checks
Also:
Verification. Local runs: 457 passed, 0 failed, and no existing expected value moved:
|
Sum modeled state UI through a year-gated parameter list so each program counts from its first verified year. Before 2022 the list is empty, so pre-2015 simulations (e.g. the 2010 Alabama SSP cases reached via SSI unearned income) no longer reach state UI parameters that start later. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
CI fix (3d57cdd): year-gate the modeled state UI programsFailure: Fix:
Modeled UI is therefore zero in years no state program is verified, and simulations of earlier years never reach state UI parameters that start later. Every test in this PR that uses modeled UI falls inside those years, so no expected values change. Verification:
|
Program ReviewSource Documents
Branch StatusThe branch is 3 commits ahead of and 83 commits behind Prior requests
Critical (Must Fix)None. Should AddressA1. The year gate has no direct test. The gate in SuggestionsS1. State that the year gate sets start years only. The comment at S2. Extend modeled-UI coverage beyond SNAP. The changelog names TANF and SSI, but only SNAP, the federal taxable-UC chain and the benefit aggregates are tested with modeled UI. One case each for S3. Case 8's comment misstates the law. S4. Case 7 cannot detect a revert of the UT consumer swap. The case at S5. Negative reported UC is now dropped. S6. Guard against modeled UI appearing in microdata. Modeled UI stays at $0 in microsim only because the state wage and quarter inputs are absent; S7. Housekeeping. Update the PR body's "106 entries in 99 files" to 108 in 100, and its VA rationale ("federal AGI now carries the total"): federal AGI carries taxable UC. Rename the Pre-existing issues (not introduced by this PR; non-blocking)P1. Virginia subtracts total rather than taxable UC. P2. SC TANF counts taxable UC. P3. HI CCAP omits strike benefits. P4. Malformed reference. Investigated and cleared
Verified correct
Validation Summary
Review Severity: COMMENTAll seven prior requests are resolved and there are no critical issues. A1 should be addressed before merge. The suggestions and pre-existing items are non-blocking; P1 and P3 are one-line fixes in files this PR already edits. Next StepsTo auto-fix issues: run the fix-pr workflow for this PR. |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Re-review of 3d57cdd: full report here: #9558 (comment)
All three of my 9/23 requests are resolved, as are the non-blocking items. The migration covers 108 entries in 100 lists, 4 contrib reforms and 13 formulas. I found no remaining raw consumers, no double counting and no cycles. Modeled UI is $0 in populace 2024–2026, so aggregates are unaffected. No critical findings.
One should-address item:
- A1: Add a test for a year before a state enters
gov.states.household.modeled_state_unemployment_compensation, e.g. AL 2023 → 0. That pins the year gate directly; right now the ParameterNotFoundError fix is only covered indirectly by the AL SSP 2010 cases.
Suggestions and 4 pre-existing items (VA/SC 2020 taxable-UC handling, HI CCAP strike benefits) are in the report and are non-blocking.
…-flow-integration
…s through Add year-gate tests for states before and after they enter the modeled-UI list (AL 2023 and 2010, NY 2024, OK 2022, and PA/UT/NJ excluded years), SSI/TANF and taxable-SS-MAGI flow tests, and treat any nonzero reported unemployment compensation (including negative amounts) as reported, as on main. Have Virginia subtract taxable UC, count strike benefits in Hawaii child care, fix a reference comma, and clarify the year-gate docs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Fixes applied (7e47d92): Pavel's re-reviewA1, year-gate tests: the gate is now tested directly, not only through the Alabama SSP 2010 cases. New cases, all in files this PR already changes:
Suggestions:
Pre-existing items fixed here, in files this PR already edits:
Deferred:
Verification: |
…nd SNAP UI paths Resolve conflicts with main's restructured dependent gross income (#9691) and SNAP months-of-receipt UI exemption (#9716): use main's structure, reading total_unemployment_compensation (reported, or modeled state UI when none is reported) in DEPENDENT_GROSS_INCOME_SOURCE_OVERRIDES and unemployment_compensation_months. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Main's #9716 limits the SNAP work-registration UI exemption to the months of receipt (26 weeks -> 6 months), so outside those months the PA adults in these cases hit the ABAWD time limit and 7 CFR 273.11(c)(2)(ii) prorates their income. Update the two expectations with the arithmetic; no code change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Same expectation updates as #9558 (this branch carries #9558's modeled state UI change): main's #9716 limits the SNAP work-registration UI exemption to the months of receipt, so the PA adults hit the ABAWD time limit outside them. No code change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Resolve the Arkansas gross income source lists and the Michigan household resources list against main's restructured lists, keeping total_unemployment_compensation in place of unemployment_compensation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Main's code-health test pins the AR1000F line for every Arkansas gross income source; the unemployment line (21 from 2018) now reads total_unemployment_compensation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
hua7450
left a comment
There was a problem hiding this comment.
[P2] Route the income consumers added on main through total unemployment compensation
There is one remaining integration gap: several consumers brought into this branch by later merges of main still read the reported-only unemployment_compensation input. They omit modeled state UI when no reported amount is supplied.
These are follow-up integrations for code added after this PR opened. In particular, NY HEAP (#9744) and NJ LIHEAP (#9745) merged on October 7 and 8 (Eastern), respectively, and entered this branch through its October 12 merge of main.
The remaining readers include:
student_loan_interest_ald_magi.py:37,ira_219g_magi.py:24, andira_219g_taxable_social_security.py:32.policyengine_us/parameters/gov/states/ny/otda/heap/income/sources/unearned.yaml:7.policyengine_us/parameters/gov/states/nj/dca/liheap/income/sources/unearned.yaml:4.
Local reproductions using actual state-UI wage/week inputs show the effect:
| Case | Current result | Expected result |
|---|---|---|
| PA 2025: $85,000 wages, $2,500 student-loan interest, $10,218 modeled UI | MAGI $85,000; deduction $2,500 | MAGI $95,218; deduction $797 |
| PA 2025: $80,000 wages, $10,218 modeled UI | IRA MAGI $80,000 | IRA MAGI $90,218 |
| NY 2026: $7,982 modeled UI | HEAP countable income $0 | $7,980 after monthly flooring |
| NJ 2026: $6,000 modeled UI | LIHEAP person income $0 | $6,000 |
The reported-UI controls produce the expected results. Please migrate these downstream readers to total_unemployment_compensation and add regression cases in the corresponding variable-named YAML files, while preserving the raw input inside the adapter and input-uprating code.
Validation: 88 changed-file cases passed; the independent cases produced five expected failures and four passing reported-UI controls. The affected runtime code and dependencies are unchanged on reviewed head 36192aabb31aa86e8341b666b03e9c3860952de1.
Thirteen readers that later merges of main brought in still read the reported-only unemployment_compensation input, so they missed modeled state UI when nothing was reported: - the student loan interest ALD MAGI and the two IRA deduction MAGI formulas (ira_219g_magi, ira_219g_taxable_social_security), which now append total_unemployment_compensation. The total never reaches AGI, so there is no cycle; - ten parameter source lists: NY HEAP, NJ LIHEAP, IN EAP, KS LIEAP, KY LIHEAP, MD MEAP, MO SAB, MS LIHEAP, NC LIEAP and OR LIHEAP. Each reader gets regression cases in its own test file: a modeled-UI case plus a reported-UI control where the state models UI (PA for the federal MAGI formulas, NY, NJ), and a reported-UI control elsewhere. The two IRA variables get new test files named for them. Add a code-health guard that fails when a parameter list entry or a Python string constant names the raw input, with an allowlist for uprating, the TAXSIM generator and the total's own formula. Add a microsimulation guard that modeled state UI is zero on the certified default build in 2025. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
* Add OK regular heating LIHEAP * Clarify OK LIHEAP coverage limitations * Fix Oklahoma LIHEAP income counting from review - Count Social Security net of the Medicare Part B premium, floored per person (FY2025-FY2027 plans section 1.9). - Count military retirement pay; correct the pension comment. - Count TANF through the take-up-gated tanf variable instead of ok_tanf. - Round monthly income half up to the dollar before the gross test and the band lookup (OAC 340:20-1-11). - Date the $240 earned-income deduction from 10/1/2024 and the child-only need standard from 1/1/2025, the earliest official editions. - Follow SNAP's noncitizen rule, as OAC 340:20-1-10(d)(3) directs through 340:50-5-67, by reusing is_snap_immigration_status_eligible (narrowed by P.L. 119-21 from July 2025). - Require a utility surcharge for heat-in-rent renters and roomers (OAC 340:20-1-19(d), plan item 2.3), proxied by a positive heating expense. - Set verified_years to 2025-2027 and shorten the programs.yaml note. - Add and update tests for each change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix issues from review: count retirement distributions and deduct premiums Count retirement_distributions; deduct other health premiums and any Part B premium above Social Security for members 60+ or disabled (OAC 340:20-1-11(c)(1)); household size uses adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply the reference page-citation convention One reference entry per source; single-page citations keep the page only in the href; multi-page titles end with a quoted #page list and the href opens the first cited page; variable references use '# PDF pages ...' comments above multi-page hrefs (CLAUDE.md, PolicyEngine/policyengine-us PR 10009). Reference lines only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review round 1 on Oklahoma LIHEAP - S1: Merge blocker from #9558: the unearned list reads the raw unemployment_compensation, so modeled ok_ui drops ou - S2: Social Security counts net of Part B in the gross test; the OAC counts gross income and deducts the premium af - S3: The medical deduction misses pretax payroll premiums (#10046) and reads is_disabled instead of the 7 CFR 271.2 - S4: Eight parameter descriptions are off the house template, and the student parameter misdescribes its scope - S5: References: two missing page lists, a missing #page=1, and FY2025 limits dated and cited only from FY2026 - S6: farm_operations_income has no test that would fail if it were dropped Also applies the in-scope suggestions. Tests not run locally; CI validates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's review on Oklahoma LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add RI regular heating LIHEAP components * Add Rhode Island LIHEAP heating eligibility * Add Rhode Island LIHEAP direct-heating award * Fix Rhode Island LIHEAP issues from review - Start regular heating payments in FY2026 with a dated in_effect switch: no FY2025 benefit matrix is published, so 2025 and earlier pay $0. - Use the eligibility primary-bill test for subsidized row F. - Count military retirement pay, retirement distributions and gambling winnings; floor each unearned source at zero. - Count TANF through the take-up-gated tanf variable instead of ri_works. - Deduct the Medicare Part B premium per manual III.H (p21); rename the deduction list to deduction_sources. - Put RI on the LIHEAP coverage line and shorten its note. - Add tests for each change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix issues from review: exclude every full-time student aged 18-23 Follow the FY2026/FY2027 application instructions over the 2020 manual's household-head exception, drop the unused is_household_head test inputs, and note the plan-versus-manual conflict for workers' compensation and TDI/TCI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply the reference page-citation convention One reference entry per source; single-page citations keep the page only in the href; multi-page titles end with a quoted #page list and the href opens the first cited page; variable references use '# PDF pages ...' comments above multi-page hrefs (CLAUDE.md, PolicyEngine/policyengine-us PR 10009). Reference lines only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pay Rhode Island LIHEAP heat-in-rent grants Heat-in-rent households receive the FY2026 matrix rows G-I: a $400 direct grant, or an $80 secondary-electric grant ($50 when subsidized) when a separate electric bill is reported, with the $350 utility enhancement on the secondary-electric grant. Subsidized heat-in-rent tenants without a utility burden are ineligible. The research-date payment gate is removed, so earlier years backfill the FY2026 schedule as unverified estimates. Utility provider and grant receipt stay an assumption; no new input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use the shared SMI helper for the Rhode Island LIHEAP income limit Calls liheap_smi_limit from PR 10019 instead of repeating the HHS floor-then-floor calculation. Limits are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review round 1 on Rhode Island LIHEAP - S1: The unearned list reads the raw unemployment_compensation, so main's #9558 guard fails - S2: Row G prints no Electric amount, but the PR pays $400 for electric heat in unsubsidized rent with no electric - S3: Three pieces of logic have no test that fails when they break: excluded members' interest, 8 unearned sources - S4: Six parameter descriptions fall outside the house template - S5: Wrong rental anchor, Appendix H without page 2 and on two hosts, multi-page titles without page lists Also applies the in-scope suggestions. Tests not run locally; CI validates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's review on Rhode Island LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add SD regular heating LIHEAP components * Count railroad retirement in South Dakota LIHEAP income * Add supported South Dakota LIHEAP eligibility and heating awards * Fix South Dakota LIHEAP tables and income counting from review - Encode the published FY2025 three-month income limits (sizes 1-10) as a dated table, since no single rule reproduces them, while FY2024 and FY2026 keep the rule-based limits. - Date the direct-payment matrix from October 2021 (FY2022/FY2023 cells) and October 2023 (FY2024-FY2026 cells). - Count Social Security net of the Medicare Part B premium (ARSD 67:15:01:18(12)), military retirement pay, trust income (manual p25) and gambling winnings (manual p27, followed over the plan); floor each unearned source at zero. - Make mixed-status households eligible: only citizens and eligible aliens count toward household size (manual p9, p18), and ineligible members' income counts in full because the manual's citizenship income calculator does not publish its proration formula. - Count TANF through the take-up-gated tanf variable instead of sd_tanf. - Put SD on the LIHEAP coverage line; verified_years 2024-2026; short note. - Add and update tests for each change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix issues from review: count workers' compensation Add workers_compensation to the unearned sources (EA-297 application page 5; ARSD 67:15:01:01(4)) and document the FY2026 plan-versus-DSS income-limit conflict for sizes 4-6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply the reference page-citation convention One reference entry per source; single-page citations keep the page only in the href; multi-page titles end with a quoted #page list and the href opens the first cited page; variable references use '# PDF pages ...' comments above multi-page hrefs (CLAUDE.md, PolicyEngine/policyengine-us PR 10009). Reference lines only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Correct South Dakota LIHEAP verification coverage * Use the shared SMI helper for the South Dakota LIHEAP income limit Calls liheap_smi_limit from PR 10019 instead of repeating the HHS floor-then-floor calculation. Limits are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review round 1 on South Dakota LIHEAP - S1: Unearned list reads the raw unemployment_compensation (main's #9558 guard fails) - S2: Regular cash help from family (financial_assistance) is excluded - S3: Twelve parameter descriptions are off the house template (five have trailing sentences) - S4: References: plan link without a page, incomplete page lists, rate parameters missing plan item 2.1 Also applies the in-scope suggestions. Tests not run locally; CI validates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's review on South Dakota LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add OH regular heating LIHEAP components * Fix Ohio LIHEAP heat-in-rent electricity eligibility * Clarify Ohio LIHEAP eligibility-only coverage * Add Ohio heating payment estimates from final 2023 workbook * Fix Ohio LIHEAP years, limits and income counting from review - Encode the FINAL 2021 benefit workbook (intercept, slope, fuel ratios, targeted multiplier, no young-child targeting); the 2021 values carry through 2022 because no final 2022 workbook was found. - Encode the 2024 and 2025 benefit workbook values, derived from the workbooks' credit percentages and matching their printed fuel maximums ($811/$441). The 2025 values carry into 2026 and later as unverified estimates: the 2026 workbook is not published. - Date the income-limit rules: 175% FPG for every size in 2022-23, FPG through size 7 with 60% SMI above from 2024-25, size 8 on FPG from 2025-07-01. Use the FFY2025 SMI for 2024-25 and the FFY2026 SMI for 2025-26 and 2026-27, inferred from the printed FPG-to-SMI switch points under the 42 USC 8624(b)(2)(B) cap and the 2026-27 OCC limits, and round as the HHS tables do (truncate 60% of the four-person median, then the size-adjusted amount), reproducing every published HHS amount. - Deduct the Medicare Part B premium; count military retirement pay, railroad benefits and general assistance (Guidelines catch-all, followed over the plan); count a minor's Social Security but not a child's SSI or other income; floor each source at zero. - Document that an omitted county falls back to Adams County. - Put OH on the LIHEAP coverage line; verified_years 2025. - Add and update tests for each change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix issues from review: deduct non-Medicare health premiums Deduct health_insurance_premiums_without_medicare_part_b (Guidelines Appendix XXIII) and test each counted unearned source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply the reference page-citation convention One reference entry per source; single-page citations keep the page only in the href; multi-page titles end with a quoted #page list and the href opens the first cited page; variable references use '# PDF pages ...' comments above multi-page hrefs (CLAUDE.md, PolicyEngine/policyengine-us PR 10009). Reference lines only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix Ohio HEAP terminal payment row and document coverage gaps * Use the shared SMI helper for the Ohio LIHEAP income limit Calls liheap_smi_limit from PR 10019 instead of repeating the HHS floor-then-floor calculation. Limits are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review round 1 on Ohio LIHEAP - S1: Unearned source list reads raw unemployment_compensation; main's #9558 guard fails - S2: Premium deduction misses payroll (pretax) premiums (main #10046) - S3: 2026 and 2027 pay the 2025 coefficients ($441 maximum) although the FY2026 matrix pays $31-$546 - S4: Size gate and NONE check are untested - S5: Twelve parameter descriptions use off-template verbs - S6: Wrong section label, two incomplete page lists, heat-in-rent branch lacks its E-4 citation - REC-C: Coordinator recommendation C: federal 110% poverty floor (applies to Ohio from size 17) Also applies the in-scope suggestions. Tests not run locally; CI validates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's review on Ohio LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rolina TANF (#9687) * Integrate modeled state unemployment insurance into income flows Rebase of PR #8303 onto current main under new ownership (original author has left PolicyEngine). Adds modeled_state_unemployment_compensation (sums al_ui, nj_unemployment_insurance, ny_ui, ok_ui, pa_uc, ut_ui) and total_unemployment_compensation (reported-wins fallback), repoints the direct consumers of unemployment_compensation - including the household_benefits parameter list - and extends the five state UI integration suites with income-flow, reported-preservation, and no-double-count cases. Resolves the uprating/adds computation-mode conflict Pavel flagged on #8303 via Option A: unemployment_compensation stays a pure uprated survey input, so CPS-reported values and future-year uprating are untouched and modeled UI reaches income flows only when no reported amount is present. NJ UI, modeled on main after #8303 was opened, is included in the modeled aggregate as part of the rebase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Route parameter-driven UI consumers through total unemployment compensation Per review: migrate every income-source list under parameters/gov/ (SNAP, TANF, SSI, WIC, school meals, Head Start, HUD, CBO, CCAP, state tax lists and the VA subtraction) and four contrib reform benefit lists from the reported unemployment_compensation input to total_unemployment_compensation. Document the reported-zero rule, fold two always-true source appends into direct substitutions, and add low-income SNAP, NJ, asymmetric-household, monthly and reported-zero tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Year-gate the modeled state unemployment insurance programs Sum modeled state UI through a year-gated parameter list so each program counts from its first verified year. Before 2022 the list is empty, so pre-2015 simulations (e.g. the 2010 Alabama SSP cases reached via SSI unearned income) no longer reach state UI parameters that start later. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Address review: pin the modeled-UI year gate and pass negative reports through Add year-gate tests for states before and after they enter the modeled-UI list (AL 2023 and 2010, NY 2024, OK 2022, and PA/UT/NJ excluded years), SSI/TANF and taxable-SS-MAGI flow tests, and treat any nonzero reported unemployment compensation (including negative amounts) as reported, as on main. Have Virginia subtract taxable UC, count strike benefits in Hawaii child care, fix a reference comma, and clarify the year-gate docs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Count gross unemployment and Social Security in South Carolina TANF The SC TANF unearned income list now reads total_unemployment_compensation and social_security instead of the taxable amounts, per SC DSS TANF Policy Manual Section 7.7 (SSA benefits count at the gross amount; unemployment benefits count in full). Closes #9677 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Update modeled-UI SNAP tests for main's months-of-receipt UI exemption Main's #9716 limits the SNAP work-registration UI exemption to the months of receipt (26 weeks -> 6 months), so outside those months the PA adults in these cases hit the ABAWD time limit and 7 CFR 273.11(c)(2)(ii) prorates their income. Update the two expectations with the arithmetic; no code change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Update modeled-UI SNAP tests for main's months-of-receipt UI exemption Same expectation updates as #9558 (this branch carries #9558's modeled state UI change): main's #9716 limits the SNAP work-registration UI exemption to the months of receipt, so the PA adults hit the ABAWD time limit outside them. No code change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * List total_unemployment_compensation in the AR line-comment check Main's code-health test pins the AR1000F line for every Arkansas gross income source; the unemployment line (21 from 2018) now reads total_unemployment_compensation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH * Route the remaining unemployment compensation readers through the total Thirteen readers that later merges of main brought in still read the reported-only unemployment_compensation input, so they missed modeled state UI when nothing was reported: - the student loan interest ALD MAGI and the two IRA deduction MAGI formulas (ira_219g_magi, ira_219g_taxable_social_security), which now append total_unemployment_compensation. The total never reaches AGI, so there is no cycle; - ten parameter source lists: NY HEAP, NJ LIHEAP, IN EAP, KS LIEAP, KY LIHEAP, MD MEAP, MO SAB, MS LIHEAP, NC LIEAP and OR LIHEAP. Each reader gets regression cases in its own test file: a modeled-UI case plus a reported-UI control where the state models UI (PA for the federal MAGI formulas, NY, NJ), and a reported-UI control elsewhere. The two IRA variables get new test files named for them. Add a code-health guard that fails when a parameter list entry or a Python string constant names the raw input, with an allowlist for uprating, the TAXSIM generator and the total's own formula. Add a microsimulation guard that modeled state UI is zero on the certified default build in 2025. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Add GA regular heating LIHEAP * Fix Georgia LIHEAP bundled-utility rental payments * Clarify GA LIHEAP coverage limitations * Fix issues from review: FY2025 cutoffs, heat-in-rent electric route, income - Add the published FY2025 Level I income cutoffs for sizes 1-16. - Make renters whose heat is in rent and who are billed for electric eligible (manual p89 row 3; p4 for subsidized renters with the bill in their name), paid the matrix amount for the main heating fuel. - Count Social Security net of the Medicare Part B premium; count military and railroad retirement; floor each income source at zero; read take-up-gated tanf instead of ga_tanf. - Shorten the registry note; set verified_years to 2025-2026. - Add period-2025, heat-in-rent, income-source and branch cases; tidy test comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count lottery winnings per the Georgia LIHEAP manual The manual's income table (section 1200.7) includes lottery winnings and cash gifts; plan section 1.9 leaves both unchecked. Follow the manual: count gambling_winnings as the closest input for lottery winnings, and note that cash gifts have no input. Also note the same plan-versus-manual conflict for disability payments and workers' compensation, which the manual counts (pages 65 and 68) and the model already follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix issues from review: document the noncitizen household-size conflict Quote manual 1100.14 (page 57) and the glossary (page 76) against 101.2, 1100.3 and 1100.5 a; the code keeps counting lawful immigrants in the size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply the reference page-citation convention One reference entry per source; single-page citations keep the page only in the href; multi-page titles end with a quoted #page list and the href opens the first cited page; variable references use '# PDF pages ...' comments above multi-page hrefs (CLAUDE.md, PolicyEngine/policyengine-us PR 10009). Reference lines only. Also cite manual section 1100.4 (not 1100.5 a) for the undocumented-adults sentence in the household-size comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count cash support in Georgia LIHEAP income * Use the shared SMI helper for the Georgia LIHEAP income limit Calls liheap_smi_limit from PR 10019 instead of repeating the HHS floor-then-floor calculation. Limits are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review round 1 on Georgia LIHEAP - S1: Merge blocker: the person source list reads the raw unemployment_compensation, so main's #9558 guard fails - S2: Eight income sources and two smaller pieces of logic are not pinned by any test - S3: Six parameter descriptions fall outside the house template - REC-C: Federal 110%-of-poverty floor (coordinator recommendation C; not raised by David for GA) Also applies the in-scope suggestions. Tests not run locally; CI validates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's review on Georgia LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address Pavel's round 2 review on Georgia LIHEAP Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Reword the Georgia household size note for the source-conflict check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apply round-3 wording suggestions to Georgia LIHEAP Cite FY2025 and FY2026 plan item 1.9 for the unchecked person sources and the child earnings exclusion, tighten the matrix test comment, and point the eligibility comment at the manual note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Supersedes #8303, whose original author (@daphnehanse11) has left PolicyEngine. @DTrim99 adopted it and rebased it onto current
main(177 commits of drift).What this does
This PR connects the modeled state unemployment insurance programs to every consumer of unemployment compensation.
modeled_state_unemployment_compensation(Person/YEAR) sums the modeled state UI programs (al_ui,nj_unemployment_insurance,ny_ui,ok_ui,pa_ucandut_ui) through a year-gated list,gov.states.household.modeled_state_unemployment_compensation. NJ UC was modeled onmainafter Draft: Integrate modeled state unemployment insurance into income flows #8303 was opened, so it was added during the rebase.verified_yearsinprograms.yaml: OK 2022; AL, NJ and UT 2024; NY and PA 2025. Lists carry forward, so there is no end year.total_unemployment_compensation.0000-01-01base keeps early-year simulations (e.g., the 2010 AL SSP cases) from reaching state UI parameters that start later.total_unemployment_compensation(Person/YEAR) uses reportedunemployment_compensationwhen it is nonzero, and the modeled amount otherwise. Every nonzero reported value, including a negative one, passes through exactly as onmain. Nothing is counted twice.unemployment_compensationnow readstotal_unemployment_compensation:student_loan_interest_ald_magi) and the IRA deduction MAGI (ira_219g_magiandira_219g_taxable_social_security). Merges ofmainbrought these in after this PR opened. Each figures MAGI without regard to section 85(c), so it counts all UC, reported or modeled;household_benefitslist.parameters/gov/from the reported input: 117 now readtotal_unemployment_compensationand one, Virginia's, readstaxable_unemployment_compensation(see below). The hardcoded benefit lists in 4 contrib reforms (Tlaib ECPA and EDAA, BOOST, TX rebate) also use the total.mainafter the first migration and are now migrated too: NY HEAP, NJ LIHEAP, IN EAP, KS LIEAP, KY LIHEAP, MD MEAP, MO Supplemental Aid to the Blind, MS LIHEAP, NC LIEAP and OR LIHEAP.default_uprating, the 2025 Trustees reform's SOI tuple), the TAXSIM test generator, and the total's own formula.Pre-existing fixes in files this PR touches (review round 3)
strike_benefitsis not in microdata, so aggregates do not move.capped_qualified_tuition_expenses_aldlacked a separating comma, so Python joined them into one invalid string. The reference is now a tuple of two URLs.Reported-zero rule
A reported nonzero amount (positive or negative) overrides modeled UI. A reported 0 is treated as not reported, because the formula cannot tell an explicit 0 from the default. To suppress modeled UI, leave the state UI wage and weeks inputs at 0. Microdata never populates those inputs, so aggregates are unaffected: there,
total_unemployment_compensation == unemployment_compensation. A new microsimulation test now checks this.Mode-conflict resolution (Option A)
@PavelMakarchuk's review on #8303 (changes requested) found that
unemployment_compensationdeclared bothupratingandadds. policyengine-core rejects that combination when the variable is registered, so the package failed to import. The fix, described in this comment:unemployment_compensationstays the pure uprated survey input, unchanged, so future-year microsim uprating and CPS-reported values are unaffected;Tests
The PR now changes 23 test files. That is above the 8-file selective Quick Feedback limit (
SELECTIVE_TEST_MAX_DIRECT_FILES), by choice: each migrated reader gets its regression cases in its own test file. Above the limit, Quick Feedback skips its selective run and coverage upload, so the full-suite jobs cover these changes.al_ui= $3,850, but modeled, total, tax-unit and taxable UC = $0) and 2010 (modeled and total UC = $0, pinning the empty base).taxable_ss_magi($10,218);adjusted_gross_incomeon each state's "feeds income flows" case (AL 103,850, NY 107,982 withny_agi, OK 108,000, PA 110,218, UT 119,396).main. Each modeled case has a reported-UC control with the same result:student_loan_interest_ald_magi$95,218 (was $85,000) andstudent_loan_interest_ald$797 (was $2,500);ira_219g_magi$90,218 (was $80,000);ira_219g_taxable_social_security$9,785.30 (was $2,500). These two IRA variables had no test file named for them, so each now has one;ny_heap_countable_income$7,980 after monthly flooring (was $0);nj_liheap_countable_income_person$6,000 (was $0);tests/code_health/test_unemployment_compensation_readers.pyfails when a parameter list entry or a Python string constant names the rawunemployment_compensation. It reads text and syntax trees and does not import the model. An explicit allowlist covers uprating, the TAXSIM generator and the total's own formula, and a second check fails if an allowlisted file stops reading the raw input. Run against the previous head, it flags all 13 raw readers fixed here.tests/microsimulation/test_microsim.py::test_default_dataset_has_no_modeled_state_unemployment_compensationasserts thatmodeled_state_unemployment_compensationis 0 for every person in the certified default build in 2025, the first year with all six programs. It computes only that variable over the full population and runs in the existing microsimulation job.Validation
SNAP before and after, for a PA single adult with no earnings and $10,218 of modeled UC, in January 2025:
Local tests on this round: 201 passed, 0 failed.
total_unemployment_compensation.yaml(18),ira_phase_out.yaml(15) andstudent_loan_interest_ald.yaml(13).test_modified_agi_add_backs.py(13).Local tests after merging current
main(85 commits): 132 passed, 0 failed.total_unemployment_compensation.yaml: 18/18.spm_unit_benefits.yaml: 6/6.va_subtractions_person,va_agi_personandintegration: 16.Earlier rounds also ran the SNAP income folder (267), the full VA subtractions folder (61) and the 4 changed contrib reforms (30). No existing expected value moved.
Coverage. On an earlier head, codecov's "project" number compared selective Quick Feedback uploads (this PR's changed files against 4 unrelated files at base), not whole-repository coverage.
No partner contract test files were touched.
Deferred to follow-ups
sc/tanf/income/unearned.yaml). This is outside the diff and the Social Security half changes SC TANF in every year, so it is tracked in South Carolina TANF counts taxable UC and taxable Social Security instead of gross amounts #9677 and fixed in the stacked Count gross unemployment compensation and Social Security in South Carolina TANF #9687, which fixes both halves together.axiom: n/a: routing reported unemployment compensation, or modeled AL/NJ/NY/OK/PA/UT unemployment insurance when none is reported, into the readers is a modeling change, not a change in law | Va. Code § 58.1-322.02(17) TheAxiomFoundation/rulespec-us#1756 queued | HAR § 17-798.3-10(b)(3)(B) TheAxiomFoundation/rulespec-us#1757 queued
🤖 Generated with Claude Code
https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH