test(integration): add git-refs per-checkpoint ref divergence & recovery (D2, D3)

Commit

Soph2mo ago

Drive the git-refs recovery end-to-end through the real pre-push path (drain queue -> batch push -> per-ref fetch+replay), complementing the unit-level coverage in strategy/refs_push_test.go.

D2:

  • remote ref amended by another clone (valid child commit) + a divergent local write of the same ref: the fast-forward-only batch push is rejected, recovery fetches the remote tip and replays the local change on top (non-force), so both sides' files survive and the remote commit stays an ancestor.
  • queue safety: when the remote refuses the ref update (bare pre-receive declining the checkpoint namespace), the ref stays queued and the remote is untouched (never force-overwritten); a later push retries and lands it. A pure content-level cherry-pick conflict is not reproducible at this layer (tree-delta apply is last-writer), so a server-side rejection stands in.

D3: two clones race on the SAME per-checkpoint ref from a shared base -- the second pusher fetch+replay+retries (non-force), preserving both. The git-refs analogue of TestConcurrentPush_SecondPusherRebasesAndRetries (v1-only).

Co-Authored-By: Claude Fable 5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_012yi3hHGAGepwfrfjPETjGq Entire-Checkpoint: faa45ac4455f

Checkpoints

Comprehensive Checkpoint Testing Coverage

CodexGPT-5.5
View session
Checkpoint 1