Repository navigation
Add a national liheap_eligible output - #11243
Conversation
liheap_eligible is true when a household is eligible for its state's regular LIHEAP heating or cooling benefit. It reads a new list of state eligibility variables, gov.hhs.liheap.regular_eligibility, as liheap reads its list of payments. Alaska had no eligibility output, so this adds ak_hap_eligible, true when the household has an award. Michigan's Home Heating Credit and Illinois crisis assistance are left out, as in liheap. The list-integrity test now covers the new list and checks that every payment in the national total has its eligibility flag in it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PavelMakarchuk
left a comment
There was a problem hiding this comment.
#11243: Add a national liheap_eligible output
Verdict: APPROVE (head da81ef3096)
The head did not move during the review. The head commit is from 2026-11-23, 2:02pm EST.
Summary
The PR adds liheap_eligible, a national yes/no output on the SPM unit. It reads a new list, gov.hhs.liheap.regular_eligibility, with adds, in the same way as liheap reads gov.hhs.liheap.regular_payments. The PR also adds ak_hap_eligible (true when ak_hap > 0), because Alaska had no eligibility output. No existing output changes. The list covers every jurisdiction that liheap covers (50 of 51; Michigan stays out, as in liheap), and every cooling eligibility variable in the model. All tests pass at the head, CI is green, and I found no wrong value or behavior.
Findings
CRITICAL
None.
SHOULD ADDRESS
None.
SUGGESTION
- The West Virginia member is an income test only.
policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:67listswv_lieap_income_eligible. That variable does not check the fuel. Failure case: a 2026 West Virginia household with $15,000 of wages andheating_typeUNSPECIFIED getsliheap_eligible: trueandwv_lieap: 0. In the other 49 jurisdictions, an unset fuel usually gives false. The PR body and the variable documentation describe this. Optional: add a shortwv_lieap_eligible(income test and a supported fuel), or name West Virginia in the documentation ofliheap_eligible. - Program registry.
policyengine_us/programs.yaml(LIHEAP entry, about line 1037) names onlyliheap. The registry has no field for a second output, so no change is necessary. Optional: say in the entrynotesthatliheap_eligibleexists.
What I checked
- Head and state. The head is
da81ef3096(1 commit onmainat0a440f1de8).mainmoved by two commits after that base (Massachusetts HEAP FY2027, #11205). Those commits do not touch the LIHEAP lists. A merge with currentmainis clean. GitHub reports MERGEABLE, BLOCKED (review needed). - Reference. I fetched 42 U.S.C. 8624 from Cornell. The anchor
#b_2exists. It is the income eligibility rule (150% of the poverty level or 60% of state median income, and categorical eligibility). This is a correct citation for an eligibility list. Forak_hap_eligible, I fetched 7 AAC 44.080. Subsection (m) makes a household with fewer than 2.0 points after (a) to (l) ineligible. Soak_hap > 0is a correct eligibility test. Both Alaska URLs return 200. - List coverage. I loaded the system and checked each of the 61 members: all are bool, SPM unit, YEAR and state-gated. I compared the list with the 62 payments in
regular_payments. Every payment has its gate on the list:defined_forfor most;al_liheap,fl_liheapandok_liheapread their flag in the formula; the three California payments each requireca_liheap_basic_eligible(directly, or throughca_liheap_utility_eligibleand the liquid-fuel formula). I searched all state folders for cooling eligibility variables. All 11 (AL, AR, DE, GA, KY, LA, NE, NJ, OK, SC, VA) are on the list. - No conflict or double count. No other variable is named
liheap_eligible. The new variable is an output only. Nothing in the model reads it, and it is not in a benefit or net income total. - Formula.
addson a bool variable returns bool. A household with two true flags (Alabama heating and cooling) gives true, not 2. - Default for states without a model. Michigan gives false. A state flag is false outside its state, so no other state leaks in.
- Tests at the head.
policyengine-core testongov/hhs/liheapandgov/states/ak/dpa/hap: 177 passed.test_aggregate_list_integrity.py: 42 passed, including the new list-to-payment test. I also merged the head with the open Alaska HAP PR #11229 (it changesak_hap_base_benefit). The Alaska and LIHEAP tests pass on that merge (187 passed). - Hand-computed cases (2026, one adult, $15,000 of wages, $1,800 of electricity, $600 of gas, cooling expense), in one vectorized simulation:
- Alabama with electric heat: both Alabama flags true,
liheap_eligibletrue,liheap$1,020. - Texas with electric heat: true, $1,200.
- Georgia with no fuel: heating flag false, cooling flag true, so
liheap_eligibletrue andliheap$400. - Michigan with gas heat: false, $0.
- Alaska with no place code:
ak_hap$0 andak_hap_eligiblefalse. - West Virginia with no fuel: true with a $0 payment (Suggestion 1).
- California with electric heat: true, $484.
- Alabama with electric heat: both Alabama flags true,
- Format and changelog.
ruff format --checkandruff checkpass on the three changed Python files. The fragmentchangelog.d/liheap-eligible.added.mdis top level and the type is valid. - CI. All 40 checks pass, including Microsimulation, Household API Partners and all baseline and contrib shards.
- Overlap. Open PRs #11229 (Alaska HAP) and #11235 (Hawaii LIHEAP) touch related files. Neither conflicts textually. #11229 passes the new tests when merged (see above).
- Partner tests. No file under
tests/policy/baseline/partners/changes.
Not verified
- I did not run a microsimulation. CI runs one and passes. In the current data,
heating_typeis unset, so this output is false for most records outside the cooling states. The documentation says so. - I did not check each state's eligibility variable against its own state rules. This PR only aggregates them.
- I did not check the HHS LIHEAP guidance documents. The statute is enough for the one reference that this PR adds.
MaxGhenis
left a comment
There was a problem hiding this comment.
Agent review for Max, written by Claude Code for Max Ghenis.
Thanks for adding this flag. A Codex cloud task reviewed da81ef3 (GPT-6.2 Sol at Extra High effort; chat https://chatgpt.com/local/6b0c5762-2aec-83ea-8480-791c7f7c30e2). Its verdict is request changes, with 3 P1 findings:
- West Virginia counts income qualification as eligibility.
policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:67useswv_lieap_income_eligible. A subsidized renter earning $9,000 with a $0 gas bill, no heat included in rent, and no other heating obligation passes the income screen and gets $0 inwv_lieap. The expectedliheap_eligiblevalue is false. The model returns true (West Virginia FY2027 plan, pp. 9–10). - Texas counts SNAP eligibility as receipt.
policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:59picks up the shortcut inpolicyengine_us/variables/gov/states/tx/tdhca/ceap/tx_ceap_eligible.py:39. A one-person household with $25,000 in 2026 countable income exceeds the $23,940 limit and hasis_snap_eligible=true, $0 insnap, and no other categorical benefit. The expectedliheap_eligiblevalue is false. The model returns true (Texas FY2026 amendment, §1.4a, PDF p. 7, and §2.1, PDF p. 10). The existingtx_ceap_eligibleformula also omits the plan’s means-tested veterans-payment route. - Alaska halves points after the heating allowance ends.
policyengine_us/variables/gov/states/ak/dpa/hap/ak_hap_eligible.py:16says the award applies every condition. The flag inherits the reduction atpolicyengine_us/variables/gov/states/ak/dpa/hap/ak_hap_base_benefit.py:69. A subsidized Juneau household with $24,000 in wages, a $300 oil bill, and an explicit $0 allowance should retain 3.0 points, get $525 inak_hap, and have bothak_hap_eligibleandliheap_eligibletrue. The model gives it 1.5 points, a $0 award, and two false flags (7 AAC 44.080(l)–(n) and Alaska subsidized-heat manual, §3007-1).
Also worth fixing (P2):
policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:12gives a Madera householdliheap_eligible=trueeven though it scores 8 points against the modeled 20-point minimum, fails the utility screen, and gets $0.policyengine_us/tests/test_aggregate_list_integrity.py:262passes when a payment is listed in 2023 and its eligibility flag first appears in 2024.policyengine_us/variables/gov/hhs/liheap/liheap_eligible.py:11callsheating_typerequired. A Delaware household with a cooling expense and no fuel input still getsliheap_eligible=true.
All 48 PR tests passed:
- 4 national YAML cases and 2 Alaska YAML cases.
- 42 tests in
test_aggregate_list_integrity.py.
Proposed YAML
- name: WV income qualification without a heating obligation
period: 2027
input:
state_code: WV
age: 35
immigration_status: CITIZEN
employment_income: 9000
heating_type: NATURAL_GAS
gas_expense: 0
heat_expense_included_in_rent: false
receives_housing_assistance: true
output: {wv_lieap_income_eligible: true, wv_lieap: 0, liheap_eligible: false}
- name: Texas SNAP eligibility without receipt
period: 2026
input:
state_code: TX
age: 40
employment_income: 25000
heating_type: ELECTRICITY
pre_subsidy_electricity_expense: 1980
is_snap_eligible: true
snap: 0
ssi: 0
is_tanf_enrolled: false
output: {tx_ceap_countable_income: 25000, liheap_eligible: false}Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
West Virginia's only eligibility output was its income test, so liheap_eligible was true for a household with no heating cost of its own, which the manual (section 21.3.1.C) makes ineligible. wv_lieap_eligible is the income test and has_heating_expense. wv_lieap reads it as its defined_for and drops its own heating check, so no payment changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Resolve test_aggregate_list_integrity.py: keep main's rewritten benefit-list checks and this branch's LIHEAP eligibility list check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds
liheap_eligible, a national output that is true when a household is eligible for its state's regular LIHEAP heating or cooling benefit, withak_hap_eligiblefor Alaska andwv_lieap_eligiblefor West Virginia.Closes #11114
What and why
liheapgives the national payment total, but a caller who wants eligibility has to know each state's variable name.liheap_eligiblereads a list of state eligibility variables, asliheapreads its list of payments.gov.hhs.liheap.regular_eligibility: 61 state eligibility variables. Each is a yes/no output on the SPM unit.liheap_eligible(SPM unit, yes/no, year): true when any listed variable is true. It usesaddson the list, asliheapdoes.ak_hap_eligible: Alaska had no eligibility output.wv_lieap_eligible: West Virginia's only eligibility output was its income test.No existing output changes.
The issue's four points
ak_hap_eligible, true whenak_hapis above $0liheapleaves it outil_liheap_eligibleis the regular heating flagheating_typeunsetheating_typeis a required input; #9754 tracks the defaultAlaska follows the award, not the base benefit
Alaska's award function applies every condition of 7 AAC 44. It tests the 2.0-point minimum of 44.080(m) after the dwelling share (h) and the utility-allowance reduction (l). A household can therefore have a positive
ak_hap_base_benefitand no award, so the flag isak_hap > 0.ak_hap_eligible.yamlCase 2 pins this: a subsidized Juneau household has a $525 base benefit, a $0 award, and is not eligible.West Virginia adds the heating-cost condition
West Virginia's manual bases Regular LIEAP eligibility on income, group size, vulnerability to the cost of home heating, residence and citizenship (section 21.3.1). Section 21.3.1.C makes a household with no heating cost of its own ineligible.
wv_lieapalready applied that condition inside its formula, throughhas_heating_expense, so an income-eligible household with no heating cost got $0 whilewv_lieap_income_eligiblestayed true.wv_lieap_eligibleis the income test andhas_heating_expense.wv_lieapnow reads it as itsdefined_forand drops its own heating check, so no payment changes. Both reviews raised this.wv_lieapwv_lieap_eligiblehas_heating_expensesent)The fuel is not part of the flag. A household that pays for a fuel the payment table does not price stays eligible with a $0 payment, as in other states. The 20-member limit also stays in the payment formula, because it is a coverage limit of the model and not a rule.
Two choices in the list
ca_liheap_basic_eligible. Each of its three payments requires it.de_liheap_cooling_eligiblealthoughliheapsums no Delaware cooling payment, because that benefit has no fixed amount.Eligible does not mean a payment above $0
Every payment in
liheapis gated by a variable on the list, so a household with a payment is always eligible. The reverse does not hold. The flag follows each state's own variable and can be true whileliheapis $0:The variable's documentation says so.
Tests
liheap_eligible.yaml, four cases: a Texas household within 150% of the poverty guideline (true); the same household over the limit (false); Delaware cooling eligibility alone, withliheap$0 (true); a Michigan household eligible for the Home Heating Credit (false).ak_hap_eligible.yaml, two cases: a Fairbanks household with a $1,925 award (true); the Juneau household above (false). Both reuse the inputs of existingak_hap.yamlcases.wv_lieap_eligible.yaml, two cases. The first has five households: one pays its own gas bill (true), one has no heating bill (false), one has heat in the rent (false), one is over the income ceiling (false), and one pays for a fuel the table does not price (true). The second has heat in the rent as a stated charge (true). The existingwv_lieap.yamlcases cover the unchanged payments.test_aggregate_list_integrity.py: the new list joinsAGGREGATE_LISTS, so the three existing list checks cover it (members are defined variables, members are state-gated, no silent removals between year blocks). One new test,test_liheap_eligibility_lists_the_flag_of_every_listed_payment, fails when a payment joinsgov.hhs.liheap.regular_paymentswithout its eligibility flag joining the new list. YAML cannot compare two parameter lists. The test reuses the module'svariablesfixture and builds no model or simulation.Test plan
make format:ruff format --checkandruff checkpass on the changed Python files (ruff 0.15.5).changelog.d/tests/policy/baseline/partners/changes.axiom: n/a: adds three outputs derived from existing variables; no rule, parameter value or existing result changes
🤖 Generated with Claude Code