Skip to content

Read SSI's medical treatment facility rate in Texas; retire the duplicate institutional parameters - #10283

Merged
MaxGhenis merged 7 commits into
mainfrom
ssi-institutional-single-source
Oct 26, 2026
Merged

MaxGhenis merged 7 commits into
mainfrom
ssi-institutional-single-source

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two parameters held the same federal reduced SSI benefit for residents of Medicaid medical treatment facilities, 42 USC 1382(e)(1)(B):

Parameter Values Read by
gov.ssa.ssi.amount.medical_facility 1975-01-01: 25, 1988-07-01: 30 federal ssi_amount_if_eligible
gov.ssa.ssi.amount.institutional.individual 1988-07-01: 30 tx_ssi_state_supplement, tx_ssi_state_supplement_eligible
gov.ssa.ssi.amount.institutional.couple 1988-07-01: 60 nothing

So for 1988-06, federal ssi paid $25 while Texas's eligibility test raised ParameterNotFoundError. DTrim99 raised this on #10148 (suggestion 4).

This PR:

  • Points both Texas readers at medical_facility, the parameter federal SSI reads.
  • Removes the whole institutional node. institutional.couple ($60) had no reader. ssi_amount_if_eligible returns p.medical_facility for each person whose living arrangement is MEDICAL_TREATMENT_FACILITY, so a couple both in a facility already gets $30 each.
  • Fixes medical_facility's statutory citation. It cited 42 USC 1382(e)(1)(A), which is the public-institution bar. The $30 rate is in (e)(1)(B)(i). The file also gets a comment dating the July 1988 increase: Pub. L. 100-203 §9119(a) substituted "$360 per year" for "$300 per year", and §9119(c) makes that effective July 1, 1988. 20 CFR 416.414(b)(1) agrees: "For months after June 1988 ... $30 per month". The #e_1_B anchor exists on the LII page. The comment in ssi_amount_if_eligible.py that cited (e)(1)(A) for the same rate now cites (e)(1)(B).

Every reader

