Repository navigation
Conversation
…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>
This was referenced Oct 11, 2026
MaxGhenis
marked this pull request as ready for review
October 11, 2026 20:10
This was referenced Oct 11, 2026
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. |
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.
Problem
defined_formasks a formula's output, but policyengine-core 3.32.15 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 raisesParameterNotFoundErrorwhenever 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.vt_renter_creditmn_ccap_provider_ratewi_shares_hourly_max_rate,wi_shares_monthly_max_ratemd_ccs_payment_rateChanges
md_flat_rate_county_tax.pypattern,where(in_state & (county != "UNKNOWN"), county, "<FIRST>_COUNTY_<ST>"). MN keeps its existing Hennepin fallback. VT switches from thecountyenum tocounty_strto match the other guards; the keys are the same.gov.states.vt.tax.income.credits.renter.max_household_size= 8, caps the table lookup. Tax units of 9 or more use the 8-person income limits and fair market rent.Why 8 for Vermont
MATCH(TEXT(IF(Household_Size>8,8,Household_Size),0),...).IF(Household_Size>4,4,Household_Size). PE'sfair_market_renttable already repeats the 4-person value through size 8, so capping at 8 is exact.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.yamltest 11: Chittenden, New Hampshire, and VT UNKNOWN (falls back to Addison).vt_renter_credit.yamltest 12: VT tax units of 8, 9 and 12.mn_ccap_provider_rate.yamlCase 13,wi_shares_hourly_max_rate.yamlCase 9,wi_shares_monthly_max_rate.yamlCase 6, and the newmd_ccs_payment_rate.yamlinformal-provider case.Fails on main, passes here. With the five formulas restored from
upstream/mainand the new tests kept, the six new cases fail withParameterNotFoundError(keys…thirty_percent.9, the out-of-state VT key,…weekly.CHILD_CARE_CENTER.UNKNOWN,…licensed_group.hourly.UNKNOWN×2,…informal.rates.UNKNOWN). The 44 existing cases in those files pass. With the fix, all 50 pass.Broader runs. All VT, MN, WI and MD baseline YAML tests plus
household/state_property_tax_creditspass (1,920).code_health/test_parameter_yaml_keys.py,code_health/test_reference_urls.pyandtest_md_ccs_service_unit_enum_default.pypass (69).51-state probe (2026). Five multi-household simulations: 51 states with real counties; the same plus UNKNOWN in every state; plus VT tax units of 9 and 12; a lone VT unit of 9; and every county of VT (14), MN (87), WI (72) and MD (24) plus UNKNOWN and out-of-state. Every scenario raised for at least one variable on main; all five variables compute in every scenario here. Script and outputs:
~/reviews/county-lookup-guards-2026-10/evidence/.Invariants
The probe runs every county of the four states and checks that each variable computes. It does not itself assert main/head equality, size-cap equality, out-of-state zeros or calculator agreement; the YAML cases assert representative values for those:
defined_for).No Python test is added, per the repo's YAML-first rule; the YAML cases cover each path.
Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
065d0e9560against this PR's head8fde198e14, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.state_income_taxincome_taxhousehold_net_incomehousehold_benefitsRun on the standard outputs only: on main, requesting
vt_renter_creditor the MN/WI/MD child-care rate variables across the whole population crashes (the crash this PR fixes), so a base run that names them cannot complete. No record changes in either year.Comparison files are in
fixes/10116-impact/on the hub host.Impact
Only cases that crashed on main get new values. In the default dataset every household has a real county matching its state.
vt_renter_credit's only consumer istaxsim_state_property_tax_credit, throughgov.states.household.state_property_tax_credits.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.
Follow-up (not in this PR)
The TY2025 booklet prints Washington County's 7-person partial-credit limit as $88,880; the calculator has $88,990. PE uses the booklet value.
🤖 Generated with Claude Code