Skip to content

Ready the US ACS local-area lane for the next national build on policyengine-us 2.145.3 (#1661, #1675, #1154) - #1719

Draft
juaristi22 wants to merge 36 commits into
us-engine-refresh-route-afrom
us-local-area-ready-2145
Draft

juaristi22 wants to merge 36 commits into
us-engine-refresh-route-afrom
us-local-area-ready-2145

Conversation

@juaristi22

@juaristi22 juaristi22 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #922. Builds on #1676: stacked on its branch, with its final head (ba410438e) merged in, so CI runs only once this PR targets main (see Tests).

Purpose

This PR unlocks the US ACS local-area build on policyengine-us 2.145.3 against the next US national build, #1676's:

  1. R1, the ACS staging;
  2. R2, the 2024 local release, with its state, district and county surfaces;
  3. the publisher's preflight.

Most of what it fixes comes from the new donor and engine, so it holds for every surface; the county-specific part is AGI support. The lane last ran as the County Files proof of concept (#1660, #1647), on policyengine-us 2.2.1 with a patched donor and temporary flags. Once the national build is certified and published, the final build runs from this PR's head (runbook: docs/us-county-files-final-build.md; #1661).

What changes

From #1660, picked with authorship:

  • the strike_benefits reviewed-fill entry (77f5fa163);
  • the two pre-R2 checks, tools/check_us_acs_local_reviewed_fills.py and tools/check_us_acs_county_agi_support.py, with their fixes (06b53f625, 46674e01f, 3b28e315c, a5ca4df65, 28e7b7ce6, f8b1039f0).

Nothing else from #1660: no donor patch, no --allow-default-donor-column, no --county-drop-empty-soi-rows. So the checks' text names no drop flag any more (d740047cf).

AGI check, 499d31f58. On 2.145.3 the static dependency closure of adjusted_gross_income reaches four take-up flags R2's stages fill. Every path runs through the 2020-only charitable deduction for non-itemizers (charitable_contributions_ald). That deduction returns 0, reading nothing, in a year whose gov.irs.ald.deductions does not list it, as 2024 does not.

  • The check would have refused every staging file R2 accepts. It now reads AGI's closure in its own year.
  • The engine-workflow test checks both sides: the deduction is 300 for a 2020 filer giving 1,000 in cash, and 0 in 2024.

Engine and donor location in the staging summary, c0b792ae5.

  • Staging records the engine it ran on (engine_versions) and the donor base's location rule (base.location).
  • R2's materialize refuses a staging made on another engine before it loads the staging file, instead of hours in. The reviewed-fill pre-check reports the same refusal.
  • A pool test checks that the legacy rule keeps a block_v1 donor's block and the geography derived from it. The final build runs R1 with --location-rule legacy on the block_v1 national donor: donors keep their own location, and minimum support works for ACS rows as in the proof of concept. Under block_v1, minimum support finds no eligible household.

Certified donor, ae091ce1e (test only).

  • A national release manifest, rewritten into a build folder of microcosm-us-2024-national or microcosm-us-2024-evidence, is one R1's --donor-release-manifest accepts.
  • The reference R1 records is one the local-area contract accepts.

SOI support in minimum support, ac3d4cabc (#1661 item 1). A county whose households all store an AGI of 0 gets an empty county AGI row, which R2 refuses after its engine pass. On a county SOI surface, materialize now computes each household's AGI before minimum support, one chunk at a time. Minimum support then:

  • ranks households with a positive AGI first;
  • moves K same-PUMA households with a positive AGI into each county still without one;
  • never leaves a donor county without a household whose AGI is nonzero.

A county it cannot fill is refused before the engine pass. The AGI check applies the same moves.

Donor lineage, 26c36d50d.

  • R2's five inherited donor limitations describe the Build O lineage: the SSI aged-band collapse, the miscellaneous income loss side, the tip-return count, the 57,240-household selection and the Social Security erasure.
  • A staging from a national build in microcosm-us-2024-national or -evidence is now refused until REVIEWED_DONOR_LINEAGES lists the limitations that hold for it.

Helper reads in the static index, 134afc6a6 (#1675). The static consumer index records a read inside one of policyengine-us's module-level helper functions (127 in variables/ on 2.145.3) under the helper's name, so a variable's dependency graph stopped at the call. School meals, for one, read their tiers through school_meal_daily_rate.

  • The index now also records each helper read under every variable whose formula reaches that call, per call context. PolicyEngineUSVariableMetadataIndex(follow_helpers=True) walks them.
  • The default view is unchanged, receipt for receipt. As the default, the new view would move the pool's pinned SSI dependency contract and the US engine ABI lock on Move the US engine to policyengine-us 2.145.3 and prepare the Route A national build #1676's line, so it is opt-in.
  • The reviewed-fill register's engine-tier walk uses it.

AGI check through helpers, 5cee14f17. The AGI pre-check reads AGI's closure with follow_helpers, so it sees the two Form 7206 inputs of the self-employed health insurance deduction. It stops at the four behavioral-response variables an engine pass without a reform never reads through; an engine test checks that. On 2.145.3 it reads 219 inputs, none of them a stage-filled column.

WIC and EITC take-up on ACS rows, 68cf15a11 (#1154, #1675). Both flags reached R2's engine pass at the engine default, True, on every ACS row.

  • WIC: R1's pool builder draws the ACS rows' decisions with the national wic_claim_input generator, unchanged, after the shared transfer and before pooling (the design of Generate complete ACS WIC participation and reject missing release inputs #1156; wic_take_up, which R1 sets). The donor's decisions are kept. R2 refuses a null WIC cell before any reviewed fill, and its take-up stage refuses an incomplete column.
  • EITC: R2's take-up stage fills the ACS tax units' takes_up_eitc with the take-up contract's seeded draw by number of qualifying children, as it already draws TANF. At the default, the state SOI EITC targets shrank eligible ACS units' weights instead of choosing claimants among them.
  • The take-up gate grades both flags on both spines, and the ACS EITC share against the contract's band.

The ESI employer premium on ACS rows: #1670 merged at fde23835c (3a699e9e4). The national donor stores employer_sponsored_insurance_premiums (#454), and R2 refuses it null. #1670 carries it on the lane from staging through package: an ASEC-only transfer of the premium's family before the shared transfer, the pool anchor, and the ESI gates at staging, finalize and package. One conflict, in build_optional_acs_multispine: after pooling, the ESI anchor runs first, then the WIC completeness check. #1670 keeps its own review and merge conditions.

Texts true on 2.145.3, and the donor lineage from calibrate, 3daa52019.

  • R2's published limitation texts and the staging receipts described policyengine-us 2.2.1. weeks_worked is an input on 2.145.3 and the export carries it; the entry-clock texts name 2.145.3's ten readers, SNAP's waiting period among them; the vehicle, CHIP and take-up texts cite 2.145.3.
  • R2 requires a new national donor's REVIEWED_DONOR_LINEAGES entry at the start of calibrate instead of materialize, and finalize checks again. Materialize writes nothing the entry decides, so R1 and materialize can run while the donor's evidence is reviewed; calibrate fixes the commit package accepts.
  • The runbook covers R1's ESI donor checks, the WIC and EITC draws, a checklist for the lineage review, when to commit it, and the projection steps that are not automated.

The reviewed-fill register on 2.145.3, 38524a2b3 (#1675). reviewed_against is 2.145.3, and each entry lists every program the walk reaches through the engine's helpers (follow_helpers), with one note per program; the engine-tier test checks every list against the walk.

  • second_home_mortgage_interest and takes_up_eitc leave the register; R2 draws EITC take-up, which joins NEVER_DEFAULT_FILLED.
  • Five entries for the next donor's columns: the four SCF student-debt inputs and weeks_worked.
  • Notes that counted California CARE, FERA, EZ-SAVE or CVRP, or Missouri SSP, say those programs pay nothing on these files, and the PTC's Medicaid bar is named where it sits on 2.145.3.

Runbook, 8db234eac and b6cf0ba6c. docs/us-county-files-final-build.md covers:

  • inputs and pins;
  • one command per step;
  • the files-only rehearsal on the built national H5;
  • what to send, and when to stop.

Before the final build

One data commit at this PR's head, before R2's calibrate: the national donor's entry in REVIEWED_DONOR_LINEAGES, from that build's evidence (the runbook's checklist). R1 and materialize can run before it.

Tests

CI runs once this PR targets main. These are local runs at 5cee14f17, on policyengine-us 2.145.3 and policyengine-core 3.36.1, counted with JUnit:

  • Engine-free:
    • 15 files in one process (the release tool, the register, both pre-checks, the county surface, production and properties, the legacy staging builder, the base pool, the build telemetry, block location, the national pool and its input consumers, and microcosm-data's local-area contract and build-folder manifests): 1,156 tests, 1,150 passed, 2 skipped, 4 failed.
    • The four failures are in test_us_pool_input_consumers.py. They fail the same way with the index module as it was: 2.2.1-era expectations (the two retired mortgage legs, taxable_pension_income, domestic_production_ald), which fail wherever 2.145.3 is installed. CI runs this file without an engine.
    • microcosm-frame's US tests, the consumer index included: 106 tests, 98 passed, 8 skipped.
  • Engine tier, one module per process:
    • test_us_multispine_pool_tool.py (the staging run end to end on fixtures): 31 passed.
    • test_us_acs_county_agi_support_engine.py: 5 passed.
    • The two ACS scenario modules: 3 passed.
    • microcosm-frame's engine-contract tests (the helper reviews): 16 passed.
    • The register's engine-contract test: 2 passed and 182 skipped. Its walk tests skip until reviewed_against is 2.145.3, which comes with the ACS local lane: re-review the reviewed-fill consumer register against policyengine-us 2.145.3 #1675 rulings.
  • The index's default view equals the previous module's on 2.145.3, receipt for receipt (7,305 targets, 27,869 receipts), so the pinned SSI contract test passes unchanged.
  • tools/ci_test_plan.py verify ok; ruff check clean.
  • At 38524a2b3: the release tool, the register, the pre-check, the take-up stage and the AGI check, 510 tests, 509 passed, 1 skipped; the register's engine-tier walk, 193 passed.
  • At 3daa52019: the touched files (the lineage order, work and disability, immigration, release tool, SSI and Medicaid take-up, register, pre-check, gate-shadow, spine and take-up modules), 1,163 tests, 1,162 passed, 1 skipped; the legacy staging builder, pool, block location and hours modules with the engine-tier release-tool test, 234 passed; tools/ci_test_plan.py verify ok.
  • At 3a699e9e4 (after the Carry the ESI employer premium on the ACS local lane (PR 0, d2283) #1670 merge), without the register draft: Carry the ESI employer premium on the ACS local lane (PR 0, d2283) #1670's ESI, battery, gate-shadow and Modal test files, 911 passed; the release tool, the pool builder, the legacy staging builder, block location, spine blindness, the take-up stage and the WIC module, 1,113 tests, 1,112 passed, 1 skipped; the hours, income, work and disability, partnership, register, pre-check, sparse-CD, SSI and Medicaid take-up, WIC claim, take-up and other ESI files, 555 tests, 554 passed, 1 skipped; the engine-tier release-tool test from Carry the ESI employer premium on the ACS local lane (PR 0, d2283) #1670, 2 passed; tools/ci_test_plan.py verify ok. With the register draft on top: the release tool, the register and the pre-check, 423 tests, 422 passed, 1 skipped.
  • At 68cf15a11, with the register draft in the worktree: the WIC module, the take-up stage, the pool builder, the legacy staging builder, block location, spine blindness and the release tool, in one process, 1,077 tests, 1,076 passed, 1 skipped; the hours, income, work and disability, partnership, register, pre-check, sparse-CD, SSI and Medicaid take-up, WIC claim, gate-shadow and take-up modules, in another, 381 tests, 380 passed, 1 skipped. Engine tier: the take-up contract 25 passed, the spec engine's take-up semantics 16 passed, the declared source inputs 2 passed.

Not in this PR

🤖 Generated with Claude Code

MaxGhenis and others added 30 commits November 17, 2026 14:47
Takes the ESI premium slice of #1199 (e730a95) into
us_runtime/esi_premiums.py: the row-kind mask, the pool-anchor kernel
with_us_esi_premium_pool_anchor, and the summary and gate checks for
frames where some rows carry the raw ASEC fields and others were filled
by a transfer.

Left out: anchor_share (US_ESI_PREMIUMS_ANCHOR_SHARE_KEY,
_validated_anchor_share, the stage keyword and its config read),
us_esi_premiums_household_mass_share, and all of #1199's stacked-pool
wiring (multispine_pool, stacked_spine, graph, spec YAMLs and the
re-pinned counts and digests).

_raw_evidence_mask, us_esi_premiums_summary and both gates take a
keyword-only allow_transferred_rows, default False. With False every
row must carry every raw ASEC field or the stage raises
SourceRuntimeError, and PERIDNUM is never read: main's rule. With True
the mask applies #1199's row-kind rule verbatim; the kernel uses True.
On frames where every row is a CPS row the summary keeps main's
arithmetic, so its statistics match main bit for bit.

Route A's callers (the base builder and the release tool) pass nothing
new and keep main's rule. derive_us_employer_esi_premiums_from_manifest
and with_us_esi_premium_inputs are byte-identical to main, including
the idempotent branch that calls the signal gate on the default.

Tests:
- test_us_esi_premiums_pool_anchor.py: #1199's kernel and row-kind
  tests, plus the mixed-frame gate tests, on a hand-built mixed frame;
  the default refuses transferred and partial rows and never reads
  PERIDNUM; the kernel refuses a CPS row without a record id.
- test_us_esi_premiums_route_a_differential.py: Route A-shaped frames
  (no id column, id on every row, red frames, blank PERIDNUM, a row
  with neither fields nor id) in the base builder's and the release's
  call orders. Premiums are byte-equal to main's stage expression, and
  every gate's verdict and details match an oracle of main's summary
  and gates (test_support/microcosm_build/us_esi_premiums_main_oracle.py).
  A hypothesis test compares verdicts over random row edits.
- test_us_spine_blindness.py: comment on esi_premiums.py's entry
  only; the classification is unchanged.
- test_us_esi_premiums.py (main's) passes unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the four P2 findings the lead kept from the commit 1 reviews.

A1: with the default allow_transferred_rows=False, _raw_evidence_mask's
refusal now names each incomplete raw ASEC column with its row count and
keeps main's remediation ("the Census column was not restored for every
vintage (asec_census_person_columns) and is never defaulted", plural when
several columns are named). The keyword hint now says only a frame that
holds transferred ACS rows is graded with allow_transferred_rows=True.
Route A's base builder prints this text in its SystemExit and the release
writes it to esi_premiums.json. The verdict, the exception class and the
substrings the pool-anchor tests assert are unchanged.
test_a_null_raw_field_is_refused_with_mains_diagnosis checks one null
NOW_HIPAID row on Route A frames (pre-clone, base, export) and fails on
a602ccd.

A2: the vendored oracle's header names the live helpers it imports and
says the differential test (T2) cannot detect a change to them.

B1: a comment at the summary's all-CPS guard, and the differential
module docstring, say its no-subsetting part holds by construction: an
all-True subset holds identical values, so no in-process test sees it.

B3: the property test's docstring says the bit-equal statistics are
pinned by the named F1/F2 tests, not by the property test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The verify of 8770b90 raised three P3s:
- The hint said a frame of CPS rows is never graded with
  allow_transferred_rows=True, but the lane's donor qualifier grades its
  CPS donor release with True. It now says only a frame that holds
  transferred ACS rows needs the keyword, and any other frame should
  restore the fields.
- The oracle header now also lists the functions and constants the six
  shared helpers call, which T2 cannot see either.
- The two-column refusal case now nulls both fields on one row, so the
  lead count (rows) differs from the cell count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add U/acs_local_esi_premiums.py from #1201 (e7e85cf): the lane's donor
qualifier, its one-family ASEC-only transfer plan, the anchor wrapper around
with_us_esi_premium_pool_anchor, and both ESI gates on narrow views. Text
that described #1199's stacked-pool wiring, which main lacks, is reworded.
The qualifier's signal gate and both lane gates pass
allow_transferred_rows=True (Q13); Route A's callers keep the default.

build_optional_acs_multispine takes esi_premium_donor_factory. When it is
set, the ESI pass runs after main's hours and income passes and immediately
before the shared transfer (Q4), and its fit records and imputed inputs sit
between theirs in the same order. The pooled frame is anchored after
with_optional_acs_spine, and provenance gains
fit_configuration.esi_premium_donor_channel and local_esi_premiums. With the
default None the orchestration is unchanged.

Engine-free tests: #1201's lane tests run on main, with the shared pool plan
assertion inverted (main's pool plan has no ESI family) and the whole-frame
gate calls passing the lane keyword, plus a check that the lane frame is red
under the default keyword. T5 is a pass-order differential with a two-family
shared plan: every non-premium column of every table, the weights, strata and
the shared transfer's receipts are byte-equal with and without the factory.
T6 records every transfer call with main's hours and income passes on. The
spine-blindness inventory classifies the new module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ACS local lane now carries the employer premium (microcosm#454) from
staging through package, and each stage holds it to the lane's two gates.

- Staging (tools/_legacy/build_us_acs_multispine_base.py) qualifies the
  premium's donor before the SIPP donor load and the ACS fetch, passes the
  donor factory to the transfer, adds the premium's family to the
  transfer-coverage plan, and grades both ESI gates on the final frame after
  the hours gate and before export. A red gate stops the build. The summary
  records the verdicts and the transfer provenance (local_esi_premiums), and
  the orchestration record carries the flag.
- The local release tool (tools/build_us_acs_local_release.py) grades both
  gates at finalize on the calibrated bytes and binds them to that artifact.
  input_coverage.passed now comes from those gates rather than a hard-coded
  pass, and a red gate is a hard failure. Package refuses a report whose
  verdict is missing, red or bound to other bytes, with the refusal text the
  other bound finalize gates use. fill_reviewed_nulls keeps main's refusal of
  a null premium; only its comment changes.
- --allow-esi-premium-gaps is the recorded waiver for diagnostic builds. On
  the release tool it records red gates (enforced: false) without failing
  finalize or package. It still refuses a report that has no boolean verdict
  or is bound to other bytes. On staging it records a refused donor and red
  gates in the summary.
- Modal: allow_esi_premium_gaps is an option of US_ACS_LOCAL_RELEASE only.
  On US_ACS_MULTISPINE_STAGING the flag is owned, so a staging plan cannot
  forward it. No committed plan digest moves: ToolSpec options are code, not
  plan data.
- Tests: the legacy builder's wiring, order and evidence; the release tool's
  finalize grading and package binding, on a real lane frame; Modal
  forwarding; and an engine-contract test of the engine pass on a lane frame
  (CI runs it). Both tool loaders now come from one test_support module. The
  block-location and telemetry tests pass the new staging stage through.

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

docs/us-esi-employer-premiums.md gains an "ACS local releases" section:
the lane's own ASEC-only pass, its donor qualification, the anchor kernel
and its wage-universe rule, the narrow view, and what staging, finalize
and package record. The section says how allow_transferred_rows splits
the callers: the lane passes True; the base build, the fiscal-refresh
release tool and the stage's re-check keep the default and its rule
(every row carries the raw ASEC fields, PERIDNUM unread). The gates table
and a new gates bullet describe grading a mixed frame by row kind, and
"What this does not do" drops the bullet that said the ACS local lineage
does not build. README.md and docs/agent-guide.md point to the section,
and one changelog fragment covers PR 0, including the
--allow-esi-premium-gaps waiver. No text describes stacked-pool wiring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #1559 (Route A default ASEC pool) and #1635 (US gates in
us/gates.json, run in shadow beside today's gates). No textual conflicts;
git auto-merged the four files both sides touched
(tools/build_us_acs_local_release.py, tools/modal_us_stage_plan.py,
test_us_acs_local_release_tool.py, test_us_spine_blindness.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Declare the two finalize ESI gates as us_local entries of us/gates.json
(us_local_esi_premiums_signal, us_local_esi_premiums_anchor), bound to the
lane's own row-kind gates (allow_transferred_rows=True), so the battery's
shadow (microcosm#1585 item 11) compares them beside today's calls.
Finalize calls the two gates one by one inside their shadow sites, and
--allow-esi-premium-gaps is recorded as their waiver. Re-pins
SCOPE_PINS['us_local']; spec_sha256 and the other scopes' pins do not move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests for what the lane review found unpinned, plus the docs and
docstrings it found stale. No production behaviour changes.

- Staging wiring test: a red ESI gate stops the build before the H5 or
  its summary is written ("write" is now in the recorded order), and a
  waived build (--allow-esi-premium-gaps) whose donor the qualifier
  refuses transfers nothing, owes nothing in the coverage plan and
  records the refusal, its red verdicts and the waiver.
- Local release: finalize runs with the gate battery's shadow armed and
  the us_local ESI entries match finalize's verdicts at 1.0, 0.0 and
  1.4; the ESI finalize tests serve the frame only as the calibrated
  artifact.
- Lane pass-order test: the shared plan adds tax-unit and SPM-unit
  families, as the declared plan has.
- Route A: a static import-closure test shows BASE and REL reach
  neither acs_multispine nor acs_local_esi_premiums.
- acs_local_esi_premium_gates hands the frame to the two single gates,
  which each narrow it once; docstring, the ESI doc's finalize sentence
  and status line, and refuse_unassigned_us_esi_premiums' docstring
  updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #1672 (build-then-certify) and #1677 (hand-off copy). Clean merge; the only files both sides touched are README.md and docs/agent-guide.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix the five findings of the independent review of 4e882d3 and two
nits that a check of those fixes raised.

- Blocking: on a mixed frame whose CPS rows hold no household mass,
  give their policyholders or employed policyholders no weighted
  MEPS-IC share, or give the employed a part of it that rounds to zero,
  the summary could divide by zero and stop both gates with
  ZeroDivisionError before a verdict. A CPS premium per unit of
  household mass that rounds to zero could do the same in
  _transferred_row_summary, and a CPS share of household mass that
  rounds to zero could stop the anchor gate in its private-sector
  cross-check. The new _refuse_unusable_source_anchor_evidence refuses
  the first three kinds of frame with a SourceRuntimeError naming each
  gap, and both gates record it as a red verdict. When the CPS premium
  per unit of household mass rounds to zero, _transferred_row_summary
  leaves the per-mass ratio NaN, and the anchor gate fails it whenever
  the transferred rows hold household mass. The cross-check divides by
  the share only when the share exceeds zero.
- Nit from the check: when the cross-check has no finite value, it
  records NaN and an unavailable reason that names each term at fault:
  the sector total, the share, or their quotient.
- Should-fix: the donor qualifier refuses a donor with any row that
  lacks a raw ASEC field or a CPS record id, before the signal gate,
  which would grade a row that lost both as a transferred row.
- Should-fix: under --allow-esi-premium-gaps, package refuses a red ESI
  gate unless finalize recorded the waiver (enforced: false).
- Should-fix: each stage of the ACS local release tool saves the
  waivers it applied to its own entries (<stage>.waivers.json), and the
  rebuilt comparison takes the ESI entries' waivers from finalize's
  record, so package's flags no longer rewrite them.
- Nit from the check: when finalize's observations have no waiver
  record, as in a checkpoint from 4e882d3, the shadow records the
  ESI entries' waiver as unknown and still rebuilds the comparison.
- Nit: _clone_disagreements selects rows only on a mixed frame.

The refusal, the per-mass guard and the cross-check's scaling run only
on a mixed frame. Tests: five mixed-frame refusal and rounding tests
and a three-case cross-check test (pool anchor), a donor that lost both
kinds of evidence (lane), a red gate finalize enforced (release tool),
and two shadow waiver tests (gate shadow). The ESI doc and the
changelog fragment describe the new refusals and waiver rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since d5aa4e2 the local income pass's OIP predictor uses
strike_benefits as a component, so R1 requires every donor to carry
it. Neither the shared plan nor the local income pass transfers it, so
every ACS person reaches R2 with a null strike_benefits, R2 fills the
engine default 0, and finalize's reviewed-fill consumer gate refuses
the fill as unregistered (package refuses it too). This blocks the
County Files proof of concept's R2 (#922) and any staging built from a
current national donor.

The register entry names the 13 means-tested consumers that the
engine-tier test recomputes from policyengine-us 2.2.1, with the
verdict harmless: no pinned ASEC respondent reports other-income
code 12, so every donor value is 0, and a transfer would draw 0 too.
The engine-free test that pins the register's column set now lists
fills added since release 767312d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 77f5fa1)
R2's attach_surface builds each county's IRS SOI rows from the state
rows' stored entries, and the state AGI row stores no zero. A county
whose households all have AGI of exactly 0 therefore gets an empty AGI
row, and attach_surface refuses the run after the materialize engine
pass (#1630 review, finding 1). Minimum support fills only counties
with no household.

tools/check_us_acs_county_agi_support.py runs on the staging H5 before
R2, in minutes and with no engine pass:
- It reads the household table and only the AGI income columns of the
  person and tax-unit tables (fixed-format blocks are streamed in row
  chunks).
- The AGI income columns are the money inputs of policyengine-us's
  irs_gross_income closure, read from the installed engine's source
  without importing it, less Social Security (taxable share only) and
  deductions, expenses and contributions. A null cell counts as 0, the
  default R2 fills. The check errs towards listing a county.
- With --puma-ladder it takes the county list from the ladder and
  applies R2's own minimum-support moves first.
- It writes a JSON report and exits 2 when a county is at risk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 06b53f6)
R2's finalize stage grades every reviewed default fill against
acs_local_reviewed_fill_consumers.yaml and refuses an unregistered fill,
a different fill value or spine, or another policyengine-us. That
refusal comes after materialize and calibrate, hours into the run.

tools/check_us_acs_local_reviewed_fills.py runs in seconds after R1:
- it reads the staging summary's reviewed_engine_input_nulls (names and
  counts by spine);
- it refuses what materialize refuses: a NEVER_DEFAULT_FILLED null off
  the ACS spine, and a null ESI employer premium;
- it builds the fill records R2 writes, with the fill values R2's
  _resolve_engine_default gives, and runs R2's own finalize gate on
  them. A null that an R2 stage fills first counts as a fill, so it
  errs towards a refusal.
It exits 2 when R2 would refuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 46674e0)
The check counted a household when any person held a nonzero gross-income
input. policyengine-us 2.2.1 adds only the positive sources of a tax
unit's head and spouse to irs_gross_income, and only an adult can be
either, so a household whose income sits on a dependent, or on a tax unit
without an adult, has an AGI of 0. A county of such households passed the
check, and R2 would refuse its empty AGI row after the engine pass (#1660
review).

The check now loads the staging frame and summary as R2's materialize
stage does, holds back the formula-owned columns, fills the reviewed
nulls with R2's own fill step, and runs the engine for the household sum
of adjusted_gross_income in household chunks. An engine-tier test checks
that sum against the production SOI materializer's AGI measure on six
households, the dependent and no-adult cases included. Null take-up flags
that R2's own stages fill are held back, as the AGI does not read them; a
null never-default column that the AGI reads is refused, as R2 refuses it.

Part of #922.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3b28e31)
…check

The zero-AGI pre-check set its exit status from at_risk alone. R2's
check_support refuses a county outside the ladder and a ladder county
without a household-universe record, with or without
--county-drop-empty-soi-rows, in materialize after the staging load and
the SSI/Medicaid pre-pass. With --puma-ladder the check now lists both
(counties_outside_ladder, unsupported_counties) with R2's set rules,
moves no household when a county is outside the ladder (as R2 does), and
exits 3, which takes precedence over 2. The report records its exit
status.

Part of #922; review of #1660 (comment 6955224433).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a5ca4df)
The reviewed-fill pre-check filed any ACS-only null in a never-default
column under natively_filled. R2's stages fill only the take-up stage's
SPM-unit take-up flags and engine-free fills and the SSI and Medicaid
take-up flags; R2's reasons for the immigration, disability, income
transfer and SSI disability-criteria columns say to re-run staging, so
such a null passed the pre-check and then stopped materialize. The check
now takes the stage-filled set from R2's own constants
(stage_filled_never_default), refuses every other never-default null on
any spine with a re-run-staging message, and records the set in its
report. A test ties the set to R2's own reasons.

Part of #922; review of #1660 (comment 6955224433).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 28e7b7c)
The zero-AGI check held back every null NEVER_DEFAULT_FILLED column that
the AGI does not read, on either spine. Run alone, it passed a file that
R2's first fill refuses. It now takes the stage-filled set from the
reviewed-fill pre-check (stage_filled_never_default) and holds back a
null column only when an R2 stage fills it, every null is on an ACS row
(the <entity>_spine tag) and the AGI does not read it. It refuses every
other never-default null, as R2's fill step does: a null on a donor row,
in a column no R2 stage fills, in one the AGI reads, or without a spine
tag to place it. An engine-tier test checks that no stage-filled column
is an input of the AGI closure, so an engine release that changes that
fails in CI.

Part of #922; review of #1660 (comment 6956136956).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f8b1039)
This branch carries the two pre-R2 checks from #1660 but not the
proof-of-concept flag --county-drop-empty-soi-rows (#1661), so the AGI
check's docstrings, two test names and its changelog line now say when R2
refuses (before or after its engine pass) instead of naming the flag. The
county rung doc gets a short section on running both checks between the
staging and R2, with their exit statuses.

No logic changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On policyengine-us 2.145.3 the static dependency closure of
adjusted_gross_income reaches four take-up flags R2's stages fill
(takes_up_ssi_if_eligible, takes_up_medicare_if_eligible,
takes_up_tanf_if_eligible, receives_housing_assistance). Each path runs
through charitable_contributions_ald, the 2020-only charitable deduction
for non-itemizers, which reads the itemization choice. Its formula returns
0 without reading anything in a year whose gov.irs.ald.deductions does not
list it, and 2024 does not. So the AGI check would have refused every
staging file R2 accepts, though no such null can change the AGI R2 stores.

The check now walks the closure's edges from AGI and stops at a deduction
in YEAR_LISTED_DEDUCTIONS that the check's year does not list. The
engine-workflow test checks the year rule on the engine (2020 lists the
deduction and it is 300 for a filer giving 1,000 in cash; in R2's year it
is not listed and is 0) and that no stage-filled column is an AGI input
then. Its AGI expectations, computed on 2.2.1, hold on 2.145.3.

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

ACS staging audits the nulls of every input the installed policyengine-us
defines, so its summary holds only for that engine. It now records the
policyengine-us and policyengine-core it ran on (engine_versions), and,
under either location rule, the donor base's recorded location rule
(base.location). The ACS local release refuses, at the start of
materialize and before it hashes or loads the staging H5, a summary that
records another policyengine-us or none: on 2.145.3 a staging made on
2.2.1 would otherwise fail in the fill step hours in, or at package for
the retired mortgage legs. The reviewed-fill pre-check reports the same
refusal through R2's function.

The County Files staging may run the legacy rule on the block_v1 national
donor, whose tract, district and county are the assigned triple the legacy
pool keeps. A new pool test checks that such a donor also keeps its block
and the geography derived from it, and that ACS rows get none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Certification writes a US national build's manifests in the tagged shape
and rewrites them into its tier's build folder (microcosm#1570, #1585 item
11). The new test writes such a release manifest, rewrites it with
rewrite_release_dir into microcosm-us-2024-national and into
microcosm-us-2024-evidence, and checks that staging's
--donor-release-manifest accepts it, that the reference it records reads
from the build's folder at main, and that the local-area release
contract's donor check accepts that reference. Test only: the County
Files staging needs no code change to name the certified donor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A county whose households all store an AGI of 0 gets an empty county AGI
row, which attach_surface refuses after the materialize engine pass, about
three hours into a county build. The proof of concept dropped such rows
with --county-drop-empty-soi-rows (#1660), which #1661 says the final
County Files build must not do: every county needs real support instead.

On a county SOI surface (state_county, county geography, minimum support
on), materialize now computes each household's AGI before the support
step, with the engine pass's own input projection and reviewed-null fill,
one 100,000-household chunk at a time (fill_reviewed_nulls gains quiet=,
since a chunk's null counts never match the register's). In 2024 the AGI
reads no county column, so the moves leave it unchanged.
plan_minimum_support takes the AGI:

- the first pass ranks households with a positive AGI first;
- a second pass moves K same-PUMA households with a positive AGI into each
  county that has supporting households but none with a nonzero AGI, with
  the first pass's eligibility and ranking (moves carry
  "reason": "soi_support");
- no move leaves a donor county without a household whose AGI is nonzero.

check_support refuses a county still without one before the engine pass.
Without the AGI, nothing differs from before. The AGI pre-check applies
the same moves, and an engine-workflow test checks that R2's AGI pass gives
the value the state SOI AGI row stores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
finalize_reviewed_limitations writes five inherited limitations about the
donor: the SSI aged-band collapse (#507), the miscellaneous income loss
side (#393), the Build O tip-return count deficit, the 57,240-household
certified selection and the Social Security erasure (#1178, for every
donor, since DONORS_WITHOUT_SOCIAL_SECURITY_ERASURE is empty). Each
describes the Build O lineage. The final County Files build stages from
the next US national build, a dense build published into a build folder of
microcosm-us-2024-national, so its release would have published those five
as its own.

REVIEWED_DONOR_LINEAGES (empty) maps a donor build outside that lineage to
the inherited limitations a review of its own evidence found to hold; the
others leave its releases' register. Materialize, before it hashes or loads
the staging H5, and finalize refuse a staging whose donor is a build of
microcosm-us-2024-national or microcosm-us-2024-evidence with no entry.
Older donors keep all five, unchanged.

The national build's entry is data: its build ID, and the rulings on the
five from that build's evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/us-county-files-final-build.md gives the operator the final County
Files build on the next US national build: host and inputs with their pins,
the two entries the checkout must hold first (the re-reviewed register and
the donor's REVIEWED_DONOR_LINEAGES entry), then one command per step: R1
with --donor-release-manifest and the legacy rule on the block_v1 donor,
the two pre-R2 checks, R2 stage by stage with the county rung's flags and
no drop flag, the publisher's --preflight-only, and the projection. It also
gives the files-only rehearsal on the built national H5 before
certification ends, what to send and when to stop. The county rung doc
points to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R2 binds its commit at calibrate and package refuses another, so a files-
only rehearsal at a commit without the re-reviewed register ends at
finalize's engine-version refusal, after gate_summary.json is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1676 moved from d596fcb to its final head, ba41043: the five
review fixes, the export reference, the shellcheck fix, and main's
#1666 and #1682. The County Files build runs on the national build's
code, so this line carries it.

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

The static consumer index interprets a module-level helper function in
policyengine-us's variables/ once per call context, under the helper's
own name, so variable_dependency_closure stopped where a formula called
one: 127 helper names on policyengine-us 2.145.3. Free and reduced-price
school meals, for one, read their tiers through school_meal_daily_rate.

The index now also records each such read under every variable whose
formula reaches that call context, directly or through other helpers
(helper_consumers), and PolicyEngineUSVariableMetadataIndex(
follow_helpers=True) walks them.

The default view is unchanged: on 2.145.3 its receipts and definitions
equal the previous module's, value for value. As the default, the new
view would move the pool's pinned SSI dependency contract (689 input
leaves would become 1,057) and the US engine ABI lock built from it, both
on #1676's line. So it is opt-in.

The reviewed-fill register's engine-tier walk uses it. Its walk tests
still skip until the register is re-reviewed on 2.145.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AGI check decides which null stage-filled columns it may hold back
from the AGI with AGI's static closure. Through helpers the closure finds
two inputs the gap hid: the self-employed health insurance deduction's
Form 7206 inputs, read only in form_7206_line_13.

It also reaches household_net_income, and through it every benefit and
the take-up flags R2's stages fill. The path runs through the behavioral
responses' get_behavioral_response_measurements helper. An engine pass
without a reform never reads through those responses, so the walk stops
at the four behavioral-response variables too (NO_REFORM_UNREAD). An
engine test checks that the simulation then has no baseline, that the
responses are 0, and that the elasticity effects are never computed.

On 2.145.3 the check reads 219 inputs: the 217 it read before plus the
two. No stage-filled column is among them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix the two should-fix findings and the three code and docs nits of
the independent review of 24a417c, reword the PR body for the
fourth, and add tests for the three faults it said the tests could
miss.

- Should-fix: a package run could show another finalize run's waiver,
  since the shadow read the checkpoint's latest finalize record
  whichever gate report package selected. Finalize's waiver record now
  holds the waivers and the SHA-256 of the gate report that run wrote,
  or null when the report at that path did not change during the run
  or the shadow could not read it. The shadow attaches the record only
  when that digest matches the selected report's; otherwise it records
  each ESI entry's waiver as "unknown: " with both digests. A record
  without the digest, as 24a417c wrote, counts as unknown too.
  The comparison still reads the latest finalize run's observations,
  whichever report package selects.
- Should-fix: a waiver record the shadow could not read or parse
  stopped the rebuild, and the comparison that stage entry had deleted
  never came back. Now, when a record is not valid JSON or not a
  mapping, or holds waivers that are not lists of strings, a digest
  that is not SHA-256 hex or an entry its stage does not waive, the
  shadow gives that stage's entries an "unknown: " waiver naming the
  file and the error, logs a warning and rebuilds the comparison.
- Nit: on a mixed frame, finite weights could sum past the largest
  float, and positive infinity passed the "not x > 0" checks. The new
  _refuse_overflowing_mixed_aggregates refuses the frame and names
  each weighted sum that overflows, and both gates record the refusal
  as red. It checks the household mass of either kind of row and of
  both together, the employer premium of either kind, and the CPS
  rows' MEPS-IC shares and the weight of their employed policyholders
  with a positive share. Only _transferred_row_summary and
  _refuse_unusable_source_anchor_evidence call it; the masses keep
  their scale and the all-CPS expressions do not change.
- Nits: the ESI doc's L0/refit note points to the gates table for the
  call sites; the doc makes the per-mass refusal conditional on
  transferred household mass; the doc and the changelog fragment state
  package's default refusal beside its waiver exception.
- Faults the tests could miss: package cases for a red verdict that
  lacks enforced or sets it to null or 0; static tests that Route A's
  tools and the stage's own gate call pass no allow_transferred_rows
  and the shadow bindings never name it; and assertions of the
  diagnostic for a zero CPS all-policyholder share.

Add four shadow tests (ten cases), a record assertion in the
shadow-armed finalize test, three package cases, four pool-anchor
tests (three overflow, one zero policyholder share) and an assertion
in a fifth, and three static call-site cases in the Route A
differential.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MaxGhenis and others added 3 commits November 21, 2026 14:38
The review of 42f59df found two should-fix findings and two nits,
none blocking.

- The shadow could attach a waiver to bytes package did not use, since
  it hashed the gate report path when the stage ended. Finalize now
  records the SHA-256 of the gate report bytes it writes
  (_write_gate_report), and package records the SHA-256 of the bytes
  it reads (_load_gate_report). Finalize's waiver record names the
  bytes it wrote, and the shadow matches it to the bytes package
  parsed. When a package run stops before it reads the report, the
  shadow still hashes the file at the path. Package parses the same
  bytes into the same report as before.
- On a waiver record nested past the JSON decoder's depth, the decoder
  raised RecursionError past the fallback, and the shadow did not
  rebuild the comparison. Path.is_file also read a stat error as no
  file. The shadow now reads the record without a separate is_file
  check and counts a missing file as no record. On any other OSError,
  a RecursionError or a ValueError, the shadow records the waiver as
  unknown, with the file name and the error, and still rebuilds the
  comparison.
- On a mixed frame, the frame-wide employer premium and the
  anchor-universe total could overflow while both side totals stayed
  finite. Both gates now turn red and name the term. The all-CPS path
  keeps main's arithmetic.
- The docs and the waiver docstring say the shadow reads the latest
  saved finalize observations. The docs and the changelog also say
  that when finalize wrote no report and the selected path holds
  none, the shadow shows the recorded flags on that package run,
  which package refuses.
- The null-digest text now reads "that run wrote no gate report, or
  its report could not be read".

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

R1's pool builder draws the ACS rows' takes_up_wic_if_eligible with the
national wic_claim_input generator, unchanged, after the shared transfer has
completed is_pregnant and own_children_in_household and before pooling, while
the loader's source identity keys each draw (the design of #1156, opt-in as
wic_take_up, which R1 sets). The donor's decisions are kept and must be
complete before the ACS spine is loaded, and the pooled frame after assembly.
R2 refuses a null WIC cell before any reviewed fill (NEVER_DEFAULT_FILLED), and
its take-up stage refuses an incomplete column.

R2's take-up stage fills the ACS tax units' takes_up_eitc with the take-up
contract's seeded draw at the rates by number of qualifying children, as it
draws TANF. At the engine default every eligible ACS unit claimed the credit
and the state SOI EITC targets shrank their weights instead. The receipt, the
assignment digest and the take-up gate cover the new cells; the gate also
grades WIC on both spines.

The register's takes_up_eitc entry goes unused until the register commit
removes it and adds the column to NEVER_DEFAULT_FILLED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The County Files build's national donor stores employer_sponsored_insurance_premiums
(#454), which R2 refuses null on ACS rows. #1670 carries the premium on the lane
from staging through package: the ASEC-only transfer of the premium's family
before the shared transfer, the pool anchor, and the ESI gates at staging,
finalize and package.

One conflict, in build_optional_acs_multispine: after pooling, the ESI pool
anchor runs first and the WIC completeness check (#1154) then reads the final
pooled frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juaristi22 juaristi22 changed the title Ready the County Files line for the next US national build (#1661, #1675) Ready the US ACS local-area lane for the next national build on policyengine-us 2.145.3 (#1661, #1675, #1154) Nov 24, 2026
…eage from calibrate (#1661, #1675)

The ACS local lane's published limitation texts and staging receipts still
described policyengine-us 2.2.1:
- weeks_worked is an input on 2.145.3 (policyengine-us#9660), so the consumer
  export carries it; the work and disability receipt now records it as
  exported (input_since) and the texts no longer say it is held back;
- the entry-clock caveat named 2.2.1's readers; it now names 2.145.3's ten,
  SNAP's qualified-alien waiting period among them;
- the vehicle, CHIP and take-up texts cite 2.145.3, and the take-up text says
  EITC and WIC take-up are now drawn on ACS rows.

R2 requires a new national donor's REVIEWED_DONOR_LINEAGES entry at the start
of calibrate instead of materialize; finalize checks it again. Materialize
writes nothing the entry decides, so R1 and materialize can run while the
donor's evidence is reviewed, and calibrate fixes the commit package accepts.

The runbook covers R1's ESI donor checks, the WIC and EITC draws, the lineage
review and when to commit it, and the projection steps that are not automated.

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

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, María. This is a big PR (+13.4k lines), so I kept to the parts that change what R2 computes: the EITC and WIC take-up draws, the AGI pre-check's year closure, the SOI support moves, and the staging engine refusal. I didn't review the ESI premium carry (#1670 has its own review), the helper index beyond its use in the AGI check, or the runbook line by line. Nothing I found blocks. There's one design point on the first support pass, and two notes.

Checked at 3daa520 (stacked on #1676's final head ba41043, 34 commits)

  • EITC on ACS tax units. It reuses the national contract unchanged: _eitc_child_count_by_tax_unit, _seed_program and the contract's rates by number of children. It fills only missing ACS cells, keeps donor values, and adds the EITC cells to the assignment digest. The gate grades the ACS weighted share against the contract's (0.60, 0.92) band and requires the flag complete and varying on both spines.
  • WIC. It runs the national with_us_wic_claim_input on the ACS-only frame after the transfer, keyed by source identity. It refuses an already-filled column or a row from another source_year, and require_complete_us_wic_take_up refuses a null or non-boolean cell at each later step. Donor decisions are never redrawn.
  • AGI year closure. In policyengine-us, charitable_contributions_ald returns 0 at the Python level before reading anything, in any year whose gov.irs.ald.deductions doesn't list it. The parameter lists it in 2020 only. So stopping the walk there in 2024 is exact. Missing other year-gated deductions (e.g. domestic_production_ald before 2018) only makes the check stricter. Stopping at the four behavioural-response variables is right for a pass with no reform, and the engine test covers it.
  • Staging engine refusal. _require_staging_engine compares the recorded and installed policyengine-us, and refuses a summary that records none. That's the right check for its purpose, since the null audit depends on the variables the engine defines.
  • Tests. Four engine-free files give 228 passed locally: county AGI support, WIC take-up, take-up and county production. I didn't run the engine tiers. CI hasn't run because the PR targets #1676's branch.

1. The first support pass now prefers positive-AGI households for every unsupported county, not just the ones that need AGI support. plan_minimum_support sorts first-pass candidates by (not positive, rank, position) whenever household_agi is given (tools/us_acs_local_county_surface.py; test_first_pass_ranks_households_with_agi_first).

  • With the default K = 3, an unsupported county's whole support becomes three filers with positive AGI, as long as its PUMAs have them. Households with zero or negative AGI, such as non-filers, people living only on Social Security or SSI, or losses, are pushed to the back.

  • County calibration then reweights only those three households. So in those counties every zero-income measure the county targets touch (SNAP and Medicaid among them, through income) rests on filers.

  • The second pass already guarantees AGI support where it's missing. Two cheaper alternatives:

    • require a positive AGI for one of the K first-pass households and leave the other K − 1 to the random rank;
    • drop the preference from the first pass and let the second pass add households only where needed.

    Either keeps support representative of the PUMA. If the preference stays, it would help if the receipt reported the share of first-pass movers with positive AGI against their PUMAs' share, so the skew is visible in the final build's evidence.

2. Four tests fail with policyengine-us 2.145.3 installed. test_us_pool_input_consumers.py encodes 2.2.1's dependency expectations (the two retired mortgage items, taxable_pension_income, domestic_production_ald). It passes in CI only because CI runs it without an engine. The lane now runs on 2.145.3, so those expectations describe an engine nothing uses. Worth updating here or on #1676's line, or listing in #1720 so the file can't silently pin the old graph.

3. Before the final build, as you list.

  • The reviewed-fill register's engine-contract walk skips 182 tests until reviewed_against is 2.145.3. The re-review commit is what turns that coverage on.
  • The donor's REVIEWED_DONOR_LINEAGES entry now gates calibrate rather than materialize, and finalize checks again. That order makes sense.

Review drafted with AI assistance and checked against the code at 3daa5201920a269d2fef83689285b0aef09d059c.

juaristi22 and others added 2 commits November 24, 2026 16:19
…45.3 (#1675)

reviewed_against is 2.145.3. Each entry's consumers are every means-tested
program the engine's dependency walk reaches, through module-level helpers too
(PolicyEngineUSVariableMetadataIndex(follow_helpers=True)), with one note per
program; the engine-tier test checks every list against the walk. Pairs that a
release pass never moves (the 2020-only charitable deduction, the contributed
COLA means test, the no-reform behavioral responses) are listed as harmless.

- second_home_mortgage_interest leaves the register (PolicyEngine/policyengine-us#9605),
  and so does takes_up_eitc: R2's take-up stage draws it, and it joins
  NEVER_DEFAULT_FILLED and the pre-check's stage-filled list.
- Five entries for the next national donor's columns: the four SCF student-debt
  inputs (no consumers) and weeks_worked (blank under 16; harmless).
- California CARE, FERA, EZ-SAVE and CVRP and Missouri SSP pay nothing on these
  files. educational_assistance and is_military -> state benefits, which rested
  on them alone, are harmless in their own notes; other notes drop those names.
  The PTC's Medicaid bar is named where it sits on 2.145.3
  (is_aca_marketplace_enrollee). pre_subsidy_rent -> the PTC is mixed, like the
  other forced, nil PTC verdict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #1719: the first support pass ranked households with a positive
AGI first, so an unsupported county's K movers all had a positive AGI
wherever its PUMAs had such households, and county calibration reweighted
only those.

The first pass now takes the K eligible households first in rank order, as
it does without the AGI. Only when none of them has a positive AGI does the
K-th give way to the next eligible household in rank order that has one (its
move carries "reason": "positive_agi"). The county's AGI row then has
support, and the other picks keep their PUMA's AGI mix. The second pass is
unchanged.

minimum_support.soi_support.first_pass reports the first-pass movers' share
with a positive AGI beside the share among their PUMAs' eligible households,
and names the counties where the swap happened.

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

Copy link
Copy Markdown
Collaborator Author

Thanks, Vahid.

1. First support pass: changed in 1f833383a, along the lines of your first alternative.

  • The first pass now takes the K eligible households first in rank order, as it does without the AGI.
  • Only when none of them has a positive AGI does the K-th give way to the next eligible household in rank order that has one. That move carries "reason": "positive_agi".
  • So an unsupported county gets its AGI support without extra households, and the other picks keep their PUMA's mix. The second pass is unchanged.
  • The receipt now has minimum_support.soi_support.first_pass. It gives the first-pass movers' share with a positive AGI, the share among their PUMAs' eligible households (averaged over the movers), and the counties where the swap happened.
  • Three engine-free tests replace test_first_pass_ranks_households_with_agi_first:
    • the rank's picks stand when one of them has an AGI;
    • the last pick is swapped when none has one;
    • nothing is swapped when no household with an AGI can move, and the second pass then names the county.
  • The three county support test files give 215 passed and 1 skipped.

2. test_us_pool_input_consumers.py on 2.145.3. It's listed in #1720, under "Adjacent follow-ups". The file tests #1676's pool code, and CI runs it without an engine, so I've left it out of this PR.

3. Before the final build. The register re-review on 2.145.3 is in 38524a2b3, and the engine-contract walk now runs: 193 tests pass. The donor's lineage entry goes in before calibrate, once the new national file is published.

🤖 Generated with Claude Code

@MaxGhenis

Copy link
Copy Markdown
Contributor

A heads-up on the SIPP 2023 donor downloads: #1753 moves them on main to the data repository's 1.115.5 tag, which serves the same pu2023.csv and pu2023_slim.csv bytes. This branch still downloads at 21280dca until it takes main.

That PR edits the attested SIPP readers, so it moves the seed map, seed protocol, US spec_sha256, minimal-spec loader golden and us-f0-coverage.json. The next re-pin here picks those up. The recorded revision constants and the source records stay the same.

juaristi22 added a commit that referenced this pull request Nov 26, 2026
C1 of the shared-code work in microcosm#1728. No target changes.

- The ledger filter rules move verbatim from
  tools/build_us_fiscal_refresh_release.py to
  microcosm.build.us_runtime.ledger_filter_rules: 25 names, 446 lines. They
  say how the national irs_soi slice reads a spec's AGI band, filing status
  and EITC child count, and which restated ledger_filter_* keys a spec may
  carry. Each definition is byte-identical. The tool imports all 25 names
  back (its materializer and filter guard call them, and tests and
  tools/bakeoff_us_support_mix.py read them there). It drops the two FSA
  balance-bound imports that only the moved code used, and keeps the two
  age-stamp keys, which a test reads through the tool.
- tools/us_acs_local_cd_surface.py reads the rules from the package, so it
  no longer imports the national tool.
- tools/build_us_acs_local_release.py compiles the registry in one function:
  _compiled_fiscal_registry takes the district crosswalk that
  state_admin_surface also gives the state_cd rule.
- test_us_spine_blindness.py classifies the new module.
- Two tests in test_us_fiscal_refresh_builder.py changed a rule on a freshly
  loaded tool and relied on that copy being thrown away. The rules now live in
  one package module that every load shares, so both use monkeypatch: one
  removes the age rule for its own run only, and one empties the refused EITC
  child-count sides where the comparison reads them.

Proof: test_us_acs_local_surface_bytes.py (the C0 pins) passes unchanged on
the pinned feed and ladder for state, totals, full and state_cd, and the
pinned surfaces of test_us_target_sets.py pass. In all, 3,714 tests
in the 47 files that load the changed tools or hold the module and binding
registers pass locally (8 skipped), with the pinned feed and ladder set.

Left for later commits, as planned: the import cycle between the district
and county modules goes when C3 moves the population rows, and the county
code's use of the argparse namespace moves with the county rung (C5),
because #1719 changes check_support.

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

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.

3 participants