Repository navigation
Nest the US target rows on the shared cross-grain operator, and re-pin the US feed (#1760: Stage A, steps 1 to 3 and decision 2) - #1791
juaristi22 wants to merge 46 commits into
Conversation
…ladder microcosm#1728 moves the code that builds the local target surface out of the tools. Each move must leave every target, role and receipt as it was. TargetRegistry.version sorts metadata keys, so it does not see a change of key order. Materialize writes target_registry.json and target_roles.json with the keys in insertion order, and their sha256 is in the run identity. test_us_acs_local_surface_bytes.py follows the target part of do_materialize for each non-county --soi-mode: the admin surface, the ladder populations, the role records, the district pro-rata populations, the ladder population rows, and the district and county hold-outs. It pins the sha256 of target_registry.json, of target_roles.json, of the target receipts, and of the population rows' matrix on a household table that supports every ladder cell (a release run refuses a cell with no household). Measured at 3316038 and run twice: state 4,867 targets, totals 742, full 30,464, state_cd 26,912. The tests run only when MICROCOSM_US_CHRONICLE_FACTS and MICROCOSM_US_PUMA_LADDER_ARTIFACT name the pinned inputs. state_county is not pinned: it needs the pinned county facts, which are not on this machine, and a household frame for its support moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
microcosm#1760 moves the US share mechanisms to the shared cross-grain operator with the same bytes. The operator divides a control among its lower rows as row x control / numpy sum. The US rows sum with math.fsum and, for the county rows, use a residual rule. On the pinned US feed the numpy sum changes the last bit of 5,533 of 21,743 district values. CrossGrainRule gains one field, allocator, default None. With None the operator runs the standing rule: no float operation is added or removed. With an allocator, the operator calls it for each control and takes (values, factor, raw_sum) from it; the refusals and the closure check apply unchanged, and the leg receipt names the allocator. The file gains no import. The UK declares no allocator. The UK graph hashes this file, so the UK target nodes and the nodes after them compute again on the next UK run, with the same outputs. Proof: - test_support/microcosm_build/cross_grain_reference.py is the file at e29843d, pinned by sha256. test_cross_grain_allocator.py runs 400 seeded surfaces (with and without factor bounds) through both modules and compares the value bytes, the receipts and the refusal texts. It also checks that only CrossGrainRule and the reconcile function differ from the reference, and that the imports are the same. - The operator tests and the UK tests that use the operator pass unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
microcosm.build.cross_grain_controls holds what a country's sources can need around the operator (microcosm#1760). It is plain arithmetic on values and keys, with no country in it: - allocators for CrossGrainRule.allocator: proportional_fsum (the standing rule with an exactly rounded sum), and share_residual_to_largest and scale_residual_to_largest, which reproduce rows first made outside the operator and are marked for replacement in Stage B; - derived controls: sum_of_lower_rows and scaled_by_sibling_ratio; - the factor band: control_ratio, level_ratio, median_by_group, band_verdict; - completeness: leg_completeness, with declared combined cells; - self-consistency: sum_gap. The operator does not import the module, so the UK graph does not hash it. No caller uses it yet. Proof: test_cross_grain_controls.py holds each allocator, bit for bit, to the arithmetic it replaces on 200 seeded blocks, runs each one through the operator, and checks the helpers and that the module names no country. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
us/cross_grain_declarations.json is the US file of the shared cross-grain operator (microcosm#1760). It names the geography levels and the levels that hold controls with the key names of uk/cross_grain_declarations.json, and it declares the four mechanisms that make lower-level rows from a higher-level control in the local tools (rows 5 to 8 of the issue): the allocator, the rule for the control, the bounds, the source of the member lists, the old metadata keys, and the reviewed registers with their reasons. The registers were Python literals in the tools: the defective, unparented and excluded district measures, the six level bridges, the factor band, the two tolerances, the reviewed crosswalk digest, the required county measures and the combined cell with its basis. The tools now read them from the declaration under their old names. No function uses the operator yet. us_runtime/cross_grain_declarations.py reads the file. us_runtime/target_nesting.py is the adapter: it builds one surface from blocks (a control and its lower rows), runs the operator with the declared allocator, and returns each block's rows. A stage can record the operator's own receipts and write them to target_nesting.json. The new resource row moves the US F0 pins, as each new legacy resource does: 42,407 configuration fields (32,621 authored), the country_manifest claim at 116 pointers, and the US bundle's semantic spec_sha256 (9141b9bf). No target changes. Both pin tools ran twice and their --check modes pass. Proof: test_us_cross_grain_declarations.py holds each register to the literal it replaces (value, type and order), read from test_support/microcosm_build/us_target_nesting_reference.py, which is the tool code at e29843d. It also checks the declaration's shape and the adapter's block interface. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
state_cd_soi_surface (row 5 of microcosm#1760) rebased each state's district rows onto the Historic Table 2 state row with its own arithmetic. The shared operator now divides each state control among its district rows, with the proportional_fsum allocator the US declaration names. The adapter (us_runtime.target_nesting.district_soi_surface) keeps the US side: the choice of the control, the level bridge by a sibling ratio, the factor band, the plan completeness check, the self-consistency check, the refusals with their texts, and the old metadata keys and receipt. The tool functions state_cd_soi_surface and state_parent_reconciliation keep their names and signatures and call the adapter. About 450 lines leave tools/us_acs_local_cd_surface.py. No target changes. On the pinned feed and ladder the state_cd surface has the bytes it had: 26,912 targets, and the same sha256 of target_registry.json, target_roles.json and the receipts (test_us_acs_local_surface_bytes.py). Proof: - test_us_target_nesting_district.py holds the tool function to the verbatim copy of the code it replaces on 160 seeded surfaces: the same specs in the same order, value bits, metadata key order, receipt bytes and refusal texts. The draws include signed rows, all-zero blocks, blocks out of the band (with NaN in the receipt), bridged concepts, a state with one district and four kinds of refusal. - The district property tests, the sparse tests and the feed contract tests pass unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three county mechanisms of the ACS local release made rows from a state control with their own arithmetic (rows 8, 6 and 7 of microcosm#1760). The shared operator now divides each state control among its counties, with the allocator the US declaration names: - with_county_populations: the ladder's county overlaps, scaled to the state total (scale_residual_to_largest); - state_county_soi_surface: county SOI facts as shares of the broad state row, with the declared combined cell (share_residual_to_largest); - acs_household_surface: the state target is the sum of the county estimates (sum_of_lower_rows), and the counties divide it (share_residual_to_largest). The adapter (us_runtime.target_nesting) keeps the US side of each one: the fact checks, the completeness checks, the refusals with their texts and their order, and the old metadata keys and receipts. The tool functions keep their names and signatures. county_code_of, the county hierarchy, cell_members and the broad-parent test moved with them and stay in the tool under their old names. About 460 lines leave tools/us_acs_local_county_surface.py. The materialize stage records the operator's own receipt of each nesting pass and writes it to a new file, target_nesting.json. No stage reads it and it is not in the run identity. The old receipts keep their bytes. No target changes. Proof: - test_us_target_nesting_county.py holds each tool function to the verbatim copy of the code it replaces on 120 seeded inputs: the same specs in the same order, value bits, metadata key order, receipt bytes, refusal texts and refusal order. The draws include equal largest rows, zero rows, the combined cell, optional measures and ten kinds of refusal. - The three county test files, the tests that run the materialize stage and the pinned non-county surfaces pass unchanged. Not covered: the county rows on the pinned county facts file. The file is not a local test input, so these blocks are synthetic. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
us/cross_grain_declarations.json gains an inventory: each US family that two geography levels measure, with the route that ties the levels today or the reason none does (microcosm#1760). It records what the code does. It decides no nesting rule: the decisions of the issue are open, and Stage B applies them. - Rows 1 to 4 of the issue (capital gains, taxable interest, state AGI bands, the district file's own state row) are compile rules. Each entry says why its arithmetic stays where it is in Stage A and names the metadata the rule writes. - Rows 5 to 8 name their mechanism on the shared operator. - The families that do not nest have a reason and an issue: the SOI families with two national rows, the state age rows, the program families whose state rows are not checked against their national row, the families with no national row, and the district ACS rows that are not in the fit. us_cross_grain_coverage_violations checks a set of compiled specs against the inventory. It is a receipt and a test of the declaration. No build calls it and it refuses nothing. docs/us-target-nesting.md describes the operator, the allocators, the four mechanisms, the receipts, the inventory and what Stage A leaves open. Proof: test_us_cross_grain_coverage.py checks each entry, that rows 1 to 8 each have one entry and each mechanism has one, and each kind of gap on synthetic specs. With the pinned feed it compiles the registry: no violation, and the families below the national level are exactly the ones the compiled entries name. The inventory does not move the US pins (both --check modes pass). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tracts main moved 93 commits (to 5589fae). None touches cross_grain.py, the three local tool files or fiscal_targets.py. Two generated pin files conflicted: the F0 coverage evidence and the pool tool's spec_sha256 pin. Both took main's side and were written again by the pin tools on the merged tree (tools/repin_us_spec_engine_contracts.py, tools/spec_engine_coverage.py: two passes each, then --check). Coverage reads 42,407/42,407 fields and 41/41 inventory checks; the US bundle's semantic spec_sha256 is now 7ef87297. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs/us-target-nesting-rule-design.md is the design step of Stage B of microcosm#1760. It is a proposal: no code reads it and no target changes. It records the two rulings so far, the second from 27 Nov 2026 (the Historic Table 2 state row is the state parent of a district row on every surface, and a parent that it does not contain is not removed). It then proposes one rule in nine statements, shows what each family does today with the sum of its lower rows over its higher row on the pinned feed, and lists nine decisions, each with a recommendation: the level holder, national to state for the SOI families, the program families, the state population vintage, the county households, bounds and members, the ACS district rows, the parent in the loss, and one allocator, key set and receipt. docs/us-target-nesting.md points to it and notes the 27 Nov ruling. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… constructs docs/us-target-nesting-rule-design.md: the nine decisions of the nesting rule were accepted on 27 Nov 2026 (the recommended option of each). The page now says so, and gains a section on how the rulings are declared. The principle of that section: the US declares its nesting with the constructs that the UK declares in uk/cross_grain_declarations.json, under the same key names (exact signatures, bridges, bridges with a derived control, partitions, relations, local routes, licensed empty legs, the cross_grain_* metadata keys and the pass receipt). The section maps each ruling to one of them, gives sketches, and lists the four additions that the shared tooling needs, each optional and beside the operator: bridge families, two kinds of derived control, a bound around a common factor, and a US contract derived from declared metadata fields. It also says what the US-only keys of Stage A (mechanisms, inventory) become at the re-pin. Docs only. No code applies the rulings yet; the target changes wait for the feed re-pin. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ruled on 27 Nov 2026: clean country-agnostic code comes first, the simpler and the more general the better, with no construct for one country only, and a UK re-key is accepted for it. So section 5 of docs/us-target-nesting-rule-design.md no longer adds US parts beside the operator. It states one model for every country in the shared operator, in six things: the measurement, the bridge (by id or by a selector), the derived control (sum or scaled), the bound (limits around a reference, and refuse or unbind), the members of a leg, and the pairs that are not reconciled. It lists what goes: the allocator hook and the three allocators at the re-pin, the US-only keys and checks, the sibling-ratio bridge, the US metadata keys and receipts, and the four separate passes. It maps each ruling to the model and gives three steps. Docs only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…erator
Three things that each country did in its own code are now parts of the
shared cross-grain operator (microcosm#1760, design section 5), each off by
default:
- The bound of a bridge. CrossGrainBridge gains min_factor_shift (a
one-sided bound), shift_around ("one", or "median" for the median factor
across the legs of the bridge, which takes out a gap that every leg
shares) and out_of_bound ("refuse", or "unbind": the leg's lower rows stay
as given and the receipt names them, so the caller takes them off its
surface). The US band of 1.25 around the median is a shift from -0.20 to
+0.25 around "median" with "unbind".
- The members of a leg. apply_cross_grain_reconciliation takes
expected_members (lower target -> leg -> geographies) and refuses a leg
that holds other rows than those. A leg with no row stays with the
empty-leg licences.
- The bridge selector. CrossGrainBridgeSelector and expand_bridge_selectors
make one bridge for each pair of targets from one declared entry, and name
the lower targets that no higher target pairs with.
The UK declares none of these. Its outputs are the same: the bit-for-bit
test still holds the default path to the operator at e29843d on 400 seeded
surfaces (values, receipts, refusal texts), and a receipt gains the
unbound_legs key only when a bridge of its rule unbinds. The UK graph hashes
this file, so the UK target nodes and the nodes after them compute again.
Proof: test_cross_grain_model.py (20 tests); the pinned list of changed
definitions in test_cross_grain_allocator.py; the operator tests and the 17
UK test files that use the operator pass unchanged (787 passed, 7 skipped).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s as frames CI's engine-free job failed on the Stage A head in test_runtime_population_operators_are_source_spine_blind. The check treats a function parameter with no annotation as a possible frame, and refuses a subscript on it whose key it cannot resolve. us_runtime/target_nesting.py had nine: two lambdas over a block key, and the county populations and county values of the two county functions, which came from the tool with no annotations. The two county functions now annotate their parameters, and the block key is read by a named function. No behavior changes. The whole test file passes. I had run one test of that file locally, not the file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…row in the operator Two general changes to the shared cross-grain operator, for step 2 of microcosm#1760 (the US on the model). The UK declares neither. - expected_members reads every declared leg, with or without rows. A leg whose members were all absent was left to the empty-leg licences. So a target with no row at all formed no group, and the pass left its totals as they were without a word. Such a leg is now refused like a leg that lacks one member. A leg that declares no member holds no row, and the licences still decide it. - The metadata of a reconciled row is in the operator: the UK's key names (cross_grain_value_before, cross_grain_factor, cross_grain_control), two new general keys (cross_grain_parent, the name of the control row, and cross_grain_members, the geographies a row stands for), and cross_grain_metadata, which writes them in a fixed order. A country takes the names from one place. No UK code changes. The default path is the operator before any edit, bit for bit (test_cross_grain_allocator.py, 400 seeded surfaces; its pinned list of added definitions gains cross_grain_metadata). The UK graph hashes this file, so UK target nodes compute again on the next UK run, with the same outputs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…'s keys and receipts Step 2 of microcosm#1760 (docs/us-target-nesting-rule-design.md, section 5.5), on María's go of 27 Nov 2026. No target value changes: on the pinned feed and ladder each of the 26,272 rows of the state_cd SOI surface has the bits of the value it had, and the full, state and totals surfaces have the bytes they had. What is general now, and where: - cross_grain_controls holds one row-level pass, reconcile_rows: it runs the operator on target rows and says, for each row, its value, what reconciled it, the factor, and the control row. The helpers that only the US used (factor band, completeness, self-consistency, sibling ratio) are gone: the operator's bound, members and selectors do that work. - us/cross_grain_declarations.json is in the UK's key names: bridge_selectors (Historic Table 2 state rows over district-file rows, with the bound +0.25 / -0.20 around the median and unbind; state SOI rows over county-file rows), derived_controls (county households), same_measurement (the ladder population), relations (six subset pairs, Medicaid with max_excess), local_routes, members, registers. What goes at the feed re-pin is under until_the_feed_repin: the allocators, the level bridges of the six district-only concepts, the compile rules of rows 1 to 4 and two known gaps. The keys mechanisms and inventory are gone. - us_runtime/target_nesting.py runs each of the four passes through one function, run_pass. What changes by design: - Metadata keys: cross_grain_parent, cross_grain_value_before, cross_grain_factor, cross_grain_control and cross_grain_members replace the state_cd_* and state_county_* keys. Six old keys have no new one: the parent row, the operator's receipt or the declaration holds the value. - Receipts: the district receipt has bridge (with the unbound legs), level_bridge_out_of_band and factor_by_measure. factor_band, rebase_factor_by_measure and internal_consistency are gone. County blocks lose share_sum. target_nesting.json entries are pass, allocator and the operator's receipt. - So three pins of state_cd move (registry, roles, receipts). The target count and the population matrix are the same. - A refusal that the operator makes has the operator's text. - The check that the district file's own state row is the sum of its district rows is gone. Row 4 of the compile scales the district rows to that state row before this pass (22,236 district rows carry its marker on the pinned feed; the 436 that do not are never bound). - A concept that takes its state parent from Historic Table 2 in some states and from the district file in others is refused. It does not occur on the pinned feed. - With the bound turned off (tests only), a concept whose Historic Table 2 level is zero in every state keeps district rows of zero. The readers of the keys move with them: the loss weights, the hold-outs and their pro-rata baselines, the county reports, and one field of the reviewed limitations. The dated runs under experiments/ are not changed. Proof: test_us_target_nesting_district.py and test_us_target_nesting_county.py hold the tool functions to verbatim copies of the code they replace (160 and 120 seeded inputs, and the pinned feed): the same rows in the same order, the same value bits, the same parent, factor, value before and members under the new keys, the same counts, drops and summaries. Both US pin tools ran and wrote no file; --check passes. PR #1755 declares the old parent keys in us/local_target_construction.json and pins the state_cd registry bytes. The PR that merges second takes the other's change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs/us-target-nesting.md is the page of the code as it is after step 2 of microcosm#1760: the six things of the model, the four passes, what the operator checks and what the adapter checks, what stays until the feed re-pin, the metadata keys with the keys they replace, and each difference from the code before. The SOI surface page and the county page name the new keys and receipt fields. The design page records that steps 1 and 2 are on the branch and which two parts of the model are not built yet (the scaled derived control, and one pass on one joint surface). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ruled on 27 Nov 2026, after steps 1 and 2 of microcosm#1760 were written: no allocator after the re-pin; one parent source for a concept; the district file's self-consistency check stays out; the county rows are compared and pinned on the pinned county facts file now; the merge waits for a gap between UK releases; PR #1755 merges first; the rulings go on the issue after the text is approved; Medicaid stays a subset with a declared excess; the full surface and district capital gains nest in the Historic Table 2 state row at step 3; decisions 4 and 7 go in their own PRs. Docs only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…pin them Call 4 of the rulings of 27 Nov 2026 on microcosm#1760: the county rows are compared and pinned on the real inputs now, not at the feed re-pin. test_us_target_nesting_county.py gains two tests that read the pinned feed, the pinned PUMA ladder and the pinned county facts file (us/chronicle_county_facts.json, 922 MB, sha256 67b0998a...). They run when MICROCOSM_US_CHRONICLE_FACTS, MICROCOSM_US_PUMA_LADDER_ARTIFACT and the new MICROCOSM_US_CHRONICLE_COUNTY_FACTS name those files, and skip without them. - The three county passes give the rows of the code before the move to the shared operator, in the same order, with the same value bits, parent, value before and members: 3,143 county populations on 2020 counties and 3,144 on the 2023 county-equivalents, 6,286 county SOI rows (two measures for 3,143 cells; one cell stands for Kalawao and Maui), and 51 state and 3,144 county household rows. - The bytes of those rows and of their receipts are pinned. Measured on the same inputs, for decision 6: the factor of each of the 51 county SOI legs is within 0.998 to 1.052 of the median for adjusted gross income (median 1.1207) and within 0.9997 to 1.0005 for the return count (median 1.0000). No leg is outside the band of 0.8 to 1.25 that the district bridge declares. The pages record it. Whether the county bridge declares the band is still to rule. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ruled on 27 Nov 2026 (microcosm#1760, decision 6), after the county factors were measured on the pinned county facts: the county bridge declares the band of the district bridge. No county value changes. - us/cross_grain_declarations.json: the selector state_soi_vs_county_file takes max_factor_shift 0.25, min_factor_shift -0.2, shift_around median and out_of_bound unbind. - us_runtime/target_nesting.py: the county pass handles a leg that the operator unbinds. Its county rows of that measure leave the surface, the receipt names the leg under bridge.unbound, and its counties do not count as missing. One helper gives both passes their selector, and one gives each surface receipt the same bridge entry (the bridge, its bound, the legs it unbound), the households receipt too. - tools/us_acs_local_county_surface.py: state_county_soi_surface takes factor_band, as state_cd_soi_surface does. The default is the declared band, and an infinite band turns the bound off (tests with random factors use that). On the pinned county facts the factor of each of the 51 legs is within 0.998 to 1.052 of the median for adjusted gross income and 0.9997 to 1.0005 for the return count, so no leg is unbound: the 6,286 county SOI rows keep their pinned bytes. The two receipt pins of the county rows move, because the receipt names its bridge in the new shape. The state_cd pins do not move. Tests: a state that is off the median loses its county rows of that measure and the receipt names it; a state off in both measures is not refused; the old-against-new comparison on random blocks runs with the bound off, because the old code had none. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…with the old copy From the adversarial review of PR #1791 (microcosm#1760), findings 2, 8 and 9. - The members check of the operator counted each member once, so a row that appeared two times passed. The old US district code refused that. The rule is now one public function, assert_leg_members: a leg holds each declared member one time; a member that is absent, a row of another area, and a member that two rows hold are refused. A caller that takes a leg off its surface before a pass checks it with the same function. The UK passes no expected_members, so no UK call reaches this. - reconcile_rows named a wrong factor, or no status, in two shapes that the operator accepts: a row under two controls (a bridge and a control of its own measurement), and a leg id that holds "+". It refuses both. No US pass reaches either. - The bit-for-bit test had one shape of surface. Two tests add the others: seeded surfaces with a bridge that is valued for each geography (200 seeds: 241 results and 159 refusals, all equal to the copy of the file at e29843d), and a replay of the operator's own tests (test_cross_grain.py) in which each call also runs that copy: 59 reconciliation calls, 6 partition calls and 4 detection calls, with bounded bridges, rows that bind nothing, reviewed unbound targets, licensed empty legs and unchecked bounds. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…its coverage check From the adversarial review of PR #1791 (microcosm#1760), findings 1, 6, 10 and 11. The district pass: - A block whose level bridge is distrusted leaves the surface before the pass, so the operator never saw it, and a block that lacked a district was dropped in silence. The old code refused it. The adapter now checks such a block with the operator's rule (assert_leg_members). With the operator change before this commit, a district row that appears two times is refused again too. - A district-file target that the selector pairs with no Historic Table 2 target, and that no state row of its own measurement controls, is refused. The pass threw that list away. - The trust band of a level bridge reads both limits of the declared bound. It read the upper one and took its inverse. The declaration: - An unknown top-level key, a bridge by id and a partition are refused when the file loads: no US pass would read them. - The part of a subset relation must be at a lower level than its whole. - The higher level of a compile rule or a known gap must be a declared level. The derivation of a derived control is read by the adapter, which hard-coded the sum. - single_member_legs goes: nothing read it. The coverage check: - A role that the top level and a lower level both hold must be named: by a relation of its own, or by a compile rule or a known gap that lists it. A family was covered as a whole, so a new role in a covered family passed unseen. On the pinned feed ten roles are at two levels. Six had a relation. The two premium tax credit roles of Historic Table 2 get a subset relation (their 51 state rows sum to 0.9996 and 0.9997 of the US row). The general SOI role and the Census age rows are listed by the two known gaps that are about them. - A subset whose whole is more than one row, or is not positive, is a violation. It was skipped in silence. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r code wrote From the adversarial review of PR #1791 (microcosm#1760), finding 4, on María's go of 27 Nov 2026 ("Fix all"). A run that is resumed across the change of the metadata keys reads files of older code. The run identity holds no code hash, so nothing stopped it: calibrate failed with a text about concept groups, finalize wrote an empty value in one reviewed limitation, and a county report could lose the SOI evidence of the county that a combined cell covers. - The checkpoint loader refuses a target_registry.json or a target_roles.json that holds a key with the prefix state_cd_ or state_county_. - The finalize stage refuses a district receipt in materialize_rss.json that holds rebase_factor_by_measure, factor_band or internal_consistency. Each refusal says that the file was materialized by older code and to run --stage materialize again. No key of this code has one of the two prefixes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
From the adversarial review of PR #1791 (microcosm#1760), findings 3, 5, 7, 10 and 11. - Two sentences from Stage A said that every metadata key and receipt, and the bytes of the surface, were as before. Step 2 made them untrue. - docs/us-target-nesting.md: what the removed self-consistency check leaves open for the six concepts that only the district file has; the two refusals that were lost and are back; a band of 2.0 or more is refused; the guard for a run resumed across the change; which proofs run in CI and which only where the pinned inputs are; what the coverage check proves and what it does not; that the pairs that are not reconciled are read by the coverage check only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tten again main moved 114 commits past the last merge (5589fae), and the PR conflicted, so no CI check ran on it. Two generated files conflicted, the same two as at the first merge: docs/evidence/spec-engine/us-f0-coverage.json and test_us_multispine_pool_tool.py. main's side was taken for both, and the US pin tools then wrote them for the merged tree (legacy, twice, coverage twice); both --check pass. main touches none of the nesting files: not the operator, not cross_grain_controls, not the US declaration, its reader or the adapter, not the two local surface tools. Its change to tools/build_us_acs_local_release.py (household batch helpers) merged with no conflict. The merged tree holds no reader of the retired metadata keys. The environment needs the lock file of main: microcosm-emitter-interface 0.18.0 (uv sync, from the local cache). Not run on the merged tree here: the tests. A build of another session filled the machine's memory, and the test run was stopped. ruff, the CI test plan check and both pin checks pass. CI runs the suites; the tests on the pinned inputs still need a run on this machine. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the refusal CI runs the property tests with a fixed seed. On that seed, this test drew a district block of 2.0 under a Historic Table 2 state row of 2,000,000,001, with the bound turned off. The operator refuses a lower total that is below 1e-9 of its control, by design. So the two engine-free jobs failed on this test on each run. A local run draws a random seed, and passed. The test now draws values from 1 to 1e8, so no block is below the limit. The case that CI drew is now a fixed case of the refusal test. Only the test file changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tten again main is 319 commits ahead, with the geography-first move of microcosm#931 (PR #1538). Six files conflicted, each a generated pin or a count of the spec-engine ledger. Each takes main's side, plus the three declaration fields that this branch adds (one resource row of the US manifest): 32,641 authored fields and 50,845 configuration fields. Both pin tools ran, and both --check pass. main changed the shared operator for #931: a share_of_parent partition may miss a member that a signed deferral leaves off the frame. So the reference copy of the bit-for-bit test is now main's file at dc77fa3 (it was the file at e29843d). The sets of definitions that this branch changed or added are the same, and the operator tests pass against the new copy. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR #1755 is on main now. It moves the US target selection, hold-outs, ladder rows and compile registers into declared files. Ten files conflicted: - six generated pins and counts of the spec-engine ledger. Each takes main's side, plus the three fields of the one manifest row that this branch adds: 32,814 authored fields, 51,018 configuration fields, country manifest 125 pointers. Both pin tools ran, and both --check pass. - the hold-out and baseline code of the two local tools: main's side (the shared target_holdouts code). Its declaration us/local_target_construction.json and the frozen reference copy of the old tool code now name the parent key cross_grain_parent at both levels, as the tool code before #1755 read it on this branch. The hold-out equivalence test sets that key on its records. - the module list of the spine blindness test: both lines. - the surface-bytes test: one docstring for both changes, and this branch's three state_cd pins. The merged code gives those bytes again, so #1755's moves change no byte here. test_us_target_sets.py pins the state_cd registry version that main makes with the state_cd_* keys; it takes this branch's version (the count and every value are as before). An import that the merge left unused goes. The shared cross-grain operator is the same file on main, so the bit-for-bit reference stays. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PolicyEngine/chronicle#451 merged as 13294b93 (28 Nov 2026). The US feed and the county facts move there together (microcosm#1760, step 3). The feed (tools/build_us_chronicle_feed.py, built offline from a clean checkout; 62,268 rows on the chronicle.consumer_fact.v5 contract, sha256 2e880fd3...). The scope keeps today's record sets and tax years: nine record sets now carry their true tax year (chronicle#117) and take it, the JCT tax expenditures for 2024 are the fiscal-year record set, and the TY2023 copy of the W-2 tips table goes because its TY2020 pair is in the scope (705 pairs). The county facts built at 13294b93 have the bytes of the 3e9d3a0 build, so only their commit and scope digest move. The parity resources follow the feed: 32 compiled families, 64 reviewed exclusions. What the compile needs on this feed: - District of Columbia: Chronicle numbers its seat 98 (1198), as the Census Bureau does; the district translation reads a seat 98 at seat 00. - Taxable interest by AGI band: the TY2023 state package carries it now, and no TY2023 national Historic Table 2 row is in the scope, so the stale interest rebase would drop those rows after they displaced the TY2022 rows. Such a slice no longer takes part in the newest-vintage selection (eligibility is part of selection), so the TY2022 rows stay and the six reviewed Iowa/North Dakota/Vermont exclusions need no change. - Measure ids: qbi_amount/qbi_claims (Historic Table 2's ids of the QBI deduction) map to the QBI variable; interest_paid_deduction_* is mortgage_interest_paid_* now (column A19300/N19300), with the same variable. - A new register, deferred_district_measures: twelve district measures that would be new targets (CTC, real estate taxes, taxable income, wages, and SALT and PTC, which read the right IRS column now). They are bound in microcosm#1731, not here. - The restamp register is empty: no fact of the feed is restamped. - District capital gains: the district file has no US row now, so its share denominator is the sum of its district rows of the same key. - The 44 JCT references take the fy2024 ids; the target names change, the values do not. The national_state surface keeps its 810 state taxable-interest band rows and gains the Historic Table 2 state rows of charitable contributions, mortgage interest and the QBI deduction (306), the Historic Table 2 US QBI rows and eight Table 1.4 partnership and S corporation rows. The state SSI targets take SSA's own workbook values (the pinned file's states summed to more than its own US row). The state_cd surface still refuses at this commit: its pairing and parents change in the next commit. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CI on 75cb18c was red, and a local run of the whole engine-free job found the rest (CI stops at the first failure). - test_the_committed_feed_pin_banks_the_anchor follows committed re-pin reports from the feed that added the three BEA facts of the ESI employer premium anchor (NIPA Table 7.8, series B4923C) to the pinned feed. The re-pin to Chronicle 13294b93 drops and changes rows, so it needs its own check: experiments/us-feed-13294b93/anchor_rows.json lists the three rows of the feed before and after it (list_anchor_rows.py), and _follow_row_changing_repin_report holds both sides to the banked rows: same period, value and source file. The three facts are unchanged. - test_every_chunk_and_batch_size_gives_the_one_chunk_target_matrix (from main, engine-us) built its district rows with state_cd_parent_target_name. The tool reads the operator's key, cross_grain_parent, so the per-chunk parent check saw no block. The fixture names the parent with PARENT_KEY. It failed since the merge of main at dc77fa3. - test_the_release_s_recorded_post_export_outputs_are_unchanged (from main) pins a hash of the reform validation output. The JCT tax expenditures have their fiscal-year ids since the re-pin (fy2024, cy2024 before), and the stand-in reform's effect is a function of its id, so the pin moves. - test__load_ledger_target_specs__compiles_the_pinned_feed (feed-gated) looked for the district file's wv_total row, which the feed no longer has. It now holds West Virginia's district rows to the two districts of the current plan, and the state row to Historic Table 2's. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The adversarial review of #1755 (30 Nov 2026) left one important finding and six smaller ones. None was changed before its merge. 1 (text). The UK national line keys its targets, problem and gates on the bytes of every UK resource, so a reworded rationale of the declared target sets makes it compute again. docs/uk-target-sets.md, the #1759 changelog entry and test_uk_solve_scope.py said that it re-keys no solve node. They now name the full line, and the national kernels as out of the test's scope. The root cause is not changed here. 2. docs/us-target-sets.md: a reworded rationale moves documentation_sha256 in the US coverage evidence; the page said that it moves no pin. 3. A metadata test compares with one scalar. The schema of the typed resource and the shared reader refuse a list or an object as the value of equals or not_equals: one with no member is absent from the canonical content, so the test changed a selection and no hash. 4. exclude and left_out_levels take the set order: their order means nothing to a selection. The US spec_sha256 and documentation_sha256 move one time (pins written again); the UK content hash does not move. The same entry two times in left_out_levels is refused by the spec engine before the reader. The page names the five fields that are normative though no selection reads them. 5. The UK page and the prose of uk/spec/target_sets.yaml described the BRMA row filter and the frs_brma stage that #931 retired. Only description and rationale text changes in the UK file: its content hash and the UK solve fingerprint are the same (test_uk_solve_scope.py, test_uk_graph.py pass with no change of a pinned value); the byte fingerprint moves, so the UK national line computes again one time. 6. The level check of the compile reads compiled targets only. The US ladder population levels (us/local_target_construction.json) are now held to the level rule and to the built rows of the declared target sets when the file loads (require_declared_built_levels). It reads the two packaged declarations only. 7. Four #1728 changelog entries lose their US field counts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ion 2) Fourteen SOI quantities bound a Historic Table 2 US row (tax year 2022) beside a newer Publication 1304 row (tax year 2023): no weight vector meets both (microcosm#1243). Decision 2 of microcosm#1760 (ruled 27 Nov 2026): the newer row is the national control, each state row keeps its share of the US total of its own file, and the Historic Table 2 US row stops binding. - The shared arithmetic: cross_grain_controls.scaled_control, a derived control that is a value times the lower rows' share of their own source's total. The operator divides it, so each lower row takes one factor and the lower rows are not scaled to sum to the value. - The declaration: one derived control of the kind scaled in us/cross_grain_declarations.json, with an entry for each of the 14 pairs (the measure of the state rows, the table and the measure of the control, the publisher concept and the evidence of the concept match). The known gap of microcosm#1243 goes. - The pass: fiscal_targets._nest_soi_state_rows_in_newer_national_controls, in the compile after rows 1 and 2 and before the state AGI bands, on target_nesting.national_share_surface. A state is a control level too, so each state is a leg of its own and the country covers them all. A state row lands at the control's period (uprating_to_period) and ages from there with its control. The compile refuses a pair with two controls or two own totals, with state rows of two periods, with a row that another rule rebased, or whose rows do not bind one quantity under the declared publisher concept (ledger_source_concept). - What follows a state row: the state AGI bands (the band rule reads the period that a rebased total is at), the district rows and the county rows (the county pass pairs by the tax year of the state row's own data). A district-file row of a paired measure takes the same factor in the compile, so its relation to its state row, and the factors and the bound of the district bridge, stay as they were. - A reconciled state row carries the operator's keys; its cross_grain_parent is the national control. - The US compile now imports the operator, its row-level pass, the US declaration reader and the US adapter. The implementation hash of the gate battery covers every module that its bindings reach by an import statement, and that closure holds the US compile, so it grows by these four modules (243 to 247). test_transport_evidence_kernels.py lists them. The gate battery computes again on the next UK run, as it does after any edit of the US compile; its outputs do not change. The concept check of the 14 pairs, on pinned data: the two rows of each pair carry one publisher concept and one return universe, and in tax year 2022 the Historic Table 2 US row is 0.974 to 1.009 of the other table's row (twelve from the feed; the two Table 1.2 pairs from the IRS file as Chronicle pins it at 13294b93). On the pinned feed: 714 state rows take a factor of 0.986 to 1.156 on the published values (an amount moves by 0.978 to 1.122 at the build year); 15 national rows stop binding (14 Historic Table 2 US rows and the state_2022 copy of the US return count); the compile goes from 28,116 to 28,101 targets and national_state from 6,316 to 6,301; the local surfaces keep their counts and move in value. The pins are measured again. The US F0 pin tools ran and moved no pin. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- docs/us-target-nesting.md: a section on the national-to-state pass (the rule, where it runs, what follows a state row, the keys, the guard, and the table of the 14 pairs with their factors and concept checks); what the joint surface needs before it can be built; what the gate battery's implementation hash covers since decision 2. - docs/us-target-nesting-rule-design.md: the status of 1 Dec 2026, with the two choices of the build that are open to a ruling. - docs/us-target-sets.md: the counts and registry versions after the pass. - docs/us-chronicle-feed-repin.md, docs/us-acs-local-soi-target-surface.md: one paragraph each. - changelog.d: an entry for the pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A second adversarial review read the branch at 30b22ee. These are its items on the national-to-state pass of decision 2. No pinned value moves. - A state that one pair lacks no longer stops the compile. The pass ran all pairs in one operator call, where the country covered the states of every pair, so a pair with a state less was refused as an empty leg. Each pair is now a pass of its own (target_nesting.national_share_surface). - A district-file row of a paired measure takes the factor only when it is of the state rows' tax year and binds their quantity; the compile refuses it otherwise. A follower is matched by its measure id, as the district bridge matches it, and the declaration says so. - The pass no longer skips in silence where a conflict would stay. With the newer row beside state rows, it refuses when the US total of the state rows' own file is missing or of another tax year. With the newer row, the US total and no state row, the US total stops binding. - The pass records what it did where a stage keeps the nesting receipts (target_nesting.record_pass_receipt): the factor of each pair, the district rows that followed, the rows that stopped binding and the pairs it left, with the reason. - The guards are as strict as the page says: each row of a pair must carry the declared publisher concept (a row with none is refused), the control and the US total must be of one sign and not zero, and a derivation that cannot run names its quantity. - Two behaviours had tests on the pinned feed only, which CI does not have. They now have tests on small inputs: the pass in the whole compile, with a state band and aging (it fails when the pass is removed or runs after the bands), and a county block under a state row that took a newer national level. The pages: the target-sets page gave the state-row counts of the old pin (4,431, 5,860 and 4,635 state rows and 441 country rows now); the county bridge medians are 1.1246 and 1.0059 since decision 2; the list of pinned-input test files has nine files; the joint surface is a follow-up PR (ruled 1 Dec 2026). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main has the renewal of the UK register expiries (microcosm#1834). Without it the engine-free job stops at the UK adjudication notice test on every branch from 1 Dec 2026. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…1760) The feed re-pin to Chronicle 13294b93 brought in the 102 Historic Table 2 state rows of the charitable deduction (tax year 2022). The only national row of that quantity is Publication 1304 Table 2.1, for tax year 2023, and both bind one model column. At the build year 2024 the 51 states sum to 1.069 of the national row for the amount and to 1.028 for the returns, so no weight vector meets them together. The national-to-state pass cannot give the state rows the national level: the feed holds no Historic Table 2 US row for this quantity, and the pass needs it for the shares. A second review of the branch found this (1 Dec 2026). Ruled on 1 Dec 2026: the repair goes in the follow-up of microcosm#1760 that makes the levels consistent, and the rows are held out until then. - us/cross_grain_declarations.json: a known gap can hold its rows out of the national solve (held_out_of_national_solve: a level, a record set family, measures). One gap does, for the charitable rows. A second gap records the SALT and real estate taxes deductions, which bind two national rows of two tax years as on main; every row of it binds. - us_runtime.fiscal_targets.us_target_is_held_out_known_gap is the test, and spec/target_sets.yaml excludes by it in national_state, beside the district classifier (predicate held_out_known_gap). - The national tool passes the predicate. Its selection receipt counts the held-out rows apart (held_out_known_gap_targets, only when there are any); dropped_congressional_district_targets counts district rows only, as before. On the pinned feed national_state goes from 6,301 to 6,199 targets. The compiled registry, the full mode and every local surface are unchanged: the state rows stay the parents of the district rows there, and no national row binds on a local surface. The US F0 pins move with the target-set file (one authored field more). The 8 Table 1.4 rows of partnership and S corporation net income and net loss, which the re-pin also brought in, are not held out. They sum to less than the Historic Table 2 combined row, and that is no conflict: a row binds the positive part of its variable on each return, so the four parts do not fix the combined quantity, and the combined target is inside the range that they allow. The page says so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Light pass, focused on the target changes, since an adversarial review and your rulings already cover the operator. Two requests and one view on the open decision.
1. Reconcile the compile change. full goes from 31,748 to 28,116 targets (−3,632). The description lists:
- +204 Historic Table 2 state rows, +2 national QBI rows and +8 Table 1.4 rows;
- 6,104 district rows deferred;
- 102 charitable rows held out of national mode.
Those don't add up to −3,632 on their own: 31,748 + 214 − 6,104 is 25,858, so about 2,250 rows are explained elsewhere. That's presumably the district file's changes (the state and US rows removed, the at-large areas, the 2022 tax year) and Row 4 retiring. A short table of the net change by source and reason, in docs/us-chronicle-feed-repin.md, would let a reviewer confirm that nothing dropped out by accident. "Target values change" PRs are where that matters most.
2. Check the effect on the build before merging. Since target values change, it's worth comparing the next national build's fit on the unchanged targets with the current build's. A big shift there would point to a nesting or rebase side effect rather than the new feed.
On the open decision: what mortgage_interest_paid_* binds. IRS A19300/N19300 is mortgage interest paid to financial institutions, before any limits. deductible_mortgage_interest is the amount after the TCJA acquisition-debt limit and the itemising choice, so it would sit below the target by construction. If policyengine-us has a pre-limit paid-interest input, binding to that matches the IRS concept better. If not, keeping these rows deferred, as you have, is safer than binding to the deductible amount.
The rest looks consistent with the rulings on #1760:
- every district row now nests in its Historic Table 2 state row on both modes;
- DC's seat 98 is mapped to 00;
- the SSA workbook replaces the state SSI file whose state rows summed to more than its US row;
- the 12 new district families are deferred to #1731.
Review drafted with AI assistance and checked against the code at f50fedd250702a9f98fd44afa55c46abf29c726f.
A review of the pull request asked how the release compile goes from 31,748 to 28,116 targets, because the listed changes do not add up to the difference by themselves. docs/us-chronicle-feed-repin.md now has the account, measured on two compiled registries at the build year 2024 (the code before the re-pin on the old feed, and this branch on the new feed): - the release compile by source and level: the district file's own state rows (-2,601) and US rows (-49), the two interest paid deduction measures of the district file (-872), the Historic Table 2 state rows that stood in for a district in nine areas (-324), and the new rows (+204, +2, +8); - why the 6,104 deferred district rows are not a removal of 6,104 rows: 5,232 of them are of twelve measures that the old feed did not hold; - the production national mode by id: 4,830 of its 6,102 old targets keep their value, 1,257 move (with the cause of each group), 112 are new and 15 are gone. The design page records the ruling of 1 Dec 2026 that the two build choices of decision 2 stand. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
anth-volk
left a comment
There was a problem hiding this comment.
Three minor fixes from a read of d6ce5d6c1, each with a suggested change. Two larger findings follow in a separate review.
Drafted with AI assistance (Claude) and checked against d6ce5d6c1.
anth-volk
left a comment
There was a problem hiding this comment.
Requesting changes for the two findings in the inline comments. Neither moves a value on the pinned feed, but each is a case the code expects (a docstring in one, an explicit branch in the other) and handles only in part, and neither shape has a test. Both come from how the compile passes are put together, so I'd rather fix them in the structure than patch each branch. Below is one possible implementation; another design that removes the same failure modes is fine.
Why these happened
The compile runs a series of passes over the target list in memory: taxable interest, capital gains, the new national-to-state pass, the AGI bands, the profile. Each pass builds its own grouping key from a family label parsed out of the record set id, and records what it did in metadata strings (uprating_factor, uprating_to_period, cross_grain_parent, soi_share_total_source_record_id) that later passes and readers interpret. This PR adds a pass and gives two of those strings new readers: the AGI-band controls now read uprating_to_period, and a state row's cross_grain_parent now names a national row.
- The first finding is a grouping error. The label
congressional_districtmerges district files of different boundary vintages. That was safe while the denominator was one published row per file, with a check that the files agree; a sum over the label is not. - The second is a branching error. The national-to-state pass has several outcomes for each pair (skipped, recorded as left as it is, refused, retired without scaling, scaled), and the scaling of district-file rows is attached to only one of them.
A possible implementation
1. Key facts on their source file. Parse each fact once, when the feed loads, into typed keys, and group on them in every pass:
@dataclass(frozen=True)
class SourceFile:
publisher: str # "irs_soi"
table: str # "congressional_district", "historic_table_2", "table_1_4", ...
tax_year: int
boundary_vintage: str | None # "117th_congress" for a district file
universe: str # "all_returns", ...
@dataclass(frozen=True)
class Quantity:
variable: str
measure_mode: str
filters: tuple[tuple[str, str], ...] # filing status, AGI class, itemizer, ...Where two files are meant to be read as one, a declaration says so; no parser merges them.
2. Give a denominator a type. It is either a published row or a sum built under checked conditions:
@dataclass(frozen=True)
class PublishedTotal:
fact_id: str
value: float
@dataclass(frozen=True)
class SumOfRows:
source: SourceFile # exactly one file
members: tuple[str, ...] # fact ids, checked complete against the file's district plan
value: float
def total_for(source: SourceFile, quantity: Quantity) -> PublishedTotal | SumOfRows:
"""Exactly one total for a file and a quantity, or an error."""SumOfRows cannot span two files and total_for cannot return two totals, which removes the first finding. soi_share_total_source_record_id can still name the sum's record set and member count, as it does now.
3. Record a target's adjustments as typed data. Keep them on the target, and write today's metadata keys from them only when the registry is saved, so the output bytes need not change:
@dataclass(frozen=True)
class Rescale:
rule: str # "national_soi_pairs", "capital_gains_shares", ...
factor: float
control: str # the control row's id
denominator: PublishedTotal | SumOfRows
to_period: str
@dataclass(frozen=True)
class Target:
key: tuple[SourceFile, Quantity, str] # file, quantity, geography
source_value: float
adjustments: tuple[Rescale, ...]
@property
def value(self) -> float: ... # source value x every factor
@property
def period(self) -> str: ... # the last adjustment's to_period, else the source yearThe AGI-band controls would read target.period instead of uprating_to_period, and "a row takes one control" becomes one check over adjustments instead of a check in each pass.
4. Plan, then apply. Each rule returns a list of operations, and one function applies every list:
Op = ScaleRows | StopBinding | Refuse
def national_soi_pairs(groups: QuantityGroups, pairs: Sequence[NationalSoiPair]) -> list[Op]:
ops: list[Op] = []
for pair in pairs:
group = groups.of(pair) # the control, the own-file total, state rows, district-file rows
match group.shape:
case Shape.NO_CONTROL:
continue
case Shape.NO_OWN_TOTAL:
ops.append(Refuse(pair, "the state rows have no US total of their own file"))
case Shape.CONTROL_AND_TOTAL:
factor = group.control.value / group.own_total.value
ops.append(StopBinding(group.own_total))
ops.append(ScaleRows(group.rows_below_control, factor, rule="national_soi_pairs"))
return opsrows_below_control holds the state rows and the district-file rows of the quantity together, so no branch can scale one and skip the other, which removes the second finding. A match over a small enumeration lets a type checker report a shape that has no case.
5. Check invariants after each pass, with one shared checker:
- a target's value equals its source value times its factors;
- each declared parent and its children add up within the declared tolerance;
- no two binding targets measure one
Quantityat one geography.
The last check finds the #1243 kind of conflict without a review, including the SALT, real estate taxes and charitable cases this PR declares as known gaps. Those would become exceptions in the declarations, each with its issue and an expiry date.
6. Test the shapes the code says it handles. Generate small feeds (Hypothesis) with two district files in one tax year, a US total with no state rows, a missing district, and district-file rows present or absent, and use the invariants above as the expected results. A tool that compares two compiled registries value by value and groups the differences by source file (the table in docs/us-chronicle-feed-repin.md) could then run on every re-pin.
Scope
Steps 1, 2 and 4 are enough for the two findings and could land in this PR, with the compiled registry on the pinned feed byte-identical before and after (compare the two registries). Steps 3, 5 and 6 could go in the follow-up of #1760 with the joint surface: with the national control, the state rows and the district rows in one declared hierarchy and one operator call, district-file rows are children of their state rows and need no separate follower step.
Drafted with AI assistance (Claude) and checked against d6ce5d6c1.
main was 108 commits ahead. Eight files conflicted, all of them pins that the US F0 pin tools write: the coverage evidence, the field counts, the seed map and seed protocol, the loader's golden vector, the multispine pool tool's spec digest and the coverage tool's digest. Each took main's side, kept the reason comments of both sides, and the pin tools then wrote the values of the merged tree (both pin checks pass). No other file conflicted; main does not touch the nesting code or the compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two findings on the structure of the compile passes, and three small fixes. None moves a value on the pinned feed: the compiled registry is byte-identical before and after (compared aged and unaged, with the district crosswalk, as the national tool compiles). - A share denominator of the capital-gains pass is one published national row (_SoiShareTotal) or the sum of one district file's rows (_SoiSumOfDistrictRows), and _SoiShareDenominators.total_for returns one or none. The sum is keyed by the file (its record set id without the period), not by the family label, so two district files of one tax year, such as two boundary vintages, no longer add into one sum. A sum holds each district one time, and, when the compile translates the district facts onto the current plan, each district of that plan (congressional_district_vintage.current_congressional_district_plan); otherwise the compile refuses (IncompleteSoiDistrictFileError). - The national-to-state pass plans each pair into one shape (_NationalSoiShape: absent, no control, control only, older control, scale), then applies the plans. A plan that scales names the state rows and the district-file rows together and applies them in one step, so the district-file rows of a pair with no state rows take the pair's factor (control over own total) instead of keeping their own year's level beside a retired US total. District-file rows under the newer row with no US total of their own file are refused, as state rows are. - The national tool's selection receipt counts held-out rows by the predicate itself and refuses a dropped row that neither exclusion names. - The county surface takes COUNTY_PREFIX from target_nesting, and the comment on the county population pass (and the county rung page) no longer describes the allocator that step 3 removed. Tests on small inputs for each shape: two district files of one tax year, a Hypothesis property over one to three files, a district counted twice or missing from the plan, every layout of a pair and its shape, a pair with district rows and no state rows, and a Hypothesis property over the layouts of a pair (control absent, older or newer; own total absent, of the rows' year or older; zero to three state and district rows). Both behaviours that the review found fail these tests when they are put back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Program reviewBase repository: PolicyEngine/microcosm Source Documents
CriticalC1 — Match published capital-gains totals by district file (OPEN)CRITICAL. With two same-tax-year district files, a published US total for file A prevents the code from constructing file B’s own denominator. A file B target then uses A’s published row and names it in its lineage. In a TY2022 compile with a 40-return Table 1.4 control, B’s district counts of 1 and 3 should produce targets of 10 and 30. Giving A a published US row of 10 produces 4 and 12 for B. This is the mixed published/summed case of the per-file support this PR adds. It also skips B’s complete-roster check. Key both published and computed district-file denominators by file, while retaining the distinct Historic Table 2 handling and making expected duplicates explicit. Head denominator selection. Declared share rule. I called the national release’s selector with the resulting registry. Its CLI-default C2 — Validate district source members before translating geography (OPEN)CRITICAL. The new membership check sees one row per destination district after the crosswalk has already merged input rows. A duplicated source cell is added to the legitimate cell, and a missing source district can be hidden when another source district has edges to every destination. With old-district counts of 2 and 3, a one-to-one crosswalk and a 40-return control, the expected output is 16 and 24. Repeating the first source cell with a distinct fact ID should raise, as the new guard promises. Instead the release’s The missing or duplicate source rows change district proportions. Rescaling a block to its state parent leaves those proportions in place. The reproduction constructs malformed inputs to test the explicit guard and establishes no effect on the pinned feed. Should AddressA1 — Read a one-shot district crosswalk once (OPEN)SHOULD ADDRESS. The compiler passes the same crosswalk object to translation and then to current-plan discovery. The translator expressly accepts an iterable of row mappings. For a one-shot iterator, the second read now reports all of the supplied columns as missing. I executed the preceding head’s compiler with the same iterator and verified it returns the 16 and 24 district targets. A list still compiles at this head. Prepare or materialize the crosswalk once and reuse the result. The national release’s normal file loader passes a DataFrame. Changed compile call. Translator input API. SuggestionsS1 — Remove stale residual-allocation claims (OPEN)SUGGESTION. The new county population declaration says the rounding residual goes to the largest county. The county rung guide also still promises exact closure through largest-residual rounding for ACS households. The shared operator now divides both controls proportionally and closure checks use tolerance, as the PR's nesting page explains. The older behavior in the new declaration can mislead downstream users reading the rule. Update the declaration and the ACS households paragraph together. This follows the already-resolved inline comment about the county population code comment. County population declaration · County rung guide · Operator rule · Prior thread S2 — Correct the mortgage-interest follow-up premise (OPEN)SUGGESTION. The 2 December review calls IRS A19300/N19300 pre-limit mortgage interest, and the PR's last open mortgage-interest bullet carries that interpretation forward. The TY2022 district guide maps both columns to Schedule A line 8a. The IRS instructions limit that line to deductible interest and points reported on Form 1098. A raw pre-limit Evidence Gaps
Notes
Validation SummaryFocused exact-head pytest passed 1,132 and skipped 34 in 178.34 seconds. Compiler and selector diagnostics reproduced three findings and confirmed the iterator was accepted by the preceding head. Source review independently corroborated all 42 values across the 14 Decision 2 pairs and checksum-verified 16 originals. At 12:38 UTC, exact-head lint, wheels, country selection, installed-emitter and integration-uk passed. The UK after-merge job was skipped as expected on this PR. GitHub Actions. Timingelapsed seconds: 554.51s; parallel review seconds: 410.00s; code role seconds: 401.00s; policy role seconds: 397.00s; consolidation cleanup seconds: 60.51s Review SeverityREQUEST_CHANGES. Open findings: 2 critical, 1 should address, 2 suggestions. |
The review of 562e220 (3 Dec 2026): two critical findings, one to address and two suggestions. No value moves on the pinned feed: the compiled registry has the same bytes, aged and unaged, with the district crosswalk. - C1: a capital-gains share denominator has a scope. A Historic Table 2 row's scope is the family; a district row's scope is its own file. The published US rows and the sums of district rows are both keyed by the scope, so a district file with no US row divides by its own sum, never by the US row of another file of the same tax year. - C2: the check of a sum reads the source rows that each translated row records in its lineage (congressional_district_vintage_sources): each source district of the crosswalk one time, then each district of the current plan one time. A source row given twice, or a missing one that other source districts hid after the crosswalk, refuses the compile. - A1: the compile reads the crosswalk into a frame one time (prepare_congressional_district_vintage_crosswalk) and gives it to the translation and to the plans (congressional_district_plans), so a one-shot iterable of rows works. - S1: the county population declaration and the ACS households paragraph of the county rung page describe the operator's proportional division. - S2 (the mortgage interest premise) is a correction to the PR text only. Tests: the review's cases with its numbers, the district-file property with a US row or none for each file, and the source districts of a translated row. Each new test of C1, C2 and A1 fails on 562e220. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All five findings of the program review of C1. Published totals by district file. A share denominator now has a scope. A Historic Table 2 row's scope is its family, because HT2 puts each state and the US in a record set of its own. A district row's scope is its own file (the record set id without the period). The published US rows and the sums of district rows are both keyed by the scope. So file B divides by its own sum (10 and 30 in your case), never by file A's US row, and B's sum gets its roster checks. The one duplicate that is expected, one total under two record ids of one scope, keeps the smaller id, as before. Two district files' US rows are no longer compared: each file divides by its own. Tests: your two-file case, and the Hypothesis property over one to three files, which now draws a US row or none for each file. C2. The source roster before the crosswalk. The translation records, in each translated row's lineage, the source rows that the crosswalk added into it, with the state-total proxies ( A1. A one-shot crosswalk. The compile reads the crosswalk into a frame one time ( S1. The county population declaration and the ACS households paragraph of the county rung page now describe the operator's division: proportional, with no rounding, and closed within the tolerance. S2. Agreed. The Schedule A instructions put on line 8a only the deductible part of the interest and points reported on Form 1098 when a limit applies, so A19300/N19300 is after the limits. In policyengine-us, Each of the five new tests of C1, C2 and A1 fails on the code of Evidence gaps. The national before/after comparison needs a build. Whether to run one before the merge is the PR owner's call, and the PR description records it. The merge, and the UK release window that gates it, are the owner's call too. 🤖 Addressed by Claude Code |
|
Thanks, Vahid. 1. The compile change. Done in 2. The effect on the build. Not done: it needs a national build, and none ran for this PR. The page gives what the comparison needs: on the production national mode, 4,830 of the 6,102 targets of the old surface keep their value. Whether to run it before the merge is María's call. The mortgage interest decision. The rows stay deferred, as you advise. One correction to the premise, from the program review of 3 Dec: the district file's guide maps A19300/N19300 to Schedule A line 8a, and the Schedule A instructions put on line 8a only the deductible part of the interest and points reported on Form 1098 when a limit applies. So the column is after the limits. |
Program reviewBase repository: PolicyEngine/microcosm Source Documents
CriticalC1 — Match published capital-gains totals by district file (RESOLVED)Published rows and computed sums now use the same file scope for district facts. The original crosswalk-enabled reproduction now gives 10 and 30 for file B and names its own two-district sum. File A still uses its published total and gives 8 and 12. Lookup and per-file sum. C2 — Validate district source members before translating geography (RESOLVED)The compiler checks the roster of source cells through translation lineage, in addition to the destination roster. It refuses a repeated original district and a missing original district whose target districts are filled by another source through a split crosswalk. The same diagnostic passed complete old-plan data with D.C. seat C3 — Resolve overlapping district files before binding the same calibration targets (OPEN)CRITICAL. Preserve file-local denominators, then choose one reviewed vintage for each overlapping district concept or reject the overlap in the compile. This commit now accepts two complete same-year district files whose published US totals differ. Its geographic target selection retains both translated rows for each district. In an ordinary TY2022 compile with two Hawaii districts, a 40-return control, and published totals of 10 and 20, the national release's default The exact preceding compiler rejected the conflicting national totals. The case that now passes is explicitly supported by the new file-scoped code and property test. The pinned feed has a single district file, so the example establishes a newly admitted re-pin failure. New scope for published totals. Default national target mode. National target materializer. ACS target selector. Should AddressA1 — Read a one-shot district crosswalk once (RESOLVED)The compiler materializes the rows before it passes the reusable frame to the translator and the plan reader. The original iterator and list both compile to the same target names and values, 16 and 24. Crosswalk preparation. A2 — Keep single-seat proxy detection inside each district file (OPEN)SHOULD ADDRESS. The crosswalk suppresses a state-total proxy once any file has a source district in the state. An old-style file B with Hawaii district rows of 1 and 3 and a D.C. state total of 4 compiles by itself using the three legitimate input cells, yielding 5, 15 and 20. Another file A's explicit D.C. district then suppresses B's proxy and B fails the new file-local source roster despite providing its state total. The prior head accepted the combined feed by using A's published denominator for B, which hid the proxy failure and produced the wrong numbers. If overlapping files stay supported through compilation, detect the absence of an explicit at-large district within the candidate file and quantity before filling a legacy state-total proxy. Resolving the overlap by selecting one source file before translation would also avoid cross-file suppression. Cross-file proxy detection. SuggestionsS1 — Remove stale residual-allocation claims (RESOLVED)RESOLVED. The county population declaration and the county household guide now describe proportional division and closure within tolerance. The examples retain their original populations, weights and units. County declaration. County household guide. S2 — Correct the mortgage-interest follow-up premise (RESOLVED)RESOLVED. The updated PR discussion explains that IRS A19300/N19300 refers to Schedule A line 8a, which reflects applicable deductibility limits and Form 1098 reporting. It distinguishes this measure from the raw Evidence Gaps
Notes
Validation SummaryThe exact-head focused test run passed 423, skipped 26 and reported zero failures. The implementation review independently repeated the prior and current compiler cases and exercised the national and ACS local selectors. The source review reconciled 436 source and 436 destination districts and both capital-gains totals, using 17 checked originals including 16 reused. CI lint, wheels, installed-emitter, select-countries and integration-uk passed at 14:12 UTC. Exact-head CI. Timingelapsed seconds: 448.54s; parallel review seconds: 323.00s; code role seconds: 323.00s; policy role seconds: 188.00s; consolidation cleanup seconds: 51.54s Review SeverityREQUEST_CHANGES. Open findings: 1 critical, 1 should address, 0 suggestions. |
The second program review of 6d744f9 (3 Dec 2026): one critical finding and one to address. No value moves on the pinned feed, which has one district file: the compiled registry has the same bytes, aged and unaged, with the district crosswalk. - C3: two district files that give district rows of one capital-gains quantity, such as two boundary vintages of one tax year or two tax years, would each bind the districts that they share. Latest-vintage selection keeps one period of each file, not one file. The compile now refuses them (OverlappingSoiDistrictFilesError) before the crosswalk. Each file's denominator stays its own, and one file at two tax years is one file. - A2: before the crosswalk, the district rows of one file could stop the state-total proxy of another, and that file then failed the check of its source districts with the wrong reason. The overlap refusal runs first, so the compile names the two files instead. Tests: the review's two cases (two files with US rows of 10 and 20; a file whose D.C. seat is a proxy beside a second file with an explicit D.C. seat), two files of two tax years, and one file at two tax years. The multi-file tests of the pass now run the pass on its own and check that the compile refuses. Both new tests fail on 6d744f9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three files conflicted, all of them pins that the US F0 pin tools write: us-f0-coverage.json, inventory_coverage.py and the multispine pool tool test. Each kept this branch's reason comments and took main's values; then the pin tools wrote the values of the merged tree, and both --check runs pass. main brings Belgium's method card rulings (#1856) and the pin of the Fed's SCF 2025 summary reissue (#1865). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The two open findings of the second program review, of C3. Overlapping district files. The compile now rejects the overlap, as the review proposes. Two district files that give district rows of one capital-gains quantity are refused before the crosswalk ( A2. Cross-file proxy suppression. The same refusal resolves it, by the review's second option. The overlap check runs before the translation, so in a compile that goes on, no second district file of the quantity can stop a file's state-total proxy. Your case (file B with Hawaii rows and a D.C. state total, beside file A with an explicit D.C. district) now refuses as two files of one quantity, not as a missing D.C. district. B alone compiles to 5, 15 and 20. The proxy rule itself is unchanged: it fills a seat only in a state with no SOI district row. A second district file that gives only other measures can still stop a proxy, and then the check of the source districts refuses the compile, so it does not pass silently. Both new tests fail on the code of Evidence gaps. The national fit comparison waits for the PR owner's decision: a comparison build before the merge, or a check of the first main build. The merge, and the UK release window that gates it, are the owner's call too. 🤖 Addressed by Claude Code |
Program reviewBase repository: PolicyEngine/microcosm Source Documents
CriticalC1 — Match published capital-gains totals by district file (RESOLVED)Published rows and computed sums now use the same file scope for district facts. The original crosswalk-enabled reproduction now gives 10 and 30 for file B and names its own two-district sum. File A still uses its published total and gives 8 and 12. Lookup and per-file sum. C2 — Validate district source members before translating geography (RESOLVED)The compiler checks the roster of source cells through translation lineage, in addition to the destination roster. It refuses a repeated original district and a missing original district whose target districts are filled by another source through a split crosswalk. The same diagnostic passed complete old-plan data with D.C. seat C3 — Resolve overlapping district files before binding the same calibration targets (STILL OPEN)CRITICAL. The guard rejects the original two-file repro before translation, but it only sees raw district rows. A legacy district file A with a D.C. state total of 6 and its own published US total of 10 can appear alongside file B with Hawaii district counts of 1 and 3 and a D.C. state total of 4. A has district-file record-set metadata and a published denominator, so it can bind outside a complete raw roster. The preflight only sees B's district records. Translation gathers eligible proxy shapes across the feed, then creates a D.C. district record for each file from its state total. The ordinary compiler and actual national Should AddressA1 — Read a one-shot district crosswalk once (RESOLVED)The compiler materializes the rows before it passes the reusable frame to the translator and the plan reader. The original iterator and list both compile to the same target names and values, 16 and 24. Crosswalk preparation. A2 — Keep single-seat proxy detection inside each district file (RESOLVED)The exact original same-quantity input now raises SuggestionsS1 — Remove stale residual-allocation claims (RESOLVED)RESOLVED. The county population declaration and the county household guide now describe proportional division and closure within tolerance. The examples retain their original populations, weights and units. County declaration. County household guide. S2 — Correct the mortgage-interest follow-up premise (RESOLVED)RESOLVED. The updated PR discussion explains that IRS A19300/N19300 refers to Schedule A line 8a, which reflects applicable deductibility limits and Form 1098 reporting. It distinguishes this measure from the raw Evidence Gaps
Notes
Validation SummaryExact-head focused tests passed 319, skipped 23 and reported zero failures. Ordinary compilation and the actual national full selector reproduced the remaining C3 path. Reused and checksum-verified 17 primary source originals and independently reconfirmed 436 source and 436 current districts and both IRS national totals. At 17:51 UTC the UK engine matrix, UK integration, lint, wheels, installed-emitter and country selection passed. The US and engine-free matrices were in progress. Exact-head CI. Timingelapsed seconds: 1157.05s; parallel review seconds: 1047.00s; code role seconds: 1047.00s; policy role seconds: 88.00s; consolidation cleanup seconds: 54.05s Review SeverityREQUEST_CHANGES. Open findings: 1 critical, 0 should address, 0 suggestions. |
The third program review of d6fed9b (3 Dec 2026) found that the refusal of overlapping district files read only raw district rows. A legacy district file with only a D.C. state total and its own US row still bound the D.C. district through the crosswalk's state-total fill, beside a second file: 24 and 20 on the full surface. A Historic Table 2 D.C. state total can take the same path. The fix is one general rule in place of the district-file checks. A new shared module, microcosm.build.ledger_cells, refuses a compiled registry in which the targets of one calibration cell give different values. A cell is one quantity (the Ledger concept, unit, entity, aggregation, period type, filters and universe) at one geography for one target period, whatever its source. The rule reads only the metadata that the shared Ledger compile writes, so a country declares nothing. The US compile runs it on the registry that it returns, after every pass. Targets of one cell with one value stay: Table 1.1 and Table 1.2 give the TY2023 national return count and AGI with equal values, and how often a cell enters the loss is a rule of the loss (microcosm#1729). - The round-2 refusal (OverlappingSoiDistrictFilesError) is deleted. - The crosswalk fills the seat of a one-seat state for each source of district rows that gives no row there, so the rows of one source no longer hide the gap of another. With one source, as on the pinned feeds, the fill is unchanged. - Tests: a shared property test of the rule with no country, and one property test of the district capital-gains surface that replaces nine tests of the earlier rounds and a vintage test. Each review case is a fixed example. - Old fixtures that gave one cell two values (a district file's own state or US row beside the Historic Table 2 row of the same cell, as before chronicle#451) now expect the refusal or compile one source at a time. Fixtures that left out what the feed uses to tell two quantities apart (a return universe, the SSA program dimension, the CBO series concept) now carry it. The compiled registry of the pinned feed has the same bytes, aged and unaged, with the district crosswalk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Program reviewBase repository: PolicyEngine/microcosm Source Documents
CriticalC1 — Match published capital-gains totals by district file (RESOLVED)Published rows and computed sums now use the same file scope for district facts. The original crosswalk-enabled reproduction now gives 10 and 30 for file B and names its own two-district sum. File A still uses its published total and gives 8 and 12. Lookup and per-file sum. C2 — Validate district source members before translating geography (RESOLVED)The compiler checks the roster of source cells through translation lineage, in addition to the destination roster. It refuses a repeated original district and a missing original district whose target districts are filled by another source through a split crosswalk. The same diagnostic passed complete old-plan data with D.C. seat C3 — Resolve overlapping district files before binding the same calibration targets (STILL OPEN)CRITICAL. The new final registry guard refuses both original feeds when they use identical filter metadata, including the state-only file whose conflicting D.C. target is created during translation. A supported equivalent all-income input still bypasses the guard. Give the second file the same two Hawaii district observations and published denominator as in the original counterexample, and omit only its C4 — Keep single-seat proxy gaps attached to their source (OPEN)CRITICAL. The translator records district presence per source and then merges the missing shapes by state across all sources. When one file has a D.C. district and another lacks it, the second file's gap can turn the first file's D.C. state total into an additional copy of its own district row. The derived fact retains the first file's record set, so the crosswalk sums the two contributions before the new ledger-cell check sees them. A published denominator also skips the computed-denominator roster check. I ran the exact-head translator, ordinary compiler and national builder's normal Should AddressA1 — Read a one-shot district crosswalk once (RESOLVED)The compiler materializes the rows before it passes the reusable frame to the translator and the plan reader. The original iterator and list both compile to the same target names and values, 16 and 24. Crosswalk preparation. A2 — Keep single-seat proxy detection inside each district file (RESOLVED)The original direct D.C. row no longer suppresses the other file's state-total proxy. With unequal values, the compile refuses their D.C. cell after translation. With the other file publishing only D.C. amounts, the legacy return source retains its Hawaii and D.C. targets of 5, 15 and 20 in the actual national selector. This disposition applies to the original blocked-proxy case. Proxy scope. A3 — Handle agreeing district duplicates before validating local nesting (OPEN)SHOULD ADDRESS. The compiler now accepts two district files that give the same dollar or return target. The selected local district surface still requires each geography to appear once in a nesting block. With two agreeing Hawaii district files and a Historic Table 2 Hawaii parent, the tested registry compiled successfully, but the actual ACS A4 — shared-1 — Preserve distinct Ledger universes when the hash is absent (OPEN)SHOULD ADDRESS. When a supported bare Ledger feed supplies its universe domain without an opaque universe hash, the new cell key loses a distinction the US materializer acts on. The normal JSONL loader read a synthetic TY2024 all-returns count of 80 and an EITC-returns count of 30. The exact preceding compiler returned both; their SOI materializer masks differed in the positive-EITC filter. The head now refuses the build as a single cell with conflicting values. Giving the rows separate universe hashes leads the head to accept both. The key fills the missing hash with an empty string and omits the recorded domain. Include the domain in the fallback for rows without the hash, or key model-population semantics directly. Vendored Chronicle v4 and v5 schemas require the universe hash, so the demonstrated regression concerns the older/bare diagnostic input contract, and no pinned-feed impact was established. Cell key. Ledger metadata. Materializer filter. Legacy/bare loader contract. SuggestionsS1 — Remove stale residual-allocation claims (RESOLVED)RESOLVED. The county population declaration and the county household guide now describe proportional division and closure within tolerance. The examples retain their original populations, weights and units. County declaration. County household guide. S2 — Correct the mortgage-interest follow-up premise (RESOLVED)RESOLVED. The updated PR discussion explains that IRS A19300/N19300 refers to Schedule A line 8a, which reflects applicable deductibility limits and Form 1098 reporting. It distinguishes this measure from the raw Evidence Gaps
Notes
Validation SummaryFocused exact-head US tests passed 310 with 23 pinned-feed skips. The exact-head shared property test passed. The broader shared suite was stopped before completion, so it supplies no full-run result. Executed ordinary compile and actual national and ACS selectors, including the original cases and alternatives. Executed exact prior/current legacy bare-file loader and compiler for the separate universe-key case. Seventeen source originals were verified and the pinned IRS roster and totals reproduced. At 23:43 UTC lint, select-countries, wheels, installed-emitter and UK integration passed. CI run. Timingelapsed seconds: 427.28s; parallel review seconds: 304.00s; code role seconds: 181.00s; policy role seconds: 137.00s; shared code role seconds: 289.00s; consolidation cleanup seconds: 54.28s Review SeverityREQUEST_CHANGES. Open findings: 2 critical, 2 should address, 0 suggestions. |
#1760) The fourth program review of ccdb915 (3 Dec 2026): two critical findings and two to address. - C4: a gap in one district file let the crosswalk fill the D.C. seat from another file's own state total, although that file gave the seat's row. The two rows of one record set added into one, so the seat counted twice: a D.C. district target of 40 beside a D.C. state target of 20. A state total now never fills the seat of a state where its own record set gives a district row. State targets do not change and still bind at their own level. - C3: the cell key read the raw filters, so a file that stated income_range=all and a file that left the dimension out were two cells (8 and 4 at HI-01). A filter whose value restricts nothing (all, or empty) is no longer part of a cell. - A3: two files of one value at a district compiled, and the local district nesting then refused the repeated member. The shared rule now gives each cell one target: two values refuse, and one value is one target, the one of the smallest fact id. Its metadata ledger_cell_also_given_by names the other facts. - A4: a fact with no universe key is keyed by its universe domain, so a bare feed keeps two universes apart. On the pinned feed the rule finds no cell of two values. Table 1.2 gives the TY2023 national return count and adjusted gross income with the values of Table 1.1, so those two cells keep the Table 1.1 targets: the compile has 28,099 targets (28,101 before), and national_state has 6,197 (6,199). The pins of test_us_target_sets.py, test_us_fiscal_target_registers.py and the fences test of test_us_fiscal_targets.py are measured again. The local surfaces do not move. Tests: the shared property test now draws filters of all or none and universes by key or by domain, and it checks which target stays. The district property test now draws a seat row and a state total in one file, and files that leave income_range out. The three cases of this review are fixed examples, and each one fails on ccdb915. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The fourth program review, of The rule. Since C4. Proxy gaps attached to their source. Your case reproduced: file B's gap let the crosswalk fill the D.C. seat from file A's own state total, and the crosswalk added that copy to A's own D.C. row. So A's D.C. district target was 40, beside its D.C. state target of 20. A state total now never fills the seat of a state where its own record set gives a district row. In your case A's D.C. target is 20 again, and B's Hawaii targets are 10 and 30. A source with a gap still takes the fill from the state total of a source that has no row there, as the A2 fix needs. State targets do not change, and they bind at their own level. C3. Equivalent unrestricted filters. Reproduced: with A3. Agreeing duplicates. Targets of one cell that give one value are now one target. The target of the smallest fact id stays, so feed order does not choose, and its metadata A4. Universes without a hash. A fact with no universe key is keyed by its universe domain. A bare-feed case like yours (national EITC return counts of 80 in all returns and 30 in returns with the credit, with domains and no hashes) refused as one cell on Tests. The two property tests of
Checks. 2,882 US and shared tests pass, and six are skipped (they need the US engine), with the three pinned inputs and CI's fixed seed. Both pin tools, 🤖 Addressed by Claude Code |
Program reviewBase repository: PolicyEngine/microcosm Source Documents
CriticalC1 — Match published capital-gains totals by district file (RESOLVED)Published rows and computed sums now use the same file scope for district facts. The original crosswalk-enabled reproduction now gives 10 and 30 for file B and names its own two-district sum. File A still uses its published total and gives 8 and 12. Lookup and per-file sum. C2 — Validate district source members before translating geography (RESOLVED)The compiler checks the roster of source cells through translation lineage, in addition to the destination roster. It refuses a repeated original district and a missing original district whose target districts are filled by another source through a split crosswalk. The same diagnostic passed complete old-plan data with D.C. seat C3 — Resolve overlapping district files before binding the same calibration targets (RESOLVED)The ordinary compiler now refuses the original Hawaii overlaps when one district file explicitly gives C4 — Keep single-seat proxy gaps attached to their source (RESOLVED)RESOLVED. The exact-head check independently reran the original two-file TY2022 setup through the translator, ordinary US compiler and national C5 — Keep an eligible state source when collapsing agreeing targets (OPEN)CRITICAL. The compiler collapses agreeing rows before the national solve chooses its target surface. If a district-file state row wins lexically over the equivalent Historic Table 2 row, C6 — Normalize equivalent filters before choosing the latest vintage (OPEN)CRITICAL. The changed district property test fails on the CI-style fixed Hypothesis seed. In two minimized cases, one district file reports its D.C. capital-gains amount as explicit all-income in TY2022 and as implicit all-income in TY2023. Its earlier vintage has one observed unit and a computed denominator of 1. Its newer vintage has the same observed units and a published denominator of 2 or 1. The latest-vintage selector keys raw fact dimensions and keeps both encodings. With denominator 2, the later normalized collision check raises, although the one latest eligible target should be 400 under the Table 1.4 control of 800. With denominator 1, agreement collapses to the older computed-denominator fact, despite the newer published source. Canonicalize those dimensions in the same-file selection key before comparing source periods. Source-period selection. Raw target identity. Should AddressA1 — Read a one-shot district crosswalk once (RESOLVED)The compiler materializes the rows before it passes the reusable frame to the translator and the plan reader. The original iterator and list both compile to the same target names and values, 16 and 24. Crosswalk preparation. A2 — Keep single-seat proxy detection inside each district file (RESOLVED)The original direct D.C. row no longer suppresses the other file's state-total proxy. With unequal values, the compile refuses their D.C. cell after translation. With the other file publishing only D.C. amounts, the legacy return source retains its Hawaii and D.C. targets of 5, 15 and 20 in the actual national selector. This disposition applies to the original blocked-proxy case. Proxy scope. A3 — Handle agreeing district duplicates before validating local nesting (STILL OPEN)SHOULD ADDRESS. The original agreeing Hawaii targets now collapse and reach the ACS A4 — Preserve distinct Ledger universes when the hash is absent (RESOLVED)Replayed the exact prior bare JSONL fixture through the normal loader and the current US compiler. Both national TY2024 count targets survived with their original values, 80 for all tax returns and 30 for EITC returns. The actual materializer signatures differ in the positive-EITC filter. The new universe-domain fallback gives them distinct cell keys. Universe fallback A5 — shared-1 — Resolve mixed hash and domain encodings to the same universe (OPEN)SHOULD ADDRESS. When two supported bare-feed records declare the same domain and one carries the universe hash, the cell key compares an opaque hash string with a domain string. The normal loader and compiler consequently retain both TY2024 country return-count targets, even though the materializer signatures coincide. Equal values of 80 and 80 bind twice. Conflicting values of 80 and 30 survive as incompatible targets. The latest test property chooses one universe representation for a whole generated dataset, so it does not reach this mixed case. Normalize compatible universe representations from their semantics before cell grouping, preserving actual domain and constraint differences. The loader's documented bare/diagnostic path permits mixed older row contracts. The supported Chronicle v4/v5 publisher schemas require hashes, so no impact on the pinned feed is established. Cell key · Bare loader contract SuggestionsS1 — Remove stale residual-allocation claims (RESOLVED)RESOLVED. The county population declaration and the county household guide now describe proportional division and closure within tolerance. The examples retain their original populations, weights and units. County declaration. County household guide. S2 — Correct the mortgage-interest follow-up premise (RESOLVED)RESOLVED. The updated PR discussion explains that IRS A19300/N19300 refers to Schedule A line 8a, which reflects applicable deductibility limits and Form 1098 reporting. It distinguishes this measure from the raw Evidence Gaps
Notes
Validation SummaryLocal exact-head US suite with Hypothesis seed 0 reported 309 passed, 1 failed, 23 pinned-feed skips. The failed district capital-gains property exposes the latest-vintage issue described in C6. The focused shared property test passed. Executed ordinary exact prior/current compile, actual national and ACS selectors, and the ACS loss-weight wrapper. Seventeen source originals were verified. The source review reconciled the pinned district roster and two agreeing national source rows. CI run. Timingelapsed seconds: 321.14s; parallel review seconds: 203.00s; code role seconds: 203.00s; policy role seconds: 104.00s; shared code role seconds: 163.00s; consolidation cleanup seconds: 56.14s Review SeverityREQUEST_CHANGES. Open findings: 2 critical, 2 should address, 0 suggestions. |
Part of #1760. Closes #1759. Draft. Step 3 is here: the US feed re-pin to Chronicle
13294b93and the target changes ruled for it, with decision 2 (the national level of the state SOI rows). Target values change.Where this stands
docs/us-target-nesting-rule-design.md: the rule, nine decisions (accepted 27 Nov 2026), and one general model to declare themscaled30b22eea2(1 Dec 2026): seven findingsd6ce5d6c1). The build comparison needs a build, so it is María's call (see "The review of 2 Dec 2026")562e220f9. The compiled registry on the pinned feed is byte-identical before and after (see "The review of 3 Dec 2026")6d744f917. The compiled registry on the pinned feed is byte-identical before and after (see "The program review of 3 Dec 2026")0ceaf6652: the compile refuses two district files of one capital-gains quantity. The compiled registry on the pinned feed is byte-identical (see "The program review of 3 Dec 2026"). The third round replaces that refusal with a general rule (next row)ccdb91550as a general rule: the compile refuses targets of one calibration cell that give different values, for any country and level (microcosm.build.ledger_cells). It replaces the district-file refusal of the second round. The compiled registry on the pinned feed is byte-identical (see "The program review of 3 Dec 2026")339ed484f. The rule now gives each cell one target: two values refuse, and one value is one target. On the pinned feed, two national copies of Table 1.2 that equal Table 1.1 stop binding: 28,099 targets (28,101 before),national_state6,197 (6,199)The rulings are in this comment on #1760. The page for the code is
docs/us-target-nesting.md. The re-pin is indocs/us-chronicle-feed-repin.md.What step 3 changes
The feed
13294b93(Add later editions of the US feed's sources (chronicle#449) chronicle#451, merged 28 Nov 2026, with the vintage review of chronicle#449). Built offline from a clean checkout: 62,268 rows onchronicle.consumer_fact.v5,facts_sha2562e880fd3…. The scope keeps today's record sets and tax years: 705 pairs (706 before).13294b93has the bytes of the3e9d3a0build (67b0998a…), so only the commit and the scope digest move.The compile
41b2fb2)13294b93)full)national_statenational_stategains 204 Historic Table 2 state rows (charitable contributions and the QBI deduction, returns and amounts, 51 states; the 102 charitable rows are held out since the second review, see below), 2 national QBI rows of Historic Table 2 and 8 Table 1.4 partnership and S corporation rows. Historic Table 2 names the QBI deductionqbi_amount/qbi_claims, and the two SOI measure maps now take those ids.98(1198) at Chronicle, as at the Census Bureau. The district translation and the household district distribution read seat98as seat00, Microcosm's at-large convention.hierarchy_reconciliations: []): the district file has no state row to scale its district rows to.state_cdsurface the district capital-gains rows then nest in the Historic Table 2 state row, like every district row.Held out of the compile:
deferred_district_measuresA new register in
us/fiscal_target_registers.jsonholds the district rows of 14 measures out of the compile (6,104 rows), each with its reason:mortgage_interest_paid_*, IRS column A19300/N19300, home mortgage interest paid to financial institutions. That is one part of the home mortgage interest deduction, not the whole interest deduction. Under its new id it binds no variable, at any level: Table 2.1 (national), Historic Table 2 (51 states) and the district file all carry it. Which variable it binds is a decision of its own (deductible_mortgage_interestis the closest). Table 2.1 keeps its nationalinterest_paid_deductiontarget.The nesting
state_cdand now onfulltoo (rule: state_cd_district_shareson both modes inus/spec/target_sets.yaml). Sofullandstate_cdgive the same rows. Charitable contributions and the QBI deduction take Historic Table 2 parents, so the level bridges go.qbi_amount/qbi_claimswith the district file'squalified_business_income_deduction_*, declared aspaired_valueson the district bridge selector.1e-12relative of the old code.CrossGrainRuleismain's again.state_cdThe
statedefault goes from 4,380 to 4,584 compiled targets (5,071 with the ladder rows);totalsstays at 255.Not built yet
Decisions 4 and 7 go in their own PRs, as ruled.
Decision 2: the national level of the state rows
The defect (#1243). 14 SOI quantities bound two national rows of two tax years: the Historic Table 2 US row (tax year 2022), which is the total of the state rows' own file, and a newer Publication 1304 row (tax year 2023). No weight vector meets both. For two of them the state rows summed to more than the smaller national row.
The rule (ruled 27 Nov 2026). The newer row is the national control. Each state row takes one factor, the newer national value over the Historic Table 2 US total, so it keeps its share of the total of its own file. The Historic Table 2 US row stops binding.
How. A derived control of the kind
scaledin the shared code (cross_grain_controls.scaled_control: a value times the lower rows' share of their own source's total). The operator divides it among the state rows. The US declares one pass with an entry for each pair, and the compile runs it (_nest_soi_state_rows_in_newer_national_controls), after rows 1 and 2 and before the state AGI bands.adjusted_gross_incomereturn_countwages_salaries_amountwages_salaries_returnstaxable_ira_distributions_amounttaxable_ira_distributions_returnstaxable_pension_income_amounttaxable_pension_income_returnstaxable_social_security_amounttaxable_social_security_returnsunemployment_compensation_amountunemployment_compensation_returnsitemized_deductions_amounttaxable_income_amountThe factor is on the published values (tax year 2023 over tax year 2022). At the build year an amount moves by 0.978 to 1.122 (the old rows were aged one year more), and a count moves by its factor.
The concept check of each pair (the ruling asked for it before the build):
source_concept) and one return universe, with no other filter;22in12ms.xlsas Chronicle pins it at13294b93, because the feed's scope does not hold that table for 2022;On the pinned feed:
national_statestate_2022copy of the US return countstate,totals,full,state_cdThe 408 state AGI band rows follow their state total. The district rows and the county rows are shares of their state row, so they follow too.
Two choices of the build, ruled to stand on 1 Dec 2026:
fullmode, where district rows are raw: without it, the district rows of taxable IRA distributions sum to 1.0056 of the one national row that is left. It also keeps the factors and the bound of the district bridge as measured at the re-pin.What a reader must know: a state row of the 14 quantities now carries the operator's keys, and its
cross_grain_parentis the national control. A reader that wants the rows under a state parent must also read the level. The readers in the tree do (the hold-out rules, the loss weights, the closure check).The UK: no UK output changes. One UK node is keyed more widely. The implementation hash of the gate battery covers every module that its bindings reach by an import statement, and that closure already holds the US compile. The US compile now imports the operator, its row-level pass, the US declaration reader and the US adapter, so the closure grows by these four modules (243 to 247;
test_transport_evidence_kernels.pylists them). The gate battery computes again on the next UK run, as it does after any edit of the US compile.The second review (1 Dec 2026)
A second adversarial review read the head
30b22eea2(decision 2, step 3, the repaired tests, the merges). It confirmed the arithmetic of the pass on the pinned feed, the aging, the readers of the parent key, the gates on the compiled registry, the UK path and the four repaired tests. It found seven items. I checked each one with my own run before I changed code.national_state). See belowf50fedd25(ruled 1 Dec 2026). The repair is in the follow-up2c2df0547: each pair is a pass of its ownNo pinned value moved with these repairs.
Finding 1, measured on
national_stateat the build year 2024:national_stateThis is the defect of #1243 on quantities outside its list of 14. For the charitable deduction the rule of decision 2 cannot run yet: Chronicle's Historic Table 2 US package has no charitable column, so the state rows have no US total of their own file.
Ruled on 1 Dec 2026: the repair goes in the follow-up of #1760 that makes the levels consistent, and the rows are held out until then. Built in
f50fedd25:us/cross_grain_declarations.jsoncan hold its rows out of the national solve (held_out_of_national_solve), andspec/target_sets.yamlexcludes them fromnational_stateby the predicateheld_out_known_gap;national_stategoes from 6,301 to 6,199 targets (2d99e5fddc8a). The compiled registry (28,101), thefullmode and every local surface are unchanged: the state rows stay the parents of the district rows there, and no national row binds on a local surface;held_out_known_gap_targets, only when there are any).dropped_congressional_district_targetscounts district rows only, as before;A correction. The text of this description from 16:33Z to this update also listed partnership and S corporation income as a third case (8 Table 1.4 component rows beside the Historic Table 2 combined row, which is 7.4% above their net). That was wrong, and those rows are not held out. A US SOI row binds the positive part of its variable on each return, so the combined row binds the positive part of each return's sum. The four parts hold that quantity between their net ($1,078bn) and the sum of the two income rows ($1,358bn), and the combined target ($1,158bn) is inside that range.
docs/us-target-nesting.mdsays so.For a later ruling (not a defect): the feed also holds the tax year 2023 state AGI-class package, so the published 2023 state totals exist. The state totals of decision 2 (2022 shares at the 2023 national level) are 0.956 to 1.054 of them for adjusted gross income, and 14 states are more than 2% off.
The review of 2 Dec 2026
A light review of the target changes, at
f50fedd25.1. The compile change, by source. Done in
d6ce5d6c1:docs/us-chronicle-feed-repin.md("The compile change, by source"). It compares two compiled registries at the build year 2024: the code before the re-pin on the old feed, and this branch on the new feed.The 6,104 deferred district rows are not a removal of 6,104 rows. 5,232 of them are of twelve measures that the old feed did not hold, so they were never compiled. The other 872 are the first line of the table. Decision 2 then takes 15 national rows off (28,116 to 28,101).
2. The effect on the build. Not done: it needs a national build, and no build ran for this PR. The page gives what the comparison needs. On the production national mode, 4,830 of the 6,102 targets of the old surface keep their value (4,817 with the same id, 13 with a new id), 1,257 move with a known cause for each group, 112 are new and 15 are gone.
The view on the mortgage interest decision. The rows stay held out, as the review advises. The review calls A19300/N19300 interest before the limits, and that premise is not right (the program review of 3 Dec 2026). The district file's guide maps both columns to Schedule A line 8a, and the Schedule A instructions put on line 8a only the deductible part of the interest and points reported on Form 1098 when a limit applies. So the column is after the limits. In policyengine-us 2.145.3,
mortgage_interestis the amount before the federal acquisition-debt caps, which is a different concept.deductible_mortgage_interest(after the caps; it also holds the interest and points not reported on Form 1098, lines 8b and 8c) stays the closest. The decision is still open.The review of 3 Dec 2026
A review of the head
d6ce5d6c1, with changes requested for two findings. Neither moved a value on the pinned feed; each was a case the code expected and handled only in part, with no test. Both are fixed in the structure, in562e220f9, after the merge ofmain(bb203130d).congressional_district, so two files of one tax year (two boundary vintages, say) added into one sum_SoiShareTotal) or the sum of one district file's rows (_SoiSumOfDistrictRows), keyed by the file (its record set id without the period)._SoiShareDenominators.total_forgives a row one denominator or none. A sum holds each district one time and, when the compile translates the district facts onto the current plan, each district of that plan, or the compile refuses (IncompleteSoiDistrictFileError)_NationalSoiShape: absent, no control, control only, older control, scale) and then applies the plans. A plan that scales names the state rows and the district-file rows together, so with no state rows the district-file rows take the factor control / US total. District-file rows under the newer row with no US total of their file are refused, as state rows areCOUNTY_PREFIXhad two definitionstarget_nestingTests on small inputs, which run in CI: two district files of one tax year; a Hypothesis property over one to three files; a district counted twice or missing from the plan (since the third round of the program review, these district-file cases are fixed examples of one property test); the shape of every layout of a pair; a pair with district-file rows and no state rows; and a Hypothesis property over the layouts of a pair (control absent, older or newer; US total absent, of the rows' year or older; zero to three state rows and zero to three district-file rows). Put back in memory, each of the two old behaviours fails these tests.
No value moved: the compiled registry of the pinned feed, aged and unaged, with the district crosswalk as the national tool compiles it, has the same bytes before and after (every spec's name, value bits and metadata in order).
The rest of the suggested design goes to the follow-up of #1760, with the joint surface, as the review proposes: the adjustments of a target as typed data (step 3), one invariant checker after each pass, including "no two binding targets measure one quantity at one geography" (step 5), and generated feeds with a registry-comparison tool that runs on every re-pin (step 6).
The program review of 3 Dec 2026
A review of the head
562e220f9: two critical findings, one to address and two suggestions. No value moved on the pinned feed: it has one district file, with no US row and with full rosters on both plans. All five are fixed in6d744f917.congressional_district_vintage_sources). The check of a sum reads them first: each source district of the crosswalk one time. Then it checks each district of the current plan one time, as beforeprepare_congressional_district_vintage_crosswalk) and gives the frame to the translation and to the plans (congressional_district_plans)Tests on small inputs, which run in CI: the review's cases with its numbers (file B's counts of 1 and 3 give 10 and 30 beside file A's US row; a source row twice under a one-to-one crosswalk refuses, and the rows are 16 and 24 without it; a missing source district under an even split refuses; a one-shot iterator compiles as the list does), the Hypothesis property over one to three district files, which now draws a US row or none for each file, and the source districts that a translated row names. Each of the five tests of C1, C2 and A1 fails on the code of
562e220f9.The review's evidence gaps. The national before/after comparison needs a build. Whether to run one before the merge is María's call (see "The review of 2 Dec 2026"). The merge, and the UK release window that gates it, are María's call too.
The second round (the review of
6d744f917, 14:50Z): the five findings above are resolved, and there are two new ones. Both are fixed in0ceaf6652.fulleach district took two targets of one quantity (8 and 2 at HI-01, 12 and 6 at HI-02 in the review's case)OverlappingSoiDistrictFilesError). This holds for two boundary vintages of one tax year and for two tax years, because latest-vintage selection keeps one period of each file, not one file. One file at two tax years is one file. The file-local denominators stay in the passTests on small inputs: the review's two cases, two files of two tax years, and one file at two tax years. The multi-file tests of the pass now run the pass alone and check that the compile refuses. Both new tests fail on the code of
6d744f917.The third round (the review of
d6fed9bcb, 18:08Z): C3 stays open through one path, and it is fixed inccdb91550by a general rule, which replaces the refusal of the second round.full. A Historic Table 2 D.C. state total can take the same path: on the pinned feed, its capital-gains state rows have the shape of the district rowsmicrocosm.build.ledger_cells): a cell is one quantity (the Ledger concept, unit, entity, aggregation, period type, filters and universe of the fact) at one geography for one target period, whatever its source. When the targets of one cell give different values, the compile refuses. The US compile runs it on the registry that it returns, after the crosswalk, the fills and every pass, so it sees what the calibration reads. The refusal of the second round (OverlappingSoiDistrictFilesError) is goneTargets of one cell that give one value stay. On the pinned feed, Table 1.1 and Table 1.2 both give the TY2023 national return count and adjusted gross income, with equal values. How many times a cell enters the loss is a rule of the loss (microcosm#1729), as statement 9 of the nesting rule says.
Tests. Two property tests replace the per-finding tests of the three rounds.
tests/engine_free/shared/test_ledger_cells.pytests the shared rule on random cells, sources and values, with no country.test_district_capital_gains_give_each_cell_one_valuetests the district capital-gains surface against a small model of the rule. It replaces nine tests of the earlier rounds and the vintage test of round 1, and each case of the three reviews is a fixed example. On the code ofd6fed9bcbthe two cases of the third round compile, so the test fails there.Older tests. The rule runs at the end of every US compile, so some older fixtures met it. Four tests gave one cell two values in a feed layout from before PolicyEngine/chronicle#451: a district file's own state or US row beside the Historic Table 2 row of the same cell. Two of them are the microcosm#489 pins: with no Table 1.4 control, they bound two national taxable-interest values. They now expect the refusal, or compile one source at a time. The other fixtures left out what the feed uses to tell two quantities apart: the return universe of the itemizers', excluding-dependents and EITC tables, the SSA payment-program dimension, and the CBO series concept. They now carry it, as the feed does.
A limit of the rule. It trusts the cell identity of the Ledger. Chronicle gives the TY2024 filing-season EITC total and the Table 2.5 TY2023 EITC total two universes, so the rule sees two cells, although for the credit's amount they are one quantity. The October release bound both (about $69.0bn and $72.0bn). That pair is a separate item, outside this PR.
The fourth round (the review of
ccdb91550, 23:46Z): two critical findings and two to address, all fixed in339ed484f.income_range=alland a file that left it out gave 8 and 4 at HI-01all, or empty), as the US compile reads itledger_cell_also_given_bynames the other facts. The third round kept bothWhat this moves on the pinned feed. Table 1.2 gives the TY2023 national return count and adjusted gross income with the values of Table 1.1. Those two cells now keep the Table 1.1 targets, so the compile has 28,099 targets (28,101 before) and
national_statehas 6,197 (6,199). The rule finds no cell of two values on the pinned feed, and the local surfaces do not move. The pins oftest_us_target_sets.pyandtest_us_fiscal_target_registers.pyare measured again.Tests. The two property tests now draw the new edge cases: filters of
allor none and universes by key or by domain in the shared test, and a seat row with a state total in one file, and files that leaveincome_rangeout, in the district test. The three cases of this round are fixed examples, and each one fails onccdb91550.What Stage A and steps 1 and 2 do
The US local tools made child target rows from parent rows in four places, each with its own arithmetic, its own checks, its own metadata keys and its own receipt. They now run on the cross-grain operator that the UK uses (
microcosm.build.cross_grain), and the US declares its choices in the UK's key names.The model has six things, and each is general (no construct is for one country only; the shared operator runs the first five, and the coverage check reads the sixth): a measurement, a bridge (by id, or by a selector that makes one bridge for each pair of targets), a derived control, a bound on the factor of a bridge, the members of a leg, and pairs that are not reconciled.
Up to step 2 no target value changed: on the feed pinned then, each of the 26,272 rows of the
state_cdSOI surface had the bits of the value it had, and the other three surfaces had their bytes.The parts
microcosm/build/cross_grain.pyreconcile_rows: the operator on target rows, with an answer for each row). No country in itmicrocosm/build/cross_grain_controls.pyus/cross_grain_declarations.jsonus_runtime/cross_grain_declarations.pyus_runtime/target_nesting.pytools/us_acs_local_cd_surface.py,tools/us_acs_local_county_surface.pytarget_nesting.jsontools/build_us_acs_local_release.pyWhat step 2 changes (by design)
On valid data the rows and their values were the same. These things differ.
Metadata keys. District and county rows carry the operator's keys, as UK rows do.
cross_grain_parentstate_cd_parent_target_name,state_county_parent_target_namecross_grain_value_beforestate_cd_cd_file_value,state_county_source_valuecross_grain_factorstate_cd_rebase_factor,state_cd_level_bridge_factorcross_grain_controlstate_cd_parent_basis,state_cd_level_bridge_siblingcross_grain_membersstate_county_cell_membersSix old keys have no new one, because another place holds the value (the parent row, the operator's receipt, the declaration).
Receipts. The district receipt names the bridge and its bound under
bridge, with the legs it unbound;factor_by_measurereplacesrebase_factor_by_measure, and since step 3paired_measure_idsreplaces the level-bridge fields.internal_consistencyis gone. County blocks loseshare_sum.Pins of
state_cd(the registry, the roles and the receipts) moved, and were measured again.Refusal texts. A refusal that the operator makes has the operator's text: a leg that does not hold its members, a sum of zero under a control, opposite signs, a county with no state.
One check is gone: that the district file's own state row is the sum of its district rows. Since step 3 the district file has no state row.
One refusal is new: a concept that takes its state parent from Historic Table 2 in some states and from the district file in others. It does not occur on the pinned feed.
With the bound turned off (only tests do that), a concept whose Historic Table 2 level is zero in every state keeps district rows of zero. The old code dropped them.
A band of 2.0 or more is refused. The old code accepted any band. No command-line flag sets it, so only a test or a direct caller can meet this.
The readers of the keys moved with them: the loss weights, the hold-outs and their pro-rata baselines, the county reports, and one field of the reviewed limitations. The dated runs under
experiments/read registries of their own date and are not changed.Since Stage A, three inputs that the oldest code computed are refused by the operator (rows that sum to less than
1e-9of their control, a county SOI block under a negative state row, a control of-0.0). None occurs on the pinned feed.A run that is resumed across this change is stopped: a later stage refuses targets with the old keys, and a district receipt with the old fields, and says to run
--stage materializeagain.Commits
288b2e3caPins on the code as it is (the pin test of #1755, cherry-picked)mainas it ise3e483dbdThe allocator hook (removed again in step 3)bc8aa6ae1cross_grain_controlsd1f62f9ddThe US declaration, its reader and the adapter base6da6e3b12District SOI shares on the operator (row 5)55fa55c36County population, county SOI shares, county households on the operator (rows 8, 6, 7)c3dc13b4cThe inventory, the docs page, the coverage test3aac702e3Merge ofmain(5589fae09), with the US F0 pins written again--checkpasses350cd9de2,17ee67085,035881105The rule, the rulings, one general model (docs only)947978c46The bound, the members and the bridge selector, general in the operator938c7faa6Annotations that the spine-blindness check needsd91ae5b37,2264fb377,011651554The operator refuses a declared leg with no row; the US on the model; the pages625c93702The ten rulings of 27 Nov on the steps, in the design page6e76eaee6,fa297a018The county rows on the pinned county facts; the county SOI bridge declares the bound of the district bridgef1c17c5e1,bb6776f87,ff0b9fa15,672e82936The eleven findings of the adversarial reviewa8b9d2c52Merge ofmain(be6a1983d), with the US F0 pins written again--checkpassesca5e864bcThe property test of the district shares draws no block that the operator refusesb138c5f20Merge ofmain(dc77fa312, with the geography-first move of #931), with the US F0 pins written again--checkpassesb4c276c23Merge ofmain(6b87a0c28, with #1755)87fabcde0Re-pin the US feed to Chronicle13294b93, and compile the feed there12677fb68Nest the district rows in Historic Table 2; the allocators and the level bridges go75cb18cbaThe pages and the changeloga9d1dd414Merge ofmain(88fadfa8f, the post-export scoring work)c00e34ccfFour tests that the feed re-pin and the key change left behinddf726b5d6Seven items from the review of #175538f3e6cfaGive state rows the level of the newer national control30b22eea2The pages and the changelog2c2df0547Six items from the second review5cf1f85e3Merge ofmain(fdd4a98fa)f50fedd25Hold the state charitable rows out of the production national modenational_state6,301 to 6,199; the US F0 pins move with the target-set filed6ce5d6c1Account for the compile change of the feed re-pin, by sourcebb203130dMerge ofmain(96888466d)562e220f9Five items from Anthony's review6d744f917Five items from the program review of 3 Dec0ceaf6652Refuse two district files of one capital-gains quantity (the second round)ccdb91550One value for each calibration cell, for any country and level (the third round)339ed484fOne target for each calibration cell; a fill never copies its own seat (the fourth round)d6fed9bcbMerge ofmain(23479e822)main's values, then the pin tools87fabcde0also renamed the SOI measure maps frominterest_paid_deduction_*tomortgage_interest_paid_*. That was wrong: it took Table 2.1's national interest paid deduction off its variable, and bound column A19300 to the variable of the whole deduction.12677fb68reverts the rename and holds the mortgage rows out (see above). Only the head runs in CI, and87fabcde0alone does not pass thestate_cdtests.The county rows on the real inputs
The pinned county facts file (922 MB, sha256
67b0998a…) is a test input on the build machine. Two tests intest_us_target_nesting_county.pyread the pinned feed, the PUMA ladder and that file, whenMICROCOSM_US_CHRONICLE_FACTS,MICROCOSM_US_PUMA_LADDER_ARTIFACTandMICROCOSM_US_CHRONICLE_COUNTY_FACTSname them. They skip in CI.1e-12relative of the old code (the allocator went); bytes pinned again1e-12relative; bytes pinned againThe county SOI bridge declares the bound of the district bridge (1.25 around the median factor across states, unbind). No leg is outside it on the pinned county facts, so it unbinds nothing.
Adversarial review, 27 Nov 2026
A reviewer with no part in the work tried to prove the PR wrong, at head
fa297a018. It changed no file. UK outputs and US values held; the eleven findings were fixed inf1c17c5e1to672e82936(a lost refusal came back twice, a run resumed across the change of keys is stopped, the coverage check is tighter, two more bit-for-bit tests). Step 3 removed one of the two lost refusals again, with the level bridges it guarded: a district block that lacked a district while its level bridge was distrusted.Pins
us/chronicle_feed.json,us/chronicle_feed_scope.json,us/chronicle_county_facts.json,us/chronicle_county_facts_scope.json, and the two parity resources (32 compiled families, 64 reviewed exclusions).test_us_fiscal_targets.py,test_us_fiscal_target_registers.pyandtest_us_target_sets.py: measured again on the new feed.state_cdbytes intest_us_acs_local_surface_bytes.py, the district contract intest_us_acs_local_sparse_cd.py, and the district and county pins in the two nesting test files: measured again.--checkpass. The seed protocol attests the bytes ofcongressional_district_geography, so the golden vector of the spec loader test moved.The seven items from the review of #1755
#1755 merged on 30 Nov 2026 with seven review items open. They are in
df726b5d6, at María's request (1 Dec 2026).docs/uk-target-sets.md, the #1759 changelog entry andtest_uk_solve_scope.pynow say so. The root cause is not changed heredocs/us-target-sets.mdsaid that a reworded rationale moves no pindocumentation_sha256in the US coverage evidence. The page names the tool to runequals: [](or{}) changed a selection and no hashexcludeandleft_out_levelswere hashed in orderspec_sha256anddocumentation_sha256move one time; the UK content hash does notfrs_brmastage that #931 retireddocs/uk-target-sets.mdand in two prose fields ofuk/spec/target_sets.yamlus/local_target_construction.jsonis held to the level rule and to the declared built rows when it loads (require_declared_built_levels)The UK
cross_grain.pyandmicrocosm.calibrate.target_sets. So the UK target nodes, and every node after them, compute again on the next UK run. The outputs are the same: the bit-for-bit test compares the operator withmain's file on seeded surfaces, and it pins the list of definitions that this branch changed or added.uk/spec/target_sets.yamlchanges in two prose fields (item 5 above: one description and one rationale). Its content hash and the UK solve fingerprint are the same:test_uk_solve_scope.pyandtest_uk_graph.pypass with no change of a pinned value. The byte fingerprint moves, so the UK national line computes its targets, problem, solve and gates again one time.uk_runtime/changes. One UK test file changes in its docstrings only (test_uk_solve_scope.py, item 1).cross_grain_controls.Merges
main: merged eight times. The last, at23479e822(commitd6fed9bcb), had three conflicting files, all of them pins that the US F0 pin tools write: each kept this branch's reason comments and tookmain's values, and the pin tools wrote the values of the merged tree. It brings Belgium's method card rulings (Record Belgium's method card rulings and pin NGI as the language-region source #1856) and the pin of the Fed's SCF 2025 summary reissue (Pin the Fed's 18 November reissue of the SCF 2025 summary extract #1865). The one before it, at96888466d(bb203130d), had eight such files; the two before that, atfdd4a98fa(5cf1f85e3) and88fadfa8f(a9d1dd414), had no conflict.cross_grain_parent, and its pin test holds thestate_cdbytes measured here.Tests run here
On 4 Dec 2026, on the tree of
339ed484f(the fourth round of the program review, onccdb91550).test_us_fiscal_targets.py, was measured againruff check .,tools/ci_test_plan.py verify, both pin tools with--checke630858e12b1; unaged:f14bdff8309b). The third round left the bytes as they were; the fourth round takes off the two Table 1.2 copiesd6fed9bcb,ccdb91550)339ed484fNo build ran here. The UK files and the engine tests did not run here: these changes touch no UK code and no pin of the pin tools. The machine was at memory pressure level 2, so the tests ran on one worker.
CI
CI was red on
75cb18cba, and on the two heads before it. I had not read it sinceca5e864bc.mainatdc77fa312)test_every_chunk_and_batch_size_gives_the_one_chunk_target_matrixmainand names the state parent with the old key,state_cd_parent_target_nametest_the_committed_feed_pin_banks_the_anchorexperiments/us-feed-13294b93/anchor_rows.json: the three facts have the same period, value and source file before and aftertest_the_release_s_recorded_post_export_outputs_are_unchangedfy2024), and the test's stand-in reform takes its effect from its idtest__load_ledger_target_specs__compiles_the_pinned_feedwv_totalrow, which the feed no longer hasOne failure was not from this branch:
test_no_committed_local_adjudication_is_about_to_lapse(UK). Four DESNZ adjudications expire on 15 Dec 2026, and the test fails from 14 days before, which is 1 Dec. It fails on every branch until the adjudications are renewed onmain. The engine-free job stops at the first failure, so it can hide a later one.CI on
df726b5d6(read 1 Dec 2026, 13:52Z): engine-us, engine-uk, integration-uk, installed-emitter, lint and wheels pass, so the chunk test is repaired in CI too. The two engine-free jobs fail on that one UK test and stop there (23,820 tests passed before it).CI on
30b22eea2(read 1 Dec 2026, 16:18Z): engine-us, engine-uk and the other jobs pass. The two engine-free jobs fail on the UK notice test only. #1834 renewed those registers onmain(merged 1 Dec 2026, 15:38Z), and5cf1f85e3merges thatmain, so the engine-free job can now run to its end.CI on
f50fedd25: all 12 checks pass (read 2 Dec 2026, 08:27Z). It is the first run on this branch sinceca5e864bcin which the engine-free job ran to its end, on both Python versions. The engine-us and engine-uk jobs pass too.CI on
d6ce5d6c1: all 12 checks pass (read 3 Dec 2026). The PR then conflicted withmain, whichbb203130dresolves.CI on
562e220f9(read 3 Dec 2026, 13:26Z): engine-uk, integration-uk, installed-emitter, lint, select-countries and wheels pass. engine-free and engine-us were still running when6d744f917was pushed.CI on
6d744f917(read 3 Dec 2026, 15:04Z): engine-uk, integration-uk, installed-emitter, lint, select-countries and wheels pass. engine-free and engine-us were still running when0ceaf6652was pushed.CI on
0ceaf6652was not read: the merged6fed9bcbreplaced it. CI ond6fed9bcb: all 12 checks pass (read 3 Dec 2026, 22:50Z). CI onccdb91550: all 12 checks pass (read 4 Dec 2026, 12:03Z). CI on339ed484fwas not read when this text was written.Not verified
state_countysurface. The county rows are compared and pinned on the real inputs (above). The support moves and the matrix rows of the county mode need a household frame, and no test here has one.--exact-karm waited on a feed with the chronicle#277 fix.13294b93contains it; the arm has not run on it.Rulings and what is open
Ten calls on the steps were ruled on 27 Nov 2026, with the nine decisions (section 4 of the design page). Step 3 was started on 30 Nov 2026 and decision 2 on 1 Dec 2026, on the rulings of those days. On 1 Dec 2026 the joint surface was ruled into a follow-up PR.
Open:
mortgage_interest_paid_*(column A19300, Schedule A line 8a: the deductible part of the interest and points reported on Form 1098) binds, at the three levels.deductible_mortgage_interestis the closest.mortgage_interestis the amount before the caps, so it is not the same concept (the program review of 3 Dec 2026 corrected the premise of the review of 2 Dec).🤖 Generated with Claude Code