Skip to content

Use PA retirement-age threshold for employer pension exclusion - #9387

Open
DTrim99 wants to merge 1 commit into
PolicyEngine:mainfrom
DTrim99:fix/pa-pension-retirement-age
Open

Use PA retirement-age threshold for employer pension exclusion#9387
DTrim99 wants to merge 1 commit into
PolicyEngine:mainfrom
DTrim99:fix/pa-pension-retirement-age

Conversation

@DTrim99

@DTrim99 DTrim99 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #9386.

Problem

pa_nontaxable_pension_income gated the Pennsylvania employer-pension exclusion on is_retired, which is hard-coded to age ≥ 65:

retired = person("is_retired", period)   # is_retired = age >= 65

But the parallel pa_nontaxable_retirement_distributions (IRA/401(k)/403(b)/SEP/Keogh) already uses PA's retirement_age_threshold = 59.5. 61 Pa. Code §101.6 treats federally qualified employee pension plans the same as IRAs, SEPs, and Keogh plans — all excluded once the recipient reaches the plan's retirement age — so the two should not use different ages. The PA-40 IN (2023, p.8) lists as not taxable: "Commonly recognized pension, old age, or retirement benefits paid after becoming eligible to retire, and retiring."

The mismatch over-taxed employer pensions for retirees aged 59.5–64.

Fix

Gate pa_nontaxable_pension_income on PA's retirement_age_threshold (59.5), matching pa_nontaxable_retirement_distributions.

Impact (TAXSIM #1165)

PA 2023 joint, primary 72 / spouse 64, no wages; $37,636 interest, $201,382 pension, $52,916 Social Security. The pension is split 50/50, and the 64-year-old's half was wrongly taxed:

  • Before: PA AGI $138,327, tax $4,246.64
  • After: PA AGI $37,636 (interest only), tax $1,155.42 — matches TaxAct (100% of pension + SS excluded)

Tests

  • Updated the unit test to probe the 59.5 boundary: age 59 → taxable, age 60 → excluded, age 67 → excluded.
  • PA income-tax suite passes (51 tests).

🤖 Generated with Claude Code

pa_nontaxable_pension_income gated the PA exclusion on is_retired (age
>= 65), while the parallel pa_nontaxable_retirement_distributions uses
PA's retirement_age_threshold (59.5). 61 Pa. Code Sec. 101.6 treats
federally qualified employee pension plans the same as IRAs, SEPs, and
Keogh plans, so both should use the same age. This over-taxed employer
pensions for retirees aged 59.5-64.

Fixes PolicyEngine#9386

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ECQhxDkVchXm1RNVyqwnx
@DTrim99

DTrim99 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

@PavelMakarchuk flagging a small convention point: this changes the PA employer-pension exclusion age from 65 (the generic is_retired default) to PA's own retirement_age_threshold of 59.5. The justification is that 61 Pa. Code §101.6 treats federally qualified employee pension plans the same as IRAs/SEP/Keogh (which we already exclude at 59.5 via pa_nontaxable_retirement_distributions), so keeping employer pensions at 65 was an internal inconsistency. It reverses the old age-60→taxable unit-test case, which encoded the age-65 assumption rather than an external PA source. Happy to adjust if you'd prefer a different threshold.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (837a1ad) to head (1b48dc5).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9387   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         1    -2     
  Lines           46        15   -31     
=========================================
- Hits            46        15   -31     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

PA taxes employer pension for retirees aged 59.5-64 (is_retired age-65 cutoff inconsistent with the 59.5 retirement-distribution threshold)

1 participant