Skip to content

Preserve supplied county keys and correct Vermont renter credit calculations - #10116

Open
MaxGhenis wants to merge 18 commits into
mainfrom
fix-county-lookup-guards
Open

MaxGhenis wants to merge 18 commits into
mainfrom
fix-county-lookup-guards

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

defined_for masks a formula's output, but policyengine-core runs the formula over the whole population and skips it only when the mask is all false. A county key missing from a county-keyed parameter table therefore raises ParameterNotFoundError whenever the simulation also holds a household the table doesn't cover. This follows #10113 (the WA property tax exemption) and comes from the same 51-state probe.

On main at 35a94c3, a vectorized county lookup could reach a key absent from the parameter table. Main now includes the initial Vermont guard through #10725. This PR keeps that work, addresses malformed keys and conflicting county inputs, and corrects the Vermont renter credit above the printed table sizes, for subsidized claims and for the Act 169 years.

Changes

  • County guard. The five lookups (vt_renter_credit, mn_ccap_provider_rate, wi_shares_hourly_max_rate, wi_shares_monthly_max_rate and md_ccs_payment_rate) choose their key through county_key_for_lookup (county_helpers.py). It validates text and UTF-8 county keys against the state's county enum. When the county_str key is invalid, each lookup keeps an independently supplied in-state county: a county input, or the county derived from a known county_fips. A valid string still takes precedence.
  • The fallbacks are placeholders, not estimates. Addison (VT), Hennepin (MN), Adams (WI) and Allegany (MD) remain placeholders when no usable in-state geography is available. The sources prescribe the actual county's rate and give no fallback, so these return an arbitrary in-state value instead of crashing. An omitted Minnesota county can resolve to Aitkin by itself or to UNKNOWN when another household supplies a county enum: an MN infant in 45 hours a week of family care gets $888.33 or $1,083.33 a month. No household in the default dataset has an unknown or mismatched county. The Maryland examples below use the model's informal rates, which still need checking against COMAR (see Follow-up).
  • Vermont income limits above eight people. gov.states.vt.tax.income.credits.renter.max_household_size = 8 marks the last printed income row. Larger tax units use HUD's family-size extension with the HUD calculator's rounding (below).
  • Vermont rents above four bedrooms. Vermont's rent rows apply through four bedrooms. Five or more exemptions use HUD's bedroom extension (below). A surviving-spouse filer's count includes the deceased spouse's exemption.
  • Subsidized claims. An eligible subsidized claimant gets the credit rate times gross rent paid at every income up to the partial-credit limit, with no phase-out, under § 6066(b)(1)(D).
  • Act 169 years. Act 169's 12.5% rate and $3,250 maximum apply to claim year 2027, which § 6061(9) makes taxable year 2026. Taxable year 2027 returns to 10% and $2,500 (2026 Act 169, Sec. 16).

Vermont households above eight people and four bedrooms

32 V.S.A. § 6061(19)–(20) and § 6066(b)(2) incorporate HUD's income limits and fair market rents, with bedrooms equal to the number of personal exemptions. § 5811(21)(C) counts the deceased spouse's exemption for a surviving spouse. Vermont's tables cover up to eight people and four bedrooms. Each taxable year uses the HUD values in effect on June 30 of that year (§ 6061(7)(C), (19) and (20)).

Larger tax units use HUD's family-size extension, which adds 8% of the four-person limit for each person above eight. The branch rounds each extended limit up to the next $50, as HUD's income-limit calculator does. The extremely low-income limit is the larger of the rounded limit at 60% of the very low-income limit and the HHS poverty guideline, capped at the rounded very low-income limit before Vermont's multiplier. HUD's FY2024 methodology also allows unrounded limits, so following the calculator's rounding is an inferred choice. The 1.3 multiplier on the very low-income limit applies from taxable year 2024 (2024 Act 144, Sec. 5). The extended income limits and HHS guidelines run through 2026, and later years carry them forward.

Exemption counts above four use HUD's bedroom extension, which adds 15% of the four-bedroom rent for each bedroom above four. The four-bedroom rents behind this extension run through FY2027, so above four bedrooms taxable year 2027 uses HUD's FY2027 rents, effective October 1, 2026. For Franklin and Grand Isle, which the statute assigns statewide averages, the larger units use the mean of Vermont's twelve HUD areas, each counted once. The sources do not state the weights; this weighting is inferred from the department's published 2025 one- to four-bedroom credits and four-person limits, which it reproduces after rounding. Amounts above the printed sizes, such as Franklin's 2025 nine-person limit of about $98,664.58, are model results.

The Department of Taxes' calculators cap the income-limit household size at eight and use rents up to four bedrooms. The source-conflict candidate records those caps with the HUD, HHS and effective-date sources; the calculator workbooks' results are unverified. The larger credit can differ from the department calculator. max_household_size.yaml cites Calculator!G10–G12 in the TY2021 and TY2022 calculators, as DTrim99 requested.

Tests

New vectorized YAML cases put an in-state household, an in-state UNKNOWN-county household and, for the crash guards, an out-of-state household in one simulation, so the mask is not all false:

  • vt_renter_credit.yaml test 11: Chittenden, New Hampshire, and VT UNKNOWN (falls back to Addison).
  • vt_renter_credit.yaml ("Vermont uses HUD extensions for tax units of nine or more") and vt_renter_credit_lookups.yaml: Chittenden tax units of 8, 9 and 12 at $82,780 of income expect $2,465, $2,500 and $2,500. Size eight uses HUD's eight-bedroom rent. The nine- and twelve-person partial-credit limits are $118,170 and $138,385, so their phase-outs exceed the $2,500 maximum.
  • mn_ccap_provider_rate.yaml Case 13, wi_shares_hourly_max_rate.yaml Case 9, wi_shares_monthly_max_rate.yaml Case 6, and the new md_ccs_payment_rate.yaml informal-provider case.

The five UTF-8 regressions, !!binary cases with DOÑA_ANA_COUNTY_NM, still pass. New cases cover:

  • a nonexistent same-state county key in each of the five formulas, which used to raise ParameterNotFoundError; the placeholder values are $1,692 (VT), $1,083.33 a month (MN), $8.75 an hour (WI hourly), $1,146.25 a month (WI monthly) and $27.67 a week (MD);
  • a valid county enum kept when county_str is invalid: Chittenden gets $2,323 with $12,000 of rent paid, instead of Addison's $1,692; Becker (MN) gets $888.33 a month, Milwaukee (WI) $9.72 an hour and $1,273.32 a month, and Montgomery (MD) $59 a week at the model's informal base;
  • a 2024 nine-person Chittenden household at $105,000 of income: $340 unsubsidized, instead of $0 under the eight-person ceiling, and $1,200 (10% of $12,000 of rent paid) with housing assistance;
  • 2025 nine-person Chittenden households at $100,000 of income: $1,530 with eight exemptions and $1,674 with nine, below the $2,500 maximum so the bedroom rate shows;
  • a 2025 Chittenden surviving spouse with seven children at $100,000 of income: nine exemptions, counting the deceased spouse, give $1,074;
  • a 2027 Chittenden household with nine exemptions at a fixed 10% rate: $1,191 with FY2027's $2,845 four-bedroom rent;
  • a 2023 nine-person Chittenden household at $90,000 of income: $0, since the limit before 2024 has no multiplier ($79,550);
  • a 2021 thirteen-person Caledonia household with $12,000 of rent, whose two income limits both round up to $67,350: $2,500 at $67,337, $67,338, $67,339 and $67,350, $0 at $67,351, and $1,200 at $67,338 with housing assistance; a nine-person Caledonia household at $52,566 gets $1,215, between its limits of $49,200 and $54,850;
  • a 2021 twenty-five-person Caledonia household with $12,000 of rent, whose two limits both round up to $104,950: $2,500 at $104,921, $104,922, $104,923 and $104,950, $0 at $104,951, and $1,200 at $104,922 with housing assistance;
  • a 2024 thirteen-person Chittenden household in a shared residence, with no exemptions and income equal to its full-credit limit of $79,620: $805, half of $1,609 rounded half up;
  • 2025 nine-person Franklin households: $361 at $95,000 of income and $0 at $100,000, above the limit of about $98,664.58;
  • Act 169 boundaries: a subsidized Chittenden claimant with $40,000 of rent and no income gets $3,250 in taxable year 2026 and $2,500 in 2027. A 2026 fourteen-bedroom Franklin household at $115,000 gets $2,427 at 12.5%. At a fixed 10% and $114,999, its $5,972.50 base rounds up to $5,973 and gives $1,942.

