Fix MS income tax to apply federal capital loss limitation #6966
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
Fixes #6964 - Mississippi income tax now correctly applies the federal $3,000 capital loss limitation instead of allowing unlimited capital losses to offset ordinary income.
Background
Mississippi Form 80-105 Line 40 ("Capital gain (loss)") flows from federal Schedule D, which already has the $3,000 loss limit applied per IRS regulations. Previously, PolicyEngine was using the raw
capital_gainsvariable which sums unlimited capital gains and losses without applying the federal limitation.Changes Made
Created new variable
loss_limited_capital_gains(policyengine_us/variables/household/income/person/capital_gains/loss_limited_capital_gains.py)loss_limited_net_capital_gainsproportionally to each personUpdated MS income sources parameter (
policyengine_us/parameters/gov/states/ms/tax/income/income_sources.yaml)capital_gainstoloss_limited_capital_gainsAdded integration test (
policyengine_us/tests/policy/baseline/gov/states/ms/tax/income/integration.yaml)Test Results
All MS integration tests pass, including the new test case:
Impact
This fix ensures Mississippi income tax calculations correctly follow federal Schedule D rules for capital loss limitations, preventing large capital losses from incorrectly zeroing out state tax liability.
🤖 Generated with Claude Code