Skip to content

Gate tip deduction on both legacy and split SSTB inputs#8062

Merged
MaxGhenis merged 1 commit intomainfrom
fix-tip-deduction-sstb-mixed
Apr 17, 2026
Merged

Gate tip deduction on both legacy and split SSTB inputs#8062
MaxGhenis merged 1 commit intomainfrom
fix-tip-deduction-sstb-mixed

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

tip_income_deduction_occupation_requirement_met currently checks only the legacy per-person business_is_sstb flag to apply OBBBA §224's SSTB exclusion:

is_sstb = person("business_is_sstb", period)
return (treasury_tipped_occupation_code > 0) & ~is_sstb

After #7944 split QBI into SSTB and non-SSTB components, a self-employed tipped worker can route their activity through sstb_self_employment_income and 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:

- name: SSTB self-employment income blocks tip deduction even without legacy flag
  input:
    sstb_self_employment_income: 50_000
    business_is_sstb: false
    treasury_tipped_occupation_code: 102
    tip_income: 5_000
  output:
    tip_income_deduction_occupation_requirement_met: false
    tip_income_deduction: 0

Reproduced the regression (met = True instead of False), then applied the fix.

Test plan

  • New YAML case fails on unmodified main, passes after fix.
  • All 13 existing tip-deduction YAML cases still pass.
  • make format clean.
  • PR CI.

🤖 Generated with Claude Code

`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
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (03faf19) to head (e97d72a).
⚠️ Report is 209 commits behind head on main.

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis MaxGhenis merged commit e4a887b into main Apr 17, 2026
15 checks passed
@MaxGhenis MaxGhenis deleted the fix-tip-deduction-sstb-mixed branch April 17, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant