fix(ci sync): probe a state commit that bundles source edits instead of trusting convergence - #10598
fix(ci sync): probe a state commit that bundles source edits instead of trusting convergence#10598luvkapur wants to merge 3 commits into
Conversation
…of trusting convergence a commit changing .bitmap AND sources is its own state commit, so the dev-commit count started after it and the edits read as converged — the exact shape the conflict-halt comment's resolve-by-hand recipe produces, stranding the resolution (and a later lane move would import-lane over it). git names alone cannot tell whether those sources are already inside the recorded snap, so the planner treats them as suspected work: a probe-only export-branch lets the snap decide — nothing pending settles as converged with zero writes, real work exports to the lane. suspected work counts as work on every path where a wrong 'no work' answer could lose something (deletion, divergence, first contact). the state-model cells that locked the old Stage-1 delta are rewritten to the new contract
PR Summary by QodoProbe bundled .bitmap+source state commits to avoid false ci-sync convergence
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo
1.
|
…n diff a state commit changed .bitmap by definition, so its first-parent diff is never legitimately empty — empty output is simple-git resolving on a non-zero exit, and must fail toward probing
…robe first contact with bundled sources routes to adopt-branch (adoption already probes via bit status); the different-lane guard's gate widens to suspected work so a bundles-only branch cannot be adopted over another lane's live claim; deletion cascade keeps master's shape with mayCarryWork feeding the unmerged-work check
Proposed Changes
bit ci syncwrongly reporting "converged" when one git commit contains both a source edit and a.bitmapchange. The edit never reached the lane, and the next lane update would overwrite it on the branch.The bug
Sync decides "does the branch have new work?" by counting commits AFTER the last commit that touched
.bitmap. When a single commit changes.bitmapAND source files, that count is zero — so sync reportsnoop (converged)even though the source edit was never snapped. The lane never gets the edit, and a laterimport-laneoverwrites it.This is exactly the commit shape sync's own conflict-resolution instructions produce (
bit lane import, fix the files, commit once). Found live while testing the halt → resolve → resume flow.The fix
Git alone can't tell whether the bundled files are already inside the recorded snap (a dev who snapped, exported, and committed everything at once) or were never snapped. So instead of guessing, sync checks with bit:
Where a wrong "no work" answer could lose something (branch deletion, divergence, first contact), the bundled commit counts as work — the safe direction. Sync's own ledger commits are exempt (they legitimately bundle merged sources).
Tests
noop (converged)), green with the fix (the lane gets the edit; the next run converges).ci-sync-state.e2e.tscells that had locked the old behavior are updated: the converged-dev case still ends with zero writes, the invisible-edit case exports immediately.Note
Master (with #10593 merged) is merged in. At first contact, a bundled commit routes to
adopt-branch— adoption already checks with bit before writing — and the different-lane guard now also fires for bundled commits.