Repository navigation
Conversation
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>
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>
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>
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>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 0 of d2283 (one US population) lets the ESI premium gates grade frames that mix CPS rows with ACS rows whose premium a transfer filled. It then carries the premium on the ACS local lane from staging through package.
Grading mixed frames (a602ccd, 8770b90, 8d291c9)
a602ccd takes the ESI premium grading from #1199 (e730a95) into
us_runtime/esi_premiums.py:with_us_esi_premium_pool_anchor;It leaves 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;multispine_pool,stacked_spine, the graph, spec YAMLs, re-pinned counts and digests).This PR leaves #1199 and #1201 as they are. The later commits take the lane module and its wiring from #1201 (e7e85cf).
Route A keeps main's rule
_raw_evidence_mask,us_esi_premiums_summaryand both gates take a keyword-onlyallow_transferred_rows, defaultFalse.False, the stage keeps main's rule: every row must carry every raw ASEC field or the stage raisesSourceRuntimeError, and nothing readsPERIDNUM. On a refusal, the message names each incomplete column with its row count, keeps main's remediation and adds one line onallow_transferred_rows(8770b90, 8d291c9).True, the mask applies Run the ESI premium stage in the stacked pool (#454) #1199's row-kind rule as written. Only the kernel and the ACS local lane passTrue.other_policyholder_employer_total.Route A's base builder (
tools/build_us_puf_support_base.py) and fiscal-refresh release tool (tools/build_us_fiscal_refresh_release.py) pass nothing new. An AST comparison parses fde2383'sesi_premiums.pyand main 402c358's, runs neither, and finds:derive_us_employer_esi_premiums_from_manifestandwith_us_esi_premium_inputsidentical to main's;__all__,_clone_disagreements,us_esi_premiums_summaryand the two gates) and a docstring change inrefuse_unassigned_us_esi_premiums;_transferred_row_summaryand_refuse_unusable_source_anchor_evidence, which only the summary calls, once each, insideif mixed:branches, and_refuse_overflowing_mixed_aggregates, which those two call and the summary calls once more inside anif mixed:branch;scaleand its expressions foranchor_universe_employer_totalandother_policyholder_employer_totalas main writes them;_clone_disagreements's body as main writes it, once its newif not rows.all():guard on the row selection comes out;private = ...statement and dict literal, with the division by the CPS rows' share of household mass only under"transferred_rows" in summary.Only
_transferred_row_summarygives the summary a"transferred_rows"key. The AST comparison reads code, not values; the Route A differential under "Tests" checks the all-CPS values against main's. Main 5499382, whose summary and gates that differential copies, has the sameesi_premiums.pyas 402c358.So the two verdict changes #1199 would bring to Route A frames do not happen here:
PERIDNUMcolumn with a blank id on a complete row stays green;A static test checks that the base builder and the fiscal-refresh release tool never import
acs_multispineoracs_local_esi_premiums. It sees literal imports, not computed module names. Two more static tests readesi_premiums.py,battery_bindings.pyand both tools. They check that neither tool nor the stage's own gate call passesallow_transferred_rows, that only the two gates pass it on to the summary, and that the shadow bindings never name it.The ACS local lane (9658d65, b83b8bf, 85c282d)
us_runtime/acs_local_esi_premiums.pycomes from Carry the ESI employer premium on the ACS local release lane (#454) #1201: the donor qualifier, a one-family ASEC-only transfer plan, the anchor wrapper and both ESI gates on narrow views.build_optional_acs_multispinetakesesi_premium_donor_factory. When a caller sets it, the ESI pass runs after main's hours and income passes and right before the shared transfer. With the defaultNone, the orchestration matches main's.tools/build_us_acs_local_release.py) grades both gates at finalize on the calibrated bytes and binds the verdicts to that artifact.input_coverage.passednow comes from those gates. By default, package refuses a report that lacks a verdict, holds a red one or binds it to other bytes. With--allow-esi-premium-gaps, package also takes a red verdict bound to the bytes it packages that finalize recorded as waived, and no other.--allow-esi-premium-gapsrecords red gates (enforced: false) instead of failing, for diagnostic builds. Package takes a red gate only as the waiver finalize recorded: with the flag, it still refuses a red gate that finalize enforced. Each stage saves the waivers it applied to its own gate battery entries, and finalize's record also names the SHA-256 of the gate report bytes that run wrote. The shadow takes the two ESI entries' waivers from finalize's record only when that digest matches the bytes package read from the selected gate report. If package stops before it reads the report, the shadow hashes the file at that path when the stage ends. A package run with other flags, or on another finalize run's report, therefore does not rewrite those waivers. When finalize's record names another gate report, names none while a gate report exists, or has no digest (as a record from 24a417c does), the shadow instead records the ESI entries' waiver asunknown:with the reason. It does the same when it cannot open or read the record as a waiver record or cannot read the selected gate report, and when finalize's observations have no record (as in a checkpoint from 4e882d3). 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 shadow matches only the waiver to the report: it reads the latest saved finalize observations, whichever report package selects. In Modal plans onlyUS_ACS_LOCAL_RELEASEtakes the flag, so a staging plan cannot forward it. No committed plan digest moves.docs/us-esi-employer-premiums.mdgains an "ACS local releases" section, and the gates table describes grading a mixed frame by row kind.Gate battery shadow (c5d11e3)
us/gates.jsondeclares the two finalize ESI gates asus_localentries and binds them to the lane's row-kind gates. The battery's shadow (#1585 item 11) then compares them with finalize's own calls. The commit re-pinsSCOPE_PINS['us_local'];spec_sha256and the other scopes' pins do not move.Review fixes (fab4f4f)
Reviews of the lane, Route A, and tests and docs found two untested staging paths. In one, a red ESI gate stops the build before the write; in the other, the qualifier refuses a waived build's donor. fab4f4f tests both and adds or tightens tests for four smaller findings. It also has
acs_local_esi_premium_gatespass the frame to each gate, and fixes stale docstrings and doc lines. At fab4f4f the suite caught each seeded defect, and no production behavior changes.Independent review fixes (24a417c)
The independent review of 4e882d3 found one blocking defect, three should-fix findings and one nit. 24a417c fixes all five, and two nits that a check of those fixes raised.
ZeroDivisionErrorbefore its verdict, since the gates catch onlySourceRuntimeError_refuse_unusable_source_anchor_evidencerefuses 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. Both gates record the refusal as red, with or without the waiver. When the CPS rows' premium per unit of household mass rounds to zero, the per-mass ratio becomes NaN, and the anchor gate fails it whenever the transferred rows hold household mass. The anchor gate records a private-sector cross-check that it does not grade; that check divides by the CPS rows' share of household mass only when the share exceeds zero.test_us_esi_premiums_pool_anchor.py: CPS employed policyholders without weight, CPS rows without weight, and a CPS mass share, premium per unit of mass or employed share that rounds to zerotest_a_donor_row_that_lost_its_raw_fields_and_record_id_is_refusedenforced: true)enforced: falsefailedcase oftest_package_requires_the_esi_premium_verdict_bound_to_the_packaged_bytes<stage>.waivers.jsonbeside its observations, and the shadow takes the ESI entries' waivers from finalize's. The ACS local release tool keeps the record, so neithergate_shadownor Route A's tools change.test_an_esi_entry_keeps_the_waiver_finalize_ran_with, with the flag on finalize only and on package only_clone_disagreementsselects rows only on a mixed frametest_the_cross_check_names_the_term_without_a_finite_value, three casestest_a_finalize_checkpoint_without_a_waiver_record_marks_the_waiver_unknownEach new test ran against the code before its fix and failed there. For each run, a copy of the test file outside the worktree put the named functions' earlier code back into the loaded module and left the rest of 24a417c's code in place:
_transferred_row_summaryand anchor gate, the five refusal and rounding tests fail withZeroDivisionError, and the three cross-check cases fail too;_require_esi_premium_gates, package accepts the red gate finalize enforced, while the other nine cases still pass;_recorded_local_gate_waiversas the fixes first wrote them, the three cross-check cases blame the share of household mass, and the missing-record test records no waiver.Each run also passed a test that holds before and after the fix.
Second independent review fixes (42f59df)
The independent review of 24a417c found two should-fix findings and four nits, and named three faults the tests could miss. 42f59df answers all six and adds a test for each fault.
generated_at. At fde2383, the record names the bytes finalize wrote instead (see below). The shadow attaches the record only when that digest matches the selected report's; otherwise it recordsunknown:with both digests. A record without the digest also counts as unknown. The comparison still reads the latest saved finalize observations, whichever report package selects.test_package_shows_a_finalize_waiver_only_on_the_gate_report_that_run_wrote(finalize a.json without the waiver, b.json with it, package each),test_a_finalize_run_that_wrote_no_gate_report_names_none,test_a_finalize_waiver_record_without_a_gate_report_digest_is_unknown(two cases); the shadow-armed finalize test also checks the record's digestunknown:with the file name and the error, logs a warning and rebuilds the comparisontest_an_unreadable_waiver_record_is_unknown_and_the_comparison_is_rebuilt, six cases: the record cut to{, a list, waivers as a list, a flag other than a string, a digest other than SHA-256 hex, and an entry finalize does not waivenot x > 0checks, so the mixed-frame shares came out 0.0 (inferred from the code)test_household_mass_past_the_largest_float_fails_both_gates: both sides at 1e307 pass; both at 1e308, and the CPS side alone past the largest float, fail and name the term.test_a_cps_weighted_meps_ic_total_past_the_largest_float_fails_both_gates(three factors) andtest_a_weighted_employer_premium_past_the_largest_float_fails_both_gates(each kind of row) scale person weights and leave household mass finite, and each names the totals that overflowis not Falsewould let package take a red verdict that lacksenforcedor sets it to null or 0allow_transferred_rows=True, since the differential calls the gates directlyEach new test failed on a copy of its test file outside the worktree that put 24a417c's code, or a seeded fault, into the loaded module:
enforcedas a truth value, the three new cases fail, and with!= False, the case with 0 fails;_transferred_row_summaryand_refuse_unusable_source_anchor_evidence, the household mass overflow test fails, since the signal gate passes at 1e308;allow_transferred_rows=Trueadded to the release tool's anchor call,**{'allow_transferred_rows': True}to the base builder's signal call, or the keyword to the stage's own signal call, the matching static test fails.The runs on the gate shadow file, the package test and the pool-anchor file also passed the tests that hold before and after each fix.
Third independent review fixes (fde2383)
The second independent review raised nothing blocking, so the review finished there. A third round, scoped to the changes from 24a417c to 42f59df, raised nothing blocking either: two should-fix findings and two nits, all inferred from the code. fde2383 fixes all four and rewords a diagnostic the review's checks flagged.
_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 the record to the bytes package parsed. If package stops before it reads the report, the shadow hashes the file at the path when the stage ends. Package parses the same bytes into the same report as before.test_package_matches_the_waiver_to_the_gate_report_bytes_it_readandtest_finalize_names_the_gate_report_bytes_it_wrotereplace the file after the read or the write.test_package_with_the_shadow_armed_matches_the_waiver_to_the_report_it_readruns the package stage with the shadow armed and replaces the file after package reads it.RecursionErrorpast the fallback, and the shadow did not rebuild the comparison.Path.is_filealso read a stat error as no fileis_filecheck and counts a missing file as no record. On any otherOSError, aRecursionErroror aValueError, the shadow recordsunknown:with the file name and the error, and still rebuilds the comparison.test_an_unreadable_waiver_record_is_unknown_and_the_comparison_is_rebuilt: an array nested 1,000,000 deep.test_a_waiver_record_the_shadow_cannot_open_is_unknown_and_named: a directory, and a symbolic link loop, at the record's path.test_a_combined_employer_premium_past_the_largest_float_fails_both_gatesscales every premium so each side reaches about 1e308, and both gates name both terms. When it scales them so the frame-wide total sits at 1.75e308, the gates name only the anchor-universe total.Each new test failed on a copy of its test file outside the worktree that put 42f59df's code, or a seeded fault, into the loaded module:
test_package_matches_the_waiver_to_the_gate_report_bytes_it_read: with 42f59df's match, which hashes the path when the stage ends, the shadow attached--allow-esi-premium-gaps.test_finalize_names_the_gate_report_bytes_it_wrote: with 42f59df's stage code, finalize's record named the replacement file's digest.test_package_with_the_shadow_armed_matches_the_waiver_to_the_report_it_read: the shadow attached the flag with 42f59df's match, and again with package reading the report through_load_jsonas before. With finalize writing throughwrite_textas before, the existing shadow-armed finalize test failed at all three factors: its record named no gate report.The same runs passed the other tests, with two expected exceptions. 42f59df's match failed the no-report test on its old text. 42f59df's stage code failed one existing test, because without the reset at stage entry package matched the digest finalize had left on
args.Tests
Local runs on fde2383's tree, one test file per process on Python 3.14, gave these counts (CI runs 3.13 and 3.14):
test_us_esi_premiums_pool_anchor.py, in three slices: 81 passed. Two of the slices hold the pool-anchor kernel's seven Hypothesis properties.test_us_acs_local_release_tool.py, in five-kslices that together cover the file: 348 passed, 1 skipped. Finalize runs on a real lane frame. One test arms the battery's shadow and scales the ACS premium by 1.0, 0.0 and 1.4; at each factor the shadow's two ESI entries match finalize's verdicts, and finalize's waiver record names the gate report it wrote. Another arms the shadow for package and replaces the gate report after package reads it.test_us_acs_local_gate_shadow.py: 27 passed.test_us_esi_premiums_route_a_differential.py: 30 passed. It builds Route A-shaped frames and runs them in the base builder's and the fiscal-refresh release's call orders. Premiums match main's stage expression byte for byte, and every gate verdict matches an oracle that copies main 5499382's summary and gates verbatim.test_us_acs_local_esi_premiums.py: 64 passed. Three form a pass-order differential whose shared plan has person, tax-unit and SPM-unit families. With and without the ESI factory, every non-premium column of every table and the strata match exactly, numeric columns and the weights byte for byte, and the shared transfer's receipts compare equal.test_us_esi_premiums.py: 182 passed.test_us_acs_multispine_legacy_builder.py: 91 passed.test_us_battery_bindings.py: 317 passed.At c5d11e3, the lane, ESI premium, spine-blindness, gate-battery and country-spec test files passed together: 1,882 passed, 1 skipped, none failed. Of those, the spine-blindness and country-spec files, and the gate-battery files other than
test_us_battery_bindings.py, did not run locally on fde2383's tree. No engine-free test runsfill_reviewed_nullson a lane frame; the engine-contract test does, in CI.Worker identity
The primary-QRF worker's static source closure includes
esi_premiums.py. Merging this changes the worker identity that a build computes and records in its receipts, and fde2383 changesesi_premiums.pyagain, so the identity differs from the one at 42f59df. No committed pin holds that identity, so no pin moves for it.Merge
Two merges bring in main with no conflicts: 1dc4952 (main bcb5cba, with #1559 and #1635) and 4e882d3 (main 402c358, with #1672 and #1677). This PR merges only after Max rules d3062 and after the d2603 parent has a fixed commit.
🤖 Generated with Claude Code