Skip to content

TX: Add PolicyEngine calculator for Early Head Start#1435

Open
catonph wants to merge 4 commits intomainfrom
catonph/mfb-823-tx-early-head-start-v2
Open

TX: Add PolicyEngine calculator for Early Head Start#1435
catonph wants to merge 4 commits intomainfrom
catonph/mfb-823-tx-early-head-start-v2

Conversation

@catonph
Copy link
Contributor

@catonph catonph commented Mar 26, 2026

Context & Motivation

Implements the TxEarlyHeadStart PolicyEngine calculator for the TX Early Head Start program, which was discovered and researched in #1414.

Changes Made

  • Added TxEarlyHeadStart class to programs/programs/tx/pe/member.py — delegates all eligibility logic to PolicyEngine (early_head_start variable), using TxStateCodeDependency and IRS gross income inputs
  • Registered "tx_early_head_start": member.TxEarlyHeadStart in tx_member_calculators in programs/programs/tx/pe/__init__.py

Testing

  • Migrations to run: None
  • Configuration updates needed: Run import_program_config_data with tx_early_head_start_initial_config.json (merged in TX: Early Head Start Discovery #1414)
  • Environment variables/settings to add: None
  • Manual testing steps: Run validation scenarios from validations/management/commands/import_validations/data/tx_early_head_start.json (merged in TX: Early Head Start Discovery #1414)

Deployment

  • Post-deployment scripts needed: None
  • Production config updates: run import_program_config for TX early head start
  • Admin updates needed: None
  • Notify team/users of: TX Early Head Start is now live for the tx white label

Notes for Reviewers

  • Implementation mirrors MaEarlyHeadStart exactly, substituting TxStateCodeDependency for MaStateCodeDependency
  • PolicyEngine handles all eligibility logic: age (birth–36 months), income (≤135% FPL), pregnancy, and categorical eligibility (TANF/SNAP/SSI/foster care) — no custom member_value override needed
  • Known limitations: Geographic service area, homelessness pathway, 10% discretionary enrollment, tribal programs, and small-community criteria are data gaps documented in the spec (PR TX: Early Head Start Discovery #1414)

Summary by CodeRabbit

  • New Features

    • Added support for Texas Early Head Start program and member eligibility checks.
  • Chores

    • Updated program links for learning more and applying.
    • Adjusted estimated application time to "Varies" and cleared estimated value and apply button description.
    • Improved program classification naming and removed a top-level warning message.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'base_branches'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: MyFriendBen/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fbf05cfd-4466-46b3-a2af-7c24be6820db

📥 Commits

Reviewing files that changed from the base of the PR and between 9b97446 and 9f2c438.

📒 Files selected for processing (4)
  • programs/management/commands/import_program_config_data/data/tx_early_head_start_initial_config.json
  • programs/programs/policyengine/calculators/dependencies/base.py
  • programs/programs/policyengine/calculators/dependencies/spm.py
  • programs/programs/tx/pe/member.py
✅ Files skipped from review due to trivial changes (1)
  • programs/programs/policyengine/calculators/dependencies/base.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • programs/management/commands/import_program_config_data/data/tx_early_head_start_initial_config.json

📝 Walkthrough

Walkthrough

Adds Texas Early Head Start support: updates program config JSON, registers a new PolicyEngine members calculator, implements the calculator class, adds two SPM dependencies, and adds a return type annotation to a base dependency method.

Changes

Cohort / File(s) Summary
Program configuration
programs/management/commands/import_program_config_data/data/tx_early_head_start_initial_config.json
Updated program_category.external_name ("tx_childcare""tx_child_care"). Changed program links and metadata (learn_more_link, apply_button_link, cleared apply_button_description, estimated_application_time"Varies", cleared estimated_value). Removed top-level warning_message.
TX PolicyEngine registration
programs/programs/tx/pe/__init__.py
Added mapping entry "tx_early_head_start": member.TxEarlyHeadStart to tx_member_calculators so the new calculator is exported into tx_pe_calculators.
TX PolicyEngine implementation
programs/programs/tx/pe/member.py
Added TxEarlyHeadStart class (subclass of PolicyEngineMembersCalculator) with pe_name = "early_head_start", inputs including age, TX state code, IRS gross income, and reported benefit flags, and output mapping to dependency.member.EarlyHeadStart.
PolicyEngine dependency annotation
programs/programs/policyengine/calculators/dependencies/base.py
Added explicit return type -> object to PolicyEngineScreenInput.value() method signature (implementation unchanged).
SPM reported-benefit dependencies
programs/programs/policyengine/calculators/dependencies/spm.py
Added SnapReportedDependency and TanfReportedDependency (both SpmUnit subclasses) exposing snap_reported and tanf_reported fields; value() returns 1 if the corresponding benefit is present on the screen, else None.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a PolicyEngine calculator for TX Early Head Start, which aligns with all file modifications.
Description check ✅ Passed The description covers all required template sections with specific details about changes, testing requirements, deployment steps, and implementation notes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch catonph/mfb-823-tx-early-head-start-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...grams/policyengine/calculators/dependencies/spm.py 75.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
programs/programs/tx/pe/member.py (1)

406-413: Consider adding a docstring for consistency.

All other calculator classes in this file include docstrings describing the program and eligibility requirements. Adding one here would maintain consistency:

📝 Suggested docstring
 class TxEarlyHeadStart(PolicyEngineMembersCalculator):
+    """
+    Texas Early Head Start calculator using PolicyEngine.
+
+    This program provides free early learning, health care, healthy meals,
+    and family support for infants, toddlers, and pregnant women in Texas.
+
+    Eligibility requirements (handled by PolicyEngine):
+    - Age eligibility (children under 3 or pregnant women)
+    - Income at or below 100% of Federal Poverty Level
+    """
+
     pe_name = "early_head_start"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@programs/programs/tx/pe/member.py` around lines 406 - 413, The
TxEarlyHeadStart calculator class (class TxEarlyHeadStart inheriting
PolicyEngineMembersCalculator, with pe_name, pe_inputs and pe_outputs) lacks a
descriptive docstring like other calculators; add a concise class-level
docstring immediately below the class declaration that describes the Early Head
Start program and its eligibility criteria/inputs (mirroring style and content
level used by other calculator classes in this file) so the class is consistent
and self-documented.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@programs/programs/tx/pe/member.py`:
- Around line 406-413: The TxEarlyHeadStart calculator class (class
TxEarlyHeadStart inheriting PolicyEngineMembersCalculator, with pe_name,
pe_inputs and pe_outputs) lacks a descriptive docstring like other calculators;
add a concise class-level docstring immediately below the class declaration that
describes the Early Head Start program and its eligibility criteria/inputs
(mirroring style and content level used by other calculator classes in this
file) so the class is consistent and self-documented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: MyFriendBen/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 11dbf49b-3573-4c6f-a64c-df9574a8d17f

📥 Commits

Reviewing files that changed from the base of the PR and between d2a92f1 and 9b97446.

📒 Files selected for processing (3)
  • programs/management/commands/import_program_config_data/data/tx_early_head_start_initial_config.json
  • programs/programs/tx/pe/__init__.py
  • programs/programs/tx/pe/member.py

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