Skip to content

Retire legacy Marketplace coverage input#8693

Merged
hua7450 merged 2 commits into
PolicyEngine:mainfrom
daphnehanse11:codex/8674-health-benefit-accounting
Jul 8, 2026
Merged

Retire legacy Marketplace coverage input#8693
hua7450 merged 2 commits into
PolicyEngine:mainfrom
daphnehanse11:codex/8674-health-benefit-accounting

Conversation

@daphnehanse11

@daphnehanse11 daphnehanse11 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8674

Summary

This PR retires the legacy Marketplace coverage input from the active input/export surface while preserving the variable name as a compatibility alias. It also canonicalizes household health benefit accounting on annual health-value variables, including assigned_aca_ptc rather than the monthly premium_tax_credit wrapper.

API partner implications

This is intentionally API-surface-relevant:

  • has_marketplace_health_coverage is no longer an active input variable discovered from PE-US metadata.
  • The legacy variable remains calculable and now mirrors has_marketplace_health_coverage_at_interview.
  • Partners exporting PE-US input variables should stop surfacing has_marketplace_health_coverage.
  • Reported Marketplace coverage should use has_marketplace_health_coverage_at_interview.
  • Simulated ACA take-up should use takes_up_aca_if_eligible.
  • Annual health resource accounting should use healthcare_benefit_value / assigned_aca_ptc; premium_tax_credit remains a monthly wrapper.

Health accounting semantics

  • healthcare_benefit_value: annual canonical household resource value of health coverage.
  • household_health_benefits: annual health value included in household_benefits only when gov.simulation.include_health_benefits_in_net_income is enabled.
  • Program wrappers medicaid, chip, and monthly premium_tax_credit are no longer listed in household health benefits to avoid double-counting or period mismatch.

Tests

  • uv run policyengine-core test policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml policyengine_us/tests/policy/baseline/household/healthcare_benefit_value.yaml policyengine_us/tests/policy/baseline/household/expense/health/has_marketplace_health_coverage.yaml policyengine_us/tests/policy/baseline/gov/aca/ptc/premium_tax_credit.yaml policyengine_us/tests/policy/baseline/gov/aca/eligibility/is_aca_ptc_eligible.yaml policyengine_us/tests/policy/baseline/gov/aca/ptc/aca_ptc.yaml -c policyengine_us
  • uv run pytest policyengine_us/tests/core/test_input_variable_definitions.py -q
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml -c policyengine_us
  • make format
  • git diff --check

CI follow-up

An initial CI changelog check failed because the fragment used the old changelog.d/fixed/8674.md path. This branch now uses changelog.d/8674.fixed.md, matching the current PR workflow.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f9e58e7) to head (2b81b22).
⚠️ Report is 161 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8693   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           55        31   -24     
  Branches         0         1    +1     
=========================================
- Hits            55        31   -24     
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.

@daphnehanse11 daphnehanse11 force-pushed the codex/8674-health-benefit-accounting branch from 7c511ae to 2b81b22 Compare July 6, 2026 20:00
@daphnehanse11 daphnehanse11 marked this pull request as ready for review July 6, 2026 20:11
@daphnehanse11 daphnehanse11 requested a review from MaxGhenis July 6, 2026 20:11

@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.

Approving — a clean soft-retirement plus health-accounting canonicalization, well-guarded by tests (agent-assisted review; I verified the load-bearing parts).

Nothing in the model reads has_marketplace_health_coverage: it keeps its name, drops default_value = True, and now aliases has_marketplace_health_coverage_at_interview via a formula, so it stops being an input variable but stays calculable (set-inputs still override). The effective default flips True→False, but with zero formula readers that's inert. #8187 already pulled it out of the PTC path; this finishes the retirement.

The household_health_benefits parameter lands on the same 7-variable list as healthcare_benefit_value: medicaidmedicaid_cost and premium_tax_creditassigned_aca_ptc are value-neutral, and the real delta — picking up co_omnisalud and or_healthier_oregon_cost — only applies when include_health_benefits_in_net_income is on (default off). No double-count: Healthier Oregon is gated on federally-barred-non-citizen status (disjoint from medicaid_cost) and OmniSalud enrollees have no federal APTC (disjoint from assigned_aca_ptc). Case 4 nails the double-count guard. fixed is the right fragment type.

Two non-blocking notes:

  • The canonical list now lives in two hand-kept places (healthcare_benefit_value.adds and the parameter). That's the drift #8674 wanted to kill — consider making household_health_benefits gate healthcare_benefit_value directly unless you're intentionally keeping the set reform-modifiable via the parameter.
  • Downstream follow-up lives in populace: it still carries has_marketplace_health_coverage in cps_carried.py and asserts on it in test_us_puf_support.py. Nothing breaks, but the export surface should switch to the _at_interview variable to finish the retirement there.

@daphnehanse11 daphnehanse11 requested a review from hua7450 July 8, 2026 14:22
@hua7450 hua7450 merged commit ba6a87d into PolicyEngine:main Jul 8, 2026
35 checks passed
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.

Retire legacy Marketplace coverage input and canonicalize health benefit accounting

3 participants