Existing cases change where these rules apply: 2022 subsidized claims ($500, or $250 shared); Act 169 tests 8, 9 and 9b ($2,115, $1,692 and $2,500); Franklin with five bedrooms in 2022 ($1,391) and six in 2025 ($2,500); Washington with seven bedrooms in 2025 ($1,720 and $3); Franklin and Lamoille with seven in 2023 ($1,387 and $1,354); and Franklin's nine-person 2022 phase-out ($1,713).

Cross-state county cases. One case per variable pairs a normal in-state household with an in-state household whose county belongs to another state. These values still pass:

  • VT with GRAFTON_COUNTY_NH uses Addison: (60,390 - 44,145) × 1,692 / (60,390 - 27,900) = 846; the Chittenden control gives 1,162.
  • MN with MILWAUKEE_COUNTY_WI uses Hennepin: 250 × 52 / 12 = 1,083.33; the Becker control uses 205 × 52 / 12 = 888.33.
  • WI hourly with HENNEPIN_COUNTY_MN uses Adams' licensed-group table rate of 8.75/hour; the Milwaukee control is 9.72/hour.
  • WI monthly with HENNEPIN_COUNTY_MN uses Adams: ceil(30 × 4.348125) = 131 hours, 8.75 × 131 = 1,146.25; the Milwaukee control is 9.72 × 131 = 1,273.32.
  • MD with FAIRFAX_COUNTY_VA uses Allegany: informal REGULAR UNIT_1 83 / 3 = 27.67; the Montgomery control is 177 / 3 = 59. Maryland's $59 and $27.67 are model-base results. Bases of $75.92 and $53.76 attributed to COMAR 13A.14.06.11D and .11F would give $25.31 and $17.92 for the same one-unit computations; the official schedule is unverified.

Validation. With the five formulas restored from main at 35a94c3 and the new tests kept, the six crash-guard cases failed with ParameterNotFoundError. A 51-state probe of five multi-household simulations (including every county of VT, MN, WI and MD plus UNKNOWN and out-of-state) raised for at least one variable at 35a94c3 and computed every variable with the county guards; the probe has not been rerun at this head. On Linux, 300 YAML cases in 23 files passed on the branch and on a merge with main at 8e81d66, including 61 cases in vt_renter_credit.yaml and 18 in vt_renter_credit_lookups.yaml. The 14-case Python grid in test_vt_renter_credit_amounts.py and the 251 source-conflict checks also passed. Reverting any one of ten fixes (HUD rounding, the subsidized phase-out, five to eight bedrooms, the deceased spouse, the Act 169 years, the FY2027 rents and the four supplied-county recoveries) made its targeted case fail. CI runs the YAML and Python files at this head.

Invariants

The YAML cases assert representative values:

  • No crash. Each variable computes for valid, UNKNOWN, cross-state, malformed and UTF-8 county keys, with out-of-state outputs masked to zero (defined_for).
  • Valid county kept. Each of the five lookups preserves an independently supplied in-state county when the string is invalid.
  • Same county key where main computed. In-state households with a valid county string use the same table key as on main; VT tax units of one to eight people use the same income-limit row.
  • Equal limits. For large units before 2024 the two Vermont income limits can coincide. An income at the limit gets the full eligible amount, one dollar above gets zero, and the phase-out never divides by zero.
  • Above the printed rows. Tax units above eight people use HUD's rounded family-size extension, and exemption counts above four use HUD's bedroom extension.

No new Python test is added, per the repo's YAML-first rule; the YAML cases cover each path. The existing Python grid in test_vt_renter_credit_amounts.py now uses HUD rents for five to eight bedrooms.

Microsimulation impact (historical, at 7089303)

A microsimulation on the default dataset compared main at 35a94c3b02 with the branch at 7089303db3 for 2025 and 2026. Sums are weighted.

Output 2025 change 2026 change 2025 records changed (weighted) 2026 records changed (weighted)
state_income_tax +0 +0 0 (0) 0 (0)
income_tax +0 +0 0 (0) 0 (0)
household_net_income +0 +0 0 (0) 0 (0)
household_benefits +0 +0 0 (0) 0 (0)

Run on the standard outputs only. At 35a94c3b02, requesting vt_renter_credit across the whole population crashes on its out-of-state households, so a base run that names it cannot complete. Branch commits 68051002b4, a23810c84e and 8fde198e14 gave the same zeros. A zero is expected at those commits: every default-dataset VT, MN, WI and MD household has a county in its own state, so no record reaches a fallback; the dataset's 654 VT tax units have at most seven people; and vt_renter_credit then fed only the TAXSIM property-credit aggregate. No microsimulation covers the Vermont bedroom, subsidized-claim, surviving-spouse or Act 169 changes; they have household-test results only.

Impact

The changes affect formerly crashing malformed keys and households in all four states with a valid supplied county and an invalid string. Vermont credits can change for five or more bedrooms, eligible subsidized claims, surviving-spouse filers, taxable years 2026 and 2027 (Act 169) and tax units above eight people. Vermont renter credit feeds TAXSIM and, since #10725, the household and SPM property-tax-refund benefit paths (state_property_tax_credits, state_property_tax_refunds, household_state_benefits and spm_unit_benefits). The microsimulation figures above apply to their named commits. Open #11095 also changes vt_renter_credit.py and vt_renter_credit.yaml.

axiom: TheAxiomFoundation/rulespec-us#1678 queued

Follow-up

The TY2025 booklet's Washington County 7-person partial-credit limit ($88,880) differed from the calculator's $88,990. #10125, now on main and in this branch, set it to $88,990, along with seven other VT income-limit corrections.

Known gaps that predate this PR and stay out of it:

  • Maryland's informal child care bases ($177 Montgomery, $83 Allegany) differ from the $75.92 and $53.76 attributed to COMAR 13A.14.06.11D and .11F. The official schedule and its effective dates are unverified, so the bases stay until someone checks them.
  • The Vermont four-bedroom rent table can hold a capped base instead of HUD's rent, such as Chittenden's 2021 entry of $2,083 a month, which rounds to the $2,500 maximum at 10%, against HUD's $2,208.

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits October 11, 2026 15:38
…D CCS

defined_for masks a formula's output, but policyengine-core runs the formula
over the whole population, so county keys missing from a county-keyed
parameter table raise ParameterNotFoundError in multi-household simulations.

- vt_renter_credit: mask non-VT and UNKNOWN counties to Addison, and cap the
  table lookup at household size 8 (new max_household_size parameter), as the
  Department of Taxes renter credit calculator does for 9+ person households.
- mn_ccap_provider_rate, wi_shares_{hourly,monthly}_max_rate,
  md_ccs_payment_rate: also mask an in-state UNKNOWN county.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each case puts an in-state household, an in-state UNKNOWN-county household
and (for the crash guards) an out-of-state household in one simulation, so
the defined_for mask is not all false and the formula runs over every
county. VT test 12 covers tax units of 8, 9 and 12. All six cases raise
ParameterNotFoundError on upstream/main and pass with the fix.

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

Copy link
Copy Markdown
Contributor Author

The CI run on this pull request was cancelled at 23:27Z on 2026-10-11 to free the organization's shared GitHub runners for an urgent fix in another repository. The US + core hub will re-run it automatically (cancelled jobs only; jobs that had passed are kept). Nothing in this pull request changed. Please don't push or reopen just to restart CI.

@DTrim99

DTrim99 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Guard county-keyed lookups in VT renter credit, MN CCAP, WI Shares and MD CCS

