Implement Pennsylvania CTC contributed reforms#7438
Implement Pennsylvania CTC contributed reforms#7438PavelMakarchuk merged 17 commits intoPolicyEngine:mainfrom
Conversation
Implementation CompleteProposal 1: Flat Amount CTC
Proposal 2: Federal CTC Match
Test Coverage (14 tests)
All tests pass locally. |
|
Updated the CTC match implementation to use Added low income test cases:
All 9 CTC match tests and 8 flat amount tests pass. |
Fix: PA CTC Match Now Uses Actual Federal CTC ReceivedThis commit fixes an important issue with the PA CTC match formula. ProblemThe original implementation used
For families with income below the standard deduction (~$24k), they have $0 tax liability and can only receive the refundable $1,700, not the full $2,200. ExampleAt $20,000 income with 1 young child:
Changes
|
policyengine_us/parameters/gov/contrib/states/pa/ctc/ctc_match/age_limit.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/tests/policy/contrib/states/pa/ctc/pa_ctc_flat_amount.yaml
Show resolved
Hide resolved
Fixes AppliedReview Comment Addressed
This verifies that the PA CTC flat amount reform correctly flows through the computation tree:
Verification
🤖 Generated with Claude Code |
Additional Fixes AppliedPA CTC Match Tests Updated
This verifies that the PA CTC match reform correctly flows through the computation tree:
Verification
🤖 Generated with Claude Code |
Add two Pennsylvania Child Tax Credit reform proposals: 1. Flat Amount CTC (pa_ctc_flat_amount): - $1,000 per child under age 6 - 2% phaseout rate above $125k threshold (all filing statuses) - Effective 2026 2. Federal CTC Match (pa_ctc_match): - 50% match of federal CTC for children under 6 - No income phaseout - Effective 2026 Includes: - Parameter files in gov/contrib/states/pa/ctc/ - Reform code in reforms/states/pa/ctc/ - __init__.py files for proper imports - Updates to reforms.py - 14 YAML tests with full coverage Closes PolicyEngine#7436 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates the PA CTC match formula to use ctc_value instead of ctc_child_individual_maximum. This ensures low-income families only receive the match on their actual federal CTC amount after phase-in, not the maximum amount they would eventually receive. Adds low income test cases: - $2,000 income: $0 match (below $2,500 phase-in threshold) - $10,000 income: $562.50 match (partial phase-in) - $20,000 income: $1,100 match (full phase-in) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed formula to use refundable_ctc + min(non_refundable_ctc, tax_liability) instead of ctc_value, which overstated the federal CTC for low/moderate income families who cannot use the nonrefundable portion due to $0 tax liability - Added SSN requirement check (meets_ctc_child_identification_requirements) to exclude children without valid SSN from the match - Updated test at $20k income: expected PA match is $850 (not $1,100) since only $1,700 refundable CTC is received, not $2,200 - Added test at $15k income verifying refundable CTC cap behavior - Added test for child without SSN verifying $0 PA match Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses review comment to verify that the PA CTC reform flows through the computation tree to pa_income_tax and household_net_income. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses review comment to verify that the PA CTC match reform flows through the computation tree to pa_income_tax and household_net_income. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2b2f436 to
5f27145
Compare
Fixes Applied🔴 Critical Issues Fixed
Verification
CI should now pass with the upstream fix included. 🤖 Generated with Claude Code |
Add reference metadata to all 8 parameter files pointing to issue PolicyEngine#7436. Fix parameter descriptions and labels to spell out "Child Tax Credit". Add reference attribute to both reform variable classes. Rename test cases to "Case N, description." format and person names from child1/child2/child3 to person2/person3/person4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve merge conflicts by keeping both PA CTC reforms and CT tax rebate 2026. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove pa_income_tax and household_net_income assertions that break when unrelated parameters change. Add non-PA resident test cases to verify defined_for=StateCode.PA works correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comments now clarify the match is based on actual federal CTC received (after phase-in and refundability limits), not the per-child maximum. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The baseline --exclude states tests were running ~565 YAML files in a single subprocess, causing OOM/timeout on CI runners. Updated test_batched.py to actually respect the --batches parameter for this code path, and set --batches 2 in the Makefile. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept upstream's memory-aware batching system for baseline tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add age boundary tests (age 5, last eligible age) - Add income threshold boundary tests ($124,999, $125,001) - Add SEPARATE and SURVIVING_SPOUSE filing status tests - Add federal CTC phaseout range tests ($205k single, $405k joint) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Review SummaryOverall Assessment: APPROVED ✅ This is a well-implemented contributed reform with no critical issues. All CI checks pass. Added Edge Case TestsAdded 7 new tests to improve boundary condition coverage: pa_ctc_flat_amount.yaml:
pa_ctc_match.yaml:
All 29 tests pass. Validation Summary
|
Migrates from old changelog_entry.yaml format to towncrier fragment after merging main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Implements two Pennsylvania Child Tax Credit reform proposals as contributed reforms (not law).
Closes #7436
Proposals
1. Flat Amount CTC (
pa_ctc_flat_amount)2. Federal CTC Match (
pa_ctc_match)Files Added
Parameters (
gov/contrib/states/pa/ctc/):flat_amount/- in_effect, amount, age_limit, phaseout/threshold, phaseout/ratectc_match/- in_effect, match, age_limitReform Code (
reforms/states/pa/ctc/):pa_ctc_flat_amount.pypa_ctc_match.py__init__.pyfilesTests (
tests/policy/contrib/states/pa/ctc/):Test Plan
make formatpasses🤖 Generated with Claude Code