Skip to content

Update the calculator for 2027: compare 2026 and 2027 current law with H.R. 1834 in the API, calculator and Overview - #37

Merged
DTrim99 merged 57 commits into
mainfrom
aca-2027-overview
Nov 24, 2026
Merged

DTrim99 merged 57 commits into
mainfrom
aca-2027-overview

Conversation

@DTrim99

@DTrim99 DTrim99 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR is the whole 2027 update of the ACA calculator, in one place so nothing reaches the live app until we relaunch. It combines #33 (the API) and #34 (the calculator) with the Overview story; #33 and #34 are closed in favor of it.

Following Max's review of November 17, this launch is the calculator and the household story only. The national estimates are off the page until a validation run supports them. The validation run is done, and they need a fix to the data before they come back (see Status of the review). Max's follow-up of November 20 cleared the household story and held the calculator for a list of fixes, which a882306 makes (step 5).

The app tells one story: how benchmark premiums rise from 2026 to 2027 under current law, who pays the increase, and what reviving the enhanced credits (H.R. 1834) would do. It has three tabs: the Overview, the Calculator and Methodology.

It pins policyengine-us 2.138.2, which:

Reviewing

Use this branch's Vercel preview (behind the Vercel login): https://aca-calc-git-aca-2027-overview-policy-engine.vercel.app/us/aca-calc

  • The preview has its own API. It calls a preview copy of the API, the Modal app aca-calc-api-preview (https://policyengine--aca-calc-api-preview-fastapi-app.us-east.modal.run), deployed from this branch's backend (a882306, the last commit to touch it) with its own caches. The Vercel project's NEXT_PUBLIC_API_URL points this branch's previews at it; production and other previews still use the live API.
  • Merging deploys both. The Modal API workflow deploys aca-calc-api from main, after its tests, with a smoke test and rollback on failure. Vercel builds production from main.
  • Expect a short gap after merging. Vercel's production build is live within minutes. The API deploy follows only after the workflow's test job, which takes about 15 minutes. Until then, the new page talks to the old API, which answers every request for 2026, and the page says "These results are for 2026: the calculator's server doesn't support 2027 yet." The page doesn't store those answers in the browser cache, so they don't outlast the deploy. The calculator's four example households are stored with the page and are unaffected. The "Your household" tab asks a new endpoint, so until the deploy it says "The calculator's server is being updated. Try again in a few minutes."

Status of the review

  1. National figures off the page: done (d99089f). The Overview drops:

    • the three key figures;
    • the national average in the premiums section;
    • the sections on cost and reach, gains by decile, who gains, poverty and inequality.

    The Methodology tab drops:

    • "How the credit is counted", "Who enrolls" and the comparison with CBO;
    • the national paragraph of "Model and data";
    • the Limitations lines on enrollment and spending levels.

    precompute_national.py, national_impacts.json, cbo_estimate.json and NationalImpactChart stay in the repo, unused by the page, and check_data.mjs still checks the national file.

  2. Calculator and household story: done (10dbb87 and later).

    • Idaho counts as a Medicaid expansion state.
    • KFF is named as the source of the 2026 and 2027 premiums.
    • Both examples above 400% FPL are said to live in their state's highest-cost rating area.
    • H.R. 1834's credit for the Pennsylvania example ends at about $174,550, where 8.5% of income reaches the benchmark premium.
    • H.R. 1834 is still on the Senate calendar, with its last action on February 10, 2026, so "has not been enacted" stands (checked November 17).
  3. Five households on the preview: done (November 18). Each was sent to the preview API with the request the calculator page sends: 2027, with H.R. 1834 and 2026 alongside, computed fresh. Each was checked against the rules by hand.

    Household What it tests Result (2027, per month)
    Single adult, 40, Ada County, ID Medicaid expansion On Medicaid at 120% FPL, with no credit. Pays $289 at 251% FPL (8.66% of income) and $409 at 301% (10.22%). Under H.R. 1834, pays $510 at 451% FPL (8.5%).
    Couple aged 45 and 43 with a child of 8, Anchorage Alaska's guideline Uses Alaska's guidelines for three: $34,150 for 2027 credits, $33,310 for 2026. At $85,000 of earnings it pays $637, the 8.78% rate on $87,000 of income for the credit, which adds the two adults' $1,000 Permanent Fund Dividends. That income is 254% FPL; the earnings alone would be 248%.
    Couple aged 60 and 58, Laramie County, WY Above 400% FPL; no expansion No current-law credit above 400% FPL, so it pays the full $4,615. Under H.R. 1834, pays $687 at 448% FPL (8.5%) and $0 at 129%.
    Parents aged 35 and 33, children aged 6 and 2, Fulton County, GA No expansion; children Below 100% FPL the parents get no credit (the coverage gap). At 120% FPL the children are on Medicaid and the parents receive a credit. Pays $587 at 248% FPL. The regulation's rounded 8.58% rate gives $586; the model's unrounded 8.5848% gives $587 (aca_required_contribution_percentage skips the 0.01% rounding of 26 CFR 1.36B-3(g)(1) policyengine-us#11060).
    Single adult, 30, Los Angeles County, ZIP 90012 A county split by ZIP code Benchmark $453; pays $289 at 251% FPL. No H.R. 1834 credit at 451% FPL, where the benchmark costs less than 8.5% of income.

    Every answer was computed fresh by the preview API at a0dd3a7 on policyengine-us 2.138.2. In each:

    • all 11 arrays cover the same 1,001 incomes, and none has a negative value;
    • 2027 coverage uses the 2026 poverty guideline, and 2026 coverage the 2025 guideline;
    • there is no current-law credit above 400% FPL;
    • the payment matches the IRS's 2027 share of income at 250% and 300% FPL.
  4. The validation run for the national figures: done (November 17; validate_national.py, not in this PR). It reproduces the page's former figures exactly ($25.0 billion cost, $54.0 billion current-law credits), and it fails the enrollment and credit checks:

    • Enrollment by income. In 2025 the model enrolls 0.76 million people at 100–150% FPL, against CMS's 10.9 million sign-ups. It enrolls 4.7 million at 300–400% FPL, against 1.8 million. Its total is 13.9–17.8 million, against 24.3 million.
    • Credit totals. The model's 2025 credits are $51–60 billion, against about $144 billion of advance payments in CMS's annualized February 2025 snapshot.
    • The expiry. From 2025 to 2026, the model's enrollment above 400% FPL rises 4%, where CMS sign-ups fell 35%.
    • Coverage reports. 64% of enrolled tax units at or below 400% FPL have no Marketplace or off-exchange coverage report, confirming the agent review's estimate.
    • Poverty. The change in deep poverty rests on one sampled household, and the change in poverty on 60.

    The fix is in the data build: take-up by income band, with credits anchored to administrative totals. The national figures come back in a later PR, after that.

  5. Max's follow-up of November 20: done (a882306, data in 6385824).

    • Overview. The 100% FPL floor sentence ends at "floor": a lawfully present immigrant below 100% FPL whom Medicaid barred by status got a credit in 2021–2025.

    • The cards come from the API at the earnings entered (/api/calculate-at-income), not from between the income axis's $1,000 steps. Each case the follow-up named, on the preview API (monthly):

      Case Before Now
      Pennsylvania, 2026, $22,400 (just above Medicaid) no credit $1,057 credit ($1,056.75)
      Florida family, 2027, $43,889.99 (just below 133% FPL) $1,263 $1,298 ($1,297.94)
      Florida family, 2027, $132,000 (exactly 400% FPL), card and chart chart $0 $1,076.37 in both
      Pennsylvania, H.R. 1834, $174,550 $1 $0
      Laramie couple and three 17-year-olds, $1,100,000 $509 refused: earnings go up to $1,000,000
      Texas, $15,500 (coverage gap) $0 benchmark "Full premium" $770 ($770.15), with "A plan bought without a credit costs its full premium."
      Florida family, $40,000 "covered by Medicaid" "Medicaid would cover your children, so the benchmark plan covers you and your spouse." Credit $1,305
      Pennsylvania and California, $5,000 "has not expanded" the 2027 work requirement: earnings under $580 a month (80 hours at the federal minimum wage) bar these adults from Medicaid in the model; 2026 cards show Medicaid
      Anchorage family of three, $134,550 no credit $2,464 ($2,463.70): with two $1,000 dividends, income is 399.85% FPL
    • Wording. The input asks for "earnings", up to $1,000,000. "Has not expanded" appears only for the 10 states that haven't. The eligibility notice is gone: no card reads between calculated incomes now. "% FPL" is the credit's income over its guideline, rounded down as on Form 8962 line 5.

    • Charts. The 400% FPL line sits where the credit's income reaches it (in Alaska, $2,000 of earnings early), and the tooltips' "% FPL" uses the credit's income. The charts read the API's values, which are exact at every point now that exactly 400% FPL gets its credit, so they don't need scenarioAtIncome; the file that held it now holds the request for the cards.

The API

  • Year. Requests take year, 2026 or 2027 (2026 if absent). The household's inputs, every simulation period and both cache keys follow it. Responses report year, fpl_year and model_version.
  • 2026 alongside 2027. A 2027 request with show_prior_year also gets 2026 current law for the same household and incomes (ptc_prior_year, slcsp_by_income_prior_year, fpl_prior_year), run in parallel with the 2027 scenarios. A 2026 request can't ask for it, since the API doesn't model 2025.
  • The poverty line. The credit measures income against the prior year's guideline (aca_magi_fraction), but the API reported the coverage year's: $15,960 instead of $15,650 for a single person's 2026 coverage. It now reports the prior year's, so the FPL lines and "% FPL" figures match the credit.
  • Alaska and Hawaii. The household's state was set only for the coverage year, so the prior-year guideline fell back to the 48 states' figure. A single 40-year-old in Anchorage earning $40,000 got a 2027 credit of $9,177 instead of $9,947. The state is now set for both years.
  • Scenarios. One table drives both calculator endpoints, which had duplicated the scenario code. show_ira is H.R. 1834: the enhanced (ARPA/IRA) schedule for 2026–2028, with no income limit. Its reform now ends with the bill, in 2028, where the old reform ran to 2100. The 700% FPL bill and CRFB's two brackets stay in the API, so the live page keeps working until this merges; a follow-up can remove them.
  • slcsp_by_income. The benchmark premium at each income, for the members who'd buy a marketplace plan, so the page can show what the benchmark plan costs after the credit.
  • AI explanations. The prompt takes the year, names H.R. 1834, says every scenario is a proposal rather than law, and attributes the CRFB brackets' cost estimates to CRFB. With show_prior_year, it compares the 2026 and 2027 benchmark premiums and credits. Its cache key includes the year, show_prior_year and the model version. The page no longer calls /api/explain (see the calculator's changes below).
  • Pins. policyengine-us 2.138.2, from 1.691.3, with policyengine-core 3.36.0 and spm-calculator 1.1.0; every other pin is unchanged.
  • Memory goes from 2 GB to 4 GB. policyengine-us 2.x takes about 0.9 GB to load, and a process reached 2.4–2.9 GB after running the reforms.
  • Smoke test. After a deploy it also checks a 2027 calculation with 2026 alongside, and that it uses the 2026 guideline.
  • ACA_API_APP_NAME lets a preview app run beside the live one with its own caches.
  • /api/calculate-at-income. The calculator's request plus income (earnings, $0 to $1,000,000). For current law, H.R. 1834 (show_ira) and 2026 current law (show_prior_year), it returns the benchmark premium, the credit, the credit's income (magi) and guideline, and what covers each member (Medicaid, CHIP, or Medicaid's work requirement keeping them off it). Where the model prices no plan, in the coverage gap (policyengine-us #9472), full_premium is what one would cost without a credit, priced as the model prices an enrollee's. Cached like /api/calculate.
  • The credit's income. /api/calculate also returns magi at each point, so the page can place the 400% FPL limit on the earnings axis.
  • Exactly 400% FPL. Income that "does not exceed 400 percent" qualifies (26 U.S.C. 36B(c)(1)(A)), and Form 8962 Worksheet 2 decides "more than" on dollars. policyengine-us 2.138.2 makes exactly 400% ineligible (draft fix Treat income exactly at 400% FPL as premium tax credit eligible policyengine-us#10312, from the audit in #10329), so for current law at that income both endpoints apply the model's own formula. A dollar above, there's no credit. Among the stored examples, only the Florida family's $132,000 point changes.
  • H.R. 1834's model is built once per process. Building a reformed model took about 10 seconds and 1 GB on every request; with it held, a household calculates in under a second, and a 1,001-income run in about 0.5 seconds instead of 11.5. The other scenarios still build theirs per request: the page doesn't ask for them, and holding each would take another 1 GB.
  • Cache keys add an answer version, so the caches drop answers from before these changes.

The calculator

  • Top to bottom. The page reads down the column: the Overview's four example households, then the household form, then the results. The examples' results are stored (src/data/households/calculator_examples.json, written by precompute_calculator_examples.py from the preview API), so they appear without a request. Choosing one fills the form and scrolls to its results.
  • One comparison. Every calculation asks for 2027 with H.R. 1834 and 2026 current law alongside (year: 2027, show_ira, show_prior_year).
    • The results show 2026 and 2027 under current law.
    • A checkbox in the household form, "Compare with the enhanced credits", adds 2027 under H.R. 1834 to the charts and the household cards, without a new request.
    • The year setting and the old scenario checkboxes go. Older links with a year or scenario choices still open their household.
  • Three tabs:
    • What you'd pay charts the monthly payment for the benchmark plan after the credit, by income.
    • Premium tax credits charts the credit itself.
    • Your household takes the household's earnings, up to $1,000,000, and asks the API for each scenario at those earnings (half a second after typing stops; the examples' answers are stored with the page). It shows each scenario's benchmark premium, credit and payment, and the change from 2026 (and from current law, with the checkbox). A card for a household that Medicaid or CHIP covers names the program; in the coverage gap a card shows the full premium. A short note names Medicaid and CHIP only for the members they cover, and explains the coverage gap, Medicaid's 2027 work requirement, or the household's position below or above 400% FPL. Each card adds up: the payment is rounded from its exact value, and the credit shown is the rounded premium less it.
  • Share results. A button under the results copies a link to them. The link, which the address bar also shows, carries the household, the comparison checkbox, the open tab and the income entered, and opening it calculates the household and opens the same view. A calculator link opened on the page (pasted, or with back and forward) starts the calculator over from that link, and a county the state doesn't have becomes its first county.
  • Links straight to a tab. The server renders the Overview, and the browser switches to the tab the address names once it hydrates, so a link to the calculator or the Methodology tab no longer causes a hydration error (the server can't see the address after #).
  • No AI explanation. The "Explain with AI" button and its explanation window go. Share links no longer carry ai=1, and an older link with it opens the household's results.
  • Spinner. A spinner, with the step the server reports, shows while a household calculates, in place of the progress bar. The "Your household" cards show a small one while they load.
  • Browser cache. The key includes the year, the 2026 comparison and a CACHE_VERSION that changes with each policyengine-us pin. Only answers for the year asked are stored.

The Overview

One Overview replaces the Overview and Explore Households pages, told in the deployed app's order and format. On wide screens, the active section's chart is pinned on the left, in the middle of the screen, while its text scrolls past in cards on the right. The chart's card and the text cards share one height (the screen's, less 80px, up to 720px), each chart fills its card, and a section becomes active as its card reaches the middle of the screen, so the active card lines up with the chart. On narrower screens it is one column, with each chart under its text. Nine sections in four parts:

  1. How the credits work. How premium tax credits work (2027 current law's schedule, 2.15% to 10.22% of income, from 100% to 400% FPL), and who gets none below 100% FPL: adults up to 138% FPL qualify for Medicaid in expansion states, and in most non-expansion states an adult without children below 100% FPL falls in the coverage gap, qualifying for neither Medicaid nor a credit. Then the 2021–2025 enhancements, which kept the 100% floor, and their expiry (the 2026 and 2027 schedules).
  2. Two households facing the 2027 increase. A 40-year-old in Harris County, Texas, earning $40,000 (about 250% FPL), and a 45-year-old in Lebanon County, Pennsylvania, earning $104,000 (about 650%).
    • The Texas adult. Its benchmark premium rises $88 (13.0%), but the credit absorbs the increase: it pays $286 a month in 2026 and $289 in 2027.
    • The Pennsylvania adult. It receives no credit, so it pays the whole increase: $1,127 a month, then $1,236.
    • A table adds a column at each step.
  3. Reviving the enhanced credits.
    • What H.R. 1834 would do for both households. It would bring their payments to $133 and $737 a month.
    • Across incomes. The Pennsylvania example's payment by income.
    • No cliff at 400% FPL. The Pennsylvania example's marginal tax rate. Under current law, earning $1,000 more at 400% FPL costs it its $8,398 credit, a rate of 863%. Under H.R. 1834, its rate is 8.5 points higher from 400% FPL until the credit ends at about $174,550.
  4. Other households. The four example households' 2026 and 2027 payments, under current law and H.R. 1834.

The Overview ends with buttons to the calculator and to the Methodology tab. The Explore Households page and its components go, and links to it open the Overview.

Methodology tab (#methodology, Methodology.jsx):

  • Model and data: the policyengine-us version, KFF as the source of the benchmark premiums, and links to the precompute scripts.
  • Policies compared: 2026 and 2027 current law, H.R. 1834's schedule, and that income of exactly 400% FPL qualifies, which the calculator follows and policyengine-us 2.138.2 doesn't.
  • Limitations.

Design.

  • Theme. Colors, fonts and radii come from @policyengine/ui-kit's theme.
  • Chart colors. 2026 current law is slate and dashed, 2027 current law dark blue, H.R. 1834 teal.
  • Page frame. The Overview is 1320px wide. A white header with the title and pill-shaped tabs lines up with its left edge. Part headings are pills, section titles teal, and buttons lift on hover.
  • Charts.
    • Each line's name sits beside it, in the nearest spot that no line, 400% FPL line, caption or other name touches, away from where two lines overlap. A chart shows its legend instead where the lines run too close, or where a name has no room, as on a phone.
    • Charts fade in as they scroll into view, and a crosshair marks the hovered income.
    • On wide screens the Overview's charts fill the pinned card. Elsewhere charts have fixed heights inside their cards, so none runs past its box. This also fixes the calculator's chart, which overflowed its panel.
  • Tables. The household tables scroll sideways on a narrow screen.

Results (policyengine-us 2.138.2)

A single 45-year-old in Lebanon County, PA. Annual credits, with the monthly cost of the benchmark plan after them. The benchmark premium is $13,523 a year in 2026 and $14,837 in 2027.

Income (% FPL for 2027 / 2026 credits) 2026 current law 2027 current law 2027 H.R. 1834
$24,000 (150% / 153%) $12,482 ($87/mo) $13,805 ($86/mo) $14,837 ($0/mo)
$40,000 (251% / 256%) $10,086 ($286/mo) $11,373 ($289/mo) $13,237 ($133/mo)
$56,000 (351% / 358%) $7,945 ($465/mo) $9,113 ($477/mo) $10,777 ($338/mo)
$72,000 (451% / 460%) $0 ($1,127/mo) $0 ($1,236/mo) $8,717 ($510/mo)
$104,000 (652% / 665%) $0 ($1,127/mo) $0 ($1,236/mo) $5,997 ($737/mo)
$120,000 (752% / 767%) $0 ($1,127/mo) $0 ($1,236/mo) $4,637 ($850/mo)

The Overview's example households (monthly). "Pays" is the benchmark premium minus the credit. Each household has the same income in both years, and all members buy a marketplace plan.

Household Income 2026 benchmark 2027 benchmark Pays 2026 Pays 2027 Pays 2027, H.R. 1834
Single adult, 40, Harris County, TX $40,000 (251% FPL) $682 $770 $286 $289 $133
Family of four, Hillsborough County, FL $75,000 (227%) $2,062 $2,201 $488 $487 $193
Single adult, 45, Lebanon County, PA $104,000 (652%) $1,127 $1,236 $1,127 $1,236 $737
Couple aged 64 and 62, San Benito County, CA $90,000 (416%) $4,084 $4,622 $4,084 $4,622 $638

Checks

  • API:

    • CI's "Test with the image's packages" passes on policyengine-us 2.138.2.
    • tests/test_api_scenarios.py covers the year, the 2026 comparison, the cache key, the prior-year and Alaska guidelines, the 400% FPL end of current law, H.R. 1834 below 150% and above 400% FPL, and the scenarios that are off.
    • tests/test_api_at_income.py covers every case in step 5, the 400% FPL point on the income axis, the earnings limits, and that an answer at one income matches the axis at a calculated income.
    • The preview API, on this branch's backend, passes its smoke test, which now also checks /api/calculate-at-income, and the five-household check above.
  • Frontend.

    • Vercel's build of this branch passes.
    • The Overview and the calculator's results render server-side in Node (react-dom/server, with Recharts at a fixed width) with every figure filled: no undefined or NaN.
    • The household table's columns add up: $682 − $396 = $286, and $1,236 − $499 = $737.
    • The eight example change lines on the calculator's cards equal the differences between the payments shown.
    • In Chrome against a local API on this branch, links for each case in step 5 show the cards and text in its table, with no console errors. Choosing an example shows its cards without a request, and typing new earnings sends one request.
  • Data check. scripts/check_data.mjs runs before next build and fails the build if:

    • the data files come from different policyengine-us versions or years;
    • the calculator's stored examples differ from the Overview's table by $1 a month or more;
    • the Pennsylvania sweep's marginal rates don't cover every income, or the sweep doesn't match the household table;
    • an example's stored answer at its earnings is missing, or differs from the Overview's table by $1 a month or more;
    • the Florida family's income axis shows no current-law credit at exactly 400% FPL, or one a step above.

    It also keeps checking the unused national file. It passes.

  • Data, by hand. The agent review reproduced the stored household calculations, including the Pennsylvania household's $8,398 credit lost over a $1,000 step (an 863% marginal rate). H.R. 1834's payment above 400% FPL is 8.5% of income ($737 and $638 a month). 2027 current law runs from 2.15% to 10.22% of income, as Revenue Procedure 2026-26 sets.

Supersedes #33 and #34.

🤖 Generated with Claude Code

- Requests take a year, 2026 or 2027 (2026 if absent, so the live page's
  answers don't change), and every period, the household and both cache
  keys follow it. Responses report the year, the guideline's year and the
  policyengine-us version.
- The FPL the API reports is now the prior year's guideline, the one the
  credit uses, and the household's state is set for that year too, so
  Alaska and Hawaii households get their own guideline for it.
- One scenario table drives both calculator endpoints. New: the enhanced
  schedule capped at 700% FPL, and the enhanced schedule with a $5 minimum
  premium, which returns a 400 until policyengine-us models it (#10681).
  H.R. 1834's reform ends in 2028, as the bill does.
- Responses include the benchmark premium at each income.
- The AI explanation prompt takes the year and names the new scenarios.
- Pin policyengine-us 2.105.0 (policyengine-core 3.34.9, spm-calculator
  1.1.0), give the Modal function 4 GB, and smoke-test a 2027 answer after
  each deploy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
aca-calc Ready Ready Preview Nov 23, 2026 7:07pm UTC

Request Review

DTrim99 and others added 4 commits November 9, 2026 11:45
…remium

2.115.0 is the first release with the published 2027 premiums
(policyengine-us #10682) and the minimum premium reform (#10681), so the $5
minimum premium scenario now runs. The tests check that it leaves $60 a year
where H.R. 1834's credit covers the whole benchmark and matches H.R. 1834
where the household pays more, and that a model without it still gets a 400
that says so. Its requirements are those of 2.105.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A coverage year setting, 2027 by default with 2026 selectable, sent to the
  API and kept in share links (year=).
- H.R. 1834 replaces the "IRA Extension" label, and the enhanced credits
  capped at 700% FPL (a January 2026 draft variant) join the scenarios. The $5
  minimum premium variant is built but hidden behind MIN_PREMIUM_AVAILABLE
  until the API's policyengine-us models it. Each description says the
  proposal's status.
- Each result card shows what the benchmark plan costs after its credit,
  from the API's benchmark premium at each income.
- Current law is labeled with the year, the browser cache key includes the
  year and a model version, and the page header no longer says 2025 vs 2026.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Until the backend that takes a year is deployed, the API answers for 2026
whatever the page asks. The results already label the year the answer
reports; a notice now says when that isn't the year requested.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The API now pins policyengine-us 2.115.0, which models it, so the checkbox
shows, and the browser cache key names that version.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@DTrim99
DTrim99 force-pushed the aca-2027-calculator branch from 7ebb80b to b4fcebc Compare November 9, 2026 16:46
DTrim99 and others added 2 commits November 9, 2026 11:46
…om data

- The precompute scripts write src/data/, where the site reads, and the
  .gitignore rule that hid any data/ folder now covers only the root's.
- precompute_cliff_household.py: the example household at one income in
  2025 (enhanced credits), 2026 and 2027 (current law) and under H.R. 1834
  and the 700% FPL bill in 2027; the charts show 2027.
- precompute_households.py: the Explore households for 2027, without the
  net income runs no chart used.
- precompute_contribution_schedules.py (new): the contribution schedules as
  policyengine-us computes them, which the schedule chart now draws instead
  of rates typed into it (its 700% FPL bill line disagreed with the model).
- The Overview's figures, the cliff table and the Explore narratives' income
  limits come from that data; the Texas narrative no longer says H.R. 1834
  covers incomes below 100% FPL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The three precompute scripts, run on Modal with the API image's packages.
2027 premiums here are still 2026's trended forward; rerun the scripts
after the release with policyengine-us #10682 is pinned. The site reads
only the combined household file, so the script stops writing the
per-household copies, and the three tracked ones go.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
policyengine-us 2.115.0 has the published 2027 premiums (policyengine-us
#10682), so the pages' 2027 figures are no longer 2026's premiums trended
forward. The three precompute scripts ran on Modal with the API image's
packages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@DTrim99
DTrim99 marked this pull request as ready for review November 9, 2026 18:33
DTrim99 and others added 8 commits November 9, 2026 14:15
The calculator now compares 2027 current law with H.R. 1834 and shows 2026
current law beside them, so the January 2026 draft variants (the 700% FPL
cap and the $5 minimum premium) go. A 2027 request with show_prior_year
also gets 2026 current law for the same household and incomes:
ptc_prior_year, slcsp_by_income_prior_year and fpl_prior_year. The smoke
test asks for it, and the explanation prompt uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The calculator now makes one comparison: 2027 coverage under current law
and under H.R. 1834, with 2026 current law alongside. The year setting and
the scenario checkboxes go; old links still load their household.

- What You'd Pay charts the benchmark plan after the credit by income, and
  Premium Tax Credits the credit, for the three scenarios (PremiumChart).
- Your Household shows, at the income entered, each scenario's benchmark
  premium, credit and net premium, and the changes from 2026 and from
  current law.
- HealthBenefitsChart goes back to main's version, keeping only the wording
  ("current law", "H.R. 1834") and the chart year in its title; the
  Overview still uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… 1834

The Overview's data now covers what the page tells: premiums in 2026 and
2027 under current law, and 2027 if H.R. 1834 revived the enhanced
credits. The 2025 rows and the 700% FPL bill go.

- precompute_cliff_household.py: the Pennsylvania example in 2026 and 2027
  and under H.R. 1834, with its income sweeps named as the calculator API
  names them.
- precompute_households.py: four example households at one income each
  (examples.json), replacing the Explore Households data.
- precompute_contribution_schedules.py: current law for 2026 and 2027 and
  the enhanced schedule.

Run on Modal with policyengine-us 2.115.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The chart's title already names what it shows; the longer label could run
past a short chart.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DTrim99 and others added 5 commits November 11, 2026 09:47
ACA_API_APP_NAME names the Modal app (aca-calc-api by default). A preview
deploy, such as aca-calc-api-preview, gets caches of its own, and the image
carries the name so its containers open them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
precompute_national.py runs policyengine-us 2.115.0 over its default
microdata for 2027, under current law and with H.R. 1834, and writes
src/data/national_impacts.json: credits and recipients (with 2026 current
law), federal cost, income deciles, winners and losers, SPM poverty and
inequality, following policyengine.py's definitions.

policyengine-us leaves the premium tax credit out of household net income
by default, so each household's change in its credit is added to its net
income. SPM resources already count the credit, through the marketplace
premium net of it, so poverty is the model's own.

It needs about 32 GB of memory and ran on Modal (about 45 minutes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Overview and Explore Households pages become one Overview: how
benchmark premiums rise in 2027, how the credit absorbs the increase below
400% FPL while households above it pay all of it, what H.R. 1834 would
mean for four example households and across incomes, and its national
effects (cost, recipients, deciles, winners, poverty, inequality), then
the methods. Every figure comes from the precomputed data.

- New ExampleHouseholdsTable and NationalImpactChart; PremiumChart (from
  the calculator) takes the lines to draw.
- The Explore Households page and its components go; its links open the
  Overview. The last section opens the calculator tab.
- ContributionScheduleChart drops the 700% FPL bill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99 DTrim99 changed the title Move the Overview and Explore pages to 2027 and read their figures from data Tell the 2027 story on one Overview page, with national estimates of H.R. 1834 Nov 11, 2026
- The Overview's first section says households below 100% FPL get no
  credit: adults up to 138% FPL qualify for Medicaid in expansion states,
  and in Texas an adult without children below 100% FPL qualifies for
  neither. The enhancements section says they kept that floor, and the
  schedule charts' note says where the lines start.
- "A clean extension of the enhanced credits" becomes "extending the
  enhanced credits" in the subtitle, the part heading and the text.
- The household table's "Paid for the benchmark plan" row is now
  "Premium after credit".
- The tables drop their "same income" notes; the example table's 2026
  and 2027 columns now say "current law" instead.
- The schedule charts no longer clip their x-axis title or the 800% tick.
- The marginal tax rate chart's cliff label moves right of the line.
- Methodology drops its contents rail (StoryRail, now unused).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The Overview's coverage gap sentence covers non-expansion states, with
  "coverage gap" in bold.
- The enhanced credits expired, so H.R. 1834 revives them: "Reviving the
  enhanced credits" replaces "extending" and "the extension" in the
  Overview, the AI explanation's prompt and chart labels, the API's field
  descriptions and the reform's docstring.
- The calculator's share button moves under the results as "Share
  results". Its link, which the address bar also shows, carries the
  comparison checkbox, the open tab and the income entered as well as the
  household, and opening it calculates the household and opens the same
  view. A calculator link opened on the page (pasted, or with back and
  forward) starts the calculator over from it; a county the state doesn't
  have becomes its first county.
- A link straight to the calculator or the Methodology tab no longer
  causes a hydration error: the server renders the Overview and the
  browser switches to the linked tab once it hydrates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wisconsin covers adults up to 100% FPL, so it has no coverage gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor

David, steps 1 to 3 pass at 8599bb371a, so the household story goes out, after one edit from the follow-up below. End the Overview sentence about the 100% FPL floor at "floor": some households below it did get a credit in 2021 to 2025. Let's hold the calculator for the calculator fixes the follow-up lists.

@MaxGhenis

Copy link
Copy Markdown
Contributor

Agent follow-up to the review above, written by Claude Code for Max Ghenis. I read the PR at 8599bb371a.

Steps 1 to 3. The tabs and README.md carry no national figure, the five corrections appear, and the description's five households reproduce. The backend's calculations, householdAtIncome.js, PremiumChart.jsx and the stored results match e0edff1a83.

Household story. The Overview says households below 100% FPL "still received no credit" in 2021–2025, but under section 36B(c)(1)(B) a lawfully present immigrant at 80% FPL whom Medicaid barred by status paid nothing for the benchmark plan. End that sentence at "floor".

Calculator, monthly:

  • Medicaid. Pennsylvania's 2026 card shows no credit at $22,400, against $1,056.71. The notice cites "the closest income calculated", but at $22,501 the 2027 card pays $69.78, the $23,000 row $75.18.
  • Florida family. Its 2027 card shows a $1,263 credit at $43,889.99, against $1,297.94, and its chart no credit at $132,000 (400%), against $1,076.37.
  • H.R. 1834. Past the credit's end, cards show $1 for Pennsylvania at $174,550 and $509 for a Laramie couple aged 64 with three 17-year-olds at $1,100,000.
  • Coverage text. Texas at $15,500 shows a $0 benchmark, against $770.15; Florida at $40,000, "covered by Medicaid" beside a $1,305 credit; Pennsylvania and California at $5,000, "has not expanded".
  • Earnings. With the model's $1,000-per-adult Alaska dividend, an Anchorage family of three earning $134,550 gets no credit, against $2,464.

Wording:

  • Notice: "Eligibility changes between {from} and {to}. These amounts may not apply at your income."
  • $0 benchmark: "A plan bought without a credit costs its full premium."
  • Name programs only for members they cover; "has not expanded" only where true.
  • Label the input "earnings", up to $1,000,000.

Code: compute credits at the entered income, show nothing where the side stays unknown, chart with scenarioAtIncome, and return the credit's income from the API.

🤖 Generated with Claude Code

DTrim99 and others added 2 commits November 20, 2026 10:20
Max's November 20 review found the cards wrong wherever they read between
the income axis's $1,000 steps: at Medicaid and CHIP limits, across the jump
in the share of income at 133% FPL, past where H.R. 1834's credit ends, above
$1,000,000, and in Alaska, whose dividend counts toward the 400% limit.

- API: /api/calculate-at-income calculates each scenario at one level of
  earnings (up to $1,000,000), with each member's Medicaid, CHIP and
  work-requirement status and, in the coverage gap, what a plan costs without
  a credit. /api/calculate also returns the credit's income (magi).
- Current law pays the credit at exactly 400% FPL, as 26 U.S.C.
  36B(c)(1)(A) allows (policyengine-us 2.138.2 doesn't; draft fix #10312).
- H.R. 1834's model is built once per process, so its calculations take
  under a second instead of about ten.
- Calculator: the input asks for earnings; the text names Medicaid and CHIP
  only for the members they cover, says "has not expanded" only where true,
  and explains Medicaid's 2027 work requirement; the charts place 400% FPL
  on the credit's income.
- Overview: end the 100% FPL floor sentence at "floor" (Max).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
precompute_calculator_examples.py against aca-calc-api-preview at a882306.
Each example gains at_income (its "Your household" cards) and the credit's
income (magi); the Florida family's grid now pays $1,076.37 a month at
exactly 400% FPL ($132,000). Nothing else changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Max, the calculator fixes from your follow-up are in a882306 (stored data in 6385824), and the preview API runs that commit. On the preview, monthly:

  • Pennsylvania's 2026 card at $22,400 shows a $1,057 credit.
  • The Florida family gets $1,298 at $43,889.99 and $1,076.37 at $132,000, on the card and the chart.
  • H.R. 1834 gives Pennsylvania $0 at $174,550, and earnings stop at $1,000,000.
  • Texas at $15,500 shows a $770 full premium with "A plan bought without a credit costs its full premium."
  • Florida at $40,000 says "Medicaid would cover your children, so the benchmark plan covers you and your spouse."
  • Anchorage at $134,550 gets $2,464.

At $5,000, Pennsylvania and California fail the model's 2027 Medicaid work requirement, so the text says that instead of "has not expanded". The cards now come from /api/calculate-at-income at the earnings entered, so the eligibility notice is gone. At exactly 400% FPL, both endpoints apply the model's formula until PolicyEngine/policyengine-us#10312 lands. The "floor" edit is in too. Details are in step 5 of the description, and all checks pass on 6385824.

…nner

- The pinned chart sits in the middle of the screen below the
  PolicyEngine bar (useCenteredSticky sets its top from its height).
- The Overview's bulleted lists show their bullets.
- Line names move to the nearest spot beside their line that no line,
  400% FPL line, its name or other label touches, away from where lines
  overlap; a chart shows its legend when a name has no room (phones).
  Widths are measured as the charts draw them (tabular figures).
  Legends are measured, so a wrapped one no longer overlaps the plot.
- The calculator shows a spinner with the server's step instead of a
  progress bar, and the "Your household" cards a small one while loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pavel's review: fill the white space and add symmetry.
- The pinned card is as tall as the screen allows (up to 720px) and each
  chart's plot fills it (a `fill` prop on the three line charts); tables
  sit in its middle.
- Text cards are the same height with their text centered, and a section
  becomes active at the middle of the screen, so the active card lines up
  with the chart.
- The Overview is 1320px wide (was 1200px); the header lines up with its
  left edge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The button, its explanation window and the helpers only the explain
request used (the state Medicaid and CHIP threshold tables, the value
lookup at a sample income) go. Share links no longer carry `ai=1`; an
older link with it opens the household's results. The API's
`/api/explain` endpoint is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Verdict: APPROVE (head c13329b81e)

I did the full review at 6385824b7f. After that, three commits changed only the Overview chart layout and removed the calculator's "Explain with AI" button. At c13329b81e, next build passes, and no source file still refers to the removed component. The /api/explain endpoint stays, as the changelog fragment says.

Summary

The PR updates the ACA calculator to 2027. The API, the calculator and the Overview now compare 2026 and 2027 current law with H.R. 1834. The model values are correct. Each household that I calculated matches a hand calculation from 26 U.S.C. 36B, Rev. Proc. 2026-26 and the HHS guidelines to the cent. The H.R. 1834 reform agrees with the engrossed bill text. The 97,700 deleted lines are almost all one data file that the PR regenerates in compact JSON. No deleted file is still referenced. CI, the Vercel build and the data check pass. The user-facing text is neutral, and its claims about the bill are correct.

One setup item stays open as a suggestion. The repo's own Python setup (pyproject.toml and uv.lock) still resolves policyengine-us 1.485.0. With that version the new API fails on every 2027 request, and make test gets 22 more failures than on main. The cause is older than the PR, and issue #40 tracks it, so I do not block on it.

Findings

CRITICAL

None.

SHOULD ADDRESS

None.

SUGGESTION

  1. The documented local setup runs the 2027 API on policyengine-us 1.485.0, which fails. pyproject.toml:9 keeps policyengine-us>=1.459.0, and uv.lock locks 1.485.0. The PR pins 2.138.2 only in modal-requirements.txt. The README's local API command (README.md:35, uv run --with fastapi --with uvicorn uvicorn src.aca_api.api:app) uses the lock.
    • Failure case: a /api/calculate-at-income request for a 40-year-old in Harris County, TX, 2027, $40,000, returns "Calculation error: Variable aca_fpg does not exist."
    • make test (uv run pytest tests/): main gets 10 failures in this environment. Head gets 24 failures and 8 errors. The new failures are all in tests/test_api_scenarios.py and tests/test_api_at_income.py.
    • The precompute scripts say that they use "the API's pinned policyengine-us" (README.md:76). A contributor who runs them in the locked environment gets a different model from the one that the data check expects.
    • Fix: raise the floor in pyproject.toml to policyengine-us>=2.138.2 and refresh uv.lock. Or change the README so that local runs and the precompute scripts install modal-requirements.txt. Issue #40 already tracks the lock refresh. This setup problem is older than this PR, and issue #40 tracks it, so I do not block on it.
  2. Unused national-estimate code ships in the PR. src/components/NationalImpactChart.jsx (336 lines), precompute_national.py (407 lines), src/data/national_impacts.json and src/data/cbo_estimate.json are new, but no page imports them. scripts/check_data.mjs:34 uses national_impacts.json as the reference year for all files. The PR body says that this is deliberate until the data fix. A separate PR that adds them with the validated figures keeps the main branch free of dead code. It also removes the dependency of the data check on a file that the page does not show.
  3. The applicable percentage is not rounded. policyengine-us 2.138.2 does not round the rate to 0.01%, as 26 CFR 1.36B-3(g)(1) requires. The Florida family's 2027 payment shows $487/month, but the regulation gives $487.50, which rounds to $488. The Georgia case in the PR body shows the same $1 difference. This is an upstream model issue (PolicyEngine/policyengine-us#11060), and the reviewer accepted it. A one-line note in the Methodology limitations would explain the $1 differences.
  4. The work-requirement text is wider than the law. src/components/CalculatorResults.jsx:147-149 says that "from 2027, Medicaid requires most adults aged 19 to 64 to work". The requirement applies to the expansion adult group, and states can get exemptions that delay it to the end of 2028. A failure case: a reader in an expansion state that has a delay sees text that does not apply to them. Suggested text: "from 2027, Medicaid requires most adults in the expansion group, aged 19 to 64, to work...".
  5. One exploratory test fails at head and on main. tests/test_income_increments.py::test_axes_with_uprating_compensation fails in the pinned environments of head and main (1,000 values off by more than $1). The PR does not cause it, and CI does not run it. Remove it or mark it xfail.
  6. Deploy gap. For about 15 minutes after the merge, the new page talks to the old API. The PR handles this case with clear messages, and the browser does not store the 2026-only answers. Merging at a low-traffic time reduces the effect.
  7. Stacked PR. PR #41 (Local impact page) has aca-2027-overview as its base. Retarget it to main after this PR merges, as its body says.

What I checked

  • The PR thread. I read the body, the three reviewer passes and the author's replies of November 17 to 20. The reviewer cleared the household story and asked for calculator fixes. The author replied that commit a882306 makes the fixes.

  • The bill. The engrossed text of H.R. 1834 (govinfo) changes "before January 1, 2026" to "before January 1, 2029" in 36B(b)(3)(A)(iii) and 36B(c)(1)(E). The change applies to taxable years after 2025. Bill status (govinfo BILLSTATUS): the House passed the bill on January 8, 2026. The latest action was on February 10, 2026: the bill was placed on the Senate calendar (Calendar No. 319). So the page's statement "passed the House on January 8, 2026; it has not been enacted" is correct.

  • The reform. aca_calc/calculations/reforms.py replaces the three schedule lists (0/0/2/4/6 to 0/2/4/6/8.5 percent at thresholds 0, 1.5, 2, 2.5, 3, 4) and removes the 400% eligibility limit for 2026-01-01 to 2028-12-31. This agrees with the bill.

  • The 2027 schedule. Rev. Proc. 2026-26 (IRS PDF): 2.15%; 3.23%–4.30%; 4.30%–6.78%; 6.78%–8.66%; 8.66%–10.22%; 10.22% up to 400% FPL. The app shows 2.15% to 10.22%. For 2026 it shows 2.10% to 9.96% (Rev. Proc. 2025-25).

  • Household values. I ran the PR's /api/calculate-at-income code on policyengine-us 2.138.2 and compared each result with a hand calculation. All results match to the cent. The poverty guideline is the prior year's guideline: $15,650 and $32,150 for 2026 coverage, and $15,960 and $33,000 for 2027 coverage.

    Household Year Income Current-law credit (hand) H.R. 1834 credit (hand)
    Single, 40, Lebanon Co. PA, 150% FPL 2026 $23,475 $10,984.58 (4.19%) $11,968.18 (0%)
    same 2027 $23,940 $12,101.50 (4.30%) $13,130.92
    same, 300% FPL 2026 $46,950 $7,291.96 (9.96%) $9,151.18 (6%)
    same 2027 $47,880 $8,237.58 (10.22%) $10,258.12 (6%)
    same, 401% FPL 2026 $62,756 $0 $6,633.92 (8.5%)
    same 2027 $64,000 $0 $7,690.92 (8.5%)
    same, exactly 400% FPL 2027 $63,840 $6,606.47 (10.22%; the app's override) $7,704.52
    Family of 4, Wake Co. NC, 200% FPL (children on Medicaid) 2027 $66,000 $8,947.16 (6.78%) $12,101.96 (2%)
    same, 450% FPL 2027 $148,500 $0 $8,935.46 (8.5%)
    Single, 60, Laramie Co. WY, 410% FPL 2027 $65,436 $0 $23,004.02 (8.5%)
  • The 400% FPL override. credit_at_400_percent (src/aca_api/api.py:248-270) pays the credit only where income equals exactly 4 times the guideline. 36B(c)(1)(A) ("does not exceed 400 percent") supports this. It changes no other income.

  • The deletions. src/data/households/cliff_demo.json goes from 1.18 MB of indented JSON with 10,001 points to 163 KB of compact JSON with 1,001 points, regenerated on 2.138.2. The PR also deletes five components (HouseholdExplorer, CliffComparisonTable, ScrollSection, ContributionScheduleTable, HouseholdSelector) and four old household JSON files. A grep of src, app, scripts, the Python files and the configuration found no remaining references to them.

  • Tests and build, head and main.

    • Full pytest in the pinned Modal environment: head has 101 passed and 1 failed; main has 71 passed and 1 failed. The failure is the same pre-existing test (Suggestion 4).
    • Full pytest in the uv.lock environment: see SHOULD ADDRESS 1.
    • node scripts/check_data.mjs passes at head. npm run build (Next.js 16.2.6) passes at head and on main.
    • The repo has no JS lint or typecheck script.
  • CI. "Test with the image's packages" passed on the head commit (run started Nov 20, 2026, 10:25am EST). Vercel passed. "Deploy and smoke-test" was skipped, as the workflow requires on pull requests. GitHub reports the PR as mergeable, with no conflicts against main (main has one newer commit, #39, which changes only pyproject.toml and uv.lock).

  • The app in a browser. I started the built frontend and the PR's API locally (no secrets). The Overview renders all sections and tables with filled values and no console errors. The Texas example shows $286, $289 and $133 a month, and the Pennsylvania example shows $1,127, $1,236 and $737 a month. The calculator's example households load from stored data. A Laramie County, WY household at $65,436 calculated from the local API: the cards show $2,182 a month for 2026 and $2,381 a month for 2027 with no credit. These match the hand values above.

  • Wording. The Overview, the Methodology tab, the calculator text, the README and the AI prompt describe H.R. 1834 as a proposal that has not been enacted. They contain no advocacy language. The Medicaid expansion list (40 states and DC) is correct, and Idaho is in it.

  • Overlap. Open PR #41 is stacked on this branch. Issue #40 covers the stale uv.lock. PRs #33 and #34 are closed in favor of this PR.

Not verified

  • I did not check the KFF benchmark premiums in policyengine-us 2.138.2 against KFF's published 2027 county figures.
  • I did not run /api/explain, because it needs an Anthropic key. I did not run the Modal deploy or the smoke test against Modal.
  • I did not open the Vercel preview, because it requires the Vercel login. I did not check the mobile layout.
  • I did not run precompute_national.py, which needs about 32 GB of memory. The page does not show its output.
  • I did not check whether H.R. 1834 had any action after the govinfo status update of September 8, 2026.

@DTrim99
DTrim99 merged commit eeab076 into main Nov 24, 2026
4 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor

David, thanks for the last follow-up's fixes, which hold at c13329b81e. With the merge in eeab0769e2 and #43's deploy, the page at policyengine.org/us/aca-calc and its API now run #37's code. The follow-up below lists what's still wrong, starting with the Basic Health Program states, where the cards show a full-price premium to people the program covers. Until you fix those cards, could you add a note pointing people to their state's Basic Health Program?

@MaxGhenis

Copy link
Copy Markdown
Contributor

Agent follow-up to Max's November 20 review, written by Claude Code for Max Ghenis. I read the merged head, c13329b81e, whose code the live page and API now run.

Fixed: the last follow-up's 19 items, including the "floor" edit.

Live calculator, still wrong (monthly figures from production's API unless marked):

  • Basic Health Program. In Minnesota, New York, Oregon and, by the code, DC, cards show a "Full premium" to adults the program covers. The explanation says the plan "costs less than the share of income". At $30,000, a single 40-year-old's 2027 card shows $527 (Hennepin), $1,053 (New York County) or $608 (Multnomah). Under 42 U.S.C. 18051(e), those adults can't enroll through an Exchange up to 200% FPL. By the code, New York at $35,000 reads "−$648/month from 2026": $219, against $867 under the model's 2026 limit of 250%.
  • Chart. The Texas example's stored chart, "What you'd pay", plots $0 up to $15,000; its card at $15,500 shows $770.
  • Work requirement. On the preview, Pennsylvania and California 2027 cards at $5,000 ruled out Medicaid on the model's default of no qualifying hours or exemption. PavelMakarchuk suggests new wording for the explanation in suggestion 4.
  • $0 earnings give no card.
  • Years. Beside a 2026 credit, three explanations (1, 2, 3) name no year: Texas adult, $15,650 to $15,959; Florida family, $32,150 to $32,999.

Smaller:

  • The card floors "% FPL"; the chart rounds it.
  • At $132,000, the Florida card's credit read $1,077 on the preview, against the stored chart's $1,076.
  • By the code, an Anchorage couple with six children gets the 400% credit at $276,600.01: float32 drops the cent.
  • The changelog fragment aca-2027-overview.fixed.md credits an Idaho fix to "the calculator's AI explanation", which this PR removed.
  • The build check passes with offsetting benchmark and credit errors, or with any example but Florida's missing.

Wording:

  • Card: "MinnesotaCare", "Covers you". Explanation: "At this income, MinnesotaCare would cover you. People eligible for it can't enroll in a Marketplace plan or get a premium tax credit."
  • Work requirement, after suggestion 4's text: "The 2027 estimate assumes you fall short of Medicaid's work or qualifying activity requirement and have no exemption."

Code: add Basic Health Program eligibility to PersonCoverage and isCovered; price full_premium only for members no program covers; blank the payment chart where the model prices no plan.

🤖 Generated with Claude Code

PavelMakarchuk added a commit that referenced this pull request Nov 25, 2026
* Name the Basic Health Program and fix the explanations' wording

Max's post-merge review of #37: in Minnesota, New York, Oregon and DC the
cards show a Marketplace premium to adults their Basic Health Program
covers. Until the API reports that coverage, the results name each
state's program, its income limit as policyengine-us 2.138.2 models it,
and a link to it.

- The work requirement explanation says it applies to the expansion
  group (Pavel's suggestion 4) and that the estimate assumes no
  exemption (Max's wording).
- The three explanations without a year now name it, so they don't read
  as describing a 2026 card that shows a credit.
- #37's changelog fragment no longer credits an Idaho fix to the AI
  explanation it removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Correct the note's charts sentence and New York's limit

From Pavel's review of #45:

- The note says the "Your household" cards show a Marketplace plan's cost
  and the charts show $0, since the note shows on every tab.
- New York's 250% FPL limit ended on June 30, 2026, when its section 1332
  waiver did.
- Where a state with a Basic Health Program has no plan priced above 100%
  FPL, the explanation names the program as the reason for no credit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the Basic Health Program only for members aged 19 to 64

The explanation named the state's Basic Health Program whenever the model
priced no plan above 100% FPL. The model also prices no plan for members
aged 65 or older, whom Medicare rules out of the credit, so a 66-year-old
in Minnesota at 313% FPL read that MinnesotaCare would cover them. Those
members now read that Medicare rules out the credit, in every state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: David Trimmer <178813244+DTrim99@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: PavelMakarchuk <pavel.ma99@gmail.com>
PavelMakarchuk added a commit that referenced this pull request Nov 25, 2026
…smaller items (#46)

* Name the Basic Health Program and fix the explanations' wording

Max's post-merge review of #37: in Minnesota, New York, Oregon and DC the
cards show a Marketplace premium to adults their Basic Health Program
covers. Until the API reports that coverage, the results name each
state's program, its income limit as policyengine-us 2.138.2 models it,
and a link to it.

- The work requirement explanation says it applies to the expansion
  group (Pavel's suggestion 4) and that the estimate assumes no
  exemption (Max's wording).
- The three explanations without a year now name it, so they don't read
  as describing a 2026 card that shows a credit.
- #37's changelog fragment no longer credits an Idaho fix to the AI
  explanation it removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Show Basic Health Program coverage on the cards and fix the review's smaller items

Max's post-merge review of #37. policyengine-us 2.138.2 models the Basic
Health Program (is_basic_health_program_eligible) and already gives its
enrollees no credit, but the API didn't report it, so the cards priced a
Marketplace plan those adults can't buy (42 U.S.C. 18051(e)).

API:
- PersonCoverage gains basic_health_program; full_premium prices only
  members no program covers.
- The 400% FPL check and the reported magi use the earnings as asked:
  float32 read $0.01 over the limit as exactly at it.
- ANSWER_VERSION 3, so the caches drop the old answers.

Page:
- Cards and explanations name the program ("MinnesotaCare", "Covers you";
  Max's wording), with a link; #45's interim note goes.
- $0 of earnings gets cards.
- The payment chart breaks where the model prices no plan; its credit is
  the rounded premium less the rounded payment, as on the cards; its % FPL
  rounds down as the cards' does (fpl.js).

Also: check_data compares each example's benchmark and credit, not only
the payment, and requires every Overview household; Pavel's suggestions 1,
3 and 5 (policyengine-us and core locked at the image's versions on
Python 3.11, a Methodology note on the $1 rounding differences, the
exploratory test marked xfail).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the deploy's smoke tests, a cent below 400% FPL and the fallback note

From Max's review of #46:

- The smoke-test steps pass --no-config, so uv skips .python-version's 3.11,
  which it won't download under only-system on a runner that lacks it.
- A cent below 400% FPL keeps the credit where the model's float32 income
  reads it as exactly at the limit.
- Answers without basic_health_program (a stale cache or a rolled-back API)
  keep #45's note in states with a Basic Health Program.
- #45's changelog fragment drops the sentence #46 makes untrue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Correct the note's charts sentence and New York's limit

From Pavel's review of #45:

- The note says the "Your household" cards show a Marketplace plan's cost
  and the charts show $0, since the note shows on every tab.
- New York's 250% FPL limit ended on June 30, 2026, when its section 1332
  waiver did.
- Where a state with a Basic Health Program has no plan priced above 100%
  FPL, the explanation names the program as the reason for no credit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say New York's 2026 card applies the Essential Plan's 250% limit all year

New York's Essential Plan limit fell from 250% to 200% FPL on July 1, 2026,
when its section 1332 waiver ended, but the model's eligibility is annual.
Where the 2026 card has the program and the 2027 card none, the explanation
says so and that from July those members could enroll in a Marketplace plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the Basic Health Program only for members aged 19 to 64

The explanation named the state's Basic Health Program whenever the model
priced no plan above 100% FPL. The model also prices no plan for members
aged 65 or older, whom Medicare rules out of the credit, so a 66-year-old
in Minnesota at 313% FPL read that MinnesotaCare would cover them. Those
members now read that Medicare rules out the credit, in every state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: David Trimmer <178813244+DTrim99@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: PavelMakarchuk <pavel.ma99@gmail.com>

This branch was successfully deployed

1 active deployment
Preview — c13329b8 Deployed Nov 23, 2026 by vercel[bot]
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.

3 participants