You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(checkpoint): harden the write-probe fetcher per re-review
Findings from the wiring commit's multi-agent re-review:
- False absence on a fallback target (HIGH): when a checkpoint_remote is
configured but unresolvable (unknown provider + unmappable origin
protocol), FetchURL falls back to origin — a remote that never hosts the
configured checkpoint refs. The ls-remote probe treated its emptiness as
absence, silently dropping backfills for checkpoints that exist on the
real checkpoint remote. fetchURLAuthoritative now reports whether the
resolved URL is authoritative for checkpoint refs; probe-emptiness on a
non-authoritative fallback is a failure, never absence.
- SSH hygiene in hooks (HIGH): the two hook wirings now use
remote.HookCheckpointRefFetcher, which marks the context non-interactive
(BatchMode SSH) like the pre-push path — a passphrase-protected key can
no longer prompt or hang inside post-commit/stop hooks.
- Actionable errors (HIGH): lsRemote folds git's redacted stderr into its
error, and FetchCheckpointRef folds the fetch output — a bare 'exit
status 128' left auth, DNS, and missing-repo failures indistinguishable
in hook Warn logs.
- Caller cancellation is no longer memoized as a network failure (a Ctrl-C
mid-operation said nothing about the remote); the memoized-skip message
notes its cause may name a different ref; mirrors never receive a
RefFetcher (best-effort write-only copies must not pay network probes);
the git-branch backfillTranscript gains the ctx.Err() guard its siblings
have (pre-existing gap surfaced by the same review).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
returnnil, fmt.Errorf("checkpoints.mirrors[%d]: backend type %q is already used by the primary or another mirror; each backend type may appear at most once", i, m.Type)
168
168
}
169
169
seen[m.Type] =true
170
-
store, err:=build(ctx, env, m.Type, m.Config)
170
+
// Mirrors are best-effort write-only copies whose failures are logged
171
+
// and dropped; never pay on-demand ref-fetch network probes for them.
returnfmt.Errorf("probe checkpoint ref %s on %s: %w", ref, RedactURL(fetchTarget), err)
62
72
}
63
73
iflen(bytes.TrimSpace(out)) ==0 {
74
+
if!authoritative {
75
+
// The probe hit an origin FALLBACK while a checkpoint_remote is
76
+
// configured (or undeterminable) — a remote that may simply never
77
+
// host the configured checkpoint refs. Emptiness there proves
78
+
// nothing; classifying it as absence would silently drop backfills
79
+
// for checkpoints that exist on the real checkpoint remote.
80
+
returnfmt.Errorf("checkpoint ref %s not visible on fallback remote %s, and the configured checkpoint remote could not be resolved; refusing to treat this as absence", ref, RedactURL(fetchTarget))
81
+
}
64
82
returnfmt.Errorf("checkpoint ref %s not found on %s: %w", ref, RedactURL(fetchTarget), plumbing.ErrReferenceNotFound)
65
83
}
66
84
67
85
refSpec:="+"+ref.String() +":"+ref.String()
68
-
if_, err:=Fetch(ctx, FetchOptions{
86
+
iffetchOut, err:=Fetch(ctx, FetchOptions{
69
87
Remote: fetchTarget,
70
88
RefSpecs: []string{refSpec},
71
89
NoTags: true,
72
90
}); err!=nil {
91
+
// Fold git's own output into the error (redacted): a bare
92
+
// "exit status 128" is undebuggable in hook Warn logs.
0 commit comments