Skip to content

[codex] Integrate household costs into cliff reporting#4

Merged
daphnehanse11 merged 3 commits into
mainfrom
codex/integrate-household-costs
Apr 20, 2026
Merged

[codex] Integrate household costs into cliff reporting#4
daphnehanse11 merged 3 commits into
mainfrom
codex/integrate-household-costs

Conversation

@daphnehanse11
Copy link
Copy Markdown
Collaborator

Summary

This PR finishes the household-cost integration that started with CHIP premiums.

It updates both the browser-side PolicyEngine path and the Python calculator path so household costs are treated consistently in net resource calculations, cliff drivers, and the chart UI.

What changed

  • subtract chip_premium from net_resources in the browser-side PolicyEngine transformer for both household and series results
  • request chip_premium from the browser-side PolicyEngine situation payload and carry it through the returned result shape
  • include household cost increases in cliff-driver generation in both the frontend and Python calculator paths
  • preserve those drivers during refined-series recomputation so cliff explanations stay accurate after zooming into cliff zones
  • render household costs in the detail chart using metadata.household_costs, including CHIP premium as a visible negative series and as a tooltip row in net-income mode
  • update cliff-report copy so it reflects household cost increases as reportable drivers
  • add focused tests for the frontend PolicyEngine transformer and Python cliff-driver logic

Why

Max's package refactor correctly introduced household costs on the Python side, but the app still had three integration gaps:

  • the browser-side calculation path ignored CHIP premiums in net_resources
  • cliff explanations never attributed drops to household cost increases
  • the UI had no place to show household costs even when the backend exposed them

That meant the app could miss real CHIP-premium cliffs in normal usage and under-explain them even when they were present.

Impact

Users now see household costs reflected consistently in:

  • net income calculations
  • cliff-driver explanations
  • the detail chart and tooltip breakdowns

This keeps the browser path, fallback API path, and visual explanations aligned.

Validation

  • uv run pytest
  • npm test
  • npm run build

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cliff-watch Ready Ready Preview, Comment Apr 20, 2026 8:35pm

Request Review

@daphnehanse11 daphnehanse11 marked this pull request as ready for review April 20, 2026 20:12
@daphnehanse11 daphnehanse11 merged commit c97e578 into main Apr 20, 2026
3 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.

1 participant