Skip to content

Add statute-facing taxpayer ID primitives#7974

Open
MaxGhenis wants to merge 2 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/id-primitives
Open

Add statute-facing taxpayer ID primitives#7974
MaxGhenis wants to merge 2 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/id-primitives

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Apr 10, 2026

Summary

  • add canonical taxpayer_id_type and has_valid_ssn person variables
  • make has_tin resolve from explicit inputs or the new taxpayer ID primitive during migration
  • update federal CTC, EITC, and other SSN-gated rules to use statute-facing ID concepts instead of overloading ssn_card_type

Why

Current federal rules use two distinct identification concepts:

  • broader taxpayer-ID (TIN) rules for filer/dependent eligibility in several places
  • stricter valid-SSN rules for child CTC, EITC, and newer SSN-gated provisions

This PR makes that split explicit in policyengine-us, while preserving has_itin as a temporary compatibility alias for existing callers.

Companion data PR: PolicyEngine/policyengine-us-data#715

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.66%. Comparing base (b70c547) to head (e762475).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...s/household/demographic/person/taxpayer_id_type.py 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #7974      +/-   ##
===========================================
- Coverage   100.00%   93.66%   -6.34%     
===========================================
  Files            1       10       +9     
  Lines           13      142     +129     
  Branches         0        8       +8     
===========================================
+ Hits            13      133     +120     
- Misses           0        5       +5     
- Partials         0        4       +4     
Flag Coverage Δ
unittests 93.66% <96.15%> (-6.34%) ⬇️

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.

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