Skip to content

Resolve a household's county from its ZIP code - #47

Merged
MaxGhenis merged 11 commits into
mainfrom
claude/zip-to-county
Nov 8, 2026
Merged

MaxGhenis merged 11 commits into
mainfrom
claude/zip-to-county

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The bug

CliffWatch's form asks for a ZIP and sends no county: InputPanel.jsx sets county: null. Before this PR, nothing in the calculator read the ZIP, so policyengine-us gave each household the first county alphabetically in its state (first_county_in_state). A household in Cambridge, Massachusetts, read Barnstable County's premiums: rating area 7, where Middlesex County has rating area 3.

323,511,506 of the 331,440,751 residents in the table (97.6%) live in a ZIP that resolves to a county other than that default, and 72 variable files in policyengine-us name county or county_str.

The fix

The API now resolves the county, so the form, share links, direct API calls and the Modal fallback follow one rule:

  1. An explicit county, such as a share link's county=MIDDLESEX_COUNTY_MA, always wins.
  2. Otherwise the household gets the ZIP's first county in its state. The table lists a ZIP's counties by 2020 Census residents, most first, and breaks a tie by the lower county code.
  3. For a ZIP code tabulation area (ZCTA) with no residents, the table ranks counties by land area.
  4. For a ZIP with no ZCTA of its own, the table takes GeoNames' county, or else the first in-state county of the ZCTA the crosswalk gives it.
  5. A ZIP with no county in the household's state resolves to nothing. The engine keeps its default, and the page says so.

A ZIP that spans counties goes to the county with the largest share of its residents. 9,981 of the 40,982 ZIPs (24.4%) touch more than one county, but 97.48% of residents live in their ZIP's largest county. The largest county holds under half of the residents in 118 ZIPs and under 90% in 4,420. So the page says what it did in those cases: "ZIP 02467 covers more than one county. This chart uses Middlesex County, home to 40% of its residents." A picker lists each county with its share. The page writes the choice into the share link, and editing the ZIP clears it. When a link names a county outside the ZIP, the page says so and quotes the ZIP's own county the same way: "This link names Barnstable County, so this chart uses it. ZIP 02467 covers more than one county, and the chart would otherwise use Middlesex County, home to 40% of its residents."

A series response gains a location block with the county, its name, its source (explicit, zip or none), whether the engine holds a benchmark premium for it, and the ZIP's counties. The chart subtitle now reads "Middlesex County, Massachusetts · 1 adult · 2 dependents".

Two engine gaps would turn a correct county into wrong numbers, so the situation builder also handles them.

It sends the ACA rating area for 31 counties the engine's join misses. slcsp_rating_area_default joins the county's code to aca_rating_areas.csv and gives rating area 1 to any county the join misses. That file spells 31 counties differently from their codes, such as BAYLOR_TX for BAYLOR_COUNTY_TX and DONA_ANA_NM for DOÑA_ANA_COUNTY_NM, and it holds Chugach, Copper River and Kusilvak only under the former Valdez-Cordova and Wade Hampton rows. RATING_AREA_OVERRIDES in cliff_watch/zip_county.py sends those counties' rating areas as slcsp_rating_area. 28 of the 31 differ from rating area 1. 108 ZIPs resolve to those 28, with 593,430 residents in those counties' parts of them, 212,900 of them in Doña Ana County.

Each cell gives the rating area the engine reads and its age-0 benchmark premium a month. On main a link that named one of these counties got rating area 1, and the ZIP alone got the state's default county.

County Main, county named Main, ZIP alone This PR, either way
Baylor, Texas (ZIP 76380) 1, $535 Anderson County: 21, $391 24, $428
Doña Ana, New Mexico (ZIP 88001) 1, $314 Bernalillo County: 1, $314 3, $412
Bryan, Georgia (ZIP 31308) 1, $351 Appling County: 14, $396 14, $396

Oglala Lakota County, South Dakota, has no row under any name, including its former name Shannon County, and keeps rating area 1.

It keeps housing assistance at $0. With a county and a ZIP, pha_payment_standard finds a PHA's ZIP-level standard, a metro small-area rent or Los Angeles County's schedule. The default "all programs" mode includes housing assistance. With it among a household's programs, receives_housing_assistance makes the household eligible whatever its tenure, and housing_assistance pays hud_hap. CliffWatch has no input for whether a household holds a voucher (#30), and its rent field also takes mortgage payments, so the engine would pay a voucher's subsidy to renters and homeowners alike. Both builders now set takes_up_housing_assistance_if_eligible to False. housing_assistance multiplies by that flag, so it reads $0, while receives_housing_assistance keeps feeding the programs that read it: Massachusetts LIHEAP, Connecticut TFA, Rhode Island Works and Orange County general relief.

