Skip to content

Comments

Fix Hawaii CDCC going negative with negative SE income#7441

Merged
PavelMakarchuk merged 2 commits intomainfrom
fix/hi-cdcc-negative-credit
Feb 20, 2026
Merged

Fix Hawaii CDCC going negative with negative SE income#7441
PavelMakarchuk merged 2 commits intomainfrom
fix/hi-cdcc-negative-credit

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

  • Clamp min_earned to non-negative in hi_cdcc.py to prevent negative self-employment income from producing a negative credit (which adds tax instead of reducing it)
  • Fix missing commas in reference tuples for hi_cdcc_min_head_spouse_earned and hi_cdcc_income_floor_eligible (implicit string concatenation → proper tuple)
  • Add 3 test cases covering negative and zero earned income scenarios

Root Cause

When a spouse has negative SE income, hi_cdcc_min_head_spouse_earned returns a negative value. Then min_(dependent_care_benefits, negative_earnings) produces a negative min_earned, and rate × negative = negative credit.

Fix

# Before (bug):
min_earned = min_(hi_dependent_care_benefits, hi_cdcc_min_head_spouse_earned)

# After (fix):
min_earned = max_(0, min_(hi_dependent_care_benefits, hi_cdcc_min_head_spouse_earned))

Test plan

Closes #7409

🤖 Generated with Claude Code

Clamp min_earned to non-negative in hi_cdcc.py to prevent negative
self-employment income from producing a negative credit. Also fix
missing commas in reference tuples for hi_cdcc_min_head_spouse_earned
and hi_cdcc_income_floor_eligible.

Closes #7409

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f073b57) to head (1d467fe).
⚠️ Report is 126 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7441   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         3    -1     
  Lines           76        52   -24     
  Branches         1         0    -1     
=========================================
- Hits            76        52   -24     
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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review February 19, 2026 20:57
@PavelMakarchuk PavelMakarchuk merged commit fc637de into main Feb 20, 2026
9 checks passed
@PavelMakarchuk PavelMakarchuk deleted the fix/hi-cdcc-negative-credit branch February 20, 2026 22:56
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.

Hawaii CDCC (hi_cdcc) goes negative when spouse has negative self-employment income

3 participants