Searched with git grep for amount.institutional, amount/institutional, quoted "institutional" and 'institutional', across all tracked files: variables, parameters, tests, partner tests (tests/policy/baseline/partners/**), programs.yaml, reforms and docs. The only readers were the two Texas variables. GitHub code search, which covers default branches, finds no other reader in the PolicyEngine and TheAxiomFoundation orgs. Two axiom-corpus files list the old YAML paths as provenance: manifests/ssi-agent-queue.yaml (discovered_via) and sources/policyengine-us/ssi-references.json. They record where a source URL was found and do not read the parameter. After this PR, git grep for those patterns returns nothing.

No other state reads either parameter. KS, LA, DC, MI, GA and IN tests mention the "$30 institutional" rate, but they get it through federal ssi, which already read medical_facility.

Values and behaviour

  • Parameters: for every month from 1988-07 through 2100-12 (1,350 months), institutional.individual == medical_facility and institutional.couple == 2 × medical_facility. I checked this on the tree before the change.

  • Outputs, differential: I computed ssi, tx_ssi_state_supplement_eligible and tx_ssi_state_supplement before and after the change. The grid was 22 Texas residents:

    • eight monthly pensions ($0, $20, $40, $49, $50, $51, $60, $100), each in and out of a facility;
    • three couples both in a facility.

    It covered 127 months: January, July and September of every year 1988-2027, plus each PNA change month and the month before it. From 1988-07 to 2027-09, all 8,316 values (126 months × 22 people × 3 variables) are identical. These include 810 nonzero supplements and 1,134 eligible person-months.

  • The only change is 1988-06 and earlier:

    • tx_ssi_state_supplement_eligible now applies the $25 rate in force then, where it used to raise ParameterNotFoundError. Examples: a $40 pension (countable $20) is eligible; a $49 pension (countable $29) is not.
    • tx_ssi_state_supplement still raises for an eligible resident, now on the Texas PNA, which starts July 1988 (Date the Texas SSI supplement's PNA history from primary sources #10148).
    • Texas paid no supplement before September 1999, and whole-household simulations before 2015 already fail on other parameters.

Tests

Existing cases already pin the results the brief asked to show:

  • the $45 2024 supplement: tx_ssi_state_supplement.yaml Case 27 (2024-01) and Cases 1, 14, 15 and 28;
  • the $30 2011 supplement: Cases 12 and 16;
  • the 2024 boundary of the $30 standard: tx_ssi_state_supplement_eligible.yaml Cases 6-7 and integration.yaml Scenarios 11-12.

The new cases cover the eligibility test, the part of the code this PR repoints, in years where it had no boundary case:

  • tx_ssi_state_supplement.yaml Cases 29-30 (2011), with SSI computed from real inputs:
    • A $50/month pension gives countable income of $30, ssi $0, eligible, supplement $360 a year.
    • A $51/month pension gives countable income of $31, ssi $0, not eligible, supplement $0.
    • So federal SSI and the eligibility test agree on the $30 standard at its edge.
  • tx_ssi_state_supplement_eligible.yaml Cases 12-13 (1987), the one behaviour this PR changes: before July 1988 the reduced rate was $25 a month, so countable income of $300 a year ($25 a month) is eligible and $312 ($26 a month) is not. On the previous head both cases raise ParameterNotFoundError on institutional.individual, which starts 1988-07-01.

These are annual cases. A monthly YAML case drops yearly inputs such as ssi_countable_income and pension_income. I checked this: with period 1988-07 and input ssi_countable_income: 30, the case reads 0.

Runs (local, macOS, Python 3.14):

  • policyengine-core test on the Texas supplement folder: 58 passed (54 before plus 4 new).
  • Federal SSI YAML (gov/ssa/ssi, 33 files, test_batched.py --mode per-subdir --workers 1): all three batches pass.
  • State SSP folders that use the federal facility rate through ssi: KS 20, LA 33, DC 14, MI 69, GA 32 and IN 78 cases. All pass.
  • Python: tests/core/test_ssi_state_supplement_couple_invariants.py, test_programs_registry.py, test_parameter_files.py, code_health/test_parameter_yaml_keys.py, code_health/test_reference_urls.py, code_health/test_known_dead_reference_urls.py, test_system_import.py and policy/baseline/parameters/test_uprating_extensions.py: 822 passed, 10 skipped.
  • ruff format and ruff check: clean.
  • No partner test is touched.

Mutations (Texas folder, in a scratch copy):

  • The eligibility test reading the full individual rate fails new Cases 30 and 13, plus existing eligibility Case 7 and integration Scenario 12.
  • Moving medical_facility's $30 to 1990-01-01 fails existing eligibility Case 17. (At the first head this also failed the then-1989 Case 12; review r1 moved Cases 12-13 to 1987.)
  • Deleting medical_facility's 1975-01-01: 25 entry fails eligibility Cases 12-13 (ParameterNotFoundError).
  • Setting that entry to $30 fails Case 13.

Invariants

  1. One source. At every instant, Texas's supplement, its eligibility test and federal SSI read the same reduced rate. This now holds by construction: all three read gov.ssa.ssi.amount.medical_facility.
  2. No change from July 1988. Texas outputs equal the previous head's for every probed month from 1988-07. The differential above checks this.
  3. Bounds unchanged. 0 ≤ supplement ≤ PNA − $30. That is the formula's max_, and this PR does not change it.

No Python property test. Invariant 1 is structural, and a test of 2 would restate the formula, which the repo's test-design rules (and DTrim99 on #10148) rule out. The differential script was run outside the tree, and its method is above.

Merge order

This PR was stacked on #10148 (tx-ssi-supplement-history), which edits the same Texas files and tests. #10148 merged on 2026-10-26 (90990a92a8), and this PR now targets main, with main merged in at ae5c73247f. The one conflict was this PR's appended Cases 29-30 in tx_ssi_state_supplement.yaml. Main's copy of that file is identical to #10148's head, so the resolution keeps this branch's side. The diff against main is these 9 files. On the merged tree, git grep finds no reader of amount.institutional, and the Texas folder passes (58).

Reviews

  • r1 (GPT-6.1 Sol, at 2a8117fb74): approve, with one minor finding and one nit. The 1989 eligibility cases repeated Cases 6-7 and left the pre-1988 change untested, and ssi_amount_if_eligible.py still cited (e)(1)(A). Both are fixed in 72792f7ff2.

Axiom

axiom: TheAxiomFoundation/rulespec-us#1816 queued

  • From July 1988, rulespec-us is already right. us:statutes/42/1382/e/1#medical_facility_individual_annual_rate_cap ($360 a year) is encoded-correct for 1988-07 onward, the months whose results this PR leaves unchanged.
  • Before July 1988, it is wrong. That module encodes $360 and $720 a year from 1974, but Pub. L. 100-203 §9119 shows $300 and $600 a year until June 1988. Those are the only months this PR changes, because Texas's eligibility test now uses the $25 rate.
  • Why queued. The pre-1988 text is not in the pinned corpus row, so the issue carries the verbatim law, the review_finding and the companion tests.

🤖 Generated with Claude Code

MaxGhenis and others added 5 commits October 12, 2026 09:25
The personal needs allowance parameter started on 1999-09-01, so any Texas
simulation for 1999 or earlier raised ParameterNotFoundError. H-1500 and the
2002 DHS handbook say the PNA was $30 before September 1999; date that value
from July 1, 1988, when 42 USC 1396a(q)(2) set the $30 federal minimum, so the
supplement is $0 until September 1999.

The existing values match HHSC's own records for every period, including
2007-2011, where SSA's State Assistance Programs tables list a $60 state
supplement but HHSC's handbook (H-6000, revisions 09-4 and 11-2) says $30.
Add the dated sources, a test case for each period, and property tests that
the supplement does not vary with a recipient's own income.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Python invariants now cover only residents paid SSI (positive federal
  payment); the zero-payment boundary at $30 countable income is left to the
  eligibility tests, since the sources do not settle it.
- The variable comment and Case 14 no longer say other income goes to the
  co-payment "instead"; they state H-6000's fixed amount and that no Texas
  source subtracts the recipient's income.
- The dated-history checks move from Python to YAML monthly cases at each
  change (Cases 17-27); the Python file keeps only the generated-resident
  properties YAML cannot express, and says why.
- The parameter comment and changelog call July 1988 the modeled backfill
  start and state the repaired range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The changelog now says tx_ssi_state_supplement returns $0 instead of
  raising for July 1988 through August 1999; household totals before 2015
  still fail on other parameters (FIRST_MODELED_YEAR).
- Remove test_tx_ssi_state_supplement_invariants.py: its properties hold by
  construction (the formula reads no income variable) and YAML Cases 14-16
  pin them with SSI computed from real inputs. Add Case 28, a resident with
  both a pension and earnings, which the seeded grid covered.
- Cite the Pub. L. 100-203 section 9119(d)(2) note for the July 1, 1988 date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cate

gov.ssa.ssi.amount.institutional.individual held the same $30 reduced
federal benefit (42 USC 1382(e)(1)(B)) as gov.ssa.ssi.amount.medical_facility,
the parameter federal SSI reads, but only from July 1988. Texas's supplement
and its eligibility test read the duplicate, so for 1988-06 federal SSI paid
$25 while the Texas eligibility test raised ParameterNotFoundError. Point
both Texas readers at medical_facility and remove the institutional node
(its couple value, $60, had no reader; SSI pays the per-person rate to each
spouse). medical_facility's citation moves from (e)(1)(A), the public
institution bar, to (e)(1)(B), and notes the July 1988 increase.

Values match for every month from 1988-07 through 2100-12, and the Texas
outputs are unchanged across 126 probed months from 1988-07 to 2027-09.
Adds 2011 and 1989 cases at the $30 standard's boundary.

Raised by DTrim99 on #10148 (suggestion 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1 found that eligibility Cases 12-13 (1989) repeated Cases 6-7: both
the old and new parameter are $30 then, so they pass before and after this
PR. The one behaviour change is before July 1988, where the eligibility test
now applies the $25 rate instead of raising ParameterNotFoundError. Move
Cases 12-13 to 1987 ($300/year eligible, $312/year not). They fail on the
parent commit (ParameterNotFoundError on the retired parameter), when the
1975-01-01 entry is dropped, and (Case 13) when that entry is set to $30.

Also fix ssi_amount_if_eligible's comment: the medical treatment facility
rate is 42 USC 1382(e)(1)(B); (e)(1)(A) is the public-institution bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from tx-ssi-supplement-history to main October 26, 2026 21:57
…ingle-source

# Conflicts:
#	policyengine_us/tests/policy/baseline/gov/states/tx/hhsc/ssi_state_supplement/tx_ssi_state_supplement.yaml
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 26, 2026 22:00
@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (ae5c732).
⚠️ Report is 674 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #10283   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         2    -2     
  Lines           76        33   -43     
  Branches         2         0    -2     
=========================================
- Hits            76        33   -43     
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 Harness.
📢 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 2562bb7 into main Oct 26, 2026
42 checks passed
@MaxGhenis
MaxGhenis deleted the ssi-institutional-single-source branch October 26, 2026 23:03
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged at ae5c73247f (squash 2562bb7fb4) using the approval-only admin bypass: the sole block was the required approving review, which can't be self-given on this PR.

Gates at merge:

axiom: TheAxiomFoundation/rulespec-us#1816 queued.

🤖 Generated with Claude Code

MaxGhenis added a commit that referenced this pull request Oct 29, 2026
One textual conflict, in ssi_amount_if_eligible.py: main corrected the
medical treatment facility citation from 42 USC 1382(e)(1)(A) to (e)(1)(B)
(#10283), while this branch moved the living-arrangement adjustment into
_ssi_living_arrangement_amount.py. Keep the branch's helper call and carry
main's citation into the helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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