Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
fdf8b8d
Model 2027 coverage and the extension scenarios in the calculator API
DTrim99 Nov 8, 2026
5471149
Pin policyengine-us 2.115.0, with the 2027 premiums and the minimum p…
DTrim99 Nov 9, 2026
30c4374
Default the calculator to 2027 and add the new scenarios
DTrim99 Nov 7, 2026
0eec0e9
Say so when the server answers for another year
DTrim99 Nov 7, 2026
b4fcebc
Offer the $5 minimum premium scenario
DTrim99 Nov 9, 2026
3b24fe0
Move the Overview and Explore pages to 2027 and read their figures fr…
DTrim99 Nov 8, 2026
f6fdf38
Regenerate the Overview and Explore data with policyengine-us 2.105.0
DTrim99 Nov 8, 2026
a72286c
Regenerate the Overview and Explore data with policyengine-us 2.115.0
DTrim99 Nov 9, 2026
51f53bb
Drop the draft scenarios and return 2026 current law alongside 2027
DTrim99 Nov 9, 2026
98470de
Merge remote-tracking branch 'origin/aca-2027-backend' into aca-2027-…
DTrim99 Nov 9, 2026
5d7a10d
Merge remote-tracking branch 'origin/main' into aca-2027-backend
DTrim99 Nov 9, 2026
d31c431
Compare 2026 and 2027 current law with H.R. 1834 in the calculator
DTrim99 Nov 9, 2026
0c045bd
Merge remote-tracking branch 'origin/aca-2027-backend' into aca-2027-…
DTrim99 Nov 9, 2026
f81c9ce
Precompute the story's households: 2026 and 2027 current law and H.R.…
DTrim99 Nov 9, 2026
6a417ed
Merge remote-tracking branch 'origin/aca-2027-calculator' into aca-20…
DTrim99 Nov 9, 2026
92e7f69
Label the premium chart's axis "Per month"
DTrim99 Nov 9, 2026
fb7bbb6
Let a preview of the API run beside the live app
DTrim99 Nov 11, 2026
b00da61
Precompute the national effects of H.R. 1834 in 2027
DTrim99 Nov 11, 2026
f999f17
Tell the 2027 story on one Overview page
DTrim99 Nov 11, 2026
1f4fd63
Merge remote-tracking branch 'origin/aca-2027-backend' into aca-2027-…
DTrim99 Nov 11, 2026
b60bac8
Merge remote-tracking branch 'origin/aca-2027-calculator' into aca-20…
DTrim99 Nov 11, 2026
a0dd3a7
Pin policyengine-us 2.138.2 and read the credit from household net in…
DTrim99 Nov 16, 2026
d7a6890
Rerun the example households and contribution schedules on policyengi…
DTrim99 Nov 16, 2026
a76fdc6
Make the Overview a single scrolling story and add the H.R. 1834 chec…
DTrim99 Nov 16, 2026
d7301f2
Rerun the national estimates on policyengine-us 2.138.2
DTrim99 Nov 16, 2026
b13cc27
Put the 1st decile at the bottom of the winners and losers chart
DTrim99 Nov 16, 2026
2c65cc2
Label the poverty and inequality bars at their ends
DTrim99 Nov 16, 2026
908a13e
Bold the average rise in benchmark premiums, not the 2027 level
DTrim99 Nov 16, 2026
b585ae3
Move the H.R. 1834 checkbox into the household form
DTrim99 Nov 16, 2026
35c0323
Show the Pennsylvania example's marginal tax rate with and without th…
DTrim99 Nov 16, 2026
a4b3870
Stack the calculator top to bottom and store the Overview's four hous…
DTrim99 Nov 16, 2026
1b47789
Add direct labels, a section rail, fade-ins, count-up figures and a d…
DTrim99 Nov 16, 2026
86c5c26
Limit take-up above 400% FPL to reported individual coverage and show…
DTrim99 Nov 16, 2026
159bbef
Add a Methodology tab
DTrim99 Nov 16, 2026
72b7e03
Restore the pill-shaped page tabs
DTrim99 Nov 17, 2026
2e29ec8
Brighten the Overview and open it with the background
DTrim99 Nov 17, 2026
9dd36a3
Keep the Overview's opening paragraph neutral
DTrim99 Nov 17, 2026
43c982a
Remove the teal bar beside the section being read
DTrim99 Nov 17, 2026
ffef990
Use David's wording for the Overview's opening paragraph
DTrim99 Nov 17, 2026
10dbb87
Address Max's step 2 review items on the calculator and household story
DTrim99 Nov 17, 2026
d99089f
Hold the national figures off the page until they're validated
DTrim99 Nov 17, 2026
24d0a64
Return the Overview to the split view and drop its section rail
DTrim99 Nov 17, 2026
6b82b8f
Tell the Overview in the deployed app's order, around the 2027 increase
DTrim99 Nov 17, 2026
48c455d
Show the 2027 increase for two incomes, below and above 400% FPL
DTrim99 Nov 17, 2026
6991628
Plain white header, with the title and tabs aligned left
DTrim99 Nov 17, 2026
514eb79
Use the Texas and Pennsylvania adults as the two examples
DTrim99 Nov 17, 2026
2e90cd7
Match the text's dollar changes to the table, and say "receives"
DTrim99 Nov 17, 2026
2896c79
Make the tables add up after rounding, and cache only answers for the…
DTrim99 Nov 18, 2026
e0edff1
Keep the calculator's cards from blending incomes across eligibility …
DTrim99 Nov 18, 2026
91a21fc
Add a Local impact page with county and district Marketplace enrollment
DTrim99 Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/modal-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- aca_calc/**
- src/aca_api/**
- tests/test_api_explain.py
- tests/test_api_scenarios.py
- tests/test_enhanced_ptc_reform.py
- tests/test_modal_requirements.py
- tests/test_smoke_test_api.py
Expand All @@ -24,6 +25,7 @@ on:
- aca_calc/**
- src/aca_api/**
- tests/test_api_explain.py
- tests/test_api_scenarios.py
- tests/test_enhanced_ptc_reform.py
- tests/test_modal_requirements.py
- tests/test_smoke_test_api.py
Expand Down Expand Up @@ -63,7 +65,7 @@ jobs:
uv venv --python 3.11
uv pip install -r modal-requirements.txt
- name: Run the API tests
run: .venv/bin/python -m pytest tests/test_api_explain.py tests/test_enhanced_ptc_reform.py tests/test_modal_requirements.py tests/test_smoke_test_api.py
run: .venv/bin/python -m pytest tests/test_api_explain.py tests/test_api_scenarios.py tests/test_enhanced_ptc_reform.py tests/test_modal_requirements.py tests/test_smoke_test_api.py

deploy:
name: Deploy and smoke-test
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Thumbs.db
# Logs
*.log

# Data/cache
data/
# Data/cache (the root's data/ only: src/data/ holds the site's precomputed results)
/data/
.cache/

# Node.js / React
Expand Down
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# ACA Premium Tax Credit Calculator

Compare 2026 Premium Tax Credits with and without Inflation Reduction Act (IRA) enhancements.
How ACA marketplace premiums change from 2026 to 2027 under current law, and what reviving the enhanced premium tax credits (H.R. 1834) would do for households.

**🔗 [Try the Calculator](https://policyengine.org/us/aca-calc)**

## Overview

The Inflation Reduction Act enhanced ACA subsidies through 2025. This calculator shows what your credits would be in 2026 with and without extending these enhancements.
The American Rescue Plan Act enhanced ACA premium tax credits for 2021 and 2022, and the Inflation Reduction Act extended them through 2025. They expired after 2025, so 2026 and 2027 coverage follows the original ACA schedule. H.R. 1834, which passed the House on January 8, 2026 and has not been enacted, would revive them for 2026 through 2028.

The app has four pages:
- **Overview**: how benchmark premiums rise in 2027, who pays the increase under current law, and what H.R. 1834 would mean for four example households.
- **Calculator**: what a household would pay for its benchmark plan, and its credit, in 2026 and 2027 under current law and in 2027 under H.R. 1834.
- **Local impact**: 2026 Marketplace plan selections, average premiums and advance credits by county and congressional district, from CMS's open enrollment files. CMS publishes county figures only for the states that use HealthCare.gov.
- **Methodology**: the model and data, the policies compared, and the limitations.

**Key Differences:**
- **With IRA Extension**: No income cap, lower premium contributions (0-8.5% of income)
- **After IRA Expires**: 400% FPL cap ("subsidy cliff"), higher contributions (2-9.5% of income)
- **Enhanced credits (2021–2025)**: No income cap; required contributions from 0% to 8.5% of income
- **Current law (2026 on)**: No credit above 400% FPL (the "subsidy cliff"); required contributions from about 2% to 10% of income, set each year by the IRS

## Quick Start

Expand All @@ -36,19 +42,10 @@ uv run --with fastapi --with uvicorn uvicorn src.aca_api.api:app --port 5001

- ✅ **All 50 States + DC**: Accurate calculations for every jurisdiction
- ✅ **3,143 Counties**: County-specific marketplace pricing
- ✅ **Real-time Comparison**: Side-by-side baseline vs. IRA extension
- ✅ **Real-time Comparison**: 2026 and 2027 current law against H.R. 1834
- ✅ **Interactive Charts**: See how credits change across income levels
- ✅ **Household Flexibility**: Single, married, with/without dependents

## Example Results

| Scenario | Income | Baseline PTC | With IRA | Savings |
|----------|--------|--------------|----------|---------|
| NJ Family of 3 | $50,000 | $8,515 | $10,626 | $2,111/year |
| TX Couple (Travis) | $60,000 | $6,974 | $9,195 | $2,221/year |
| CA Couple + Child | $75,000 | $12,913 | $15,695 | $2,782/year |
| NY Single @ 400% FPL | $62,280 | $0 | $2,899 | $2,899/year |

## Technical Details

Built with:
Expand All @@ -64,14 +61,17 @@ County data sourced from PolicyEngine's ACA rating areas database.
.
├── app/ # Next.js entry (layout and page)
├── src/
│ ├── App.jsx # The Overview, Explore Households and Calculator pages
│ ├── App.jsx # The Overview and Calculator pages
│ ├── components/ # Charts, tables and the calculator
│ ├── data/households/ # Precomputed results the Overview and Explore pages read
│ ├── views/ # The Local impact page
│ ├── data/ # Precomputed results the Overview reads
│ └── aca_api/ # The FastAPI backend (api.py, models.py)
├── aca_calc/calculations/ # The household builder and the scenarios' reforms
├── aca_calc/data/ # CMS enrollment extracts and district boundaries for Local impact
├── aca_calc/*_ingest.py # Rebuild those extracts from CMS and Census files
├── modal_app.py # The API's Modal deployment
├── modal-requirements.txt # The API image's exact package versions
├── precompute_*.py # Regenerate the precomputed household results
├── precompute_*.py # Regenerate the precomputed results (see below)
├── scripts/ # The post-deploy smoke test
├── counties.json # County lists for the calculator form
├── process_counties.py # Regenerates counties.json
Expand All @@ -98,6 +98,20 @@ make test
python process_counties.py
```

## Precomputed results

The Overview reads results computed ahead of time with the API's pinned
policyengine-us. Rerun the scripts after every pin:

- `precompute_contribution_schedules.py`: the share of income each schedule
charges for the benchmark plan
- `precompute_cliff_household.py`: the Pennsylvania example across incomes
- `precompute_households.py`: four example households at one income each
- `precompute_national.py`: the national effects of H.R. 1834 in 2027, over
policyengine-us's default microdata. It needs about 32 GB of memory, so run
it on Modal or another large machine. The Overview doesn't show these
figures until they are validated against administrative data.

## Deploying the API

The calculator page calls a FastAPI backend on Modal: app `aca-calc-api` in
Expand Down
9 changes: 8 additions & 1 deletion aca_calc/calculations/household.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ def build_household_situation(
"spm_units": {"your household": {"members": ["you"]}},
"tax_units": {"your tax unit": {"members": ["you"]}},
"households": {
"your household": {"members": ["you"], "state_name": {year: state}}
"your household": {
"members": ["you"],
# The credit measures income against the prior year's poverty
# guideline (aca_magi_fraction), so the state is set for that
# year too. Without it, Alaska and Hawaii households get the
# 48 states' lower guideline.
"state_name": {year - 1: state, year: state},
}
},
}

Expand Down
44 changes: 28 additions & 16 deletions aca_calc/calculations/reforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,41 @@
ENHANCED_INITIAL = [0, 0, 0.02, 0.04, 0.06]
ENHANCED_FINAL = [0, 0.02, 0.04, 0.06, 0.085]

ENHANCED_PERIOD = "2026-01-01.2100-12-31"
# H.R. 1834 extends the enhanced schedule for 2026 through 2028.
ENHANCED_PERIOD = "2026-01-01.2028-12-31"


def _enhanced_schedule() -> dict:
"""The enhanced schedule as policyengine-us parameter overrides.

The three lists are replaced together: the threshold list has one more
entry than the rate lists, and current law's lists have a 133% FPL
threshold the enhanced schedule doesn't.
"""
return {
"gov.aca.required_contribution_percentage.threshold": {ENHANCED_PERIOD: ENHANCED_THRESHOLDS},
"gov.aca.required_contribution_percentage.initial": {ENHANCED_PERIOD: ENHANCED_INITIAL},
"gov.aca.required_contribution_percentage.final": {ENHANCED_PERIOD: ENHANCED_FINAL},
}


# gov.aca.ptc_income_eligibility's third bracket starts at 400% FPL; from 2026
# it makes incomes there ineligible.
NO_INCOME_CAP = {"gov.aca.ptc_income_eligibility[2].amount": {ENHANCED_PERIOD: True}}


def create_enhanced_ptc_reform():
"""Create reform extending enhanced PTCs (IRA extension) from 2026 on.
"""H.R. 1834: extend the enhanced premium tax credits for 2026-2028.

Restores the ARPA/IRA applicable-percentage schedule and removes the 400%
FPL eligibility limit, so households above 400% FPL pay at most 8.5% of
income for the benchmark plan.

The three schedule lists are replaced together: the threshold list has one
more entry than the rate lists, and the 2026 law's lists have a 133% FPL
threshold the enhanced schedule doesn't.
income for the benchmark plan. H.R. 1834 passed the House on January 8,
2026; it has not been enacted.

Returns:
Reform: PolicyEngine reform object
"""
return Reform.from_dict(
{
"gov.aca.required_contribution_percentage.threshold": {ENHANCED_PERIOD: ENHANCED_THRESHOLDS},
"gov.aca.required_contribution_percentage.initial": {ENHANCED_PERIOD: ENHANCED_INITIAL},
"gov.aca.required_contribution_percentage.final": {ENHANCED_PERIOD: ENHANCED_FINAL},
"gov.aca.ptc_income_eligibility[2].amount": {ENHANCED_PERIOD: True},
},
country_id="us",
)
return Reform.from_dict({**_enhanced_schedule(), **NO_INCOME_CAP}, country_id="us")


def _contrib_reform(module: str, name: str):
Expand All @@ -57,6 +66,9 @@ def _contrib_reform(module: str, name: str):
def create_700fpl_reform():
"""Create 700% FPL extension reform (Bipartisan Health Insurance Affordability Act).

Introduced by Reps. Dunn (R-FL) and Schneider (D-IL) on December 9, 2025;
not enacted.

This implements the proposed bill's schedule:
- 200-250% FPL: 2% to 4%
- 250-300% FPL: 4% to 6%
Expand Down
Loading