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

Open
DTrim99 wants to merge 54 commits into
mainfrom
aca-2027-overview
Open

DTrim99 wants to merge 54 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.
  • 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, the household cards and the explanation, 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 #).
  • AI explanation. The request sends H.R. 1834 as the only scenario, with the 2026 benchmark and credit, so the narrative can compare the years.
  • 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 while its text scrolls past in cards on the right. 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. A white header with the title and pill-shaped tabs aligned with the Overview's left edge. Part headings are pills, section titles teal, and buttons lift on hover.
  • Charts.
    • Lines are labeled at their ends, with a legend only where the labels would collide.
    • Charts fade in as they scroll into view, and a crosshair marks the hovered income.
    • 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 20, 2026 3:26pm 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
Same structure as the deployed Overview, with one policy option:

1. How the credits work: how premium tax credits work, the 2021-2025
   enhancements and their expiry (the opening paragraph's text, now in the
   first three cards, each with its contribution-schedule chart).
2. A household facing the 2027 increase: the Pennsylvania adult at about
   650% FPL pays the whole benchmark premium in 2026 ($1,127/month) and in
   2027 ($1,236/month, up 9.7%), with no credit.
3. A clean extension of the enhanced credits, naming H.R. 1834 as the bill
   that would do it: $737/month for the household, then the premium and
   marginal rate charts across incomes.
4. Other households: the four example households.

A new HouseholdYearTable shows the household's premium, credit and payment,
adding a column at each step, as the deployed CliffComparisonTable did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DTrim99 and others added 2 commits November 17, 2026 10:28
The example now follows the same 45-year-old in Lebanon County at $50,000
(about 315% FPL) and $104,000 (about 650% FPL), with the same benchmark
plan: $1,127/month in 2026 and $1,236/month in 2027.

- Below 400% FPL the credit rises $99 to $811/month, so the payment rises
  only $11 (to $426/month), from the share of income rising from 9.96% to
  10.22%.
- Above 400% FPL there is no credit, so the household pays the whole $109
  increase.
- Under a clean extension, $264/month and $737/month.

HouseholdYearTable reads both incomes from the Pennsylvania sweep
(cliff_demo.json), and check_data.mjs now checks the sweep against the
household table at $104,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header drops its teal-to-blue gradient and widens to 1200px, so the
title, subtitle and page tabs line up with the left edge of the Overview's
split layout, as on the deployed app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part 2 now follows the Texas adult (40, Harris County, $40,000, about 250%
FPL) and the Pennsylvania adult (45, Lebanon County, $104,000, about 650%
FPL) instead of the Pennsylvania adult at two incomes, and no longer calls
them middle-income.

- Texas: the benchmark premium rises $89 to $770/month; the credit rises to
  $481/month, so the payment rises only $2, to $289/month.
- Pennsylvania: the premium rises $109 to $1,236/month, all of it paid.
- Under a clean extension, $133/month and $737/month.

HouseholdYearTable reads both from examples.json. The four-household card
now covers the Florida family and the California couple.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Dollar changes in the 2027 card are now taken between the rounded monthly
  amounts the table shows (monthlyChange), so the Texas adult's payment rises
  $3 ($286 to $289) and its premium $88 ($682 to $770), as the table reads.
- "gets/get no credit" becomes "receives/receive no credit" on the Overview,
  in the calculator's results and on the Methodology tab.

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

The household table, the calculator's cards and the text round what the
household pays from its exact value and show the credit as the rounded
premium less it, so each column adds up: the Texas adult's 2026 credit
reads $396 (was $395, beside $682 and $286) and the Pennsylvania adult's
H.R. 1834 credit $499 (was $500, beside $1,236 and $737).

The calculator stores an answer in the browser only when it is for the
year asked. Right after the relaunch Vercel serves the new page before the
API deploy finishes, and the previous API answers every request for 2026
without naming a year; caching that would show 2026 results for a day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 2896c7900c. This note doesn't change Max's decision above.

Step 1. The three tabs show no national figure or claim. README.md line 3 describes effects "for households and nationwide", and line 11 lists two pages.

Step 2. Each item appears on the page and matches the model's premium file, Medicaid.gov and govinfo.

Step 3. The preview API's five answers match the description. Under Rev. Proc. 2026-26, the HHS guidelines, Form 8962's whole-number percentages and the rate rounding in 26 CFR 1.36B-3(g)(1), every payment matches except Georgia's. There, 8.58% of $82,000 gives $586.30; the model's unrounded 8.5848% gives the stated $587 (PolicyEngine/policyengine-us#11060). Three labels miss the arithmetic: Alaska's 8.79% (rate 8.78%), "254% FPL, not 249%" (truncated against rounded) and Wyoming's "450%" (448%).

On the page

  • The Florida family's 2027 payment reads $487; the regulation's 7.80% gives $487.50, which rounds to $488. Its calculator card shows a $1,714 credit, against the regulation's $1,713. No model release rounds the rate yet; rounding it would also move four chart tooltips by $1.
  • Five of eight example change lines round the exact difference and miss the cards' payments by $1. Texas's reads "+$2/month from 2026" beside $286 and $289.
  • The Overview shows Texas's $88 rise on $682 as 13.0%, not 12.9%.
  • The "Your household" tab interpolates between $1,000 incomes, so across the 400% FPL cliff: at $63,500 the Texas example's card shows a $117 monthly credit, against $229 under the rules, and $23 at $63,900, above the limit. Larger credits miss by more, and the live app does the same.

In the description, Florida's H.R. 1834 payment reads $192 (the page shows $193), and two lines credit the agent review's work to Max.

I didn't check the validation script or the premiums against carriers' filings.

🤖 Generated with Claude Code

…limits

Between the API's $1,000 steps the cards drew a straight line, so a step holding the 100% or 400% FPL limit or a Medicaid or CHIP limit showed a mix of the two sides. The credit's limits now apply exactly. Medicaid and CHIP limits aren't in the API's answer, so those steps show the closest income calculated and say so. The monthly change lines now match the payments on the cards, and the README describes the household-only app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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.

This branch was successfully deployed

1 active deployment
Preview — 6385824b Deployed Nov 20, 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.

2 participants