PR #10116 (author: MaxGhenis, head 8fde198e14, merge-base 065d0e9560). 12 files (+380/−15), 3 commits. Axiom: TheAxiomFoundation/rulespec-us#1678 queued for the Vermont size cap; the county guards are marked n/a.

Summary

The PR stops five county-keyed parameter lookups from raising ParameterNotFoundError. Each crash happened when a simulation held both a household the lookup covers and one it doesn't:

  • vt_renter_credit:
    • It masks out-of-state and UNKNOWN counties to Addison.
    • It switches from the county enum to county_str. The keys are the same.
    • It caps the table lookup at household size 8 with a new parameter, max_household_size.
  • mn_ccap_provider_rate, wi_shares_hourly_max_rate, wi_shares_monthly_max_rate, md_ccs_payment_rate: these already masked out-of-state counties. They now also mask an in-state UNKNOWN county, to Hennepin, Adams, Adams and Allegany.
  • Tests: six new YAML cases. Each puts an in-state household, an in-state UNKNOWN household and an out-of-state household in one simulation, or (VT test 12) tax units of 8, 9 and 12.

The fixes are right:

  • The guards work across a whole population. I checked how policyengine-core applies defined_for, checked the table keys (every county of each state is a key), and traced the fallbacks. No household that computed on main changes value.
  • The cap of 8 is the department's rule for every year the PR applies it. The 2021, 2022, 2024 and 2025 Renter Credit Website Calculators all look up IF(Household_Size>8,8,Household_Size).
  • Tests. Every expectation in the six new cases reproduces by hand, and the VT ones match the department's 2025 calculator.
  • Rounding on main. The VT expectations still hold under the whole-dollar rounding main gained in Match Vermont renter credit base amounts for Franklin and Grand Isle to the department's tables #10130.
  • CI is green.

One should-fix. The new parameter starts in 2021 but cites only the 2023–2025 calculators. The 2021 and 2022 calculators show the same cap and should be cited.

Branch. The branch conflicts with main in the two VT files, because of #10130 and #10125. It needs a merge from main before it can land; Branch status gives the resolution.

Three suggestions follow.

Critical (must fix)

None.

Should address

