Extract named steps from reconciliation::build_reconciliation, pinning three untested gaps first - #480
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
A mutation run found that removing the pack check from the report tie-out guard, the duplicate-record-across-windows gap, or the complete-count versus unique-identity comparison left all 967 bridge lib tests green. Each new test fails under its mutation on this code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
build_reconciliation was 276 lines against a file median of 12. The gap checks and cross-window totals are now named steps: insert_run_drift_gaps, insert_window_count_gaps, report_tie_out_gap and SnapshotTotals (add_object_counts, add_canonical_records, finish). Gaps are a set and mismatches are sorted and deduplicated, so step order cannot change output. No behaviour change: 1,573 workspace test names identical. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ction Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lamemustafa
force-pushed
the
tapish-claude/reconciliation-steps-v2
branch
from
September 17, 2026 03:19
f3afd28 to
dd4f521
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
sync/reconciliation.rs::build_reconciliationwas 276 lines against a file median of 12. It is now the run sequence, with each gap check and the cross-window accumulation as named steps. No behaviour change.Before the move, three of its gap branches had no test at all. A PR commit now pins each one, proven on the original code.
insert_run_drift_gapsinsert_window_count_gapsreport_tie_out_gapSnapshotTotals::add_object_countsSnapshotTotals::add_canonical_recordsSnapshotTotals::finishgapsis aBTreeSetandmismatchesis sorted and deduplicated before use, and nothing reads either while the loop runs. So the order in which steps insert cannot change the output.Commits
Pin three build_reconciliation gaps no test reached(tests only, on the original code). A hand mutation run on the moved branches found that three mutations left all 967 bridge lib tests green:report.pack == input.packfrom the tie-out guard;duplicate_record_across_windows;No test anywhere names those gap codes, and each decides whether a snapshot can be
Verifiedand write a checkpoint. The new tests arereport_tie_out_passes_only_for_the_run_pack,identical_record_in_two_windows_without_complete_scope_is_a_duplicateandcomplete_source_count_must_equal_the_unique_identities_accepted. Each fails under its mutation on the original code (21 passed, 1 failed, each time).The extraction. The same four mutations (the three above plus dropping
source_cut_atomicity_unavailable) applied to the new code each fail (21/1). Mutations were restored from the commit each time.Review fixes (comments only) and the reseal.
Proof
cargo test --workspace -- --listonsrc-tauri/gives 1,573 names, identical before and after the extraction (sorted diff empty), plus the 3 new tests from commit 1. Tests and the diff were run on the original base before the rebase.cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warnings -A clippy::pedanticpass onsrc-tauri/.reconciliation.rsand its tests are byte-identical to the reviewed head../scripts/reseal.shthen--verifyexits 0: 262 pins, cap 262, one content hash.Open follow-up (P3, not in this PR)
The per-window
record_countssum stays inline inbuild_reconciliationwhile the other accumulations live onSnapshotTotals. Folding it in needs a full rebuild, deferred because disk was tight tonight.Conventions checklist (docs/rust-module-conventions.md), measured
build_reconciliationis a livepub fncalled by the snapshot orchestration.reconciliation_tests.rs(Move the inline tests out of commands.rs and sync/reconciliation.rs #441).canonicalize_core_window(169) is the longest, andbuild_reconciliationholds the loop and proof assembly.SnapshotTotalsholds the six mutually coupled per-iteration accumulators.Coordination: claimed with the app-crate lane owner. It joins
BRIDGE-MERGE-QUEUE.mdat the tail and merges only after announcement.🤖 Generated with Claude Code