tighten committed-ref mirror visibility and ctx handling

main

Commit

pfleidi3mo ago

Three small visibility fixes for the v1.1 mirror best-effort path:

  • Add ErrPrimaryMetadataMissing sentinel. MirrorCommittedMetadataRef wraps the primary-ref NotFound case with the sentinel, so the best-effort caller can log Debug only for that case and Warn for every other failure — including a SetReference NotFound that the previous errors.Is(err, plumbing.ErrReferenceNotFound) check conflated with 'primary missing'.

  • Detach cancellation in MirrorCommittedMetadataRefBestEffort with context.WithoutCancel. A near-expired parent deadline (e.g. the 2-minute fetch budget in fetchMetadataFromOrigin) could fail settings.Load silently inside ResolveCommittedRefs, causing HasMirror to report false and the mirror to skip with no log. The mirror is short and best-effort; trace/value context is preserved.

  • Log Debug in mirrorSyncedMetadataBranch for the two cases that previously returned silently (primary not a branch; branch name does not match primary). These are future-topology guards; today they never fire, but a silent skip would be hard to find later.

Entire-Checkpoint: 3372c9e81e2d

Checkpoints

Centralize Checkpoint Metadata Mirror Updates

CodexGPT-5.5
View session
Checkpoint 1

Prevent Unauthorized Metadata Ref Creation

Claude Code
View session
Checkpoint 1