-
Notifications
You must be signed in to change notification settings - Fork 201
SSI spousal deeming uses wrong FBR: couples lose /month when deeming applies #6843
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6843 +/- ##
===========================================
- Coverage 100.00% 97.18% -2.82%
===========================================
Files 2 4 +2
Lines 26 71 +45
Branches 0 1 +1
===========================================
+ Hits 26 69 +43
- Misses 0 1 +1
- Partials 0 1 +1
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:
|
...ables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py
Outdated
Show resolved
Hide resolved
policyengine_us/tests/policy/baseline/gov/ssa/ssi/integration_tests.yaml
Show resolved
Hide resolved
…dual FBR This commit fixes a critical bug in SSI spousal deeming calculations and improves code organization: 1. **Main Fix: Use couple FBR when deeming applies** - Modified `ssi_amount_if_eligible.py` to use couple rate ($1,450) instead of individual rate ($967) when spousal deeming applies - This corrects a $483/month ($5,796/year) underpayment for couples where only one spouse is eligible and the other has income exceeding the deeming threshold - Added mathematical proof in comments explaining why the regulatory cap is redundant 2. **New variable: is_ssi_spousal_deeming** - Created helper variable to determine when spousal deeming applies (spouse's countable income > $483/month) - Consolidates threshold logic in one place to avoid duplication - Clear boolean naming convention consistent with other SSI variables 3. **Bug fix: Child allocation consistency** - Fixed `ssi_unearned_income_deemed_from_ineligible_spouse.py` to multiply child allocations by `is_ssi_aged_blind_disabled` - Now consistent with `ssi_earned_income_deemed_from_ineligible_spouse.py` and parent deeming pattern 4. **Code improvements** - Refactored `ssi_income_deemed_from_ineligible_spouse.py` to reuse `is_ssi_spousal_deeming` instead of duplicating threshold check - Eliminated nested `where()` in `ssi_amount_if_eligible.py` for better readability - Better variable naming: `individual_earned` instead of `indiv_earned` 5. **Test updates** - Updated integration test expectations to reflect correct SSI amounts with couple FBR - All 102 SSI tests passing Fixes PolicyEngine#6842 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
policyengine_us/tests/policy/baseline/gov/ssa/ssi/integration_tests.yaml
Show resolved
Hide resolved
This commit refines the SSI spousal deeming fix with better code organization and additional test coverage: 1. **Move cap logic from uncapped_ssi to ssi** - Makes uncapped_ssi truly "uncapped" (just amount - countable) - Consolidates all final logic (floor and cap) in the ssi output variable - Clearer separation of concerns 2. **Refactor is_ssi_spousal_deeming for clarity** - Use add() to combine earned and unearned deemed income - Rename variables for consistency (spouse_deemed_income) - Break out nested where() statements for readability 3. **Update comments with corrected understanding** - Clarify that deeming threshold compares GROSS income (not countable) - Explain why cap is necessary (not redundant) - Document that exclusions apply to COMBINED income after threshold check 4. **Add comprehensive test cases** - Case 8: Spouse earns $967 - demonstrates cap is necessary - Case 9: Spouse earns $3,000, no child - shows $0 benefit - Case 10: Spouse earns $3,000, with child - shows $234 benefit - Case 11: Single parent scenario with two children - All tests include detailed calculation step comments 5. **Fix child allocation consistency** - Added missing is_ssi_aged_blind_disabled filter to unearned income variable - Now consistent with earned income and parent deeming patterns All 105 SSI tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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.
Nit, LGTM after
...ables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming.py
Outdated
Show resolved
Hide resolved
MaxGhenis
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.
This PR correctly implements the SSI spousal deeming rules per 20 CFR §416.1163 and SSA POMS SI 01320.400.
Key points:
- Correctly uses the couple FBR when deeming applies.
- Accurately implements the deeming threshold (spouse's income > difference between couple and individual FBR).
- Properly caps the benefit at the individual FBR when deeming applies.
Comprehensive tests cover various scenarios, including the cap and child allocations. The code is well-refactored and addresses the bug effectively.
Fixes #6842