Repository navigation
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>
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>
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>
|
Agent follow-up to the review above, written by Claude Code for Max Ghenis. I read the PR at Step 1. The three tabs show no national figure or claim. 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
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>
|
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 |
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.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).#).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 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:
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