Skip to content

Add education credit eligibility inputs#8170

Open
MaxGhenis wants to merge 3 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/fix-aotc-eligibility
Open

Add education credit eligibility inputs#8170
MaxGhenis wants to merge 3 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/fix-aotc-eligibility

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Apr 28, 2026

Summary

  • add lower-level American Opportunity Credit eligibility inputs for the statutory student, documentation, institution, identification, residency, improper-claim, and filing-status predicates
  • compute is_eligible_for_american_opportunity_credit from those predicates instead of leaving it as an unpopulated input
  • gate AOTC Form 1098-T/payee-statement, institution-EIN, and qualifying-SSN requirements with time-varying eligibility parameters
  • add lower-level Lifetime Learning Credit predicates for eligible-institution attendance, Form 1098-T/exception, taxpayer/student identification, nonresident-alien disallowance, and MFS disallowance
  • gate LLC qualified tuition through is_eligible_for_lifetime_learning_credit while continuing to exclude AOTC-eligible students from LLC expenses

Primary Sources

Tests

  • uv run ruff format policyengine_us/variables/gov/irs/credits/education policyengine_us/tests/policy/baseline/gov/irs/credits/education/lifetime_learning_credit
  • uv run ruff check policyengine_us/variables/gov/irs/credits/education policyengine_us/tests/policy/baseline/gov/irs/credits/education/lifetime_learning_credit
  • uv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/irs/credits/education -c policyengine_us

Follow-up data PR: PolicyEngine/policyengine-us-data#843

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.53%. Comparing base (8675371) to head (ef9ae9b).
⚠️ Report is 103 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main    #8170      +/-   ##
===========================================
- Coverage   100.00%   95.53%   -4.47%     
===========================================
  Files            3       25      +22     
  Lines           39      291     +252     
  Branches         0        4       +4     
===========================================
+ Hits            39      278     +239     
- Misses           0       11      +11     
- Partials         0        2       +2     
Flag Coverage Δ
unittests 95.53% <100.00%> (-4.47%) ⬇️

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.

@MaxGhenis MaxGhenis force-pushed the codex/fix-aotc-eligibility branch from 4cb43ae to 37bf0fb Compare April 28, 2026 13:39
@MaxGhenis MaxGhenis force-pushed the codex/fix-aotc-eligibility branch from 37bf0fb to 605ddc3 Compare April 28, 2026 16:01
@MaxGhenis MaxGhenis changed the title Add AOTC student eligibility inputs Add education credit eligibility inputs Apr 29, 2026
@MaxGhenis
Copy link
Copy Markdown
Contributor Author

Local paired build result using this PE-US branch with PolicyEngine/policyengine-us-data#843:

  • Rebuilt PUF, Extended CPS half, and calibrated EnhancedCPS_2024 locally.
  • Lifetime Learning Credit: $1.034B over 1.712M weighted positive tax units.
  • Nonrefundable AOTC: $6.779B.
  • Refundable AOTC: $5.166B over 5.615M weighted positive tax units.
  • Full AOTC: $12.915B.
  • Combined nonrefundable education credits: $7.813B over 7.161M weighted positive tax units.

Calibration log from the local build:

  • Refundable AOTC target: $5.090B, estimate $5.071B, relative error -0.38%; count target 5.822M, estimate 5.544M, relative error -4.76%.
  • Combined education-credit target: $7.555B, estimate $7.698B, relative error +1.90%; count target 7.211M, estimate 7.066M, relative error -2.02%.

There is no standalone LLC calibration target in this pair because IRS SOI Table 3.3 reports LLC only inside the combined nonrefundable education credit.

@MaxGhenis MaxGhenis enabled auto-merge (squash) April 29, 2026 01:14
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.

1 participant