Change in cliffs for the example household

The example household, a single parent, 33, with children 6 and 10, lives in Cambridge: ?s=MA&zip=02139&ms=unmarried&p=33:a::0,6:c::0,10:c::0.

main (7cb8f2d) This PR
County the engine reads Barnstable Middlesex
Rating area 7 3
Largest single-step drop $14,628 at $42,500 $15,797 at $37,750
Cliff zones 3 4
Zone Driver main This PR
$18,000 to $18,250 TAFDC $4,059 $4,059
$37,500 to $37,750 Adult 1 Medicaid $11,086 $15,797
$42,250 to $42,500 Child 1 and Child 2 Medicaid $14,628 $14,628
$82,750 to $83,375 Massachusetts CHIP none $3,652

The link with &county=MIDDLESEX_COUNTY_MA gives the same four zones on main and on this PR, with source explicit here.

We measured these by running each link through the app's own client code (decodeInputs, the draft adapters, the coarse series, refinement and the cliff report) against the real api/*.py handlers. We ran main at 7cb8f2d and this PR at 12f4df1, both on policyengine-us 1.755.5. The later commits change only tests and formatting, so the figures hold for the merged code.

Other places, same household

ZIP County now Largest drop, main Largest drop, this PR
NY 10001 New York $71,137 at $37,750 $71,153 at $37,750
CA 90001 Los Angeles $5,216 at $37,750 $8,381 at $72,875
CA 90802 Los Angeles $5,216 at $37,750 $9,879 at $72,875
IL 60601 Cook $3,930 at $37,750 $12,068 at $87,500
PA 19103 Philadelphia $33,332 at $37,750 $34,272 at $37,750
AZ 85004 Maricopa $20,313 at $37,750 $24,992 at $37,750
NM 88001 Doña Ana (rating area 3) $9,987 at $67,500 $7,635 at $67,500
TX 76380 Baylor (rating area 24) $20,089 at $37,750 unchanged
TX 77002 Harris $20,089 at $37,750 unchanged
GA 30303 Fulton $10,346 at $10,750 unchanged
CO 80202 Denver $13,816 at $40,250 unchanged
MD 21201 Baltimore city $16,471 at $88,500 unchanged
WA 98101 King $22,119 at $58,875 unchanged
FL 33130 Miami-Dade $11,814 at $8,750 unchanged

The page computes each figure as the net resources lost across one bracket of its refined series. The drops at $67,500 and above span $625 brackets, so each nets the cliff against what the rest of the bracket's earnings add after taxes and benefits, $344 in New Mexico's case. At $25 steps, NM 88001's Medicaid loss comes to $7,979 between $66,925 and $66,950, and Chicago's comes to $12,460 between $86,875 and $86,900. In the Los Angeles ZIPs the loss comes to $10,289 (90802) and $8,791 (90001) between $72,650 and $72,675. The brackets come from the API, which counts its 201-point cap from $0 rather than from a window's start. To refine New Mexico's coarse drop between $66,500 and $67,000, the page asks for $100 steps from $66,250 to $67,250. The API serves three points $625 apart: $66,250, $66,875 and $67,500. That predates this PR.

What else moves

In Los Angeles County, the engine reads the rating area from the ZIP. The calculator sends zip_code too, because slcsp_rating_area_la_county reads the ZIP's first three digits. For a link that names Los Angeles County, adding ZIP 90802 moves the rating area from 16 to 15, and net resources differ by up to $658 at 9 of 25 earnings points from $0 to $60,000. ZIP 90001 keeps rating area 16.

A link that names Los Angeles County loses its housing subsidy. On main, only such a link got housing assistance, because Los Angeles County's schedule needs neither a ZIP nor county_fips.

Example household with $24,000 rent, at $0 / $10,000 / $20,000 / $30,000 / $40,000 of earnings main This PR
county=LOS_ANGELES_COUNTY_CA, no ZIP $18,138 / $15,558 / $14,058 / $12,558 / $10,368 $0
ZIPs CA 90802, TX 75201, TX 77002, KS 67202 and MA 02139 $0 $0

