Skip to content

Restrict tip deduction to qualifying occupations#7896

Open
MaxGhenis wants to merge 7 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/tip-deduction-occupation-gate
Open

Restrict tip deduction to qualifying occupations#7896
MaxGhenis wants to merge 7 commits intoPolicyEngine:mainfrom
MaxGhenis:codex/tip-deduction-occupation-gate

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Mar 28, 2026

Summary

  • Restrict the federal tip income deduction to people who meet a new tipped-occupation requirement.
  • Add a detailed_industry_recode person input so the gate can be refined independently of the current microdata wiring.
  • Move the occupation-to-eligible-industry mapping into policyengine_us/parameters/gov/irs/deductions/tip_income/eligible_industries_by_occupation_recode.yaml.
  • Exclude SSTB cases and add focused policy tests for eligible, ineligible, and industry-dependent cases.

Notes

  • The legal rule requires the deduction to be limited to published tipped occupations and excludes SSTB contexts.
  • policyengine-us currently only carries the coarse CPS POCCU2 occupation recode, so this PR uses a conservative approximation with an industry hook rather than pretending we already have the final detailed occupation and industry inputs.
  • The industry mapping is now policy parameter data rather than hardcoded Python, so it can be adjusted without editing the formula.
  • If occupation data is missing entirely, the new gate stays permissive so standalone calculations remain backward compatible.

Testing

  • make format
  • uv run python -m compileall policyengine_us/variables/gov/irs/income/taxable_income/deductions/tip_income policyengine_us/variables/household/demographic/person/detailed_industry_recode.py
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/tip_income/tip_income_deduction.yaml -c policyengine_us
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/tip_and_overtime_income_deduction.yaml -c policyengine_us
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/states/in/tax/income/deductions/obbba_conformity/in_tip_income_deduction.yaml -c policyengine_us
  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/senior_deduction/integration.yaml -c policyengine_us

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (edaf7b1) to head (66f09d5).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #7896      +/-   ##
===========================================
+ Coverage   97.26%   100.00%   +2.73%     
===========================================
  Files           5         3       -2     
  Lines          73        42      -31     
  Branches        2         0       -2     
===========================================
- Hits           71        42      -29     
+ Misses          1         0       -1     
+ Partials        1         0       -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (+2.73%) ⬆️

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.

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