Cap 401(k) and 403(b) contributions at the IRC §402(g) elective deferral limit#8391
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8391 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 2 17 +15
Lines 57 177 +120
Branches 1 0 -1
==========================================
+ Hits 57 177 +120
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
Contributor
Author
|
Companion data-side PR: PolicyEngine/policyengine-us-data#1122 — re-routes the CPS imputation pipeline to write |
fa35a77 to
4264fd5
Compare
4264fd5 to
6e34707
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
traditional_401k_contributions_desired,roth_401k_contributions_desired,traditional_403b_contributions_desired, androth_403b_contributions_desiredas new pre-cap input variables.*_contributionsvariables into formulas that proportionally scale the desired amounts when the combined total exceeds the §402(g) limit (base + age-based catch-up, including SECURE 2.0 ages 60-63).elective_deferral_limit,elective_deferrals_desired, andelective_deferral_scale_factor.policyengine_us/tools/default_uprating.pyso the default dollar uprating attaches to the new_desiredinputs.Fixes #8386.
Fixes #8390.
Design note
PR #8263 moved away from
_reportedshortcuts as a generic data-vs-model split. The pattern here is semantically different:_desiredis the pre-cap intended amount versus the legally allowable amount. The canonical variable name remains the post-cap value that downstream code consumes, so callers that aggregatetraditional_401k_contributions(e.g.,pre_tax_contributions,savers_credit_qualified_contributions) are unaffected.Direct overrides of
traditional_401k_contributions(or any other canonical variant) still bypass the cap — preserving backward compatibility for any existing API caller or test that sets the post-cap value directly. Survey microdata should migrate to the_desiredinputs to opt into capping; this PR does not change the microdata wiring.Followups
Test plan
uv run policyengine-core test policyengine_us/tests/policy/baseline/household/expense/retirement/elective_deferral_cap.yaml -c policyengine_us— 9/9 passirs_employment_income.yaml,savers_credit_*.yaml,test_fica_wage_base_excludes_401k.yaml,additional_medicare_tax.yaml(22 cases)🤖 Generated with Claude Code