Repository navigation
Conversation
Add location_clone_index_column and location_clone_index_series to
support_provenance, the owner of every {entity}_* provenance column, and
spell block_location's clone column through it. A table that was never
location-cloned (K = 1) reads as index 0, so a copy key of (source ID,
support clone index, location clone index) reduces to today's pair.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With K > 1 location clones, block_location.clone_frame_for_location
repeats each unit K times and marks each copy with an
{entity}_location_clone_index column, so K copies of one support row
share their source ID and support clone index. Add that index to the
copy keys in the Route A consumer checks (SIPP Head Start, voluntary
filing, SSI take-up, the PUF capital gains tail and warm-start
selection), register the six columns as stored build lineage, and add
assert_location_clone_expansion to the outer stage runtime. Tables never
location-cloned read index 0, so their keys reduce to today's pair. The
ACS local-release line still refuses location_clones > 1, because it
keeps each donor's block.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PUF support expansion copies each row's current ID into its source ID, so on a located frame every location copy would become its own source unit. Refuse such a frame where the expansion checks its metadata columns. Drop assert_location_clone_expansion, which no stage calls and no test covers, and its branch in assert_clone_expansion. Keep the location clone index in the frame identity, with a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a location-cloned base, a capital-gains tail donor counts as present when the base holds each of its K location copies, all copies carry the same recipient source ID, and the selected frame keeps that recipient. Before, a base missing a copy passed against itself, and a donor whose copies sat on two recipients passed as one donor. K = 1 reads no new column and returns the same receipt. Move the property test and its scenarios to test_us_puf_capital_gains_tail_location_properties.py, so the rest of the tail tests run without Hypothesis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Household weights between 1 and 2 split w/K inexactly, so a gate that compares weighted shares with its threshold could pass at K = 1 and fail at K = 3 or 4 on the same decisions. Weights of 48 times the household number divide exactly by every support, tail and location copy in the property, so the check compares equal floats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base-h5 tool refused K > 1 by naming four copy checks that now key on the location clone index. Name the parts that still count or draw by row: the household_location_assignment stage, the tail-concentration gate, and stages that draw per row or per a remapped ID. docs/us-location-v1.md lists every remaining blocker, and the other refusals and docs follow. The legacy ACS tool now refuses a block_v1 base that records more than one location clone, since pooling keeps each donor's block. The preflight counts donors, rather than location copies, in its summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A located frame whose source lacks its lowest support copy at location 0 must still take its predictors from the lowest remaining support rank. A warm-start base must hold every location copy: one without an identity's last copy, or with every identity lacking copy 1, is refused at K = 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release builder returns retirement distributions unchanged, and it redraws childcare and energy subsidy only when the base carries their ASEC source columns. The old sentence listed all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tail survival check refuses an applied row whose source ID is missing, on the base and on the frozen support. PUF support expansion checks for location clones before it chooses a branch. The legacy ACS tool tells the caller to rebuild a located donor base with one location clone. The docs and the changelog say that the warm-start and tail checks read K from the largest location clone index, what K copies do to the top-100 share, when the QRF stages draw per row, and which columns a voluntary-filing frame must lose before it draws per row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 raised three P1s. This commit answers them. R1: the warm-start and capital-gains-tail checks read K from the largest location clone index, so a base in which no unit has its highest copy passed both as K - 1. `h5_io.require_declared_location_clones` compares that index on every entity table with the H5 attribute `populace_location_clones`. `build_us_fiscal_refresh_release.py` calls it right after it loads the base and before the tail check, bound to the digest of the bytes it read, and the preflight calls it where it loads a base that isn't a pool. The generic loaders don't call it: they also read selections, exports and reference files, which can lack copies. A frame with no location column returns before the file is opened, so K = 1 does no new reads. A1: the six register entries move the register's SHA-256 on every receipt, K = 1 included. `register_sha256` exists to make a register change visible when a receipt is replayed, so this keeps the digest over the whole register (b563fbb added the four student-loan entries the same way). The K = 1 golden test also requires the reading to carry the current register's digest, and the changelog says which receipts need a new run. A2: the warm-start docstring claimed the same messages on any frame with no location column. It names the exception: a requested key that names `household_location_clone_index` is refused for having no copies to choose among. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text and one test, with no change to what any code does (review round 2). - The base-h5 refusal and the docs say how location copies rank for the top-100 tail share, and that the cutoff can split a record's copies (R3). - The base-h5 refusal says the QRF stages draw per row when they impute, and that education debt needs --scf-education-debt (R4). - The PUF expansion refusal gives a reason that holds on both expansion paths; one of them keeps source IDs (R7). - The Head Start and voluntary-filing docstrings name the lowest surviving location clone, and the changelog and docs limit the copy-key claim to the code that validates those keys (E1). - The outer-stage identity test moves one entity's index at a time (D2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_main_writes_diagnostics_before_post_calibration_gate_failure returns a fake frame without `entities` from its base loader, so the declared-K check would raise AttributeError before the gates under test. The stub asserts the path and digest the builder passes and leaves the fake frame unchanged. Two declared-K tests now fail on the faults they name: the replacement test swaps the file as the check opens it, and the byte-string case stores fixed-width bytes, which h5py returns undecoded. The release-build test also pins the tail check as the next statement. The helper, its test module, the tail comment, the warm-start docstring, the docs and the changelog say what the check compares: the largest index on each non-empty entity table of a base H5 that isn't a stacked pool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. The independent review has used its four rounds and a P1 is still open, so the PR guide's review limit allows no round 5. I'm handing the PR to the Microcosm hub, which chooses between a rework and a call for Max. Nobody merges this PR while the P1 is open, and it stays a draft. Head: Round 4 (scoped, the last round): REQUEST CHANGES. Two findings are open:
Round 4 found no other fixture that reaches the guard with an incompatible frame or file. Rounds 1 and 2 also asked for changes. Round 3 closed two of round 2's three P1s, A1 and A2, lowered the third, R1, to P2, and raised N1, which round 4 left open. Not run: nobody has run a pytest test on any of the ten commits. I replayed the tail check in pandas, and Pins: none moved and none committed. On this machine, in a borrowed environment with a checkout of main's packages on the path, Proposed fix, not pushed: a patch for N1 only, which nobody has reviewed or run. Applying it counts as a rework, which would need the hub's own review. Depends on: nothing. Hold or decision: none. From 2026-12-01 the UK local-adjudication checks go red and block every microcosm merge until someone renews those UK entries. Follow-ups owed (none filed). R1, R5 and R6 are round 1's labels, which later rounds carried forward, and C1 through F1 are round 2's:
Review record (on this machine, under
|
Main moved the US engine to policyengine-us 2.145.3, which defines
tax_unit_role_input, the two parent ids and the four federal student
loan inputs, so those seven left the stored-input register. This branch
adds the six {entity}_location_clone_index columns. Three files
conflicted, and each keeps main's register plus the six indexes:
- stored_inputs.py: main's paragraph on the seven dropped entries, then
the location-clone paragraph without its parent-id and student-loan
bullets.
- test_support/microcosm_data/stored_inputs.py: the producer-bound
entries are county_fips_2023 and the six indexes.
- test_us_stored_input_register.py: main's docstring, construction set,
count and owners, plus the location set and owners; the count is
56 - 7 + 6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 4 of the review left one P1 and one P2 open. N1: test_main_writes_diagnostics_before_post_calibration_gate_failure patches builder._sha256 with fake_sha256, which returns "base-sha" for the base. The builder passes that value to the declared-K check, so the stub must compare it with fake_sha256(base_h5), not with the real SHA-256 of the fixture's bytes. N2: require_declared_location_clones requires the largest index on each non-empty entity table to be K - 1. The test module docstring, the capital-gains tail comment and the warm-start docstring said the index is compared with K; they now say K - 1. The tail module is attested, so this commit moves generated identities that are not yet recomputed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first real run of this PR's tests, at 5805543, failed three: - test_the_register_is_the_pre_location_register_plus_six_entries and test_the_examined_files_verdicts_match_the_pre_change_golden compared with goldens read at main 1d8b9b8. Main at 2baa35e dropped seven register entries when it moved to policyengine-us 2.145.3. Recomputed at 2baa35e with main's own stored_inputs.py: 49 entries, register df9155e2, verdicts 7352f3d5. The merged register without the six location entries equals main's register, and main's code gives the same verdict digest as this branch's code. - test_block_v1_refuses_location_clones_naming_the_route_a_checks looked for "auto loans and education debt". Round 3 (482f2f7) reworded the tool's blocker to "auto loans and, with --scf-education-debt, education debt" and left the test behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by the Microcosm hub (Claude Code). The hub took this hand-off as a rework rather than a call for Max. The open P1, N1, and the P2, N2, are a test-stub assertion and comment wording, with no methodology or release question. The head is now
Run: at Still to do before merge:
The PR stays a draft until then. |
|
Agent-written for Max, by the Microcosm hub (Claude Code). The ten P2 and P3 findings this PR owes are filed as microcosm#1845. Each was re-checked by reading the merged tree at |
h5_io.py conflicted only because both sides added a function right after assert_h5_unchanged: this branch's require_declared_location_clones and main's refuse_unexpected_h5_digest. The merge keeps both, unchanged. Every other file merged without conflict. The US seed protocol pins still need the re-pin that follows this merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WIP, handed to the Microcosm hub. A P1 was still open after review round 4. Nobody merges this PR while that P1 is open (hand-off comment).
When a build makes K > 1 location clones of a household,
block_location.clone_frame_for_locationgives the K copies of a support row the same source ID and support clone index. Route A's copy checks then reject those copies as duplicates. These commits let the checks tell the copies apart:support_provenancenames the location clone index once, andblock_locationspells its column through that helper. A table that no build location-cloned reads as index 0.outer_stage_runtimeadds the index to the outer-stage identity digest. A frame without the column (K = 1) keeps its digest.microcosm-dataregisters the six{entity}_location_clone_indexcolumns as stored build lineage.build_us_fiscal_refresh_release.pyand its preflight refuse a located--base-h5, other than a stacked pool, when the largest location clone index on a non-empty entity table differs from K − 1. They read K from the H5 attributepopulace_location_clones.All three build lines still refuse K > 1:
tools/build_us_puf_support_base.py, the stacked pool (tools/build_us_multispine_pool.py) and the ACS local-release line.docs/us-location-v1.mdlists what still blocks K > 1 on each.Receipts. The six register entries change the stored-input register's SHA-256. The recertification verifier (
compatibility_recertification.py) and the source-enrichment verifier (source_enrichment.py) compare each receipt's value with the current register's. Anyone replaying a receipt made before this PR merges has to regenerate it first.Pins. The US seed-protocol and F0 pins still hold main's values. CI fails at the first stale one, and
--maxfail=1hides every failure after it, so CI at this head says nothing about the tests below. Derive the pins once, on the final head. #1676 and this PR overlap on some pins and onpuf_support.py, so whoever lands second derives the pins again.Tests. A Codex cloud task ran 13 engine-free files on an earlier base (main
1d8b9b8dd6, treee7cfc21d): 491 passed and one skipped. Nobody has run a pytest test on any of the ten commits after063040ef17, so nobody has run one at this head.🤖 Generated with Claude Code