Skip to content

Add Marketplace premiums to SPM MOOP#8178

Open
daphnehanse11 wants to merge 2 commits intoPolicyEngine:mainfrom
daphnehanse11:codex/issue-8095-marketplace-spm-moop
Open

Add Marketplace premiums to SPM MOOP#8178
daphnehanse11 wants to merge 2 commits intoPolicyEngine:mainfrom
daphnehanse11:codex/issue-8095-marketplace-spm-moop

Conversation

@daphnehanse11
Copy link
Copy Markdown
Collaborator

Summary

  • Adds marketplace_net_premium to spm_unit_medical_out_of_pocket_expenses.
  • Updates the SPM MOOP documentation to list Marketplace, Medicaid, CHIP, and Medicare Part B computed premium components.
  • Adds a selected-plan-ratio SPM MOOP test showing Marketplace net premium flows through after PTC.

Addresses #8095 and part of #8168.

Notes

This should be reviewed alongside the us-data residualization path in PolicyEngine/policyengine-us-data#844 so baseline imputed MOOP does not double-count computed Marketplace premiums.

Tests

  • uv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses.yaml policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses_medicare_part_b.yaml policyengine_us/tests/policy/baseline/gov/aca/ptc/marketplace_net_premium.yaml -c policyengine_us
  • uv run --extra dev ruff format policyengine_us/variables/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses.py
  • uv run --extra dev ruff check policyengine_us/variables/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses.py

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #8178       +/-   ##
============================================
+ Coverage   85.36%   100.00%   +14.63%     
============================================
  Files           3         1        -2     
  Lines          41        16       -25     
  Branches        2         0        -2     
============================================
- Hits           35        16       -19     
+ 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.

Copy link
Copy Markdown
Collaborator Author

Read-only review pass before patching:

The failing Full Suite - Baseline (irs-household) check is caused by the new marketplace_net_premium term flowing through spm_unit_medical_out_of_pocket_expenses into pre-existing household/SPM expense fixtures that were not setting ACA Marketplace inputs explicitly. The log shows:

  • policyengine_us/tests/policy/baseline/household/cliff_gap.yaml: the two TX spm_unit_net_income@2021 expectations are now lower by 6675.7188, consistent with an added Marketplace net premium expense.
  • policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_spm_expenses_chip_premium.yaml: spm_unit_spm_expenses@2024 now includes about 6294.821 of Marketplace net premium on top of the intended CHIP premium assertion.

I did not see a hardcoded-value, parameter metadata, or period-handling issue in the small formula diff itself. The focused fix is to isolate those existing non-Marketplace tests by explicitly setting Marketplace net premium/take-up to zero where the fixture is testing CHIP/cliff behavior, while leaving the new Marketplace SPM MOOP coverage intact.

Patching this now in a fresh detached worktree under /tmp.

@daphnehanse11 daphnehanse11 marked this pull request as ready for review April 28, 2026 18:33
@daphnehanse11 daphnehanse11 requested a review from MaxGhenis April 28, 2026 18:34
@MaxGhenis
Copy link
Copy Markdown
Contributor

This doublecounts marketplace premiums in MOOP and doesn't connect it to other MOOP use cases like SNAP and IMD. Fixing

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.

2 participants