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
feat(attach): explicit-target review attach bound to a commit SHA
Adds an explicit-target mode to 'entire session attach --review':
--checkpoint-id <id> --commit-sha <sha> creates the checkpoint under a
caller-supplied ID bound to the given commit via a new commit_sha metadata
field, instead of resolving HEAD's Entire-Checkpoint trailer and amending
the commit.
This unblocks platform review provenance for commits that cannot carry a
trailer (merge commits, squash merges, human pushes): the reviewed commit
is immutable once pushed, so the trailer-based linkage requires a force
push that is never allowed. The platform mints the checkpoint ID and
passes the reviewed commit's SHA; the binding lives in checkpoint
metadata, not the commit message.
- commit_sha (omitempty) on Metadata, CheckpointSummary and WriteOptions,
plumbed through the session and summary writers.
- Explicit-target mode skips trailer resolution, the session-has-checkpoint
refusal (the reviewer's own eagerly-condensed checkpoint is irrelevant to
the new checkpoint), and never amends HEAD.
- Retried attaches with the same target are idempotent no-op successes so
the platform can safely retry the publication script.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
returnfmt.Errorf("invalid --commit-sha (want full 40-hex SHA): %s", commitSHAFlag)
157
+
}
158
+
opts.CheckpointID=cpID
159
+
opts.CommitSHA=normalizedSHA
160
+
}
118
161
// When tagging as a review, consume any pending-review marker left
119
162
// by `entire review` for an agent it could not launch itself: adopt
120
163
// its agent / skills / prompt so the manual attach matches what the
@@ -149,6 +192,8 @@ the transcript and prints the detected agent name.`,
149
192
cmd.Flags().StringVarP(&agentFlag, "agent", "a", string(agent.DefaultAgentName), "Agent that created the session (see 'entire agent list' for registered agents, including external)")
150
193
cmd.Flags().BoolVar(&reviewFlag, "review", false, "Tag the attached session as an agent review")
151
194
cmd.Flags().StringSliceVar(&skillsFlag, "skills", nil, "Optional: declare which review skills were run in this session. Only used with --review")
195
+
cmd.Flags().StringVar(&checkpointIDFlag, "checkpoint-id", "", "Explicit checkpoint ID to create for this attach (requires --review and --commit-sha; skips trailer resolution and never amends HEAD)")
196
+
cmd.Flags().StringVar(&commitSHAFlag, "commit-sha", "", "Full SHA of the commit this attach is bound to, recorded as commit_sha in the checkpoint metadata (requires --review and --checkpoint-id)")
0 commit comments