checkpoint: ask the remote for both shard spellings

Commit

Stefan Haubold1mo ago

batchPushRefs pushes <ref>:<ref>, so the local and remote spellings of a checkpoint ref are deliberately identical โ€” and writeRefName now targets the folded spelling when that is where the local ref lives. A checkpoint written on a machine whose shard bucket was folded therefore reaches the remote under the folded name.

resolveRefMaybeFetch asked only for the canonical one. A clone holding neither spelling โ€” a fresh clone, or any case-sensitive filesystem โ€” was told "absent" and never looked further, so an intact checkpoint read as missing across machines. It also stranded a remote-list discovery stub: ParseRef accepts the folded remote name, so the stub is listed, and then hydration had nothing to fetch.

The fetch now walks both spellings, canonical first. Only the absence signal advances to the second: a transport failure still returns at once and is still memoized, so an outage is paid once rather than twice.

Cost: a genuinely absent checkpoint is asked for twice instead of once. Absence was already O(N) round-trips (it is per-ref and deliberately not memoized), so this doubles a linear cost rather than changing its shape. A single glob refspec would avoid it, but no-match and success become indistinguishable, which is exactly the absence-on-positive-evidence property remote.FetchCheckpointRef is built around.

Refs #2402

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com Entire-Checkpoint: 01M2JQW1M351EDK4SVG212RD3C