Skip to content

Fix PA employer-plan retirement exemption and NJ 529 deduction ordering (#8848, #8849); close #8830#8922

Merged
MaxGhenis merged 2 commits into
PolicyEngine:mainfrom
MaxGhenis:codex/state-tax-accuracy
Jul 6, 2026
Merged

Fix PA employer-plan retirement exemption and NJ 529 deduction ordering (#8848, #8849); close #8830#8922
MaxGhenis merged 2 commits into
PolicyEngine:mainfrom
MaxGhenis:codex/state-tax-accuracy

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

Three state income-tax accuracy issues. Two are fixed here with dated, page-anchored parameters and tests; one is already correct on main and is documented below with evidence for closing.

Issue State Verdict
#8848 PA Fixed — employer-plan (401(k), 403(b), SEP, Keogh) distributions now exempt post-retirement, like IRAs
#8849 NJ Fixed — 529 deduction moved from gross-income subtractions to taxable-income deductions
#8830 OK Already correct on main (PR #8911) — close with evidence

#8848 — PA post-retirement employer-plan distributions

Law. 61 Pa. Code § 101.6 defines "Old Age or Retirement Benefit Plans" to include "Individual Retirement plans (IRA), Simplified Employee Pension Plans (SEP), Keogh plans, Federally qualified employe pension plans and similar old age or retirement benefit plans," and makes their distributions non-taxable when "made upon or after retirement from service after reaching a specific age or after a stated period of employment." The PA PIT Guide (Gross Compensation) and the PA DOR 1099-R FAQ (a_id 1470, Code 7 normal distribution) say the same: a distribution from an eligible PA plan is not taxable once the plan's age/service requirements for retirement are met.

Bug. taxable_401k_distributions, taxable_403b_distributions, taxable_sep_distributions, and keogh_distributions all sit in taxable_retirement_distributions — separate from taxable_pension_income (which the pension path already exempts via pa_nontaxable_pension_income). pa_nontaxable_retirement_distributions only excluded taxable_ira_distributions, so post-retirement 401(k)/403(b)/SEP/Keogh distributions stayed in pa_total_taxable_income and were taxed at 3.07%.

Fix. New parameter gov/states/pa/tax/income/nontaxable_retirement_distribution_sources lists all five eligible distribution sources; pa_nontaxable_retirement_distributions sums them and applies the existing retirement_age_threshold (59½) proxy, mirroring the IRA treatment the issue asks for. The previously-passing "Case 3" test that pinned the old behavior (401(k) at 67 → taxed) is corrected to the exempt result, and cases for 403(b)/SEP/Keogh plus the issue's reported household (PolicyBench scenario_085: PA single, age 67, $1,560 401(k)) are added.


#8849 — NJ 529 deduction shifts the filing threshold

Law. NJ's filing-threshold zero-tax floor (N.J.S.A. 54A:2-4) tests gross income — Form NJ-1040 line 29 ("more than $20,000 … $10,000 if single/MFS"). The NJBEST 529 contribution deduction (N.J.S.A. 54A:3-13; P.L. 2021 c.419) is a New Jersey College Affordability Act deduction on line 37a, in the deductions block (lines 30–37c) between gross income (line 29) and taxable income (line 39) — the same 54A:3 family as the medical-expense deduction PE already models in nj_total_deductions.

Bug. nj_529_deduction was listed in subtractions.yaml, which feeds nj_total_incomenj_agi (PE's gross-income line). Away from the threshold this is harmless (the deduction lands either way), but at the boundary it netted into nj_agi and wrongly pulled 529 contributors just above $10k/$20k below the threshold, zeroing their tax and flipping nj_property_tax_deduction_eligible.

Fix. Remove nj_529_deduction from subtractions.yaml (collapsing the now-redundant 2022 breakpoint) and add it to nj_total_deductions alongside nj_medical_expense_deduction. Its income-limit test reads federal adjusted_gross_income, not nj_agi, so this creates no circular dependency. A boundary test confirms a single filer with $10,500 gross income and $10,000 of 529 contributions keeps nj_agi = 10,500 (above the threshold, unmoved by the deduction) with the deduction landing in nj_total_deductions.


#8830 — OK §401 employer pensions in TY2021 (already fixed)

Fixed on main by PR #8911 (commit 1f61736c69). ok_pension_subtraction now excludes private-employer (IRC §401) pension income before 2022 via the dated boolean parameter private_pension_qualifies (2021 → false, 2022 → true), page-anchored to Form 511 Schedule 511-A line 6 for both years. The reported-household case is already covered by baseline tests: age 66 with taxable_private_pension_income: 20_000 yields ok_pension_subtraction: 0 in 2021 and 10,000 in 2022, with a companion case confirming government pensions still qualify in 2021. No code change needed; recommend closing #8830 with reference to #8911.


Tests

All baseline state trees pass on this branch:

Run:

python -m policyengine_core.scripts.policyengine_command test \
  policyengine_us/tests/policy/baseline/gov/states/{pa,nj,ok}/ -c policyengine_us

Closes #8848, closes #8849, closes #8830.

🤖 Generated with Claude Code

PA (PolicyEngine#8848): 61 Pa. Code Sec. 101.6 treats IRAs, SEPs, Keogh plans, and
federally qualified employee pension plans (401(k), 403(b)) alike -
distributions made on or after retirement after reaching the plan's age
or service requirements are not taxable PA compensation. PE previously
excluded only IRA distributions, so post-retirement 401(k)/403(b)/SEP/Keogh
distributions were taxed at 3.07%. Route all eligible employer-plan
distribution sources through pa_nontaxable_retirement_distributions via a
new page-anchored source-list parameter.

NJ (PolicyEngine#8849): The NJBEST 529 contribution deduction (N.J.S.A. 54A:3-13,
Form NJ-1040 line 37a) is a taxable-income deduction applied after the
gross-income line (line 29) that the filing threshold (N.J.S.A. 54A:2-4)
keys on. PE netted it into nj_agi via subtractions.yaml, wrongly zeroing
529 contributors just above the $10k/$20k gross-income filing threshold.
Move it into nj_total_deductions alongside its 54A:3 sibling
nj_medical_expense_deduction.

Tests: PA pre/post-retirement cases for each plan type plus the issue
reported household; NJ boundary test at the filing threshold confirming
529 contributions no longer move nj_agi.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f9e58e7) to head (c1d44a3).
⚠️ Report is 139 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8922   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         2    -1     
  Lines           55        25   -30     
=========================================
- Hits            55        25   -30     
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.

…ct effective date

Moving nj_529_deduction from the dated subtractions list to
nj_total_deductions.adds removed the only pre-2022 gate; the cap
parameter now pins it to zero for 2021 with a regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis marked this pull request as ready for review July 6, 2026 12:47
@MaxGhenis MaxGhenis merged commit a92861e into PolicyEngine:main Jul 6, 2026
35 checks passed
MaxGhenis added a commit that referenced this pull request Jul 6, 2026
Maine EITC (issue #8927): 36 M.R.S. Sec. 5219-S(5)-(6) restores the EITC to
childless filers aged 18-24 whom federal Sec. 32 bars only on the minimum-age
floor. Add me_childless_eitc_age_eligible and me_pro_forma_childless_eitc, and
take the larger of the federal EITC and the pro forma amount in me_eitc.

Maine STFC (issue #8928): the 2025 Schedule PTFC/STFC line 17 table shows a
base of $215 for joint, head of household, and surviving spouse filers with no
dependents; the model had $220. Set the 2025 base to $215 and re-split the
dependent add-ons to $35/$65 so the with-dependent totals ($250/$280) are
unchanged.

Also add reported-household regression tests for issues #8710 (DE per-column
credit cap, already fixed by #7940) and #8589 (PA retiree income, already fixed
by #8922).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant