-
Notifications
You must be signed in to change notification settings - Fork 201
Add Minnesota 2025 income tax updates and new programs #6923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rams New Programs Added: - K-12 Education Credit: Refundable credit for qualifying K-12 education expenses - 75% of qualifying expenses up to $1,500 per child - Income-based phaseout starting at $75,820 (2025) - Parameters for income limits, phaseout rates, expense rates - K-12 Education Subtraction: Subtraction for K-12 education expenses - $1,625 max per child grades K-6 - $2,500 max per child grades 7-12 - No income limit (available since 1997) - 529 Contribution Subtraction: Subtraction for 529 plan contributions - $1,500 single / $3,000 joint maximum - Available since 2017 (corrected from 2023) - Updated statute reference to Subd. 23 - Military Pension Subtraction: Full subtraction of military retirement pay - 100% subtraction with no income limits - Available since 2016 - Active Duty Military Pay Subtraction: Full subtraction of active duty pay - 100% subtraction with no income limits - Available since 2005 Parameter Updates for 2025: - Tax brackets for all filing statuses - Standard and itemized deduction amounts and thresholds - Personal exemption amounts and AGI thresholds - AMT rates and income thresholds - Child and Working Families Credit amounts - CDCC credit parameters - Marriage credit parameters - Social Security subtraction thresholds - Public pension subtraction caps - Charity subtraction thresholds Historical Coverage: - Updated sources.yaml to include 529 subtraction starting 2021 - Added documentation comments for program enactment dates Fixes PolicyEngine#6920 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6923 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 7 -6
Lines 195 100 -95
=========================================
- Hits 195 100 -95
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:
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial suggestions
...engine_us/variables/gov/states/mn/tax/income/subtractions/mn_military_pension_subtraction.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/states/mn/tax/income/subtractions/k12_education/cap/higher.yaml
Show resolved
Hide resolved
policyengine_us/parameters/gov/states/mn/tax/income/subtractions/k12_education/cap/lower.yaml
Show resolved
Hide resolved
...s/variables/gov/states/mn/tax/income/subtractions/mn_active_duty_military_pay_subtraction.py
Outdated
Show resolved
Hide resolved
...ngine_us/variables/gov/states/mn/tax/income/credits/k12_education/mn_k12_education_credit.py
Show resolved
Hide resolved
..._us/parameters/gov/states/mn/tax/income/subtractions/social_security/alternative_amount.yaml
Show resolved
Hide resolved
policyengine_us/parameters/gov/states/mn/tax/income/subtractions/k12_education/max_k6.yaml
Outdated
Show resolved
Hide resolved
...e_us/parameters/gov/states/mn/tax/income/subtractions/education_savings/max_subtraction.yaml
Outdated
Show resolved
Hide resolved
|
@PolicyEngine, please integrate the comments from @PavelMakarchuk. Make sure all parameter descriptions are in active voice and remove "values:" when appropriate. The 2025 values in social_security\income_amount.yaml and social_security\alternative_amount.yaml need to be hardcoded to prevent unwanted uprating |
|
Sorry @DTrim99, only members of the PolicyEngine/core-developers team can invoke Claude Code. |
Changes based on @PavelMakarchuk review: 1. Military subtraction variables - use 'adds' syntax: - mn_military_pension_subtraction: adds = ["military_retirement_pay", "military_retirement_pay_survivors"] - mn_active_duty_military_pay_subtraction: adds = ["military_service_income"] 2. K-12 education subtraction parameters - reorganized: - Renamed max_k6.yaml -> cap/lower.yaml - Renamed max_7_12.yaml -> cap/higher.yaml - Updated variable to use p.cap.higher 3. K-12 education credit - split into separate files: - Created mn_k12_education_credit_eligible.py for eligibility logic - Simplified mn_k12_education_credit.py to use defined_for eligibility 4. Parameter descriptions - converted to active voice: - "Minnesota K-12 Education Credit provides..." -> "Minnesota provides this maximum K-12 Education Credit..." - "Minnesota K-12 Education Credit phases out..." -> "Minnesota phases out the K-12 Education Credit..." - All k12_education credit parameters updated 5. 529 subtraction parameter - removed 'values:' nesting: - Changed from "JOINT:\n values:\n 2017-01-01: 3_000" to "JOINT:\n 2017-01-01: 3_000" - Updated description to active voice 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addressed Review CommentsThanks for the feedback @PavelMakarchuk! I've made the following changes: 1. Military subtraction variables - converted to
|
...variables/gov/states/mn/tax/income/credits/k12_education/mn_k12_education_credit_eligible.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/states/mn/tax/income/subtractions/education_savings/cap.yaml
Show resolved
Hide resolved
...ine_us/parameters/gov/states/mn/tax/income/credits/k12_education/income_limit_increment.yaml
Outdated
Show resolved
Hide resolved
...cyengine_us/parameters/gov/states/mn/tax/income/credits/k12_education/income_limit/base.yaml
Show resolved
Hide resolved
...ne_us/parameters/gov/states/mn/tax/income/credits/k12_education/income_limit/additional.yaml
Show resolved
Hide resolved
- Parametrize the hardcoded `2` as `income_limit/child_threshold.yaml` - Rename `max_subtraction.yaml` to `cap.yaml` for 529 subtraction - Move income limit params into `income_limit/` folder (base.yaml, additional.yaml) - Update description to reference "above a certain number" instead of "beyond 2" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Addressed all review comments:
All 136 Minnesota income tax tests pass. |
.../parameters/gov/states/mn/tax/income/credits/k12_education/income_limit/child_threshold.yaml
Outdated
Show resolved
Hide resolved
Updates the Minnesota Statutes reference from general "290.0674" to specific "290.0674, Subd. 2(a)" with anchor link for income limit parameters (base, additional, and child_threshold). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…engine-us into DTrim99/issue6920
|
@DTrim99 please fix tests but structure looks good |
They aren't failing, but timing out. |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Review: Minnesota 2025 Income Tax Updates
I've reviewed this PR focusing on parameter accuracy, legal references, variable logic, and test coverage.
🔴 Critical Issues
1. Incorrect Statute References for Military Subtractions
The military subtraction variables cite incorrect subdivision numbers:
mn_military_pension_subtraction.py (line 11):
- Currently cites:
290.0132#stat.290.0132.27 - Should cite:
290.0132#stat.290.0132.21 - Subdivision 27 is about "Deferred foreign income", not military pensions
- Correct reference: Subdivision 21 - Military service pension; retirement pay
mn_active_duty_military_pay_subtraction.py (line 11):
- Currently cites:
290.0132#stat.290.0132.20 - Should cite:
290.0132#stat.290.0132.12 - Subdivision 20 is about "Dependent exemption", not active duty pay
- Correct reference: Subdivision 12 - Armed forces active duty compensation
🟡 Medium Issues
2. Missing Unit Tests for mn_k12_qualifying_children
The mn_k12_qualifying_children variable has no direct unit tests. While it's tested indirectly through the credit tests (using the variable as input), adding unit tests would:
- Verify the
is_in_k12_schoolandis_tax_unit_dependentlogic - Test edge cases with mixed K-12 and non-K-12 children
- Ensure proper entity aggregation with
tax_unit.sum()
Suggested test location: policyengine_us/tests/policy/baseline/gov/states/mn/tax/income/credits/k12_education/mn_k12_qualifying_children.yaml
🟢 Verified Correct
Parameter Accuracy ✓
| Parameter | Expected Value | PR Value | Source |
|---|---|---|---|
| K-12 Credit phase-out rate (1 child) | 25% ($1 per $4) | 0.25 | 290.0674 |
| K-12 Credit phase-out rate (2+ children) | 50% ($2 per $4) | 0.50 | 290.0674 |
| K-12 Credit max per child | $1,500 | $1,500 | 290.0674 |
| 529 Subtraction max (single) | $1,500 | $1,500 | 290.0132 Subd. 23 |
| 529 Subtraction max (joint) | $3,000 | $3,000 | 290.0132 Subd. 23 |
| 529 Subtraction enacted | 2017 | 2017-01-01 | 2017 1st Special Session |
Entity Relationships ✓
- Military income variables (
military_retirement_pay,military_retirement_pay_survivors,military_service_income) are correctly defined at Person level - Subtraction variables use
addsattribute to properly aggregate to TaxUnit level - K-12 qualifying children uses
tax_unit.sum()correctly for person-level aggregation
Variable Logic ✓
mn_k12_education_credit_eligiblecorrectly excludes SEPARATE filing status- Income limit calculation properly accounts for additional children beyond threshold
- Phase-out logic uses different rates for single vs multiple children
Test Coverage ✓
All new programs have test files with reasonable coverage:
mn_k12_education_credit.yaml- 6 test casesmn_k12_education_subtraction.yaml- 4 test casesmn_529_contribution_subtraction.yaml- 6 test casesmn_military_pension_subtraction.yaml- 4 test casesmn_active_duty_military_pay_subtraction.yaml- 3 test cases
📝 Documentation Note
The mn_k12_education_subtraction.py appropriately documents the limitation that it uses the 7-12 maximum ($2,500) for all children since grade-level data isn't available. This is an acceptable approximation but slightly overestimates benefits for K-6 students.
Summary
Required changes before merge:
- ❌ Fix the military pension subtraction statute reference (Subd. 27 → Subd. 21)
- ❌ Fix the active duty military pay subtraction statute reference (Subd. 20 → Subd. 12)
Recommended improvements:
3. mn_k12_qualifying_children variable
|
@PolicyEngine fix the statute misalignment and add unit tests for mn_k12_qualifying_children variable |
|
I ran into an issue: |
- Correct mn_active_duty_military_pay_subtraction reference to Subd. 12 - Correct mn_military_pension_subtraction reference to Subd. 21 - Add mn_k12_qualifying_children tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
All 141 Minnesota tests pass ✓ Committed fixes:
|
PR Review - Minnesota 2025 Income Tax Updates✅ CI Status: All Checks Passing🟢 Approval RecommendedThis is a well-structured PR that adds Minnesota 2025 tax updates and 5 new programs. The implementation follows PolicyEngine standards and all tests pass. Validation Summary
🟡 Suggestions (Optional Improvements)1. Add Direct Unit Tests for Helper VariablesThe following variables are only tested indirectly:
Recommendation: Consider adding dedicated test files for these helper variables for more explicit coverage. 2. Minor Comment ClarificationFile: The comment mentions using an "average limit as approximation" but the code actually uses # Using 7-12 cap as upper bound since we cannot distinguish grades
# (K-6 cap is $1,625, 7-12 cap is $2,500)3. Edge Case Tests to ConsiderFor future enhancement, consider adding boundary tests at:
New Programs Validated
Key Implementation HighlightsGood Patterns Used:
References Quality:
VerdictAPPROVE - This PR is ready for merge. All critical requirements are met, CI passes, and the implementation follows PolicyEngine standards. The suggestions above are optional enhancements. 🤖 Automated review by Claude Code |
|
@DTrim99 please add last couple unit tests for intermediate variabels and merge |
Summary
This PR implements Minnesota's 2025 income tax changes and adds several new subtraction and credit programs that were missing from the codebase.
New Programs Added
Parameter Updates for 2025
Key Corrections
Files Changed
New Variables (6 files):
mn_k12_education_credit.py- K-12 education credit calculationmn_k12_qualifying_children.py- Count of qualifying K-12 childrenmn_k12_education_subtraction.py- K-12 education subtraction calculationmn_529_contribution_subtraction.py- 529 plan contribution subtractionmn_military_pension_subtraction.py- Military pension subtractionmn_active_duty_military_pay_subtraction.py- Active duty pay subtractionNew Parameters (9 files):
New Tests (5 files):
Updated Parameters (78 files):
Test Plan
make formatReferences
Fixes #6920
🤖 Generated with Claude Code