Without the take-up flag, the first head of this PR paid up to $22,913 a year at those ZIPs.

The example household enters no rent. test_naming_the_default_county_reproduces_the_old_series confirms that its series with ZIP 02139 and an explicit Barnstable County matches its old series at every point, so the ZIP moves its chart only through the county.

The table

scripts/build_zip_county.py builds cliff_watch/data/zip_county.json.gz (323 KB, SHA-256 710185a1920d20feec42733a8f7133998f9a66df248df2b0bccf0071756139d7). Loading it takes about 0.2 s on the first request that needs it, and the module imports no engine code.

Source Use ZIPs
Census 2020 ZCTA-county relationship file and DHC table P1 at summary level 881 Each ZCTA's counties and residents 33,499
The same relationship file's land areas ZCTAs with no residents 143
GeoNames US postal codes (CC BY 4.0; the README credits them) ZIPs with no ZCTA 7,195
UDS Mapper crosswalk, as policyengine-us-data stored it ZIPs with no ZCTA where GeoNames gives a Connecticut planning region the engine lacks 145

GeoNames gives the table's first county for 32,776 of the 33,363 ZCTA ZIPs where it names a county the engine knows (98.24%), and one of the ZIP's counties for 33,291 (99.78%). The first review rebuilt the table in memory from the saved source cache and matched the table this PR adds.

We ran all 3,143 counties through one engine simulation with no error or NaN on 19 variables, and the engine read each county back. We also ran 91 real ZIPs, one per state and DC plus 40 at random, through the API's series path with no failure.

The preview of 12f4df1, whose code the merged head changes only in formatting, returned the same location and series as the local API for 9 households: a ZIP alone, an explicit county, a ZIP across counties, a picked county, a ZIP with no county in the state, DOÑA_ANA_COUNTY_NM, a Los Angeles ZIP in rating area 15, Baylor County's override, and a Los Angeles County link with rent, which read $0 of housing assistance.

Invariants

Each holds for every input, and a test executes it.

The rule and the table (tests/test_zip_county.py):

  • An explicit county always wins, whatever the ZIP. (Hypothesis)
  • A ZIP resolves only inside the household's state. county_for_zip returns a county code with that state's suffix or nothing, and never raises on arbitrary text. (Hypothesis)
  • A ZIP alone gives what naming its county gives. The situation from a ZIP equals the situation from that ZIP plus its resolved county, for all 41,120 (ZIP, state) pairs the table holds, in all 50 states and DC. A second test checks that the loops list each pair exactly once. (Exhaustive) Through the engine, the series for 02139 equals the series for county=MIDDLESEX_COUNTY_MA, and a negative control confirms that the no-county series differs and that the engine reads Barnstable.
  • A ZIP's county options lead with the county it resolves to, all in the household's state, each named, with any resident share in (0, 1]. (Exhaustive over the same pairs)
  • The table's order follows the rule. For every ZIP, rows run by residents descending and then by code, and a ZIP counts all its rows or none. county_for_zip returns each ZIP's first in-state row. (Exhaustive)
  • Resident shares sum to 1 across state lines for every ZIP with counts. (Exhaustive)
  • Every code names an engine County, survives the explicit county path unchanged, and serves a ZIP. The 50 states and DC all appear. (Exhaustive)
  • normalize_zip gives five ASCII digits or nothing, and a second call changes nothing. (Hypothesis)
  • The builder follows the rule on any inputs. Counties run by residents, or by land for a ZCTA with no residents, most first with ties by code. A county with no residents drops out when another has some, and the input order changes nothing. The builder writes the same bytes for the same table. (Hypothesis)

