Skip to content

Add a national liheap_eligible output - #11243

Merged
hua7450 merged 4 commits into
mainfrom
liheap-eligible
Dec 1, 2026
Merged

hua7450 merged 4 commits into
mainfrom
liheap-eligible

Conversation

@hua7450

@hua7450 hua7450 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Adds liheap_eligible, a national output that is true when a household is eligible for its state's regular LIHEAP heating or cooling benefit, with ak_hap_eligible for Alaska and wv_lieap_eligible for West Virginia.

Closes #11114

What and why

liheap gives the national payment total, but a caller who wants eligibility has to know each state's variable name. liheap_eligible reads a list of state eligibility variables, as liheap reads 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 uses adds on the list, as liheap does.
  • 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

Point in #11114 This PR
Alaska has no eligibility variable Adds ak_hap_eligible, true when ak_hap is above $0
Michigan's Home Heating Credit Left out, as liheap leaves it out
Illinois crisis eligibility Left out; il_liheap_eligible is the regular heating flag
heating_type unset Ships now. The variable's documentation says heating_type is a required input; #9754 tracks the default

Alaska 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_benefit and no award, so the flag is ak_hap > 0. ak_hap_eligible.yaml Case 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_lieap already applied that condition inside its formula, through has_heating_expense, so an income-eligible household with no heating cost got $0 while wv_lieap_income_eligible stayed true.

wv_lieap_eligible is the income test and has_heating_expense. wv_lieap now reads it as its defined_for and drops its own heating check, so no payment changes. Both reviews raised this.

Household (one adult, $9,000 wages, 2027) wv_lieap Income test wv_lieap_eligible
Gas heat, $900 gas bill $191.68 true true
Gas heat, $0 gas bill, heat not in rent $0 true false
Electric heat included in rent $0 true false
Heat in rent as a stated charge (has_heating_expense sent) $280 true true
Other fuel, $900 bill $0 true true

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

  • California lists ca_liheap_basic_eligible. Each of its three payments requires it.
  • Delaware lists de_liheap_cooling_eligible although liheap sums no Delaware cooling payment, because that benefit has no fixed amount.

Eligible does not mean a payment above $0

Every payment in liheap is 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 while liheap is $0:

  • a fuel with no amount in the state's benefit table, such as fuel oil in Alabama;
  • Delaware cooling eligibility alone;
  • a California household that meets the common eligibility but no payment's own conditions, such as a Madera County household below the county's priority minimum.

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, with liheap $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 existing ak_hap.yaml cases.
  • 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 existing wv_lieap.yaml cases cover the unchanged payments.
  • test_aggregate_list_integrity.py: the new list joins AGGREGATE_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 joins gov.hhs.liheap.regular_payments without its eligibility flag joining the new list. YAML cannot compare two parameter lists. The test reuses the module's variables fixture and builds no model or simulation.

Test plan

  • YAML tests: eight cases. I computed each directly with a script against this branch and all matched; I did not run the test suites locally, so CI validates them.
  • The new list check, evaluated directly: 61 members, all defined, state-gated, yes/no on the SPM unit; no listed payment lacks its flag.
  • Source conflicts: not applicable.
  • make format: ruff format --check and ruff check pass on the changed Python files (ruff 0.15.5).
  • Changelog fragment in changelog.d/
  • No file under 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

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>
@hua7450
hua7450 marked this pull request as ready for review November 23, 2026 19:06

@PavelMakarchuk PavelMakarchuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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

  1. The West Virginia member is an income test only. policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:67 lists wv_lieap_income_eligible. That variable does not check the fuel. Failure case: a 2026 West Virginia household with $15,000 of wages and heating_type UNSPECIFIED gets liheap_eligible: true and wv_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 short wv_lieap_eligible (income test and a supported fuel), or name West Virginia in the documentation of liheap_eligible.
  2. Program registry. policyengine_us/programs.yaml (LIHEAP entry, about line 1037) names only liheap. The registry has no field for a second output, so no change is necessary. Optional: say in the entry notes that liheap_eligible exists.

What I checked

  • Head and state. The head is da81ef3096 (1 commit on main at 0a440f1de8). main moved by two commits after that base (Massachusetts HEAP FY2027, #11205). Those commits do not touch the LIHEAP lists. A merge with current main is clean. GitHub reports MERGEABLE, BLOCKED (review needed).
  • Reference. I fetched 42 U.S.C. 8624 from Cornell. The anchor #b_2 exists. 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. For ak_hap_eligible, I fetched 7 AAC 44.080. Subsection (m) makes a household with fewer than 2.0 points after (a) to (l) ineligible. So ak_hap > 0 is 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_for for most; al_liheap, fl_liheap and ok_liheap read their flag in the formula; the three California payments each require ca_liheap_basic_eligible (directly, or through ca_liheap_utility_eligible and 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. adds on 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 test on gov/hhs/liheap and gov/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 changes ak_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_eligible true, liheap $1,020.
    • Texas with electric heat: true, $1,200.
    • Georgia with no fuel: heating flag false, cooling flag true, so liheap_eligible true and liheap $400.
    • Michigan with gas heat: false, $0.
    • Alaska with no place code: ak_hap $0 and ak_hap_eligible false.
    • West Virginia with no fuel: true with a $0 payment (Suggestion 1).
    • California with electric heat: true, $484.
  • Format and changelog. ruff format --check and ruff check pass on the three changed Python files. The fragment changelog.d/liheap-eligible.added.md is 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_type is 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 MaxGhenis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. West Virginia counts income qualification as eligibility. policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:67 uses wv_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 in wv_lieap. The expected liheap_eligible value is false. The model returns true (West Virginia FY2027 plan, pp. 9–10).
  2. Texas counts SNAP eligibility as receipt. policyengine_us/parameters/gov/hhs/liheap/regular_eligibility.yaml:59 picks up the shortcut in policyengine_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 has is_snap_eligible=true, $0 in snap, and no other categorical benefit. The expected liheap_eligible value is false. The model returns true (Texas FY2026 amendment, §1.4a, PDF p. 7, and §2.1, PDF p. 10). The existing tx_ceap_eligible formula also omits the plan’s means-tested veterans-payment route.
  3. Alaska halves points after the heating allowance ends. policyengine_us/variables/gov/states/ak/dpa/hap/ak_hap_eligible.py:16 says the award applies every condition. The flag inherits the reduction at policyengine_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 in ak_hap, and have both ak_hap_eligible and liheap_eligible true. 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:12 gives a Madera household liheap_eligible=true even 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:262 passes when a payment is listed in 2023 and its eligibility flag first appears in 2024.
  • policyengine_us/variables/gov/hhs/liheap/liheap_eligible.py:11 calls heating_type required. A Delaware household with a cooling expense and no fuel input still gets liheap_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}

hua7450 and others added 2 commits November 30, 2026 12:45
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>
@hua7450
hua7450 merged commit 90af7c4 into main Dec 1, 2026
36 checks passed
@hua7450
hua7450 deleted the liheap-eligible branch December 1, 2026 20:46
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.

Add a national liheap_eligible output, and note that heating eligibility is false in 41 jurisdictions when heating_type is unset

3 participants