Repository navigation
Update the calculator for 2027: compare 2026 and 2027 current law with H.R. 1834 in the API, calculator and Overview - #37
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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>
7ebb80b to
b4fcebc
Compare
…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>
3a88911 to
f6fdf38
Compare
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>
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>
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>
- 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>
|
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. |
|
Agent follow-up to the review above, written by Claude Code for Max Ghenis. I read the PR at Steps 1 to 3. The tabs and 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:
Wording:
Code: compute credits at the entered income, show nothing where the side stays unknown, chart with 🤖 Generated with Claude Code |
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>
|
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:
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 |
…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
left a comment
There was a problem hiding this comment.
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
- The documented local setup runs the 2027 API on policyengine-us 1.485.0, which fails.
pyproject.toml:9keepspolicyengine-us>=1.459.0, anduv.locklocks 1.485.0. The PR pins 2.138.2 only inmodal-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-incomerequest 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 intests/test_api_scenarios.pyandtests/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.tomltopolicyengine-us>=2.138.2and refreshuv.lock. Or change the README so that local runs and the precompute scripts installmodal-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.
- Failure case: a
- Unused national-estimate code ships in the PR.
src/components/NationalImpactChart.jsx(336 lines),precompute_national.py(407 lines),src/data/national_impacts.jsonandsrc/data/cbo_estimate.jsonare new, but no page imports them.scripts/check_data.mjs:34usesnational_impacts.jsonas 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. - 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.
- The work-requirement text is wider than the law.
src/components/CalculatorResults.jsx:147-149says 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...". - One exploratory test fails at head and on main.
tests/test_income_increments.py::test_axes_with_uprating_compensationfails 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 itxfail. - 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.
- Stacked PR. PR #41 (Local impact page) has
aca-2027-overviewas its base. Retarget it tomainafter 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.pyreplaces 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-incomecode 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.jsongoes 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 ofsrc,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.lockenvironment: see SHOULD ADDRESS 1. node scripts/check_data.mjspasses 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.tomlanduv.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.
|
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? |
|
Agent follow-up to Max's November 20 review, written by Claude Code for Max Ghenis. I read the merged head, Fixed: the last follow-up's 19 items, including the "floor" edit. Live calculator, still wrong (monthly figures from production's API unless marked):
Smaller:
Wording:
Code: add Basic Health Program eligibility to 🤖 Generated with Claude Code |
* 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>
…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>
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
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'sNEXT_PUBLIC_API_URLpoints this branch's previews at it; production and other previews still use the live API.Modal APIworkflow deploysaca-calc-apifrom main, after its tests, with a smoke test and rollback on failure. Vercel builds production from main.Status of the review
National figures off the page: done (d99089f). The Overview drops:
The Methodology tab drops:
precompute_national.py,national_impacts.json,cbo_estimate.jsonandNationalImpactChartstay in the repo, unused by the page, andcheck_data.mjsstill checks the national file.Calculator and household story: done (10dbb87 and later).
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.
Every answer was computed fresh by the preview API at a0dd3a7 on policyengine-us 2.138.2. In each:
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: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.
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):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, 2026 or 2027 (2026 if absent). The household's inputs, every simulation period and both cache keys follow it. Responses reportyear,fpl_yearandmodel_version.show_prior_yearalso 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.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.show_irais 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.show_prior_year, it compares the 2026 and 2027 benchmark premiums and credits. Its cache key includes the year,show_prior_yearand the model version. The page no longer calls/api/explain(see the calculator's changes below).ACA_API_APP_NAMElets a preview app run beside the live one with its own caches./api/calculate-at-income. The calculator's request plusincome(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_premiumis what one would cost without a credit, priced as the model prices an enrollee's. Cached like/api/calculate./api/calculatealso returnsmagiat each point, so the page can place the 400% FPL limit on the earnings axis.The calculator
src/data/households/calculator_examples.json, written byprecompute_calculator_examples.pyfrom the preview API), so they appear without a request. Choosing one fills the form and scrolls to its results.year: 2027,show_ira,show_prior_year).#).ai=1, and an older link with it opens the household's results.CACHE_VERSIONthat 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:
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):Design.
@policyengine/ui-kit's theme.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.
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.
Checks
API:
tests/test_api_scenarios.pycovers 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.pycovers 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./api/calculate-at-income, and the five-household check above.Frontend.
undefinedorNaN.Data check.
scripts/check_data.mjsruns beforenext buildand fails the build if: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