The engine gaps (tests/test_zip_county.py, tests/test_zip_county_engine.py):

  • Every table county has an exact row in the engine's rating-area file or an override, apart from Oglala Lakota, and each override holds the area its row gives. For Oglala Lakota the test fails on any South Dakota row whose name starts with its own name or its former name, Shannon. (Exhaustive, against the installed file)
  • A situation carries slcsp_rating_area exactly when its county has an override, with that override's area. (Hypothesis, plus all 31 counties by name and by ZIP)
  • Each override county prices like its rating area. Its slcsp_rating_area and age-0 benchmark equal those of a county in the same state whose name the join matches in the same area. Doña Ana, alone in New Mexico's rating area 3, has no such twin, so the test checks that its benchmark differs from the rating area 1 benchmark the join gives it otherwise. Baylor's premium tax credits equal Archer County's at every point of the earnings series and differ from what rating area 1 gave. (Exhaustive over the 31)
  • No household takes up housing assistance. The builders set takes_up_housing_assistance_if_eligible to False in every situation. Through the engine, housing_assistance reads $0 at four ZIPs and on a Los Angeles County link where hud_hap exceeds $0. (Hypothesis, plus the engine examples)
  • The page's benchmark note fires exactly where the engine reads no benchmark. For a single adult at $60,000, the counties with a $0 benchmark, out of all 3,143, equal COUNTIES_WITHOUT_BENCHMARK. A series in each of the three shows no premium tax credit at any point, where the same household in its state's default county gets one. (Exhaustive)
  • The API cache keeps ZIPs apart. Cambridge's and Hyannis's series differ, and each equals its uncached series, so the test fails if the cache key drops the ZIP.

