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(attach): harden explicit-target mode for general CLI use
Review findings on the explicit-target attach, fixed for the CLI as a
public command rather than platform plumbing:
- Validate --commit-sha names a real commit in the repository (it was only
shape-checked); silently recording an unknown SHA would produce
provenance pointing at nothing.
- Refresh remote state for the explicit checkpoint ID before treating it
as new (ensureExplicitCheckpointFreshness): a retried attach from a
fresh clone would otherwise rebuild the ID as an orphan that clobbers
the original on push. Same-session hits stay idempotent no-ops; an ID
that exists with other content is refused, never modified. Fetch
failures degrade to 'not present' with a warning, preserving offline
operation.
- Keep explicit-target attaches out of trailer-linked session state: the
SHA-bound review checkpoint is not the session's code checkpoint, so
BaseCommit/LastCheckpointID are no longer overwritten (amend hooks and
resume must never treat the review checkpoint as trailer-linked).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entire-Checkpoint: 01KY4W9TBQX9Y7JSSSHMW9J5ZC
t.Errorf("LastCheckpointID = %s, want original session checkpoint %s", attachedState.LastCheckpointID, ownCheckpointID)
1275
+
}
1276
+
ifattachedState.BaseCommit!="" {
1277
+
t.Errorf("BaseCommit = %q, want empty; explicit-target attach must not bind session state to HEAD", attachedState.BaseCommit)
1278
+
}
1279
+
ifattachedState.AttributionBaseCommit!="" {
1280
+
t.Errorf("AttributionBaseCommit = %q, want empty; explicit-target attach must not bind attribution state to HEAD", attachedState.AttributionBaseCommit)
1281
+
}
1282
+
1262
1283
// HEAD must be untouched: same commit, no trailer appended.
0 commit comments