1. max_household_size starts in 2021, but no cited source covers 2021–2022.

  • Where: parameters/gov/states/vt/tax/income/credits/renter/max_household_size.yaml.
    • Line 9 sets 2021-01-01: 8.
    • The references (lines 15–20) are the 2023, 2024 and 2025 calculators only.
    • The comment (lines 2–7) names cells G11–G13, which is the 2023–2025 layout.
  • The PR body agrees. It says: "The calculators document the size-8 income-limit cap for TY2023–2025. This PR applies the same cap to 2021–2022; no contrary rule was found for those years."
  • The 2021 and 2022 calculators have the same rule. I opened both, at the URLs main already cites in fair_market_rent.yaml since Match Vermont renter credit base amounts for Franklin and Grand Isle to the department's tables #10130. On their Calculator sheets, one row above the 2023–2025 layout:
    • G10 (very low-income limit): =IFERROR(INDEX(VLIL2021[],MATCH(County,VLIL2021[County],0),MATCH(TEXT(IF(Household_Size>8,8,Household_Size),0),VLIL2021[#Headers],0)),"")
    • G11 (extremely low-income limit): the same lookup on ELIL2021.
    • G12 (credit amount): =VLOOKUP(County,TRebateAmounts[],MATCH(TEXT(IF(Household_Size>4,4,Household_Size),0),TRebateAmounts[#Headers],0),FALSE)
    • G5 (family size): validated as a whole number from 1 to 10.
    • The 2024 and 2025 workbooks have the same formulas in G11, G12 and G13.
  • Fix:
    • Add two references:
      • 2022 Renter Credit Website Calculator (Calculator sheet, cells G10-G12), at https://tax.vermont.gov/sites/tax/files/documents/2022%20Renter%20Credit%20Website%20Calculator_1.xlsx
      • 2021 Renter Credit Website Calculator (Calculator sheet, cells G10-G12), at https://tax.vermont.gov/sites/tax/files/documents/2021%20Renter%20Credit%20Website%20Calculator_8.xlsx
    • Say in the comment that the cells are G10–G12 in 2021–2022.
    • Replace the PR body's "Size cap before 2023" bullet with the citation.
    • Add both workbooks to the size-convention section of rulespec-us#1678, which lists only TY2023–2025.

Suggestions

1. Make an UNKNOWN county give the same result as an omitted county.

  • Omitted county. A household with no county input gets first_county_in_state (county.py:65-66): Addison, Adams, Allegany and Aitkin.
  • VT and WI agree. Their UNKNOWN fallbacks are the same counties, so UNKNOWN and omitted give one answer.
  • MN does not. mn_ccap_provider_rate.py:36 sends UNKNOWN to Hennepin. The PR body discloses the result: an infant in 45 hours a week of family care gets $888.33 a month with county omitted (Aitkin, $205 a week) and $1,083.33 with UNKNOWN (Hennepin, $250 a week).
  • MD is split within one household.
    • md_ccs_payment_rate.py:37 sends an UNKNOWN county to Allegany, which is Region Z, for informal rates.
    • md_ccs_region.py:21,56 defaults an unmatched county to Region W, for center and family rates.
    • So an MD household with an UNKNOWN county is priced in Region W for licensed care and in Allegany for informal care (informal REGULAR: $83 a week, against $135 in every Region W county).
    • COMAR 13A.14.06.11.B(2) (text): "The rate paid to the provider is based on the region in which the: (a) Child care is given if the provider is a: (i) Family child care provider; or (ii) Center child care provider; or (b) Child resides, if the provider is an informal child care provider."
  • The law gives no fallback. None of the four sources gives a rate for an unknown county:
    • Minn. Stat. 142E.17 subd. 1(b) (text): "the maximum rate paid for child care assistance in a county or county price cluster"
    • Wis. Stat. § 49.155(6)(a) (text) leaves the maximum rates to the department, which publishes them by county. § 49.155(4)(c)1, which covers out-of-state providers, keys the rate to "the maximum rate applicable in the county in which the eligible individual resides".
    • 32 V.S.A. § 6061(7)(C) (text): "the monthly fair market rent for the area in which the claimant resides as determined by the U.S. Department of Housing and Urban Development".
    • So any fallback is a modeling choice, and the PR body rightly calls these placeholders.
  • Fix (optional):
    • Use AITKIN_COUNTY_MN as MN's in-state UNKNOWN fallback. Hennepin can stay for out-of-state rows, which defined_for zeroes anyway.
    • Either use a Region W county for MD's informal fallback, or map UNKNOWN to Allegany's region in md_ccs_region.
    • Or keep the current choices and note the difference in the code comments.

2. A household whose county belongs to another state still raises.

  • Where: vt_renter_credit.py:31, mn_ccap_provider_rate.py:36, wi_shares_hourly_max_rate.py:29, wi_shares_monthly_max_rate.py:32 and md_ccs_payment_rate.py:37.
  • The gap. in_state & (county != "UNKNOWN") lets an in-state household with another state's county (for example VT with GRAFTON_COUNTY_NH) reach the table. The PR body's invariants say so.
  • The fix. A suffix test such as np.char.endswith(county.astype(str), "_VT") excludes both UNKNOWN and mismatched counties.
  • Optional. The != "UNKNOWN" form matches md_flat_rate_county_tax.py:24 and in_county_tax.py:20. A mismatched state and county is an input error, and every VT, MN, WI and MD household in the default data has a matching county (Verified correct).

3. Reword the changelog and one PR-body sentence about what crashed on main.

  • The changelog (changelog.d/fix-county-lookup-guards.fixed.md) says all four programs crashed "on simulations that include households outside the state". On main, the MN, WI and MD formulas already masked out-of-state counties: the diff's context lines show where(in_mn, county, "HENNEPIN_COUNTY_MN") and the matching WI and MD lines. Only VT crashed on out-of-state households. The PR body's own table has this right.
  • The PR body's microsimulation section says that on main, "requesting vt_renter_credit or the MN/WI/MD child-care rate variables across the whole population crashes".
    • Only vt_renter_credit can crash on the default population. Every enum county of MN (87), WI (72) and MD (24) is a key in every rate table, so the old MN/WI/MD formulas fail only on an in-state UNKNOWN county.
    • The default data has none. Every MN (1,166), WI (1,232) and MD (1,091) household in the Populace 2024 release has an in-state county_fips that maps to an enum county.
    • MD is on the net-income path. md_child_care_subsidies is in household_state_benefits, so a main run of household_net_income reaches md_ccs_payment_rate for the whole population whenever any MD child is eligible. The PR's main run of the standard outputs completed.
  • Fix: say "the Vermont renter credit from crashing on out-of-state households and on tax units over eight people, and all four from crashing on an in-state household whose county is UNKNOWN". In the PR body, limit the microsimulation crash sentence to vt_renter_credit.

Verified correct

  • How policyengine-core applies defined_for. I checked this in the local core 3.26, simulations/simulation.py. The PR cites 3.32.15, which behaves the same way.

    • Lines 766–774: the formula is skipped only when the mask is all false (if np.all(~mask): array = holder.default_array()).
    • Lines 836–837: otherwise the formula runs over every entity and is masked afterwards (array = np.where(mask, array, variable.default_value)).
    • So a county key missing from the table raises whenever one in-state row shares the simulation, as the PR describes.
  • The guards are vectorized and complete.

    • Table keys. Every county in the County enum for each state is a key in every table the formulas index:
      • VT: 14 of 14, in thirty_percent, fifty_percent and fair_market_rent
      • MN: 87 of 87, in weekly, full_day, hourly and lnl_hourly
      • WI: 72 of 72, in both hourly tables and both full_time_monthly tables
      • MD: 24 of 24, in informal/rates
    • No table has an UNKNOWN key. So once out-of-state and UNKNOWN counties are masked, every household whose county matches its state computes.
    • The UNKNOWN test works. county_str is county.decode_to_str(), so County.UNKNOWN arrives as "UNKNOWN" and county != "UNKNOWN" catches it.
    • In-state values don't change. A real in-state county passes through where(...) unchanged.
    • VT's switch is safe. county (enum) and county_str index the tables with the same names.
  • The VT size cap.

    • The code. size = min_(tax_unit_size, p.max_household_size).astype(int) (vt_renter_credit.py:24) follows mo_mhf_parent_income_limit.py:21. Sizes 1–8 use the same key as before, and .astype(int) keeps the key an integer if the parameter loads as a float.
    • The calculators. I opened the department's calculators for 2021, 2022, 2024 and 2025:
      • All four cap the income-limit lookup at 8 and the credit-amount lookup at 4.
      • All four validate family size to 1–10.
      • The cells are listed under Should 1.
      • PE's fair_market_rent table already repeats the 4-person amount through size 8, so one cap of 8 reproduces both lookups.
    • The 2023 workbook. I couldn't re-open it, because the Wayback Machine returned HTTP 429. But the Wayback availability API resolves the cited link to a 200 capture of the .xlsx (2025-06-09), and the CDX index lists four captures with one digest.
    • The statute. 32 V.S.A. § 6066(b)(2) (text): "The Commissioner shall calculate the credit under subdivision (1) of this subsection (b) using the fair market rent corresponding to a number of bedrooms equal to the number of personal exemptions allowed under subdivision 5811(21)(C) of this title for the taxable year". The statute sets no size limit, and the PR body records HUD's extrapolation as an alternative reading. Following the department, which administers the credit, is reasonable.
    • The 2025 calculator's tables match PE's 2025 cells:
      • Chittenden: full limits 31,200 (size 2), 48,650 (size 7) and 54,150 (size 8); partial limits 67,540, 104,650 and 111,410; credit amounts 2,323 (size 2) and 2,500 (size 4+).
      • Addison, size 2: 27,900, 60,390 and 1,692.
  • Hand checks. Every expectation in the six new cases reproduces. The VT figures use the head's formula; the post-merge check is below.

    Case Calculation Expected
    VT test 11, Chittenden, size 2, $49,370 (67,540 − 49,370) / (67,540 − 31,200) = 0.5; 0.5 × 1,936 × 12 × 0.1 = 1,161.6 1,162
    VT test 11, NH household defined_for 0
    VT test 11, VT UNKNOWN → Addison, size 2, $44,145 16,245 / 32,490 = 0.5; 0.5 × 1,692 846
    VT test 12, Chittenden, sizes 8, 9 and 12, $82,780 28,630 / 57,260 = 0.5; 0.5 × 2,083 × 1.2 = 1,249.8 1,250 ×3
    VT comment: size 7 1 − 34,130 / 56,000 = 0.3905; × 2,499.6 = 976.2 976
    VT comment: UNKNOWN priced at Chittenden 23,395 / 36,340 × 2,323.2 = 1,495.6 1,496
    MN case 13, Becker, family infant, 45 h/week (weekly rate, >35 h) 205 × 52 / 12 888.33
    MN case 13, UNKNOWN → Hennepin 250 × 52 / 12 1,083.33
    WI hourly case 9, Milwaukee and UNKNOWN → Adams, licensed group, ages 2–3 table values 9.72, 8.75
    WI monthly case 6, 15 h/week (part time) ceil(30 × 4.348125) = 131 h; 9.72 × 131; 8.75 × 131 1,273.32, 1,146.25
    MD informal case, Montgomery and UNKNOWN → Allegany, age 3 (REGULAR, ≥ 24 months), 2 h/day (UNIT_1) 177 / 3; 83 / 3 59, 27.67
  • The tests fail on main. By the code on main, each new case reaches a missing key:

    • VT test 11: the NH county and the VT UNKNOWN county
    • VT test 12: size key 9
    • MN, WI ×2 and MD: UNKNOWN
    • The in-state controls pin the unchanged path. Each case puts at least one in-state row in the simulation, so the mask is never all false.
  • No change to default microsimulation records. In the Populace 2024 release, every VT (496), MN (1,166), WI (1,232) and MD (1,091) household has an in-state county_fips that maps to an enum county. So no default record reaches a fallback. That matches the PR's zero-change run.

  • Callers.

    • vt_renter_credit feeds only the state_property_tax_credits lists, the TAXSIM-parity aggregate, not net income.
    • The rate variables feed md_ccs, mn_ccap_max_rate and wi_shares_child_subsidy.
    • Values change only for rows that raised before.
  • Parameter metadata.

    • The description follows the house pattern, and the label is clear.
    • unit: person is used in 140 other parameter files, and period: year is right.
    • The cell locators in the reference titles stand in for page anchors, which a workbook doesn't have. That fits the reference convention.
  • Changelog. changelog.d/fix-county-lookup-guards.fixed.md is top-level and typed fixed. Suggestion 3 covers its wording.

  • Local run. policyengine-core 3.26 can't import the head tree (_uprating_index_value is missing; CI uses a newer core). I relied on CI, the hand checks and the independent key and calculator checks.

Axiom line assessment

Valid: queued for the size cap and n/a for the guards.

  • The line: axiom: us-vt/statute/32/6066 TheAxiomFoundation/rulespec-us#1678 queued (corpus ingest TheAxiomFoundation/axiom-corpus#816; ...). The county guards are n/a: pure crash guards.
  • The issue is OPEN and labelled pe-parity. It was created on 2026-10-11 from this PR, and it has:
    • module paths: us-vt/statutes/32/6066/b.yaml, plus us-vt/policies/tax/renter-credit/table-household-size.yaml for the department's size convention
    • corpus citations: the axiom-corpus 2026-10-06-w6-income-tax-statute-vt rows
    • blockers, as main's CLAUDE.md now requires for queued: the corpus pin must advance, and the billed encoder run needs approval
    • verbatim law: § 6066(b), and § 6061(7)(C), (19) and (20)
    • required outputs: min(exemptions, 8) and min(exemptions, 4)
    • companion tests from the department's 2025 calculator: 1,162, 846, 976 and 1,250 at sizes 8, 9 and 10, which match YAML tests 11–12
  • It matches the head's behavior. The Correct eight Vermont renter credit income limits to HUD's limits #10125 and Match Vermont renter credit base amounts for Franklin and Grand Isle to the department's tables #10130 comments on the issue add the rounding and Franklin/Grand Isle data points that main now has.
  • n/a for the guards is right. They are placeholder keys with no legal content, and no source gives a rate for an unknown county (Suggestion 1).
  • Gaps to fix in the issue:

CI status

All 26 checks pass (gh pr checks 10116, run 38171059356, attempt 2, on head 8fde198e14).

  • Skipped jobs. Three aggregate jobs from the earlier cancelled run (38170610280) show as skipping. The maintainer's comment says that run was cancelled to free runners and re-run without changes.
  • The changed YAML files ran:
    • states-shard-1: mn_ccap_provider_rate.yaml (13 cases) and vt_renter_credit.yaml (13)
    • states-shard-2: md_ccs_payment_rate.yaml (9)
    • states-shard-3: wi_shares_hourly_max_rate.yaml (9) and wi_shares_monthly_max_rate.yaml (6)
    • All passed.
  • Partner tests. The PR touches none, and the Household API Partners job passes.

Branch status

Verdict: REQUEST_CHANGES

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The guards are right: every county of each state is a table key, in-state results are unchanged, and every new expectation reproduces by hand (the VT values match the department's 2025 calculator). One should item (see the comment above): max_household_size.yaml starts in 2021 but cites only the 2023-2025 calculators. The 2021 and 2022 calculators have the same cap at Calculator!G10-G12, so cite both and fix the cell numbers in the comment, the PR body and rulespec-us#1678. Also, the branch now conflicts with main in vt_renter_credit.py/.yaml (#10130 rounding, #10125 cases). Keep main's whole-dollar base and half-up rounding with this PR's [size][safe_county], and keep all YAML cases.

@MaxGhenis MaxGhenis closed this Oct 14, 2026
@MaxGhenis MaxGhenis reopened this Oct 14, 2026
@MaxGhenis MaxGhenis closed this Oct 14, 2026
@MaxGhenis MaxGhenis reopened this Oct 14, 2026
@DTrim99

DTrim99 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

PR Review (round 2): Guard county-keyed lookups in VT renter credit, MN CCAP, WI Shares and MD CCS

PR #10116 (author: MaxGhenis). Head 7089303db3; we last reviewed 8fde198e14. Since then there are three author commits and one merge of main (a23810c84e, which merged 35a94c3b02). The merge-base diff is 13 files, +794/−21. Axiom: TheAxiomFoundation/rulespec-us#1678 queued for the Vermont § 6066 size cap; the guards are n/a.

Summary

Every round-1 item is resolved, and nothing new needs fixing in this PR.

  • The should-fix is fixed. max_household_size.yaml now cites the TY2021 and TY2022 calculators (cells G10–G12), and its comment gives the cell layout for each year.
  • The mismatched-state gap is closed. This was round-1 Suggestion 2. All five formulas now gate on in_state & county_has_state_suffix(county, "<ST>"), a new shared helper.
    • An in-state household whose county is UNKNOWN, belongs to another state or is missing falls back to the placeholder county instead of crashing.
    • Out-of-state rows fall back the same way and are then zeroed by defined_for.
    • In-state rows with a real county keep their key.
  • The UTF-8 fix is right. The helper compares bytes values with a bytes suffix and text values with a text suffix. It never ASCII-decodes, so a UTF-8 county such as DOÑA_ANA_COUNTY_NM supplied as bytes can't raise UnicodeDecodeError before the mask applies.
  • The wording fixes are in. The changelog and the PR body's microsimulation sentence now say what actually crashed on main (round-1 Suggestion 3).
  • The merge of main is correct. Both hand-resolved blocks keep every case and line from both sides.
  • The branch merges cleanly with today's main, which is 120 commits ahead. None of those commits touches these programs, their rate tables or the core pin. The source-conflict ratchet (Tie source-conflict markers to the register shared with Axiom #10287) passes on the merged tree.
  • Tests. Ten new YAML cases, 20 expectations. Each reproduces by hand from the head's tables.
  • CI is 27/27 green on the head.

Two suggestions:

  • The same crash pattern remains in lookups this PR doesn't cover. Main hasn't added any new ones since the merge-base.
  • Some Axiom issue housekeeping.

Prior findings

Finding Status Evidence
Should 1: max_household_size starts in 2021 but cited only the 2023–2025 calculators Fixed 4d47b5f22a adds the 2022 and 2021 Renter Credit Website Calculators (Calculator sheet, cells G10-G12) at lines 22–25. Both URLs are the ones main already cites in fair_market_rent.yaml. The comment (lines 2–8) now reads "G10-G12 in 2021-2022 and G11-G13 in 2023-2025". The PR body's "Size cap before 2023" bullet is replaced by the citation. rulespec-us#1678 got a 2026-10-14 comment adding both workbooks, with the same cells and formulas.
Suggestion 1: make UNKNOWN give the same result as an omitted county (MN Hennepin vs Aitkin; MD informal Allegany vs Region W) Declined, with a reason (optional) The fallbacks stay as labelled placeholders. The PR body now discloses the MN difference ($888.33 with county omitted, $1,083.33 with UNKNOWN). The code comments don't, and the MD split (Region W for licensed rates, Allegany/Region Z for informal) is still not mentioned. That split now also applies to an MD household with another state's county. The law gives no fallback, so this stays a modelling choice; no action needed.
Suggestion 2: an in-state household with another state's county still raised Fixed 68051002b4 replaces county != "UNKNOWN" with a state-suffix test in all five formulas, and 7089303db3 moves that test into county_has_state_suffix (tools/geography/county_helpers.py:17). There are five new paired cases: VT+GRAFTON_COUNTY_NH, MN+MILWAUKEE_COUNTY_WI, WI+HENNEPIN_COUNTY_MN (hourly and monthly) and MD+FAIRFAX_COUNTY_VA. Each reaches a missing key on main and at 8fde198e14.
Suggestion 3: changelog and PR-body wording about what crashed on main Fixed The changelog now reads "Stop the Vermont renter credit from crashing on out-of-state households and on tax units over eight people, and all four programs ... from crashing on an in-state household whose county is UNKNOWN or belongs to another state, including counties supplied as UTF-8 bytes". The microsimulation note now limits the crash to vt_renter_credit.
Branch: conflicts with main in the two VT files (#10130, #10125) Fixed Merged at a23810c84e; both resolution blocks are checked under Verified.
Axiom gap (a): add the TY2021–2022 calculators to #1678 Fixed, in a comment The 2026-10-14 comment on #1678 adds them. The body's size-convention section still lists TY2023–2025 only (Suggestion 2).
Axiom gap (b): #1678 output 7 says "TY2027" for Act 169 (claim year 2027) Open, not blocking Unchanged. It matches main's max_credit/fmr_rate dating (2027-01-01), which this PR doesn't touch.

New findings

Critical (must fix)

None.

Should address

None.

Suggestions

1. Other county-keyed lookups still have the crash this PR fixes. None of them is new on main.

  • Main added none since the merge-base. I checked all 120 newer commits on main. The new county readers (OH HEAP Add Ohio HEAP regular heating assistance #9975, SD LIEAP Add South Dakota LIEAP regular heating assistance #9974, RI LIHEAP Add Rhode Island LIHEAP regular heating assistance #9972, VA Auxiliary Grant Add Virginia state supplementation for 2026 #10172, NY SSP Add New York state supplementation for 2026 #10158) all use np.isin(county, ...) or equality checks, which can't raise.
  • Older lookups on main that are still exposed:
    • nc_scca_market_rate.py:17-19, with no guard:
      • The formula is return p.childcare_market_rates[county][age_group], and the table has the 100 NC counties only.
      • Any simulation that holds an eligible NC child together with a non-NC household (or an NC household whose county is UNKNOWN) reaches a missing key. That is the VT mechanism this PR fixes.
      • nc_child_care_subsidies is in gov.hhs.ccdf.child_care_subsidy_programs.
      • I traced this by code; I did not run it.
    • MD local income tax, with the old guard: md_applicable_local_tax_rate.py:26, md_flat_rate_county_tax.py:24 and md_withheld_income_tax.py:30 keep in_md & (county != "UNKNOWN"). So an MD household with a non-MD county still indexes gov.local.md.flat_rate with a missing key.
    • IN county tax, with the old guard: in_county_tax.py:20-24 has the same gap. rates[safe_county[in_valid_county]] is reached by an IN household with an Ohio county.
    • WA property tax exemption: the open sibling PR Guard Washington property tax exemption county lookups #10113 guards wa_pte_tier/wa_pte_income_eligible with the old != "UNKNOWN" form (ADAMS_COUNTY_WA fallback). That form would leave the mismatched-state gap.
  • Fix (optional, follow-up): open an issue or follow-up PR that reuses county_has_state_suffix for the MD, IN and WA formulas and adds an in_nc & county_has_state_suffix(county, "NC") guard to NC SCCA, each with a paired mixed-state YAML case. This PR's title and body name only its four programs, so this isn't a gap in its scope.

2. Put the TY2021–2022 sources into the queued Axiom work itself.

Verified

  • The guards, for each program. I read the head's formulas (vt_renter_credit.py:31-37, mn_ccap_provider_rate.py:34-40, wi_shares_hourly_max_rate.py:29-34, wi_shares_monthly_max_rate.py:32-37, md_ccs_payment_rate.py:35-41).

    • Out-of-state household: in_state is false, so it gets the fallback key and defined_for zeroes it.
    • In-state with another state's county, or UNKNOWN: the suffix test fails, so it gets the fallback key.
    • In-state with an in-state county: the same key as on main. VT's switch from the county enum to county_str keeps the same names.
  • The helper, probed with numpy only (policyengine_us was not imported). I ran the helper and the where(...) that follows it on three kinds of array:

    • an object array mixing text, ASCII bytes, UTF-8 bytes (DOÑA_ANA_COUNTY_NM), UNKNOWN, None and ""
    • a text (<U) array
    • a fixed-width bytes (|S) array

    In-state text and ASCII-bytes values keep their key. Everything else becomes the fallback, and the resulting key array casts to text without error. Core's table lookup does that cast, and CI's !!binary cases confirm it works end to end.

  • Edge cases.

    • Non-ASCII names: the County enum has 18 non-ASCII names (1 NM, 17 PR) and none in VT, MN, WI or MD. A non-ASCII county can therefore only be out-of-state or mismatched, and it is always replaced by the ASCII fallback before any lookup.
    • Default county: an omitted county gets first_county_in_state (Addison, Aitkin, Adams, Allegany), which passes the suffix test. A county that resolves to UNKNOWN (the enum default) falls back.
    • Names shared across states: WASHINGTON_COUNTY_* exists in all four states. Each state keeps its own, and another state's Washington County falls back.
    • Not handled: a county string that ends in _VT but isn't a real county still raises. That is an input error outside the enum and unchanged from main.
  • NH Add New Hampshire state supplementation for 2026 #10156 pattern. Every key variable the formulas index with has a valid default:

    • MN: mn_ccap_age_group, default SCHOOL_AGE
    • WI: wi_shares_age_group, default AGE_6_AND_OLDER
    • MD: md_ccs_age_group REGULAR, md_ccs_service_unit UNIT_3, md_ccs_region REGION_W. Each is defined_for its state, and each default is a member present in its table.
    • VT: the size key is min_(tax_unit_size, 8), and tax_unit_size is at least 1.
  • Hand checks of every new or changed expectation. All match the head's parameters: VT 2025; MN 2026-01; WI 2027-01 (part-time conversion 30, 4.348125 weeks per month); MD 2026-01.

    Case Calculation Expected
    VT, NH county (line 634): Chittenden, size 2, $49,370 base floor(1,936 × 12 × 0.1 + 0.5) = 2,323; 18,170 × 2,323 / 36,340 = 1,161.5, which rounds to 1,162 1,162
    VT, NH county: VT household with GRAFTON_COUNTY_NH → Addison, size 2, $44,145 base 1,692; 16,245 × 1,692 / 32,490 = 846.0 846
    VT, UTF-8 (line 679): Chittenden as bytes; NM household as above; defined_for 1,162, 0
    MN Case 14 (line 286): Becker, family infant, 45 h/week (weekly) 205 × 52 / 12 888.33
    MN Case 14: MN household with MILWAUKEE_COUNTY_WI → Hennepin 250 × 52 / 12 1,083.33
    MN, UTF-8 (line 314): Becker as bytes; NM 205 × 52 / 12; defined_for 888.33, 0
    WI hourly Case 10 (line 190): Milwaukee, licensed group, ages 2–3; HENNEPIN_COUNTY_MN → Adams table values 9.72, 8.75
    WI hourly, UTF-8 (line 218): Milwaukee as bytes; NM table; defined_for 9.72, 0
    WI monthly Case 7 (line 143): 15 h/week, part time ceil(30 × 4.348125) = 131 h; 9.72 × 131; 8.75 × 131 1,273.32, 1,146.25
    WI monthly, UTF-8 (line 172) 9.72 × 131; defined_for 1,273.32, 0
    MD, Virginia county (line 325): parents; Montgomery informal REGULAR UNIT_1; MD household with FAIRFAX_COUNTY_VA → Allegany 0; 177 / 3; 0; 83 / 3 0, 59, 0, 27.67
    MD, UTF-8 (line 378): Montgomery as bytes; NM child 177 / 3; defined_for 0, 59, 0, 0
    VT tests 11–12, comments rewritten in the merge (values unchanged) 0.5 × 2,323 = 1,161.5 → 1,162; 0.5 × 1,692 = 846; 0.5 × 2,500 = 1,250; "Chittenden would give 1,496": 23,395 × 2,323 / 36,340 = 1,495.5 → 1,496; "7-person gives 976": 21,870 × 2,500 / 56,000 = 976.3 → 976 1,162 / 0 / 846, 1,250 ×3
  • What the tests discriminate.

    • Each mismatched-state case reaches a missing key under main's != "UNKNOWN" form (and VT's enum lookup).
    • The UTF-8 cases would fail on the ASCII cast at 68051002b4, as the author reports.
    • Each case keeps an in-state control row, so the defined_for mask is never all false.
  • Merge resolutions (a23810c84e).

    • Block 1, vt_renter_credit.yaml: compared with main at the merge-base, the head removes 0 lines. It has no conflict markers, and its 38 cases are main's 34 plus this PR's 4. Main's Franklin/Grand Isle and corrected-limit cases are intact.
    • Block 2, vt_renter_credit.py: keeps this PR's [size][safe_county] lookups and main's Match Vermont renter credit base amounts for Franklin and Grand Isle to the department's tables #10130 rounding. That is floor(fmr × 12 × rate + 0.5) for the base, multiply-before-divide in the phase-out, and floor(unrounded + 0.5) at the end. Main's duplicate [tax_unit_size][county] lines are dropped, which is the resolution round 1 proposed.
  • Interaction with main's 120 newer commits.

    • None touches the 13 files, these programs' variables, the VT renter parameters, the MN/WI/MD rate tables, the geography variables or the core pin (policyengine-core 3.32.27 on both).
    • The only related changes are one-line income-source list edits for MD CCS, MN CCAP and WI Shares. No new test has unemployment inputs, so the expectations hold on the merged tree.
  • Source-conflict ratchet (Tie source-conflict markers to the register shared with Axiom #10287), checked statically on the merged tree.

    • I applied the test's CONFLICT_COMMENT_RE to the comments of the six scanned files this PR changes (the five formulas and max_household_size.yaml). It finds 0 matches on main and 0 on the merged tree.
    • None of the six files is in KNOWN_UNMARKED.
    • The helper (tools/) and the YAML tests (tests/) are outside the scanned folders.
    • "calculators use" does not trigger the calculator\s+(uses|use) pattern.
  • Other code-health guards on main. The new hrefs don't match any tax.vermont.gov prefix in known_dead_reference_urls. The PR doesn't touch income-source lists, so test_unemployment_compensation_readers.py doesn't apply.

  • Changelog. changelog.d/fix-county-lookup-guards.fixed.md is top-level and typed fixed. The UTF-8 clause is accurate: on main, an MN, WI or MD household with another state's UTF-8 county reaches the core lookup's ASCII cast.

  • Partner tests. None touched.

  • Local run. Not possible: the head imports _uprating_index_value from policyengine-core, which the local 3.26 lacks. I relied on CI, the hand checks and the numpy-only helper probe. No microsimulation was run.

Axiom line assessment

Valid: queued for the § 6066 size cap and n/a for the guards.

  • The line: axiom: us-vt/statute/32/6066 TheAxiomFoundation/rulespec-us#1678 queued (corpus ingest TheAxiomFoundation/axiom-corpus#816; the rulespec-us corpus pin predates the VT § 6061/§ 6066 rows). The county guards are n/a: pure crash guards.
  • rulespec-us#1678 is OPEN and labelled pe-parity (created 2026-10-11, updated 2026-10-14). It is dispatch-ready:
    • module paths: us-vt/statutes/32/6066/b.yaml and us-vt/policies/tax/renter-credit/table-household-size.yaml
    • corpus citations: the 2026-10-06-w6-income-tax-statute-vt rows
    • blockers: the corpus pin must advance, and the billed encoder run needs approval
    • verbatim law: § 6066(b) and § 6061(7)(C), (19) and (20)
    • required outputs: min(exemptions, 8) and min(exemptions, 4)
    • companion tests from the department's TY2025 calculator: 1,162, 846, 976 and 1,250 at sizes 8, 9 and 10. These are the PR's YAML values.
  • It matches the head. The size-cap and credit computation are unchanged since round 1. The new commits add only guard logic, which has no legal content, and no source gives a rate for an unknown or mismatched county. So n/a for the guards stands.
  • The blocker, axiom-corpus#816, is OPEN.
  • Non-blocking gaps:
    • The TY2021–2022 sources are only in a comment, and Error with person-level childcare expenses #816 is still scoped to TY2023–2025 (Suggestion 2).
    • Output 7 still says "TY2027" for Act 169. Round 1 noted that claim year 2027 is TY2026. That text mirrors main's parameter dating, which is outside this PR.

CI status

All 27 checks pass (gh pr checks 10116, re-checked at the end of this review). This is run 38674936177 on head 7089303db3, from 2026-10-15 03:11 to 05:11 UTC.

  • The run is older than two main-side changes:
  • The jobs that run the changed files all pass: the baseline state shards 1–4, Microsimulation, Household API Partners, PR validation and Quick Feedback with coverage.
  • Merge state: GitHub reports the PR as mergeable, and BLOCKED only by the outstanding changes-requested review.

Branch status

  • Position: 7 commits ahead of PolicyEngine/main (328d1721e2) and 120 behind. The merge-base is 35a94c3b02.
  • Merge: git merge-tree --write-tree PolicyEngine/main 7089303db3 is clean (tree 3c8f25f09d). No conflicts.
  • Sibling: Guard Washington property tax exemption county lookups #10113 (WA, open) touches only WA files, so it doesn't conflict with this PR (see Suggestion 1 on its guard form).
  • CI age: CI last ran 120 commits ago. A merge from main and a re-run before landing would refresh it, but the static checks show no interaction.

Verdict: APPROVE

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Round 2: Should 1 (TY2021-22 calculator citations) is fixed, and the new county_has_state_suffix guard handles mismatched-state counties in all five formulas, with paired tests. Out-of-state, UNKNOWN, mismatched and missing counties all fall back, and in-state keys are unchanged. Both hand-resolved merge blocks are correct, and all 20 new expectations hand-check. Two suggestions, including the other lookups still on the old guard (NC SCCA, MD local tax, IN county tax, WA). Full report in the comment above.

MaxGhenis added a commit that referenced this pull request Nov 9, 2026
Counting the credit in net income puts its formula on every household's path.
Core runs a formula over the whole population whenever any row passes
defined_for, and the formula indexes tables by tax unit size and county. A 2026
microsimulation raised ParameterNotFoundError on a tax unit of nine, and a
county outside Vermont's tables raises the same way.

This takes the Vermont guard from #10116 word for word: tax units above eight
people use the eight-person values, and a county outside Vermont's tables falls
back to Addison. The department's 2025 calculator looks up
IF(Household_Size>8,8,Household_Size) and accepts family sizes 1 to 10. The
fallback changes nothing for a household in a Vermont county.

#10116's four Vermont YAML cases move to vt_renter_credit_lookups.yaml with
rent set, since this branch gives no credit to a tax unit that paid no rent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Nov 9, 2026
…usehold and SPM benefits (#10725)

North Dakota's renter's refund, Minnesota's homestead credit refund, Montana's property tax rebate, Pennsylvania's property tax or rent rebate, Vermont's renter credit and the renter part of Utah's relief reached no net income. The new `state_property_tax_refunds` list feeds `household_state_benefits` and `spm_unit_benefits`, so each refund now raises both net incomes.

- `ut_homeowner_renter_relief` now adds `ut_renters_credit` and `ut_homeowners_credit`, and the list counts only the renter part.
- `vt_renter_credit` pays only tax units that paid rent (32 V.S.A. 6066(b)(1) and (c)(3)) and carries the Vermont lookup guard from #10116.

We estimate the refunds add $525.8 million to household net income and to SPM net income in 2026 on `populace-us-2024-spm-20260909`.

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

Copy link
Copy Markdown
Contributor Author

#10725 carries this PR's Vermont lookup guard word for word and gives its four Vermont cases rent, because counting the credit in net income needs the guard. On rebase, this PR can drop its Vermont changes and keep Minnesota, Wisconsin and Maryland.

MaxGhenis and others added 2 commits November 30, 2026 11:39
policyengine_us/tests/policy/baseline/gov/states/vt/tax/income/credits/rent/vt_renter_credit.yaml: keep every test case and add rent to the four guard fixtures for main's eligibility rule.
policyengine_us/variables/gov/states/vt/tax/income/credits/renter/vt_renter_credit.py: keep the guarded lookups, main's exemption-based bedrooms and eligibility, and half-up rounding.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@MaxGhenis MaxGhenis changed the title Guard county-keyed lookups in VT renter credit, MN CCAP, WI Shares and MD CCS Validate county keys in VT, MN, WI and MD and extend Vermont renter credit lookups Nov 30, 2026
MaxGhenis and others added 6 commits November 30, 2026 08:14
The 1.3 multiplier applies from taxable year 2024. For tax units of nine
or more in Franklin and Grand Isle, the statewide average counted
Burlington's HUD area three times; the published tables count it once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The full credit applies at income equal to the extremely low-income
limit, and the phase-out never divides by a zero gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An income equal to a limit stored just below its exact value counted as
above the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits December 1, 2026 06:35
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Validate county keys in VT, MN, WI and MD and extend Vermont renter credit lookups Preserve supplied county keys and correct Vermont renter credit calculations Dec 1, 2026

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 10116
Reviewed head SHA: 31468cd
Merge base SHA: 094934a
Mode: incremental from 7089303
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10116-review-sources.json
Review status: COMPLETE

Source Documents

Critical

None.

Should Address

A1 — TY2026 Act 169 rate is applied to TY2025 bedroom rents, so Chittenden's capped $2,083 base gives $3,125, not $3,250 (OPEN)

  • Location: vt_renter_credit.py:82 (fmr = p.fair_market_rent[clip(exemptions, 0, 4)][safe_county]) with fair_market_rent.yaml, whose 0–4-bedroom rows end at 2025-01-01. Chittenden has 2,083 for both 3 and 4 bedrooms. Compare vt_renter_credit.py:129-139, which sizes 5+ bedrooms from HUD FY2026 rents.
  • Trigger: TY2026, Chittenden, one adult and 2 or 3 children (3 or 4 exemptions), $0 income, $30,000 rent, no subsidy.
  • Expected: § 6066(b)(1)(A) as amended by Act 169 Sec. 8, with § 6061(7)(C) FMR "as of June 30 of the taxable year" (HUD FY2026). That is 12.5% × 12 × $2,745 (3 BR) = $4,117.50, or × $2,833 (4 BR) = $4,249.50, both capped at $3,250.
  • Observed (executed at head): $3,125 for both, which is 12.5% × 12 × $2,083. The same household with 4 children (5 exemptions) gets $3,250, so the credit goes up when one bedroom is added at the cap. Other counties also use FY2025 rather than FY2026 rents at 0–4 bedrooms, for example Orleans 4 BR: $2,367 vs $2,979 from HUD FY2026.
  • Why this diff exposes it: 54986b5 moves 12.5%/$3,250 from 2027 to TY2026, the right year. The $2,083 entry is the $2,500 cap divided by 12 × 10%, so at 10% it rounds to the cap, but at 12.5% it falls $125 short. The same commit also starts sizing 5+ bedrooms from HUD's FY2026 rents, so the 4- and 5-bedroom rows now come from different vintages. The table rows themselves predate this PR, and on main TY2026 was wrong by more ($2,500 at 10%). The PR body's Follow-up mentions the capped Chittenden base only for 2021 "at 10%". It doesn't mention that the cap understates the credit in the 12.5% year.
  • Impact: an executed wrong credit in a year the PR claims: $125 for Chittenden 3–4-exemption claimants at full credit, plus smaller understatements wherever FY2025 rents trail FY2026. It now flows into net income through #10725.
  • Source: 32 V.S.A. § 6066(b)(1)(A) and § 6061(7)(C); Act 169 Secs. 8 and 16(b) (PDF p.9, 18); HUD FY2026 rents from the model's own fair_market_rents dataset (Chittenden 3/4 BR 2,745/2,833).
  • Proposed severity: should-address. The wrong value comes from pre-existing table data that the author commits don't edit, and the PR reduces the TY2026 error overall. A strict reading of the Phase 6 rubric (an executed wrong benefit in a claimed year) would make it critical; the assembler should decide.
  • Fix: do one of two things. Either add TY2026 rows (HUD FY2026 × the rate, uncapped, for Chittenden at least) or use HUD rents at 0–4 bedrooms for years after the last department table, as the 5+ path already does. Or narrow the Act 169 claim in the PR body and changelog and add the TY2026 capped-base limitation to Follow-up.

Coordinator assessment: I've kept this at should-address rather than critical, on the same basis as earlier rounds: main gives this household less ($2,500 at 10%), so no claimant gets less than on main. It is in scope because this round moves Act 169's 12.5% and $3,250 into TY2026 and sizes five or more bedrooms from HUD FY2026 rents, while zero to four bedrooms stay on the FY2025 table. A Chittenden claimant with 3 or 4 exemptions gets $125 less than one with 5. Either fix in the report works.

A2 — No test covers the county_fips recovery or the dataset input-detection branch in county_key_for_lookup (OPEN)

  • Location. policyengine_us/tools/geography/county_helpers.py:40-51. Branch (a) is the if not supplied: path that accepts a county derived from a known county_fips. Branch (b) is the simulation.is_over_dataset / holder.get_input_periods input detection.
  • Trigger. An in-state household with an invalid county_str, no county input and a valid county_fips. A dataset simulation reaches branch (b) whenever any in-state row has an invalid string.
  • Expected vs observed. The behaviour is correct when executed. A 2025 VT single person with income $10,000, county_fips 50007 and county_str NOT_A_COUNTY_VT gets 1,771 (Chittenden, the same as with a valid FIPS alone). The same household with no geography gets 1,324 (the Addison placeholder).
  • The gap. No YAML or Python test supplies county_fips together with an invalid county_str. Only the rejection side of the gate is pinned, through the MN/WI/MD NOT_A_COUNTY_* cases with an omitted county (Hennepin, not Aitkin).
    • Forcing the FIPS acceptance to false (needs_county &= False) would fail no test.
    • So would removing the is_over_dataset block.
    • Both branches are new in 54986b5, and the PR body claims the FIPS behaviour.
  • Impact. Coverage only. The branch is reachable only when county_str contradicts other geography inputs. No wrong value was found.
  • Proposed severity. Should-address under the brief: a new branch with no test that would fail without it. Fix: add one multi-household YAML case (in-state FIPS + invalid string, plus a no-geography control) to one of the five lookups.

Suggestions

None.

Evidence Gaps

No material gaps reported.

Notes

  • This re-review covers the 7 commits pushed since the 10-21 approval, and the 4 merges of main.
  • County keys outside Vermont are unchanged. The new county_key_for_lookup and county_is_in_state have exactly five consumers (vt_renter_credit, mn_ccap_provider_rate, the two wi_shares max rates and md_ccs_payment_rate), and no county, county_str or county_fips formula changed. Executed on main and the head, these are identical: MD local tax (Montgomery 2,350.40, Worcester 1,652.63), IN county tax (Marion 1,131.20, Lake 840.00), NC SCCA market rates (Wake 1,256, Swain 867) and a mixed VT/MD/IN simulation.
  • The Vermont changes match the sources:
    • The full credit where the two income limits coincide follows § 6066(b)(1)(A)–(C).
    • Subsidized claims use rate × gross rent with no phase-out, under § 6066(b)(1)(D).
    • Franklin and Grand Isle use the 12-HUD-area statewide mean, which reproduces the department's printed values; a 14-county mean does not.
    • The 1.3 multiplier starts in TY2024 (Act 144 Sec. 21(c)), and Act 169's 12.5%/$3,250 applies to TY2026 and its 10%/$2,500 to TY2027 (Sec. 16(b), (e)).
    • The FY2027 HUD rents match the HUD schedule (pp. 48–49), and the additional-bedroom 15% rule matches the captured HUD page.
  • Hand checks at the head: 2021 Caledonia, 13 people at $67,350, gets $2,500; 2025 Chittenden, size 9 with 9 exemptions at $100,000, gets $1,674; five bedrooms gives $1,771; Franklin at $95,000 gives $330. Recomputing the binary rounding across $10,000–$250,000 gives 0 mismatches.
  • The hand-resolved merge f2629e0 keeps all of main's 50 vt_renter_credit.yaml cases plus the PR's 4. The other three merges carry no combined-diff hunks. The PR merges cleanly with current main.
  • Optional, still open from the approval: the NC SCCA, MD local tax, IN county tax and WA lookups still use the old pattern. county_key_for_lookup would fit a follow-up. rulespec-us#1678 and axiom-corpus#816 still don't mention TY2021–2022. Max's 11-09 comment is superseded, since #10725 is on main and this PR builds on its guard. The PR body's zero-change microsimulation table predates #10725 and no longer predicts impact; the body already labels it historical.

Validation Summary

Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot): 1,324 YAML cases (the Vermont renter credit, MN CCAP, WI Shares, MD CCS, county, NC SCCA market rate, IN county tax and MD local tax folders) and 898 pytest tests (the Vermont renter credit property tests and the county FIPS fallback, dataset and enum-coverage tests) passed with 0 failures. Diagnostics ran the Vermont boundary households and the non-Vermont county programs on main and the head. Sources: 32 V.S.A. §§ 6061 and 6066, Acts 144 and 169, and the HUD FY2025–FY2027 FMR schedules and methodology; manifest check passed. CI: 36/36 checks pass at 31468cd.

Timing

setup seconds: 7.00s; scope seconds: 60.00s; parallel review seconds: 454.90s; policy role seconds: 454.90s; code role seconds: 439.30s; adjudication seconds: 180.00s; consolidation cleanup seconds: 233.60s; elapsed seconds: 967.00s

Review Severity

COMMENT. Open findings: 0 critical, 2 should address, 0 suggestions.

This branch has not been deployed

No deployments
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.

2 participants