Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28b573c
Let session attach link a commit without rewriting it
peyton-alt Oct 6, 2026
1355b5b
Let session attach decide how to link from the commit
peyton-alt Oct 6, 2026
171e4f2
Join the checkpoint a pushed commit is already linked to
peyton-alt Oct 6, 2026
9457344
Join only a local linked checkpoint, and fetch before deciding to amend
peyton-alt Oct 6, 2026
f994c53
Fail closed when attach can't confirm a commit's push state
peyton-alt Oct 7, 2026
55c3949
Find a pushed commit that isn't a remote branch tip
peyton-alt Oct 7, 2026
4f2df4f
Never amend a pushed HEAD from an existing checkpoint; scope remote c…
peyton-alt Oct 7, 2026
c56a236
Share one stub-read budget and cache across a blame run
peyton-alt Oct 7, 2026
7d4338a
Confirm before attach links; rewrite unpushed commits; one rule for a…
peyton-alt Oct 7, 2026
e204fa0
List linked commits in explain; quieter re-attach; singular rewrite w…
peyton-alt Oct 7, 2026
c6535cb
Write no remote-tracking ref when fetching branches to check ancestry
peyton-alt Oct 7, 2026
b141f79
Push a joined checkpoint now when its commit is already pushed
peyton-alt Oct 7, 2026
4b25fe9
Ask only the branch's remotes' tracking refs whether a commit is pushed
peyton-alt Oct 7, 2026
8cda1a5
Never rewrite a commit any remote-tracking ref holds; refuse commits …
peyton-alt Oct 8, 2026
8f3dd52
Check a commit against untracked remote tips in one walk; test delive…
peyton-alt Oct 8, 2026
331edf7
Retry an undelivered checkpoint when attach is rerun
peyton-alt Oct 8, 2026
a9aad14
Confirm delivery against the ref the checkpoint is actually in
peyton-alt Oct 8, 2026
35bc72a
Confirm before a rerun pushes; treat an unfinished history walk as un…
peyton-alt Oct 8, 2026
b91b510
Merge origin/main into peyton/attach-commit
peyton-alt Oct 8, 2026
926de5e
Keep each commit's committer when attach adds the trailer
peyton-alt Oct 8, 2026
8db7fd7
Refuse a non-UTF-8 HEAD too when adding the trailer
peyton-alt Oct 8, 2026
10bcb1d
Harden attach's remote checks found in a security review
peyton-alt Oct 8, 2026
9fb45ea
Label recorded links as unverified; ask remotes again after the prompt
peyton-alt Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/checkpoint/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ type WriteOptions struct {
// CheckpointSummary.CommitSHA point back here.
CommitSHA string

// LinkedCommits links this checkpoint to existing commits without a
// trailer, as `entire session attach --commit` writes when the commit
// cannot be amended. Unlike the import anchor (CommitSHA) it is an
// attributing link: readers treat each entry exactly like a commit
// carrying this checkpoint's Entire-Checkpoint trailer. A rewrite of the
// same checkpoint keeps the existing entries and adds new ones.
LinkedCommits []LinkedCommit

// Transcript is the session transcript content (full.jsonl).
// Must be pre-redacted (via redact.JSONLBytes or redact.AlreadyRedacted for trusted sources).
Transcript redact.RedactedBytes
Expand Down Expand Up @@ -355,6 +363,10 @@ type CheckpointInfo struct {
// CheckpointID is the stable 12-hex-char identifier
CheckpointID id.CheckpointID

// LinkedCommits are the checkpoint's trailer-less commit links; see
// WriteOptions.LinkedCommits.
LinkedCommits []LinkedCommit

// SessionID is the session identifier (most recent session for multi-session checkpoints)
SessionID string

Expand Down Expand Up @@ -591,6 +603,8 @@ type CheckpointSummary struct {
FilesTouched []string `json:"files_touched"`
Sessions []SessionFilePaths `json:"sessions"`
TokenUsage *types.TokenUsage `json:"token_usage,omitempty"`
// LinkedCommits: attributing trailer-less links; see WriteOptions.LinkedCommits.
LinkedCommits []LinkedCommit `json:"linked_commits,omitempty"`

// LegacyCombinedAttribution carries the combined_attribution older CLIs
// wrote into the root summary through rewrites, byte for byte; see
Expand Down Expand Up @@ -651,3 +665,16 @@ type CodeLearning struct {
EndLine int `json:"end_line,omitempty"` // End line for ranges (optional)
Finding string `json:"finding"` // What was learned
}

// LinkedCommit is one trailer-less link from a checkpoint to a commit; see
// WriteOptions.LinkedCommits. The server links it only after verifying the
// commit, so Repo is a hint for finding which code repository holds SHA when
// one checkpoint store serves several.
type LinkedCommit struct {
// SHA is the full lowercase commit hash.
SHA string `json:"sha"`
// Repo is the code repository as <forge>/<owner>/<repo> (e.g.
// gh/entireio/cli), resolved from the git remote that holds the commit.
// Empty when it could not be resolved.
Repo string `json:"repo,omitempty"`
}
8 changes: 8 additions & 0 deletions cmd/entire/cli/agent_help_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ var agentHelpClassification = map[string]agentHelpFacts{
// true for both audiences (e.g. "these endpoints are internal and can change")
// belongs in Long instead, where both see it.
var agentHelpGuidance = map[string]string{
"session attach": "Commits made during a session are linked to it automatically. Use this\n" +
"only when one was missed: `entire session attach <session-id> --commit <sha>`\n" +
"(default HEAD). Run it without --force first: it prints what it would do\n" +
"(rewrite unpushed commits to add the trailer, or record a link to a pushed\n" +
"commit and push the session transcript) and exits non-zero without changing\n" +
"anything. Show the user that output and ask them; pass --force only after\n" +
"they agree to that exact change, never pre-emptively. A link to a pushed\n" +
"commit counts only when its author attaches it.",
"api": "LAST RESORT. Right in two cases: you are developing against Entire's own\n" +
"APIs and want a raw response, or no first-class command covers your need.\n" +
"Otherwise prefer the command built for the job (checkpoint, session, trail,\n" +
Expand Down
941 changes: 779 additions & 162 deletions cmd/entire/cli/attach.go

Large diffs are not rendered by default.

Loading
Loading