The builders (tests/test_payload_invariants.py, #40's suite, whose payloads now draw ZIPs and counties):

  • Each location input follows the rule. The builder sends the county the payload names or else the ZIP's county, sends the payload's ZIP as zip_code, and sends slcsp_rating_area only with an override. (Hypothesis)
  • Send household inputs to the policyengine-us variables rules read #40's invariants hold when the payloads draw places. The builder never sends a total with its components, sends only the computed inputs that KNOWN_COMPUTED_INPUTS lists with reasons (county and slcsp_rating_area among them) and puts every variable on its entity, and the frontend snapshot covers it.
  • The JS builder sends the same inputs as the Python one, apart from the ZIP and the override counties, which only the Python builder handles. The JS builder carries no ZIP table, and no production page calls it. (Differential)

The frontend (frontend/src/utils/*.test.js):

  • A link with only a ZIP sends county: null and gains no county when the page re-encodes it, a link that names a county keeps it, and the two links' payloads differ only in the county.
  • A county note never says "mostly", and every share it quotes matches that county's option. (fast-check)
  • A differential test compares the form's getZipState with the table across all ZIPs and fails on any disagreement outside its list of 10 known ZIPs and two known prefixes. In those prefixes, 201xx and 569xx, only the known disagreement passes: form DC where the table says Virginia, and form Minnesota where it says DC.

Intended exception: a ZIP whose form state disagrees with the table resolves to none, by rule 5.

Known limits

  • Three counties have no benchmark premium in policyengine-us, and this PR moves their households to $0 of premium tax credit. gov.aca.state_rating_area_cost has no row for South Carolina's rating areas 9 and 19 or Florida's 22, so Calhoun and Edgefield counties in South Carolina and Gulf County in Florida read a $0 benchmark. 9 ZIPs resolve to those counties, with 47,410 residents in the counties' parts of them (59,295 across the whole ZIPs). On main those households read their state's first county, so a single adult, 40, at $30,000 goes from $3,623 to $0 in South Carolina and from $6,951 to $0 in Florida. Adding those rows to policyengine-us closes the gap. Until then, the page says "CliffWatch has no benchmark premium for Edgefield County, so this chart shows no premium tax credit." The test that compares the list with the engine fails when an engine update adds the rows, so the note goes when the gap does.
  • The overrides last until policyengine-us renames its rating-area rows to its county codes. Then RATING_AREA_OVERRIDES has no work left, and test_every_county_has_a_rating_area_row_or_an_override fails until the list goes. Oglala Lakota keeps rating area 1 until the file gains its row: 8 ZIPs, 13,351 residents.
  • Housing assistance stays $0 for every household. Turning it on needs an input for whether a household holds a voucher (add housing assistance #30), and county_fips for the county fair market rent. That calls for a product decision, so it gets its own PR.
  • The form's state table, in policyengine-household-wizard, has gaps. getZipState disagrees with this table on 106 ZIPs (1,015,529 residents). It sends 80 of them, Northern Virginia's 201xx ZIPs (1,014,526 residents), to DC. Those households get DC's rules, as on main, and the page now says it can't place the ZIP. 78 other ZIPs get no state, so the form won't calculate them.
  • An explicit county the engine doesn't know still raises SituationParsingError, as on main.
  • Connecticut uses its 8 old counties, because the engine does.
  • The table holds a county per ZIP, not per address. A household in the smaller part of a ZIP gets the larger county's rules unless it picks its own.

Order with the other open PRs

Before this PR, no main commit or open PR mapped ZIP to county. #46 and #40 landed first, and this branch merged main at 7cb8f2d: countyContext.test.js and zipCounty.test.js now import test from Vitest, and #40's payload invariants draw ZIPs and counties. #45 moves to policyengine-us 2.2.1, so its rebase should rerun tests/test_zip_county_engine.py, which checks the rating-area overrides and the no-benchmark counties against the installed engine. The rebase should also update #45's README line about the form reading no county.

Reviews

The first review, by GPT-6.1 Sol at 463716d, requested changes for the voucher subsidy, the rating areas and the "mostly" wording in the override note. 12f4df1 fixes all three and adds the tests that review found missing: the cache test now fails without the ZIP in the key, the builder property checks land order for ZCTAs with no residents, and a test covers every state.

The second review, by an Opus 5.5 agent at 12f4df1, approved and found no defect in the code. Its notes on test coverage led to 711201c, which changes only tests: the ZIP property runs all 41,120 (ZIP, state) pairs, a test catches a rating-area row for Oglala Lakota under another spelling, and the 201xx and 569xx exemption passes only the known disagreement. Its notes on the figures led to the benchmark table's three columns, the bracket note under "Other places" and the no-benchmark reach in its known limit.

The same reviewer approved 711201c after running a negative control for each new test and rechecking every changed figure. Its two notes led to a48741b. The coverage test now compares the (ZIP, state) pairs the loops list with a fresh walk of the table, so it fails if the 138 pairs of ZIPs that cross a state line drop out. The bracket note now says what each bracket nets. That commit also applies ruff's formatting to the three files this PR had left unformatted and replaces two lambdas that closed over loop variables in the builder property test. The reviewer approved a48741b, and the PR merged at that head.

axiom: n/a: CliffWatch input mapping; no policy encoding change

🤖 Generated with Claude Code

The form sends a ZIP and no county, so policyengine-us gave every household
its state's first county. A Cambridge, Massachusetts household read Barnstable
County's benchmark premiums.

The API now maps the ZIP to its county, keeps an explicit county from a share
link, passes the ZIP on to the engine, and returns a `location` block saying
which county it used and why.

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

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cliff-watch Ready Ready Preview Nov 8, 2026 7:18pm UTC

Request Review

The results page now names the county the chart used. When a ZIP spans counties
it states the rule, shows each county's share of the ZIP's residents and offers a
picker, whose choice goes in the share link.

Tests cover the whole table, the resolution rule and the builder, with property
tests, and a differential test that a Middlesex ZIP gives the same series as the
explicit county link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits November 5, 2026 11:08
A county picked on the results page goes through the calculator's county
normalization, so each code in the table must come out unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a ZIP with no residents, the note said a county the user picked had the most
land. Only the first county does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
policyengine-us's premium table has no row for South Carolina's rating
areas 9 and 19 or Florida's 22, which serve Calhoun, Edgefield and Gulf
counties. Once the API read the ZIP, households there went from another
county's premium tax credit to none, with nothing on the page to explain
it. The location block now reports has_benchmark_premium, and the results
page states the gap. A test compares the list with the engine across every
county, so an engine update that adds the rows fails until the note goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 5, 2026 16:43
The note read "in a District of Columbia county" and "in District of
Columbia". DC is the state the form sends most mismatched ZIPs to, so it is
the note's most common reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits November 7, 2026 13:21
README.md conflicted: keep main's Cold-start install section and this
branch's County from ZIP section, in that order. Everything else merged
cleanly. The next commit adapts this branch to #40's Vitest tests,
payload invariants and variable-graph snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note for a link naming a county outside the ZIP said "ZIP 02467 lies
mostly in Middlesex County", but Middlesex holds 40% of its residents.
It now says the ZIP covers more than one county and that the chart would
otherwise use Middlesex County, home to 40% of its residents, or the
county with the largest share of its land when no one lives there.
A fast-check property checks that a note never says "mostly" and that
every share it quotes matches that county's option. The tests import
`test` from Vitest, as main's do since #40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Housing: the ZIP and county let pha_payment_standard find a ZIP-level
standard, a small-area rent or Los Angeles County's schedule, and with
housing assistance among a household's programs the engine then pays a
voucher's subsidy to renters and homeowners alike wherever that standard
exceeds the household's required payment. CliffWatch
has no voucher input (#30), so both builders set
takes_up_housing_assistance_if_eligible to False. Housing assistance
stays at $0, as on main for every household but links naming Los
Angeles County, while receives_housing_assistance keeps feeding the
state programs that read it.

Rating areas: policyengine-us joins a county's code to
aca_rating_areas.csv and gives rating area 1 to a county the join
misses. 31 counties appear there under other names (BAYLOR_TX, the
former Valdez-Cordova and Wade Hampton rows, and so on), so the builder
now sends slcsp_rating_area for them. Oglala Lakota County has no row
under any name and keeps rating area 1.

Tests: every table county has an exact row, an override or no row;
each override holds its row's area; each override county prices like a
twin county the join matches; the override reaches every point of the
series; housing stays $0 where the engine computes a voucher; the API
cache keeps two ZIPs' series apart; a ZIP alone equals its county named
in every state; and the builder ranks a ZCTA with no residents by land.
The payload invariants now draw ZIPs and counties, and the JS
comparison leaves out the ZIP and the override counties, which only the
Python builder handles. The variable-graph snapshot adds zip_code,
slcsp_rating_area and the take-up flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second review found three gaps in the tests:

- The ZIP-alone-equals-named-county property drew at most 300 examples from a
  fixed 2,000-ZIP sample. It now runs every (ZIP, state) pair the table holds,
  41,120 in all, per state; so does the check that a ZIP's county options lead
  with the county it resolves to.
- The rating-area test saw only exact codes, so a new row for Oglala Lakota
  under another spelling would have passed while the county kept area 1. A new
  test looks for rows under its own and its former name, Shannon.
- The frontend's form-vs-table check exempted every 201xx and 569xx ZIP. Those
  ranges now pass only with the known disagreement: form DC where the table
  says Virginia, and form Minnesota where it says DC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The coverage test checked that every ZIP and every state appear in the
per-state lists, so lists holding each ZIP under its first state only
(40,982 pairs instead of 41,120) passed it while the 138 pairs of ZIPs
that cross a state line went untested. It now compares the listed pairs,
each exactly once, with a fresh walk of the table.

Also formats this PR's files with ruff (one blank line in zip_county.py),
sorts an import block, and passes the builder property's order check a
measure dict instead of lambdas that closed over loop variables (B023).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit db78f41 into main Nov 8, 2026
5 checks passed
@MaxGhenis

MaxGhenis commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR landed at a48741b as squash commit db78f41, after these checks and reviews:

  • gh pr checks exited 0 at a48741b (python, frontend, build, Vercel and Vercel Preview Comments). GitHub reported the PR MERGEABLE and CLEAN, with no review requesting changes.
  • GPT-6.1 Sol requested changes at 463716d, and we fixed all three findings in 12f4df1.
  • An Opus 5.5 agent approved 12f4df1, 711201c and a48741b in turn. For the last two, it ran a negative control for each new or changed test and rechecked every changed figure in the description.

Production has served this code since 19:27Z. Its answers to 31 requests match, byte for byte, the answers the API gave locally at 12f4df1, whose code a48741b changes only in formatting. The requests cover:

  • the metadata and households routes;
  • four landing households in Texas and Massachusetts, through series and calculate;
  • nine place cases, from a ZIP alone to a Los Angeles County link with rent.

Before the merge, production matched local main on all 31. The deploy changed 29 of the 31 answers. The 16 landing answers, from households that give no ZIP, gained the new location and input.zip fields, and none of their values moved.

@MaxGhenis
MaxGhenis deleted the claude/zip-to-county branch November 8, 2026 19:31
MaxGhenis added a commit that referenced this pull request Nov 8, 2026
Conflicts:
- cliff_watch/calculator.py keeps the engine bridge's import beside #47's
  zip_county import.
- cliff_watch/variable_graph.py lists is_tanf_enrolled and slcsp_rating_area.
  This branch already keeps ssi in REVIEWED_TOTAL_INPUTS, so main's duplicate
  entry goes.

#47's engine test built its direct Simulation through
calculator._load_simulation, which this branch removed. It now imports
Simulation from policyengine_us, as the other engine tests do, and its 27
tests pass on policyengine-us 2.2.1.

The README's Maryland note now follows the county the API resolves from the
ZIP. Regenerating the variable-graph snapshot on 2.2.1 reproduces the merged
file, which adds #47's zip_code, slcsp_rating_area and
takes_up_housing_assistance_if_eligible.

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

This branch was successfully deployed

1 active deployment
Preview — a48741b7 Deployed Nov 8, 2026 by vercel[bot]
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