Skip to content

Refuse invalid fit input that the microimpute bug-parity audit reproduced - #1543

Merged
MaxGhenis merged 11 commits into
mainfrom
fix/fit-input-validation-bug-parity
Nov 17, 2026
Merged

MaxGhenis merged 11 commits into
mainfrom
fix/fit-input-validation-bug-parity

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Both review rounds have run, and round 2 raised no P0 or P1. The brief owner accepted the two valid-input exceptions below as documented changes.

The microimpute bug-parity audit reproduced nine defects in microcosm-fit. This PR fixes each one, with tests that fail on main for the defect under test. The checks are meant to leave the output for valid input unchanged, and a differential run against main matched bit for bit. There are two exceptions, both outside every production caller: unsorted classes in categorical_scores, and argument types outside the annotations that main converted. Only the attested kernel hashes move.

The PR has merged main five times, last at c7a5f9679. The first merge (52aea1477) brought balanced and level-offset gate calibration. The second (085672fa9), third (c4ad23289) and fourth (14797c665) changed no microcosm-fit file but moved the same attested hashes (microcosm#1585, microcosm#1096, microcosm#1387), so the branch repins them for the combined source. The fifth changed no microcosm-fit file either, but microcosm#1614 moved one of those hashes, the spec_sha256 that us-f0-coverage.json and test_us_multispine_pool_tool.py pin, so the branch repins it too. "Main" below means 52aea1477's microcosm-fit, identical to 085672fa9's, unless it says dc00d158.

What changes

Defect Main This branch
D010 seeds RegimeGatedQRF turns seed=True and seed=1.9 into seed 1, and CategoricalClassifier turns seed=True into 1. A negative QRF seed constructs and then fails at fit with numpy's "expected non-negative integer". Both models refuse a bool or non-integer seed (TypeError) and a negative seed (ValueError) at construction. The QRF also refuses a bool or non-integer n_estimators there. Only Python and NumPy integers pass, so seed=1.0, seed="3" and n_estimators=4.0, which main's QRF turned into equal integers, are refused too.
D034 tolerance zero_atol=nan or +inf makes a positive target fit as degenerate zero and draw only zeros, and a chain checkpoint restores nan. The constructor, detect_regime and QRFChainState require a finite zero_atol >= 0 that is a numbers.Real and not a bool. The check converts nothing, so detect_regime still compares an integer tolerance exactly with integer targets. A string, a bool, a Decimal or a 0-d array, which main's constructor turned into a float, is refused.
D031 duplicate labels The fit reads a duplicated predictor or target label as a two-column frame without saying so. A duplicated predictor fits silently; in the audit's repro an all-zero duplicated target fits as degenerate zero, and the test's alternating target crashes with an unrelated IndexError. A duplicated weight or groups label crashes with an unrelated error ('DataFrame' object has no attribute 'dtype', The truth value of a Series is ambiguous). A DataFrame fit refuses a predictor, target, weight or groups label that names more than one column. It ignores duplicates among the columns it does not read.
D022 scorer categorical_scores scores [[2, 0], [0, 2]] at a log loss of -0.69, accepts NaN, negative and all-zero weights, and drops the imaginary part of complex probabilities and weights (NaN ones included) with only a NumPy warning. Unsorted classes fail with "Every label must be one of classes", unless the sorted search happens to find every label; then they score in the order given, and the calibration fit reads that order: it fixes the first class's offset, and an ill-posed fit also depends on the order of the other columns. The scorer requires a real probability distribution over classes in every row, distinct classes, real finite non-negative weights with a positive total, and each stratum as a 1-D array with one label per row (a shape check). It reads the classes in sorted order whatever order they come in: labels are found by main's sorted search and NumPy equality (True still matches 1), and sorted classes keep main's exact arrays. A permutation of the classes with the probability columns leaves every score, the calibration included, unchanged, bit for bit for a C-ordered proba.
Zero-weight sign A weighted fit of a sign whose rows all carry zero weight crashes in the weighted bootstrap with "Probabilities contain NaN". The fit refuses that target and names the sign.
Empty training table Unweighted, the fit treats the target as degenerate zero and imputes 0; weighted, it already raises "Weights sum to zero". The fit refuses it, and so does start_chain.
Empty recipient batch The sign gate's classifier refuses zero rows in predict, conditional_uniforms and the chain step. These return an empty result, keyed or positional. predict consumes no draws for it, and predict_from_uniforms already returned early.
Missing donor-distance values A missing recipient rank takes rank 1, tying the largest donor, and a missing presence-rank value counts as absent. donor_distance_features refuses missing or non-finite rank and presence-rank values and missing categories, and names the column and the side.
D067 unseen categories A recipient category that no donor holds becomes an all-zero dummy without a word. A new unseen_categories argument follows CategoricalClassifier's convention: "refuse", the default, raises, and "ignore" keeps the old all-zero indicators.

Valid input is unchanged, with two exceptions

  • Unsorted classes in categorical_scores (accepted by the brief owner). Unsorted classes that main's sorted search happened to locate scored in the order given; they now score as the same columns sorted would. This is the cost of round 1's finding 3, a canonical class order. No production caller passes unsorted classes: each passes np.unique or classes_ order. I measured it on 4,107 random unsorted inputs that main scored, drawn three ways (labels unrelated to the probabilities, labels drawn from them, and inputs where only one class may be observed):
    • In every one, this branch equals main run on the sorted presentation of the same data, bit for bit.
    • The log loss never moves, and the share gaps move only in the last bits (never more than 1e-12 relative).
    • With at least two observed classes, the slope moved by more than 1e-9 in 26 of 1,880 cases, all with slopes near 0 (moving by about 1e-9) or between 8 and about 2,700, and by at most 3.2%. The calibration outcome never changed. For slopes between 0.1 and 5 (77% of the cases) the largest relative move was 2.4e-12.
    • Where only one class is observed, the slope is ill-posed: the outcome changed in 106 of 1,230 cases, and 331 of 387 reported slopes moved by more than 1%, slopes between 0.1 and 5 included. test_an_unsorted_order_main_scored_now_scores_as_sorted pins one such input, with classes [0, 2, 1]. Both orders fix class 0's offset, but the order of the other two columns tips where the ill-posed fit stops: on arm64 main reports a slope of about 0.849 and the sorted order about 0.875. That stop point is not portable, so the test pins only that the input scores exactly as its sorted columns do.
    • The alternative keeps main's path wherever main's search succeeds and sorts only what main refused. That keeps main's output exactly, but the calibration then depends on the column order for those inputs, the path depends on the labels, and the permutation property no longer holds.
  • Argument types outside the annotations (accepted by the brief owner). seed=1.0, seed="3" and n_estimators=4.0 for the QRF, and a string, bool, Decimal or 0-d array zero_atol for its constructor, used to be converted and are now refused. The round-2 reviewer's walk over the build configs found 282 seed and n_estimators values, all integers, and every zero_atol is 1e-6.

For everything else:

  • Differential run. One fixed workload ran through main's microcosm.fit (52aea1477) and this branch's. It covers four RegimeGatedQRF configurations spanning every regime, weighted and unweighted, in-sample and cross-fitted gates, with groups. Each one runs predict, predict_from_uniforms, conditional_uniforms, release_models and a full checkpointed chain with positional and keyed steps. The workload also covers detect_regime at four float tolerances and at integer tolerances and targets around 2^53, CategoricalClassifier probabilities and draws, out_of_fold_proba and categorical_scores with strata, the scorer on sorted integer, string, float and boolean classes and boolean labels against integer classes, each in C and Fortran layout (calibration fallback cases included), and donor_distance_features feeding keyed_nearest_donors. All 335 arrays, 33,492 values in total, match bit for bit, and so does the serialized chain state. The first version of the sorted-order fix failed this run: proba[:, order] returns a Fortran-ordered copy, and the share-gap sums rounded differently in the last bit. The branch now leaves sorted input untouched and permutes with np.take.
  • Kernel parity. python -m tools.graph_parity_repin fit.qrf refuses to write when the local direct call's bytes move from the pinned direct.csv. It wrote, so the fit.qrf parity case's outputs stayed byte-identical.
  • Donor distances. test_valid_input_gets_the_coordinates_it_got_before embeds an adaptation of main's donor_distance_features (arguments renamed, rank helper copied in, guards left out) and checks that every valid Hypothesis input gets exactly main's coordinates.
  • Production callers.
    • UK APS and SPI score out-of-fold probabilities only after can_deal_folds and stratified_folds. The stricter scorer refuses an all-zero row, which out_of_fold_proba leaves for each learner in a fold whose training rows hold a single class. APS deals rows, so every class (each with at least as many rows as folds) reaches every fold, and every training fold holds every class. SPI deals whole households, so another class can sit in one fold only (the first review built such a case). A training fold then holds a single class only if every class but one sits in the held-out fold. The round-2 reviewer's caller trace argues that this cannot happen with at least 3 folds, and SPI pins 5. Its random search found single-class training folds only at 2 folds (9 of 689 cases), and none at 3 or 5. If it did happen, the scorer would now raise where main scored those rows at the 1e-4 floor. The follow-up below covers it.
    • SPI is the only production caller of donor_distance_features, and it reaches the function on two paths. Its held-out copy runs after _held_out_evidence, whose fold classifiers train on exactly the copy's donor rows and predict every row it uses as a recipient. Its draw path runs after _draw_held_groups predicts the same recipients with the classifier fitted on the same donors. Those classifiers list region among their categorical predictors and refuse unseen categories by default. An unseen region therefore raises there first, on main as on this branch, so the new "refuse" default adds no failure.
    • Every production seed and n_estimators is a Python int.

Invariants

The new file packages/microcosm-fit/tests/engine_free/shared/test_input_validation.py holds these as Hypothesis properties (derandomized):

  • validated_integer keeps each integer at or above the minimum, as an equal Python int, and refuses everything else by type or range. A NumPy integer seed draws exactly as the equal Python int.
  • Over every float, NaN and infinities included, the model accepts zero_atol exactly when it is finite and >= 0. Example tests cover a bool, a string and None. A checkpoint round-trips every valid tolerance exactly.
  • A duplicated label that the fit does not read moves no draw.
  • For every valid input, the floored log loss lies in [0, -log(1e-4)] and every share gap in [0, 1]. Permuting the classes together with the probability columns leaves every score bit for bit unchanged, calibration slope and outcome and strata included, for C-ordered probabilities. (A Fortran-ordered proba with sorted classes keeps main's untouched path, whose weighted sums round in another order.) The scorer refuses any probability outside [0, 1].
  • detect_regime on integer targets and an integer tolerance (up to 2^62) gives the regime that exact integer arithmetic gives.
  • Predicting an empty batch consumes no draws: the next batch draws exactly as a fresh model does.
  • Donor distances: valid input gets main's coordinates exactly. "ignore" matches main everywhere, and "refuse" raises exactly when a row holds an unseen category. Rank coordinates lie in [0, 1] and never fall as the value grows.

Tests

  • 113 new tests in packages/microcosm-fit/tests/engine_free/shared/test_input_validation.py. Against main at 52aea1477, 98 fail and 15 pass.
    • Most failures are the defect itself: main raises nothing where the branch refuses, crashes with an unrelated error (the sign gate's "Found array with 0 sample(s)", an IndexError, '<' not supported, "Probabilities contain NaN"), or refuses unsorted classes.
    • A few fail only because main lacks the new unseen_categories keyword or validated_integer helper, or raised a less specific error: float()'s own TypeError for zero_atol=None, a matmul shape error for too few weights, and an unknown label it did not name.
    • The 15 that pass on main are guards and properties of valid input: integer seeds, a partly weighted sign, an unrelated duplicated label, the checkpoint's refusal of a bool or string tolerance and its round trip, predict_from_uniforms on an empty batch, score and rank bounds, and the new exact-integer-tolerance and NumPy-label-equality tests.
    • Those last two, with the complex-value, calibration-order and permutation tests, are the first review's regressions: all fail on the previous head 3254ba08, apart from the one guard case (2**53 read as zero).
  • The empty-batch tests run under all three sign-gate calibrations, including main's new cross_fitted_balanced. The fixture asserts that the cross-fitted cases get cross-fitted gates, calibrated out of fold or fallen back to the class rates. The empty-batch property pins both cross-fitted calibrations as explicit examples, at seed 7 (every gate calibrated) and seed 14 (one gate on the class rates). Called directly, it passes at seeds 0 to 40, 224 and 2^32 under each calibration.
  • On 4052c126c, the head before the fifth merge, every microcosm-fit test (337), the spec-engine loader tests (10) and the graph parity pin tests (11) passed, as did all 12 CI checks. The fifth merge changed no microcosm-fit or microcosm-graph file. CI runs every suite on this head, including the policyengine-us and orrery-contract jobs this venv cannot.
  • tools/ci_test_plan.py verify passes, and ruff check and format are clean on the changed files.

Attested hashes

microcosm.build.spec_engine.seeds attests microcosm.fit.qrf's source bytes, so this PR repins:

  • seed_map and seed_protocol in inventory_coverage.py, plus docs/evidence/spec-engine/us-f0-coverage.json, through tools/repin_us_spec_engine_contracts.py and tools/spec_engine_coverage.py. After the last merge the result shows 41 of 41 inventory checks and 42,401 of 42,401 configuration fields, and --check is clean. This PR changes no bundle constant, and generate_us_bundle_from_constants.py --check passes and reports the pinned spec_sha256.
  • The golden spec_sha256 in test_spec_engine_loader.py and test_us_multispine_pool_tool.py.
  • The fit.qrf graph parity pins (implementation hash and node keys for arm64/darwin/py3.14 and x86_64/linux/py3.13 and py3.14), written by tools/graph_parity_repin.py.

Review

  • Round 1 at 3254ba08: REQUEST_CHANGES, four should-fix findings and three nits, all fixed in 18924d618; round 2 confirmed each.
  • Round 2 at 881cc983 (Subfleet hard tier): REQUEST_CHANGES, with two P2 findings and several P3s and no P0 or P1, so the review has finished. 80628146e fixes them:
    • the cross-fitted fixture accepts a class-rate fallback, and the property pins both outcomes;
    • the claims about unsorted classes, argument types, empty tables, duplicate labels, strata and the memory layout now match main and the branch.
  • Round 2 rated the class-order change P2 on the evidence that only the last digits move. My own measurement (above) shows that ill-posed calibrations can move materially, so I took the call to the brief owner, who accepted the sorted order and the stricter types as documented exceptions. 001b8daf7 adds the pinning test round 2 asked for. An in-session delta check at 001b8daf7 of everything since round 2 (the third merge and its hashes, the tests, and every claim; each P0–P2 finding went to a refuter) found no P0 or P1. Its one P2, a slope pin on a stop point that isn't portable, and its P3 wording findings are fixed in e93a1c0cb.

Out of scope

  • D001, pure leaves at min_samples_leaf=1, and CategoricalClassifier's sensitivity to the scale of the weights. Both are methodology calls for Max.
  • microimpute, which PolicyEngine is archiving.

Follow-up

  • out_of_fold_proba leaves all-zero rows for a learner in any fold whose training rows hold a single class. The scorer now refuses such rows, where main scored them at the 1e-4 floor. APS never reaches it, and SPI does not at its 5 folds (see Production callers), but a direct caller with unstratified folds can. Score single-class folds and refuse weightless balanced classes in microcosm-fit #1617, which waits on this PR, scores those folds and also refuses a balanced class with no weight in a fold.

🤖 Generated with Claude Code

MaxGhenis and others added 4 commits November 7, 2026 14:59
…uced

microcosm-fit accepted, or crashed on, nine kinds of invalid input that the
microimpute bug-parity audit reproduced. It now refuses each with a named
error:

- seeds and n_estimators: refuse bools and non-integers (D010)
- zero_atol: require a finite value >= 0 in the constructor, detect_regime
  and chain checkpoints (D034)
- DataFrame fits: refuse a predictor, target, weight or groups label that
  names more than one column (D031)
- categorical_scores: validate probabilities, classes, weights and strata,
  and map labels by the supplied class order (D022)
- a weighted target whose positive or negative rows all carry zero weight
- an empty training table
- donor_distance_features: refuse missing or non-finite values, and add an
  explicit unseen_categories policy, "refuse" by default (D067)

A gated model now answers an empty recipient batch with an empty result
instead of the sign gate's zero-row error.

Valid input fits, draws and scores exactly as before: a differential run of
one fixed workload through main and this branch matched in all 239 arrays.
The fit kernels' attested source moves, so this repins seed_map and
seed_protocol, the golden spec hashes, the coverage evidence and the fit.qrf
graph parity pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The empty-batch fix reads classes_ from either gate type, so the empty
predict, conditional_uniforms, chain-step and no-draw tests now run under
both sign-gate calibrations. The fixture asserts that every gated target
really gets a cross-fitted gate, so the new cases cannot pass vacuously.
On main all ten empty-batch cases fail with sklearn's zero-row refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the RegimeGatedQRF constructor conflict by keeping main's
gate_level_columns checks and this branch's seed, n_estimators and
zero_atol checks. The attested-hash files take main's versions here; the
next commit repins them for the merged source.

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

- categorical_scores finds labels by main's sorted search and NumPy
  equality again, so boolean labels still match 0/1 classes. It reads the
  classes in sorted order whatever order they come in, so the calibration
  no longer depends on the column order, and sorted input keeps main's
  exact array (np.take keeps a permuted copy C-ordered).
- It refuses complex probabilities and weights before the float cast,
  which dropped NaN or infinite imaginary parts.
- detect_regime checks zero_atol without converting it, so an integer
  tolerance compares exactly with integer targets above 2**53.
- Corrects the wording the review flagged in docstrings, the donor
  distance error message and the changelog.
- Repins the attested kernel hashes for the merged source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's microcosm#1585 moved the same attested hashes this branch moves.
The merge keeps main's comments, adds this PR's, and repins the hashes
for the combined source: repin_us_spec_engine_contracts.py, then
spec_engine_coverage.py (42,395 of 42,395 fields, 41 of 41 checks), the
repin again, --check clean, and the fit.qrf graph parity repin (pins
unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Nov 14, 2026
#1543 merged main again (085672f), which moved the attested spec-engine
hashes. The four hash-only conflicts took #1543's side, then
tools/repin_us_spec_engine_contracts.py, tools/spec_engine_coverage.py and
the repin again (--check clean) repinned them for this branch's qrf.py, and
ruff format restored the double quotes the repin tool drops. No
microcosm-fit source or fit.qrf parity pin changes in the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 4 commits November 15, 2026 22:42
Main's microcosm#1096 (exact softmax cap projection in solve) moved the same
attested hashes this branch moves. The conflicts were hash-only: keep both
sides' comments and re-pin seed_map, seed_protocol, the coverage evidence and
the golden spec_sha256 values for the combined source. The fit.qrf graph
parity pins do not move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… claims (review round 2)

- The empty-batch fixture asserted every cross-fitted gate calibrated out of
  fold, so seeds whose gate falls back to the class rates (5, 14) failed it
  before the empty batch ran. Accept both cross-fitted outcomes, and pin both
  cross-fitted calibrations at seeds 7 and 14 as explicit examples (finding 1).
- The changelog said main refused every unsorted class order. Main scored the
  orders its sorted search happened to locate, in the order given, and those
  now score as the sorted columns do. Say so, with what moves: log loss never,
  share gaps in the last bits, and the calibration slope and outcome
  materially only where the fit is ill-posed (finding 2).
- Name the argument types now refused that main converted (seed 1.0 or "3",
  n_estimators 4.0, a Decimal or 0-d zero_atol), and correct the empty-table,
  duplicate-label, strata, permutation-layout and test docstring wording
  (findings 3 and 4).

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

Round 2 (finding 2) asked for a test that pins one unsorted-class input main
scored. Main scores classes [0, 2, 1] with one observed class at a slope of
about 0.849, in the order given; the sorted order gives about 0.875, and the
test pins that the input now scores exactly as its sorted columns do. The
brief owner accepted this change, and the stricter seed and tolerance types,
as documented exceptions.

The changelog's 1e-12 slope bound held only with at least two observed
classes: with one, slopes between 0.1 and 5 move too. Say so.

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

An in-session check of the changes since review round 2 found:

- The new pin asserted a slope of about 0.8754, the stop point of an
  ill-posed one-class calibration that a different row-sum association moves
  to 0.849. Pin only that the input scores exactly as its sorted columns do,
  which holds on any platform and fails on main.
- Both orders in that pin fix class 0's offset; the gap comes from the order
  of the other columns in an ill-posed fit. Say so in the test and changelog.
- The changelog's slope bullets: with two or more observed classes the
  outcome never changed and only slopes far above 1 moved by more than
  rounding; drop "near 0" from the material cases.
- Both models refuse a negative seed; only RegimeGatedQRF turned 1.0 and "3"
  into integers; its constructor also turned a string or bool zero_atol into
  a float.
- The zero-weight-sign crash belongs with the defects, not with the
  less-specific errors, in the module docstring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 16, 2026 04:25
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

The Microcosm hub now owns this PR and lands it.

  • The head is e93a1c0. Round 2's review read 881cc983. Since then the branch has three changes:
    • 9e6f57606 merges main c4ad23289. Its conflicts were hash-only, against microcosm#1096, and it repins the attested hashes.
    • 80628146e, 001b8daf7 and e93a1c0cb fix round 2's findings and add the pinning test round 2 asked for. They change only tests, the changelog and one docstring, and touch no attested source.
  • Round 1 (3254ba08) asked for changes, and 18924d618 fixed them; round 2 confirmed each fix.
  • Round 2 ran as Subfleet job 20261114-131612-fit-bug-parity-r2c (review, hard tier) over the whole diff. It raised two P2s and several P3s, and no P0 or P1. Its verdict line reads REQUEST_CHANGES for those P2s. Because round 2 raised no P0 or P1, review by class ends review there.
    • The verdicts are in ~/reviews/microcosm-fit-bug-parity-evidence-2026-11-07/review-r1.md and review-r2.md.
    • The PR body's Review section maps each finding to its fix.
  • An in-session check of everything since round 2 (run wf_ff7f8a05-934, in runs/delta-r3/ in the same folder) covered the merge, the hashes, the tests and the claims. It found no P0 or P1. Its one P2 (a slope pin on a stop point that isn't portable) and its P3 wording findings are fixed in e93a1c0cb.
  • Pending: CI. The Tests run on e93a1c0cb (43804001509) is in progress. Earlier heads passed all 12 checks at 881cc983. GitHub reports the PR as MERGEABLE, and the branch merges cleanly into main at 1da7fbe39.
  • The local checks pass:
    • all 336 microcosm-fit tests;
    • the spec-engine loader, seeds and graph parity tests;
    • tools/repin_us_spec_engine_contracts.py --check (rc 0) and coverage (41/41 and 42,395/42,395);
    • against main's source, the new module fails 98 tests and passes 15.
  • Two valid-input exceptions are documented in the changelog and the PR body. The requesting session accepted them as its own engineering call. They were not a Max decision, and no hold or decision id applies.
    • categorical_scores now scores unsorted classes in sorted order. That includes inputs main scored in the order given. No production caller passes unsorted classes.
    • Seed, n_estimators and zero_atol values of types outside the annotations, which main converted, are now refused.
  • Stacked PR. Score single-class folds and refuse weightless balanced classes in microcosm-fit #1617 (owner session local_a0cc316b, still a draft) is based on this PR's branch fix/fit-input-validation-bug-parity.
  • This PR depends on no open PR. The one follow-up, out_of_fold_proba's all-zero rows in single-class folds, is Score single-class folds and refuse weightless balanced classes in microcosm-fit #1617.

Main brought nine first-parent merges since c4ad232: #1626 (Belgium gate
rows), #1628 (NZ B8 reference teen heads), #1621 (County Files household
measures sidecar and schema manifest tools), #1540 (L0 release practice
docs), #1609 (gate battery shared scopes), #1619 (ACS partnership_income
kept at zero where SEMP holds it, #1387), #1629 (untimed composed stage-scan
test), #1594 (withdraw a release build) and #1541 (Microcosm name sweep).
Main changed nothing under packages/microcosm-fit or packages/microcosm-graph.

Four pin files conflicted; each block took main's text plus this branch's
own comment lines, placed after main's #1387 sentence:
- docs/evidence/spec-engine/us-f0-coverage.json: five digest blocks, main's
  side (the branch has no comment there).
- packages/microcosm-build/src/microcosm/build/spec_engine/inventory_coverage.py:
  main's #1387 comment, then the branch's #1543 sentence, then the digests.
- packages/microcosm-build/tests/engine_free/shared/test_spec_engine_loader.py:
  main's #1387 comment, then the branch's fit-input-checks sentence, then the
  golden.
- packages/microcosm-build/tests/engine_workflow/us/test_us_multispine_pool_tool.py:
  main's #1387 comment, then the branch's #1543 line, then spec_sha256.
No code or test file conflicted, and no other file was changed by both sides.

The tools then wrote every value on the merged tree:
- tools/repin_us_spec_engine_contracts.py: EXPECTED_HASHES seed_map
  d5898b93 and seed_protocol 206be396, the loader golden b7c843a1 and the
  multispine pool spec_sha256 4062e22e (its first pass moved the coverage
  tool test's covered_item_count to 40; its second pass restored 41, so that
  file equals main's).
- tools/spec_engine_coverage.py: us-f0-coverage.json's eight digest lines
  (42395/42395 configuration fields; 41/41 inventory checks).
- fit.qrf/pins.json keeps the branch's values: the merged fit sources equal
  the branch's and the kernel's implementation hash reproduces, so
  tools/graph_parity_repin.py was not run.
The repinner's quote style was then reformatted with ruff format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main brought five first-parent merges since 14797c6: #1640 (UK dense
bus floor for 21 families), #1642 (Belgium's ten gate entries in the gate
contract), #1643 (Belgium's Axiom engine pinned at 753ce7d9), #1608
(promotions notify collector; emitter-interface floor 0.16.0) and #1614
(LWI's US county facts pin). Main changed nothing under
packages/microcosm-fit or packages/microcosm-graph.

Two pin files conflicted, both through #1614; each block took main's text
plus this branch's own comment lines, placed after main's sentence:
- docs/evidence/spec-engine/us-f0-coverage.json: two spec_sha256 blocks,
  main's side (the branch has no comment there).
- packages/microcosm-build/tests/engine_workflow/us/test_us_multispine_pool_tool.py:
  main's #922 county-facts comment, then the branch's #1543 line, then
  spec_sha256.
No code or test file other than these two pins conflicted, and no other
file was changed by both sides.

The tools then wrote every value on the merged tree:
- tools/repin_us_spec_engine_contracts.py: the multispine pool
  spec_sha256 9ad067de (tools/generate_us_bundle_from_constants.py --check
  computes the same digest). It left the branch's EXPECTED_HASHES seed_map
  d5898b93 and seed_protocol 206be396 and the loader golden b7c843a1 as
  they were, and main's field-usage and coverage-tool pins as main has them.
- tools/spec_engine_coverage.py: us-f0-coverage.json's two spec_sha256
  lines (42401/42401 configuration fields; 41/41 inventory checks).
- fit.qrf/pins.json keeps the branch's values: the merged fit sources equal
  the branch's and the kernel's implementation hash reproduces, so
  tools/graph_parity_repin.py was not run.
The repinner's quote style was then reformatted with ruff format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit e0f728f into main Nov 17, 2026
12 checks passed
MaxGhenis added a commit that referenced this pull request Nov 17, 2026
…-degenerate-classes

#1543 landed on main as a merge commit, so this branch's copies of its
commits are already in main's history. The only conflicts were the
attested spec-engine hashes in four pin files. They took main's side, and
#1617's line in inventory_coverage.py's repin comment was restored. Then
tools/repin_us_spec_engine_contracts.py, tools/spec_engine_coverage.py
(42,401/42,401 fields, 41/41 inventory checks), the repin again and
--check (all exit 0), and python -m tools.graph_parity_repin fit.qrf.
The fit.qrf node keys are unchanged from 708d67e, because qrf.py is
unchanged. ruff format restores the double quotes.

Main's other change to microcosm-fit since #1617's base is #1543's
docstring edit to categorical_scores, which merged cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Nov 17, 2026
microcosm#1614 and #1543 moved the same pins as this PR, so the seed,
loader, multispine, pointer-inventory and coverage-report pins
conflicted. Main's side was taken in each pin file and both PRs'
comments kept; the repinner, bundle generator, coverage tool and
graph-parity repin then rewrote every value. The three --check runs
exit 0 and tools/ci_test_plan.py verify reports ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22 added a commit that referenced this pull request Nov 17, 2026
main's 124 commits since 9504278 conflicted only in the six F0 pin
files. They were resolved to main's side and re-pinned: repin
--legacy-only (no change), the generator with the US engine (no bundle
file changed), the full repin, spec_engine_coverage.py, then ruff format
on the five Python files it rewrites. Coverage reads 42404/42404
configuration fields and 41/41 inventory checks, and every --check
passes. spec_sha256 is now 0088d3f6; the pool test's comment keeps
main's three lines (#922, #1543, #1641) and this branch's us/gates.json
line.

main's microcosm#922 county work merged cleanly into the ACS local tool:
county support, its re-applied moves, the resume shortcut's evidence
check and do_package's county CSV all sit outside this branch's shadow
sites, which keep their call shapes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant