Skip to content

Add person_receives_aca and assigned ACA PTC variables#7808

Merged
MaxGhenis merged 5 commits intoPolicyEngine:mainfrom
daphnehanse11:codex/7806-person-receives-aca
Apr 6, 2026
Merged

Add person_receives_aca and assigned ACA PTC variables#7808
MaxGhenis merged 5 commits intoPolicyEngine:mainfrom
daphnehanse11:codex/7806-person-receives-aca

Conversation

@daphnehanse11
Copy link
Copy Markdown
Collaborator

Closes #7806

Summary

  • add person_receives_aca as a person-level ACA receipt flag
  • keep aca_ptc as the pre-takeup ACA premium tax credit amount and add assigned_aca_ptc for the amount actually assigned after take-up
  • add YAML coverage for base ACA PTC behavior, assigned ACA PTC behavior, and person-level ACA receipt

Testing

  • make format
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/aca/ptc/aca_ptc.yaml policyengine_us/tests/policy/baseline/gov/aca/ptc/assigned_aca_ptc.yaml policyengine_us/tests/policy/baseline/gov/aca/person_receives_aca.yaml -c policyengine_us

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.89%. Comparing base (fd8a1f8) to head (932f195).
⚠️ Report is 122 commits behind head on main.

Files with missing lines Patch % Lines
...les/household/income/spm_unit/spm_unit_benefits.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #7808      +/-   ##
===========================================
- Coverage   100.00%   91.89%   -8.11%     
===========================================
  Files           12        7       -5     
  Lines          174       74     -100     
  Branches         0        2       +2     
===========================================
- Hits           174       68     -106     
- Misses           0        6       +6     
Flag Coverage Δ
unittests 91.89% <95.65%> (-8.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PavelMakarchuk
Copy link
Copy Markdown
Collaborator

Review: Downstream breakage from removing takeup gate on aca_ptc

The core change — separating aca_ptc (potential) from assigned_aca_ptc (post-takeup) — is a good design. But removing the takeup gate from aca_ptc without updating downstream references is a breaking change.

Problem

4 files reference aca_ptc and expect it to be the actual credit received (post-takeup):

File Usage Impact if aca_ptc becomes pre-takeup
spm_unit_benefits.py BENEFITS.append("aca_ptc") Non-taken-up PTC counted as benefits
healthcare_benefit_value.py Lists aca_ptc Overstates healthcare benefit value
premium_tax_credit.py adds = ["aca_ptc"] Flows into federal tax computation
income_tax_excluding_ptc.py subtracts = ["aca_ptc"] Understates tax excluding PTC

These would cause household_net_income, spm_unit_benefits, and federal tax calculations to be wrong for anyone who doesn't take up ACA.

Fix

These 4 references should switch from aca_ptc to assigned_aca_ptc:

# spm_unit_benefits.py
BENEFITS.append("assigned_aca_ptc")  # was "aca_ptc"

# healthcare_benefit_value.py
"assigned_aca_ptc",  # was "aca_ptc"

# premium_tax_credit.py
adds = ["assigned_aca_ptc"]  # was ["aca_ptc"]

# income_tax_excluding_ptc.py
subtracts = ["assigned_aca_ptc"]  # was ["aca_ptc"]

CI failure

The Full Suite - Baseline (excl States) failure is a pre-existing hourly_wage data array mismatch in the microsim test — not caused by this PR.

Other notes

  • The new variables and tests look clean
  • person_receives_aca logic is correct (person eligible AND tax unit takes up)
  • Test case 5 (takeup counts even when assigned PTC is $0) is a good edge case
  • The aca_ptc test confirming it's available even without takeup correctly validates the new semantics

Copy link
Copy Markdown
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question on benefit accounting

@MaxGhenis MaxGhenis merged commit d15f53c into PolicyEngine:main Apr 6, 2026
7 of 9 checks passed
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.

Add person_receives_aca variable for ACA receiver counts

3 participants