Gate tip deduction on both legacy and split SSTB inputs#8062
Merged
Conversation
`tip_income_deduction_occupation_requirement_met` checked only the legacy per-person `business_is_sstb` flag. After #7944, self-employed tipped workers can route their SSTB activity through `sstb_self_employment_income` while leaving the legacy flag unset, which would have bypassed the §224 SSTB exclusion and granted the deduction. Treat a person as "in the course of" an SSTB if the legacy flag is set OR `sstb_self_employment_income > 0`. Fallback stays conservative: any SSTB taint disqualifies, matching the binary semantics of the legacy flag. Callers relying on the old single-flag semantics see no behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8062 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 16 1 -15
Lines 261 14 -247
==========================================
- Hits 261 14 -247
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:
|
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
tip_income_deduction_occupation_requirement_metcurrently checks only the legacy per-personbusiness_is_sstbflag to apply OBBBA §224's SSTB exclusion:After #7944 split QBI into SSTB and non-SSTB components, a self-employed tipped worker can route their activity through
sstb_self_employment_incomeand leave the legacy flag unset. That path silently bypasses the §224 SSTB exclusion and grants the deduction.Fix
Treat a person as "in the course of" an SSTB if either the legacy flag is set or
sstb_self_employment_income > 0. Behavior for anyone using only the legacy flag is unchanged; anyone using only the new split inputs is now correctly excluded.TDD
Failing test added first:
Reproduced the regression (
met = Trueinstead ofFalse), then applied the fix.Test plan
make formatclean.🤖 Generated with Claude Code