Skip to content

Model Basic Health Program as separate coverage (fixes #8112)#8127

Merged
MaxGhenis merged 5 commits intomainfrom
codex/issue-8112-basic-health-program
Apr 27, 2026
Merged

Model Basic Health Program as separate coverage (fixes #8112)#8127
MaxGhenis merged 5 commits intomainfrom
codex/issue-8112-basic-health-program

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Rebased + review-fixed replacement for #8116 (daphnehanse11's original fork PR — fork PRs can't run CI here, so repushed to upstream).

Summary

  • Adds gov/hhs/basic_health_program/ coverage modeling (statutory 133–200% FPL, with NY's 250% FPL expansion). Active states: MN (2015), NY (2016+), OR (2025+), DC (2026+).
  • Excludes is_basic_health_program_eligible people from ACA PTC eligibility, so simulated aca_ptc zeros out for Essential Plan / MinnesotaCare / OHP Bridge / Healthy DC Plan enrollees. This is the upstream fix that closes the NY per-state ACA calibration gap seen in policyengine-us-data integration tests.
  • Moves MN/NY/OR/DC adult and parent Medicaid income ceilings back to Medicaid-only levels so that above-Medicaid-line residents in those states land in BHP rather than silently losing coverage.

Review-driven fixes on top of #8116

Codex review caught two bugs on the original PR which are fixed in this version:

  1. No income floor. BHP relied on ~medicaid_eligible alone, which only works in Medicaid-expansion states. Adding TX (non-expansion) to active_states would have qualified sub-133% FPL adults as BHP-eligible. Added explicit income_floor = 1.33 parameter per 42 USC §18051(b)(2)(B).
  2. Sub-annual cutover dates on a YEAR-defined variable. NY (2015-04-01), OR (2024-07-01), and NY expansion (2024-04-01) cutovers never triggered in annual sims, so e.g. 2024 NY at 230% FPL and 2024 OR at 180% FPL both returned false when they should return true. Moved effective dates to Jan 1 of the first full BHP year for each state.

Added 5 YAML regression tests covering the floor, the NY 2016 first-full-year, the OR 2024 not-yet-active case, the NY 2025 250% FPL expansion boundary, and the NY 2024 at-230% FPL boundary.

Credits

Original implementation: @daphnehanse11 in #8116 (issue #8112). This PR preserves the original three commits from that branch, adds one review-fix commit, and pushes to upstream so CI can run.

Test plan

  • uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/hhs/basic_health_program --batches 1 → 11 passed
  • uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/hhs/medicaid --batches 1 → 167 passed
  • uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/aca/eligibility --batches 1 → 57 passed
  • make format / ruff check clean
  • Once merged + published: policyengine-us-data integration test_aca_calibration should drop NY from 511% to <100% error

Fixes #8112. Supersedes #8116.

🤖 Generated with Claude Code

daphnehanse11 and others added 4 commits April 21, 2026 07:15
(1) BHP had no explicit income floor — the ~medicaid_eligible guard
alone only works in Medicaid-expansion states. Adding a non-expansion
state to active_states would have swept sub-133% FPL citizens into
BHP incorrectly. Added an explicit income_floor parameter (1.33 =
133% FPL per 42 USC 18051(b)(2)(B)).

(2) Variable is YEAR-defined but parameter cutovers used sub-annual
dates (NY 2015-04-01, OR 2024-07-01, NY expansion 2024-04-01), so
they never triggered in annual simulations. Moved cutovers to Jan 1
of the first full BHP year for each state (NY 2016, OR 2025,
NY expansion 2025; MN 2015 and DC 2026 were already Jan 1).

Added 5 regression YAML tests covering: the 133% FPL floor, the
NY 2016 first-full-year, the OR 2024 not-yet-active case, the NY
2025 250% FPL expansion, and the NY 2024 at-230% FPL boundary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (20705b0) to head (ca325ca).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #8127       +/-   ##
============================================
+ Coverage   85.36%   100.00%   +14.63%     
============================================
  Files           3         4        +1     
  Lines          41        57       +16     
  Branches        2         0        -2     
============================================
+ Hits           35        57       +22     
+ Misses          6         0        -6     
Flag Coverage Δ
unittests 100.00% <100.00%> (+14.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

# Conflicts:
#	policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/adult/income_limit.yaml
#	policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/parent/income_limit.yaml
#	policyengine_us/variables/gov/aca/eligibility/is_aca_ptc_eligible.py
@MaxGhenis MaxGhenis enabled auto-merge (squash) April 26, 2026 18:17
@MaxGhenis MaxGhenis merged commit 9f036f0 into main Apr 27, 2026
24 checks passed
@MaxGhenis MaxGhenis deleted the codex/issue-8112-basic-health-program branch April 27, 2026 03:21
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.

Model Basic Health Program as a separate coverage program

2 participants