Repository navigation
Conversation
State benefit programs that list Social Security as income often leave out Railroad Retirement Act benefits, whose tier 1 share replaces Social Security for railroad workers. This adds `railroad_benefits` to 50 income lists and to Missouri's Supplemental Nursing Care income variable, where the program's rule names railroad retirement, counts pensions, annuities or retirement benefits, or counts all income it doesn't exclude. Each program's own rule was read against the sources the parameter cites. Tests: a property test checks that railroad benefits raise each program's income by the amount received, and a YAML case pins each program whose rule names railroad retirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Passing runs cost about a tenth of a second per example, so the extra examples add little to CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 9, 2026 11:46
An independent review found that the first sweep skipped any file that mentioned railroad retirement, even in a comment, and hid child care lists whose rules name those benefits. Sweep parsed values instead, add the programs whose rules reach the benefits (HI, MA, MT, PA, UT and WY child care and seven California county programs), and record the disability and Medicare limits in the lists' comments. Add R3, which fails on any state or county reader of Social Security that neither counts railroad benefits nor explains why, and R4, which rejects a repeated entry. Run R1 from the first dollar, over the programs that already counted the benefits too, and extend R2 to every list with a pension line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Louisiana CCAP (LAC 28:CLXV.509.A.3.b), North Dakota CCAP (NDAC 75-02-01.3-08 disregards no recurring railroad benefit), Oregon ERDC (OAR 414-175-0035(52)), South Dakota CCA (subsidy manual, section 4) and Washington ECEAP (DCYF 05-006, section 9) now count railroad_benefits, each with a YAML case and an R1 row that fails without the entry. The R3 check now reads each list, and each function or class body, on its own, and counts the railroad total or any of its parts. R4 also fails when a list holds railroad_benefits with one of its parts. R5 finds state and local programs that read the federal TANF or SNAP lists, which leave out railroad benefits (#10551). Los Angeles County General Relief cites GR policy 44-101. Massachusetts CCFA's list explains why railroad payments count as "Retirement income". Utah's case drops a citation that governs the assistance unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record Washington's new disability retirement test (#10330) as a yes-or-no signal, so R3 passes after the merge of main. - R3 also scans each variable file's top level, so a module-level list of Social Security names no longer passes unseen. - R4 checks variable adds lists as well as parameter lists, and fails on any railroad amount listed twice or with a part it holds. - R5 follows federal lists through the variables that add or read them and up to two more formulas, which finds the school meals ratio and the Medicaid and ACA MAGI measures that state programs read. Its entries end when their source counts railroad benefits or no state code reads them. - State SC LIHEAP's reason as the guide's wording, and fix the docstring's R1 range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The R1 and R5 docstrings and the FEDERAL_GAPS comments now match the PR body: agencies and taxpayers act under each cited rule, R5's docstring says why it stops at two formula steps, and the group descriptions list federal benefits beside pensions, annuities and retirement benefits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides added a ninth Hawaii CCAP case. This keeps main's eight Hawaii TANF cases as 9 to 16 and renumbers the railroad case to 17. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Hawaii CCAP counts Hawaii TANF since #10332, so its R1 and R2 rows set wages above the aid limits, as the other eight rows with cash aid do. R5 starts from one more kind of federal source: a variable whose own code names a Social Security amount and no railroad amount, the check R3 runs on state code. That finds is_medicare_eligible, which tests Social Security disability for 24 months and leaves out the disabled railroad annuitants 42 U.S.C. 426(b)(2)(B) covers. FEDERAL_GAPS lists it and the seven premiums and tests state code reads within two steps of it. R5 reads a parameter path through names assigned in the same module or function, and a list named in a string. R4 maps each railroad amount to the dollars it holds and fails when two entries of a list share any, so the tier 1 amount beside the taxable total fails too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 14, 2026
…s federal benefit test; follow federal lists in R5 40 TAC 809.44(c) counts income that subsection (b) doesn't exclude, and (b)(17) excludes only regular payments from Social Security. COMAR 07.03.07.03(A)(2) asks for a federal benefit for age, blindness or disability. WHEAP Manual 3.2.2.4 names Social Security alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…federal gaps R4 now maps every railroad variable to the five kinds of railroad dollars it holds, including the dependent's taxable tier 1 inside the tax-exempt amount and #10722's filer amount, so no income list can count the same dollars twice. After merging main, R5 follows federal parameter lists one step, and FEDERAL_GAPS gains the gross income, AGI, ACA and CHIP sources that state programs now reach. Missouri's and Pennsylvania's LIHEAP lists move to ALREADY_COUNTED, Louisiana's LIHEAP key follows its rename, and the changelog names Maryland PAA's federal benefit test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R5 resolved names until no alias grew, so a name assigned from its own attribute, such as `p = p.income`, grew a longer path on every pass and never ended. R5 now takes at most one pass per assignment, which resolves any chain of plain assignments. The docstring now says which assignments R5 follows and that a name bound to two paths reads as both. Case 20 of md_paa_eligible.yaml now sets meets_ssi_disability_criteria to false, the input the aged, blind or disabled gate reads, and Case 21 pins an eligible railroad disability annuitant who meets that test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pass cap still let a name assigned twice from its own attribute, such as `p = ...gov; p = p.usda; p = p.snap`, double its paths on every pass, so 19 assignments in one function would stall the test. R5 now reads each scope's assignments once, in source order, which ends on any input and gives the same paths as before on all 7,534 variable files. The docstring adds the one form this misses: a path built in a loop from a name the loop assigns further down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R5 doesn't follow a name bound to a call or a conditional expression, and reads a path that continues past a call only up to the call; the docstring now says so. The comment above md_paa_eligible.yaml Case 21 now compares the railroad gate with Social Security other than SSDI, which the formula gates the same way, rather than with SSDI, which it doesn't gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
I'm handing this PR to the US hub at 4f52f39.
|
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…road income Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…d list Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PolicyEngine counts Railroad Retirement Act benefits in 72 state and county benefit income totals. Maryland Public Assistance to Adults accepts a railroad annuity paid for age, blindness or disability. The changes address part of #10551.
I audited 113 items across state and county programs. I changed 72 income totals and Maryland’s federal benefit test. I found 17 income totals that already count railroad benefits and 23 benefit-program exceptions. R3 also covers two Washington property-tax exceptions, for 25 exceptions in all.
Changes
PolicyEngine adds a railroad amount to 71 state and county income lists and to Missouri’s Supplemental Nursing Care income formula. Use
railroad_benefitsfor the gross amount and report any program-specific component in its corresponding input.Rules that name railroad retirement
Rules that list pensions, annuities, retirement benefits or federal benefits
Rules that define income as everything outside their exclusions
Texas excludes regular Social Security payments under 40 TAC 809.44(b)(17). It counts railroad retirement benefits under subsection (c), which includes income outside the exclusions. Texas Workforce Commission adopted rule
Maryland PAA’s federal benefit test
Maryland requires a federal benefit for age, blindness or disability under COMAR 07.03.07.03(A)(2). PolicyEngine checks both the applicant’s qualifying status and the basis of the railroad annuity. Supply the gross annuity in
railroad_benefitsand setmd_paa_receives_qualifying_railroad_annuityfor qualifying months. A survivor annuity paid solely because the recipient cares for the employee’s child does not qualify.The YAML cases cover qualifying annuitants who meet the age, disability or blindness tests. They also cover an annuitant who meets none of the three tests and a blind applicant whose sole payment comes from a child-in-care survivor annuity. Maryland PAA eligibility Railroad annuity eligibility
Programs that inherit the change
ma_tcap_gross_unearned_incomein its EAEDC net income calculation.il_isbe_countable_incomefor Prevention Initiative and Preschool for All Expansion.il_aabd_countable_unearned_incomewhen calculating Health Benefits for Immigrant Seniors.Federal sources that state programs read
R5 identifies 31 federal totals, lists and tests that state and county programs outside the tax code read within its two-step scan. State programs inherit gaps in the federal inputs they use. For example, PolicyEngine counts railroad benefits in New Jersey LIHEAP and still reads the federal Part B premium for its Social Security deduction.
tanf_gross_unearned_income.medicaid_income_levelthroughmedicaid_income_eligible. Under IRC 36B(d)(2)(B)(iii), taxpayers add the untaxed Social Security-equivalent share of tier 1 to AGI for ACA MAGI.is_usda_disabled. Under 7 U.S.C. 2012(j)(7), SNAP agencies recognize a railroad disability annuitant whom the Railroad Retirement Board finds eligible for Medicare or who meets SSI’s disability criteria.is_medicare_eligible.medicare_part_b_premium. Energy aid in eight states readsmedicare_part_a_premium, and Illinois SMIB readsbase_part_b_premium.medicare_enrolled, which also appears in the disqualifying coverage list Rhode Island CHIP uses. California CCHIP reads the CHIP coverage test and the Medicaid eligibility test. Colorado CHP+ reads Medicaid eligibility, and Mississippi’s waiver readsis_adult_for_medicaid.Mississippi’s waiver also uses an annual Medicaid income wrapper, which sums monthly budgets that count railroad benefits through SSI. The shared monthly formula reads gross Part B premiums, which depend on Medicare eligibility. R5’s two-step scan stops before the annual wrapper. PolicyEngine sets the premium deduction to false for Mississippi.
California CVRP’s increased rebate and Texas CSFP use separate income totals following #10873. They no longer read
school_meal_fpg_ratio. Issue #10551 still covers the federal school-meals, TANF and SNAP lists. #10696 covers railroad benefits in gross income, AGI and the MAGI additions. #10804 covers Medicare eligibility, and #9330 covers SNAP disability.Merge order with #10696 and #10722
#10696 and #10722 remain open. #10696 builds
railroad_benefitsfrom the Social Security-equivalent amount and the taxable and tax-exempt shares of the rest. Households can still supply the total directly. Whichever of this PR and #10696 merges second removes theFEDERAL_GAPSentries that the combined code resolves.#10722 adds the tax-exempt railroad amounts to Washington's senior and disabled property tax exemption income list. Its branch lacks this PR's invariant tests. Whichever of this PR and #10722 merges second drops the income list's
NO_RAILROAD_INCOMEentry and keeps the disability retirement receipt exception.RAILROAD_DOLLARSalready maps #10722's filer-only Social Security-equivalent amount.Reporting railroad benefit components
Report the gross annuity in
railroad_benefits. Enter the amounts below separately when the gross input includes them. The program applies the deduction or exclusion to the reported component.railroad_benefits_overpayment_withheldrailroad_disability_benefitsrailroad_benefits_medicare_premium_withheldrailroad_benefits_retroactive_lump_sumFor Wyoming POWER, report the cash from a retroactive payment in assets if the household still holds it.
Minnesota counts retirement benefits for CCAP and MFIP under Minn. Stat. 256P.06, subd. 3(2)(ix). PolicyEngine uses the reported railroad total. Georgia’s DECAL counts railroad disability and survivor annuities because the CAPS 8.4.2 exclusion concerns benefits from the Social Security Administration.
New Jersey LIHEAP’s handbook names Social Security in its Medicare Part B deduction and exclusion for children. PolicyEngine counts gross railroad benefits at every age. Two YAML cases cover the premium and age treatment.
PolicyEngine omits
pension_incomefrom the Illinois TANF source list. Issue #10784 tracks that omission.How I read the rules
Other audited lists and checks
Programs I couldn't resolve
I couldn't settle these 5 from the sources, or the sources wouldn't load, so I left them unchanged.
Invariants
policyengine_us/tests/test_state_benefit_railroad_income.pychecks these properties.taxable_social_security, in state and county parameter lists and Python scopes outside the tax code. R3 accepts a mapped railroad name, an exception with a nonempty reason or the formula that R1 exercises at its sample period. It checks other formulas in those files and flags stale exceptions. Dynamic names and scalar parameters fall outside the scan.addslists for overlapping railroad dollars. The test maps taxable Social Security-equivalent benefits for filers and dependents, tax-exempt Social Security-equivalent benefits, and the taxable and tax-exempt parts of the remaining annuity. It includes program-specific components and Count railroad benefits in state tax worksheets, income tests and limits as each state's law does #10722’s filer-only amount.R1 and R2 draw five examples per income total with Hypothesis. YAML cases cover the new eligibility outcomes and the program-specific railroad exclusions.
axiom: TheAxiomFoundation/rulespec-us#2142 queued
🤖 Generated with Claude Code