Skip to content

Require head/spouse for SC CCAP activity eligibility#8071

Merged
MaxGhenis merged 1 commit intoPolicyEngine:mainfrom
MaxGhenis:fix-sc-ccap-activity-vacuous-pass
Apr 18, 2026
Merged

Require head/spouse for SC CCAP activity eligibility#8071
MaxGhenis merged 1 commit intoPolicyEngine:mainfrom
MaxGhenis:fix-sc-ccap-activity-vacuous-pass

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #7935. sc_ccap_activity_eligible returned True whenever an SPM unit contained no tax-unit head/spouse, because spm_unit.sum(is_head_or_spouse & ~individually_eligible) == 0 is vacuously satisfied over an empty set. An SPM unit with only dependents (e.g. two unaccompanied minors) would therefore pass the activity test.

This mirrors the VA CCSP activity-eligibility pattern (has_active_parent & all_covered) by also requiring at least one head/spouse to be present, while preserving the "every head/spouse must individually qualify" rule from the SC CCAP Policy Manual sec. 2.13.

Changes

  • policyengine_us/variables/gov/states/sc/dss/ccap/eligibility/sc_ccap_activity_eligible.py: require spm_unit.sum(is_head_or_spouse) >= 1.
  • New sc_ccap_activity_eligible.yaml test file covering head/spouse presence, disability exemption, student path, multi-parent, and the orphaned-minors regression case.
  • Updated sc_ccap_maximum_weekly_benefit.yaml cases 1-9 to use a realistic two-person unit (working head + child). The benefit-rate assertions are unchanged; the tests simply no longer rely on the vacuous activity-pass.

Test plan

  • New regression case (Case 6, SPM unit with only dependents) fails before the fix and passes after.
  • All 305 tests under policyengine_us/tests/policy/baseline/gov/states/sc/ pass.

Follow-up to PolicyEngine#7935.

sc_ccap_activity_eligible returned True whenever no head/spouse
appeared in the SPM unit, because `spm_unit.sum(is_head_or_spouse &
~individually_eligible) == 0` is vacuously True for an empty set.
An SPM unit composed only of dependents (e.g. a pair of
unaccompanied minors) would therefore satisfy the activity test.

Mirror the VA CCSP activity-eligibility pattern by requiring at
least one head/spouse to be present in addition to every head or
spouse meeting the individual activity requirement.

The benefit-rate tests in sc_ccap_maximum_weekly_benefit.yaml
previously tested a single-child SPM unit to isolate the rate
schedule. Those are now realistic family scenarios with a working
head, which keeps the rate assertions unchanged while matching the
tightened activity test. A new sc_ccap_activity_eligible.yaml
covers the head/spouse requirement directly, including the
orphaned-minors regression case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (05d5d97) to head (0bca903).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #8071    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           18         1    -17     
  Lines          353        20   -333     
  Branches         4         0     -4     
==========================================
- Hits           353        20   -333     
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 2ac6fec into PolicyEngine:main Apr 18, 2026
15 checks passed
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