Skip to content

Conversation

PavelMakarchuk
Copy link
Collaborator

Fixes #6605

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (78100ff) to head (636d4a9).
⚠️ Report is 45 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #6607   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         4    +1     
  Lines           39        70   +31     
  Branches         0         2    +2     
=========================================
+ Hits            39        70   +31     
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.

@PavelMakarchuk PavelMakarchuk marked this pull request as draft September 26, 2025 18:37
@PavelMakarchuk PavelMakarchuk removed the request for review from MaxGhenis September 26, 2025 18:37
@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review September 26, 2025 19:03
- Fixed critical calculation error where Texas supplement was double-multiplied
- Changed tx_lifeline_supplement from YEAR to MONTH definition period
- Created unified is_lifeline_income_eligible variable that handles both federal (135% FPG) and state expansions (TX at 150% FPG)
- Removed redundant tx_lifeline_income_eligible variable
- Fixed variable references from incorrect DART transit links to proper Texas Admin Code citations
- Fixed float32/float64 dtype mismatch that caused comparison failures at exact thresholds
- Added comprehensive integration tests for Texas Lifeline scenarios
- Tests now properly validate income eligibility expansion and supplement calculation

The implementation now correctly models how Texas uses state authority to expand Lifeline eligibility beyond federal limits using state funding per Texas Utilities Code § 55.015(d-1).
@MaxGhenis
Copy link
Contributor

PR Review Complete ✅

Issues Found and Fixed

  1. Critical Calculation Error: The Texas Lifeline supplement was being double-multiplied (multiplied by 12 twice), resulting in incorrect benefit amounts. Fixed by changing tx_lifeline_supplement from YEAR to MONTH period definition.

  2. Incorrect References: Both Texas variables referenced DART transit fares website instead of Texas telecommunications regulations. Updated to reference proper Texas Admin Code § 26.412 and Texas Utilities Code § 55.015.

  3. Improved Federal/State Separation: Created a unified is_lifeline_income_eligible variable that cleanly handles both federal (135% FPG) and state expansions (Texas at 150% FPG) using np.where(is_tx, tx_p.fpg_limit, p.fpg_limit).

  4. Float Precision Issue: Fixed float32/float64 dtype mismatch that caused comparison failures at exact thresholds (e.g., 1.35 <= 1.35 was returning False).

  5. Added Comprehensive Tests: Created 11 integration tests covering various Texas Lifeline scenarios including edge cases, household compositions, and benefit calculations.

Legal Authority Clarified

Texas can expand Lifeline eligibility to 150% FPG (beyond federal 135%) through:

  • Texas Utilities Code § 55.015(d-1): Explicitly requires providers to offer Lifeline to households up to 150% FPG
  • State Funding: Texas uses its Universal Service Fund (Chapter 56) to fund the expanded eligibility
  • Dual Jurisdiction: States regulate intrastate telecommunications, allowing them to create state-funded programs with broader eligibility

All Tests Passing

  • ✅ Federal Lifeline tests (28 passed)
  • ✅ Texas Lifeline tests (11 passed)
  • ✅ CI checks passing (lint, tests, version)

- Capitalize FPG in parameter label
- Remove utm_source tracking parameter from Cornell Law URLs
The tolerance approach doesn't work because the issue isn't about test precision -
it's that float32(1.35) > float64(1.35) due to binary representation differences,
causing people at exactly 135% FPG to be incorrectly rejected.

This is a fundamental issue that needs to be fixed in the code, not the tests.
This file belongs in a separate repository, not in this PR.
@PavelMakarchuk
Copy link
Collaborator Author

Pushed some minor formatting changes. @MaxGhenis read for review

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.

Texas state specific lifeline eligibility and payout
2 participants