Skip to content

Remove the years_since_us_entry default of 5 - #9732

Open
DTrim99 wants to merge 7 commits into
mainfrom
remove-years-since-us-entry-default
Open

DTrim99 wants to merge 7 commits into
mainfrom
remove-years-since-us-entry-default

Conversation

@DTrim99

@DTrim99 DTrim99 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

On hold: do not merge until the data supplies years_since_us_entry (PolicyEngine/microcosm#1085, fixing PolicyEngine/microcosm#776). It also needed the ICHIA/CHIPRA §214 lawfully-residing option modeled first. That option merged on October 5, 2026 (#9737), and this branch now includes it, so recent permanent-resident children and pregnant people in states that took the option pass through it. Without the data column, this change moves every permanent resident in the default dataset (11.03M weighted) inside the Medicaid five-year bar. It also moves about 8.6M adult permanent residents with no data-observable exception inside the SNAP waiting period. The two partner tests below also need the partner sign-off gate before merge.

Partner sign-off pending before merge: the two partner cases below now state years_since_us_entry: 5, so their expected values are unchanged. Per the partner-test rule, Ziming Hua's approval of a head that contains these edits is still needed before merge.

Summary

This PR removes default_value = 5 from years_since_us_entry, so the variable now falls back to the float default of 0. #8151 added the default of 5, and its own comment called it "a PolicyEngine modeling decision — not a statutory value." Ziming Hua raised this in standup: the default quietly treated every noncitizen without an entry date as past the federal five-year bar.

With a default of 0, the model treats a noncitizen in a status subject to the five-year bar as inside the bar, and a refugee as inside the refugee cash assistance (RCA) window, unless the caller supplies the input. The variable's documentation now says what the input means for each program: for the 8 USC 1613(a) bar, years since entry with qualified-alien status; for the Office of Refugee Resettlement window, years since entry, or since the status grant for statuses such as asylee. Households that supply years_since_us_entry get the same results as before.

Behavior before and after, when the input is omitted

Program Variable Before (default 5) After (default 0)
Medicaid (federal) is_medicaid_immigration_status_eligible LPRs, parolees and conditional entrants pass the five-year bar They fail the bar, unless they are children or pregnant people in a state that elected the lawfully residing option (#9737). Bar-exempt statuses (refugee, asylee, Cuban/Haitian entrant, deportation withheld) are unchanged
Washington TANF wa_tanf_immigration_status_eligible LPRs and conditional entrants (and parolees before September 30, 2021) pass They fail, so these families move from TANF to State Family Assistance through wa_sfa_immigration_status_eligible
Missouri SSP mo_ssp_immigration_status_eligible LPRs, parolees and conditional entrants pass the waiting period They fail, unless they are veterans or on active duty
Washington RCA wa_rca_immigration_window_eligible Refugees and other RCA statuses fall outside the one-year window They fall inside the window
SNAP (federal, from #9661) meets_snap_qualified_alien_waiting_period LPRs, parolees and conditional entrants pass the five-year waiting period They fail it unless an exception applies: under 18, disability benefits, a military connection, or, for LPRs only, 40 qualifying quarters or an exempt admission category. A person who fails becomes an ineligible member: excluded from the SNAP unit, with income prorated
CHIP (federal, from #9737) is_chip_immigration_status_eligible LPRs, parolees and conditional entrants pass the five-year bar They fail it, unless the state elected the lawfully residing option for the group (children or pregnant people) in both CHIP and Medicaid. This flows to is_chip_eligible_child, is_chip_eligible_standard_pregnant_person and California's County Children's Health Initiative Program (CCHIP)
New Hampshire SSP (from 2026) nh_ssp_eligible LPRs, parolees and conditional entrants pass the waiting period They fail it, unless an LPR is credited with 40 qualifying quarters (snap_alien_qualifying_quarters)
Nebraska and Oklahoma LIHEAP ne_liheap_household_size, ok_liheap_immigration_eligible LPRs, parolees and conditional entrants count in the household Both programs read is_snap_immigration_status_eligible, so a person inside the SNAP waiting period with no exception does not count in the household, and their income is prorated (Nebraska) or deemed (Oklahoma)

Downstream of Medicaid, an LPR inside the bar can now qualify for Emergency Medicaid, Illinois Health Benefits for Immigrants, Healthier Oregon, and the ACA premium tax credit's below-100%-FPL exception for lawfully present immigrants.

Code comments in wa_tanf_immigration_status_eligible (the pre-1996 limitation note) and wa_rca_immigration_window_eligible no longer refer to the default of 5. The meets_snap_qualified_alien_waiting_period documentation no longer says the default of 5 leaves everyone past the waiting period. It now says the default of 0 leaves a person in a subject status inside the waiting period unless an exception applies.

Test changes

I ran every case that has a person in a bar-subject or RCA status and no explicit years_since_us_entry (190 cases across 101 files, including partner files). I also ran the full WA DSHS, MO SSP and Medicaid eligibility test directories and every edited file in full. Other cases can't change: every consumer short-circuits citizens, and immigration_status defaults to CITIZEN. No expected value changed. Each case that relied on the old default now states the input:

  • Tests of an eligible status rather than of the bar. Each gets years_since_us_entry: 5 and a comment:
    • is_medicaid_immigration_status_eligible.yaml: "Eligible immigration status - Legal Permanent Resident"
    • is_medicaid_eligible.yaml: "Eligible via medicaid eligibility and immigration eligibility"
    • emergency_medicaid/integration.yaml: Case 7
    • il_hbi_eligible.yaml: "LPR senior not eligible"
    • il_hbi_immigration_status_eligible.yaml: "Legal Permanent Resident not eligible for HBI"
    • or_healthier_oregon_immigration_status_eligible.yaml: "LPR NOT eligible (uses federal Medicaid)"
  • Tests of the bar or window that relied on the default. Each now states years_since_us_entry: 5:
    • is_aca_ptc_eligible.yaml: "Medicaid immigration-eligible immigrant below FPL does not qualify through exception"
    • wa_tanf_immigration_status_eligible.yaml: Case 8. It now duplicates Case 6 and could be dropped.
    • wa_rca_eligible.yaml: Case 5
  • New cases that lock the new default:
    • Medicaid: an LPR with no input is inside the bar (false).
    • WA RCA Case 5b: a refugee with no input is inside the window (true).
  • wa_tanf_immigration_status_eligible.yaml Case 15: the comment now names the default of 0.

SNAP, after merging #9661: I ran the SNAP immigration tests (185 cases, counting the two new ones). I also ran 576 more cases: the rest of the SNAP eligibility directory, the SNAP ineligible-member tests and the California SNAP tests. All pass. I also traced all 81 cases, partner files included, that have a person in a waiting-period status and no explicit input. Only four reach meets_snap_qualified_alien_waiting_period: my two new cases, one case whose outputs don't change, and the partner case below. No expected value changed:

  • Tests of the status list or California's delayed implementation rather than the waiting period now state years_since_us_entry: 5, with a comment:
    • is_snap_immigration_status_eligible.yaml: Case 7 ("LPR still eligible post-OBBBA").
    • Case 48, renamed "California parolee past the waiting period is eligible during the delayed implementation".
    • Case 51, renamed "parolee and conditional entrant past the waiting period are eligible before OBBBA".
  • Tests of the waiting period that relied on the default now state it:
    • meets_snap_qualified_alien_waiting_period.yaml: Case 5, renamed "adult LPR with five years in qualified status meets the waiting period". It now duplicates Case 4.
    • Case 50, renamed "five years in qualified status leave every subject status past the waiting period".
  • New cases that lock the new default:
    • Case 5b: an adult LPR with no input is inside the waiting period (false).
    • Case 50b: an adult LPR, a parolee and a conditional entrant with no input are inside it (false), and an LPR child is exempt (true).
  • The header comments of both files now name the default of 0.

After merging main on October 26, 2026

The merge with main (545 commits) had no conflicts. Main added two direct readers of years_since_us_entry: is_chip_immigration_status_eligible (#9737) and nh_ssp_eligible. It also added the Nebraska and Oklahoma LIHEAP programs, which read SNAP immigration eligibility, including the waiting period. I scanned every YAML case for a person in a qualified-noncitizen status with no years_since_us_entry (208 cases in 116 files). I then ran 30 non-partner files (516 cases): the 22 whose outputs can reach a reader, and every other test file this PR edits. All pass after the changes below. No expected value changed:

  • is_chip_immigration_status_eligible.yaml:
    • Case 7 tests the post-section-71109 status list. Its Arizona LPR now states years_since_us_entry: 5, with a comment. Without it, the LPR fails the bar.
    • Case 14's comment cited "the default five years since entry". The parolee and conditional entrant now state five years, so the case still tests only the status limit. The expected values were already false.
    • New Case 2b locks the new default: an Arizona LPR child with no input is inside the bar (false).
  • ne_liheap_household_size.yaml Case 2 tests whether permanent residents count. Both LPRs now state years_since_us_entry: 5. Without the input, their household size falls from 2 to 0.
  • The New Hampshire SSP and Oklahoma LIHEAP tests already state the input, so none change. California CCHIP Case 16 (an LPR child) still passes through California's child option.
  • The years_since_us_entry documentation now names the programs that apply the bar: Medicaid, CHIP, Washington TANF, and the Missouri and New Hampshire SSPs.

Partner test impact

Two partner cases relied on the old default. Each LPR now states years_since_us_entry: 5 (commit d013717), so both expected values are unchanged and both files pass (38 cases). Without the input, these are the values a caller who omits the field would get:

  • partners/analytics_coverage/edge_cases/federal/cash/ssi/federal.yaml, case ssi_aged_lpr_status (federal), a 65-year-old LPR in Texas in 2026:
    • medicaid falls from 13,708.50 to 0.
    • is_medicaid_eligible changes from true to false.
    • SSI (11,928) and every other output are unchanged.
  • partners/analytics_coverage/edge_cases/federal/nutrition/snap/federal.yaml, case snap_head_immigration_lpr (federal). The household is in Texas in 2026: a 35-year-old LPR head earning $20,000, a citizen spouse and a citizen child.
    • snap falls from 5,442 to 4,158 a year. The head is inside the waiting period, so the head becomes an ineligible member: excluded from the unit, with income prorated.
    • is_snap_eligible stays true.
    • The other 23 cases in that file are unchanged. No other partner case has a person in a waiting-period status without the input, so no other partner case can change through SNAP.

Microsim note

The default dataset (populace_us_2024.h5@populace-us-2024-spm-20260909) has no years_since_us_entry column, so every record uses the default. It does fill immigration_status_str:

Status Records Weighted people
Citizen 153,491 318.1M
Undocumented 6,682 9.95M
LPR 5,702 11.03M
Cuban/Haitian entrant 226 0.73M
DACA 220 0.30M

No records are refugee, asylee, parolee or conditional entrant.

This PR therefore moves all 11.03M weighted LPRs from past the bar to inside it:

  • Medicaid: they fail the bar nationwide, including in California, whose state-funded status list covers only undocumented, DACA and TPS immigrants.
  • Washington TANF: 194 records, or 0.39M weighted people, move to SFA.
  • Missouri SSP: 24 records, or 0.12M weighted people, fail the waiting period.
  • Washington RCA: no effect, because Washington has no refugee-like records.
  • SNAP: of the 11.03M weighted LPRs, 1.06M are under 18 and exempt. That leaves 9.96M adults (5,098 records) inside the waiting period unless an exception applies. Data proxies for the exceptions cover about 1.3M of them: reported SSI, SSDI or other disability benefits cover 1.00M, and veteran benefits or military service (self or spouse) cover 0.35M. The data carry no qualifying-quarters or exempt-category input. About 8.64M weighted adult LPRs (4,618 records) are left with no data-observable exception. Of those, 1.65M (837 records) live in SPM units that report SNAP in the CPS. Modeled SNAP also changes for their households, because a member who fails the waiting period leaves the unit and only part of their income counts. These counts come from reading the h5 columns directly, not from a simulation. The model computes SSI and disability receipt itself, so its exemption count can differ.

These counts predate the merge of #9737 and the newer programs. LPR children and pregnant people in states that elected the lawfully residing option, including California for children, now pass Medicaid through the option. The Medicaid effect is therefore smaller than "nationwide" above. The CHIP, New Hampshire SSP and Nebraska and Oklahoma LIHEAP effects are not counted here.

The dataset carries the raw CPS year-of-entry code PEINUSYR. By my unverified reading of the code bands, about 26% of weighted LPRs (2.86M) entered in 2020 or later. Neither default fits the population. The old default overstated eligibility for recent entrants, and the new one understates it for long-resident LPRs. Of the 8.64M adult LPRs with no exception, 1.92M have those codes. Deriving years_since_us_entry in the data (PolicyEngine/microcosm#776) resolves this; without it, expect a material drop in modeled Medicaid enrollment and in SNAP benefits among LPRs.

axiom: n/a: the default value of years_since_us_entry is a PolicyEngine input convention, not a provision of law

🤖 Generated with Claude Code

https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH

The variable now defaults to 0, so a non-citizen in a status subject to a
five-year bar is treated as inside the bar (and a refugee as inside the RCA
window) unless the input is supplied. Tests that are not about the bar now
state years_since_us_entry: 5 explicitly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (ffe31ef).
⚠️ Report is 114 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9732   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         3    -1     
  Lines           76        40   -36     
  Branches         2         0    -2     
=========================================
- Hits            76        40   -36     
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 Harness.
📢 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.

…nce-us-entry-default

# Conflicts:
#	policyengine_us/variables/household/demographic/person/years_since_us_entry.py
DTrim99 and others added 2 commits October 1, 2026 20:47
- meets_snap_qualified_alien_waiting_period docstring: the default is now 0,
  so a bar-subject status without the input is inside the waiting period
  unless an exception applies.
- SNAP tests that relied on the old default now state years_since_us_entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
@DTrim99

DTrim99 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@hua7450, this PR needs the partner-test sign-off before two files under tests/policy/baseline/partners/ change.

Model change. This PR removes default_value = 5 from years_since_us_entry, so an omitted entry date now falls back to 0. A lawful permanent resident with no years_since_us_entry is now inside the five-year bars:

  • Medicaid: 8 U.S.C. 1613(a).
  • SNAP's qualified-alien waiting period: 8 U.S.C. 1612(a)(2)(L), meets_snap_qualified_alien_waiting_period.

Before this PR, the default of 5 treated them as past the bar. You raised this in standup.

Partner cases that change (CI "Household API Partners", run 36952591908):

File Case Output Expected (old default 5) With the default of 0
partners/analytics_coverage/edge_cases/federal/nutrition/snap/federal.yaml snap_head_immigration_lpr snap 2026 5,442 4,158 (the LPR head becomes an ineligible member: excluded from the unit, income prorated)
partners/analytics_coverage/edge_cases/federal/cash/ssi/federal.yaml ssi_aged_lpr_status medicaid 2026 13,708.50 0 (inside the five-year bar)

Proposed edit. Add years_since_us_entry: 5 to the LPR in each case. Both expected values stay the same (5,442 and 13,708.50). It's the same pattern the PR already uses for the non-partner cases that relied on the old default.

Partner impact even with that edit. An API partner that sends an LPR without years_since_us_entry will get SNAP and Medicaid results for someone inside the bar. In these two households, that's SNAP 5,442 → 4,158 and Medicaid 13,708.50 → 0. Partners who send the field see no change.

The PR stays a draft and on hold until the data supplies years_since_us_entry (PolicyEngine/microcosm#1085) and the ICHIA/CHIPRA option (#9737) is modeled.

Before I edit either file, could you answer:

  1. Are you sure you want to edit this test file?
  2. Have you notified a team member about this change?
  3. Have you notified the API partner about this change?

@DTrim99
DTrim99 requested a review from hua7450 October 26, 2026 14:37
DTrim99 and others added 3 commits October 26, 2026 10:39
…rging main

Main added two direct readers of years_since_us_entry (CHIP immigration
eligibility from #9737 and New Hampshire adult cash assistance) and two
LIHEAP programs (Nebraska, Oklahoma) that read SNAP immigration eligibility,
including the qualified-alien waiting period.

- is_chip_immigration_status_eligible Case 7: the Arizona permanent resident
  checks the post-71109 status list, so it now states five years.
- Case 14: the comment no longer relies on the default of 5; the parolee and
  conditional entrant state five years so only the status limit applies.
- New Case 2b locks the default of 0 for CHIP (inside the bar).
- ne_liheap_household_size Case 2: the permanent resident couple checks that
  permanent residents count, so both state five years.
- years_since_us_entry documentation names the programs that apply the bar.

No expected value changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
snap_head_immigration_lpr and ssi_aged_lpr_status relied on the old
default of 5. Each LPR now states years_since_us_entry: 5, so both
expected values are unchanged (SNAP 5,442; Medicaid 13,708.50).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH
@DTrim99
DTrim99 marked this pull request as ready for review October 26, 2026 15:18
@DTrim99

DTrim99 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@hua7450, a quick update on my earlier comment. After talking it over, I've added years_since_us_entry: 5 to the LPR in both partner cases (d013717). That's the same pattern the PR uses for the non-partner cases.

  • Expected values: unchanged. snap_head_immigration_lpr stays at SNAP 5,442, and ssi_aged_lpr_status stays at Medicaid 13,708.50. Both files pass locally (38 cases).
  • What partners still see: the behavior change for callers who omit the field (SNAP 5,442 → 4,158 and Medicaid 13,708.50 → 0 in these households) is still described in the PR body.
  • Merge: your approval of a head with these edits is still needed, and the PR is still on hold for the data (microcosm#1085).

I've marked the PR ready for review so CI runs.

This branch has not been deployed

No deployments
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.

1 participant