Remove shadow branches and line attribution #2692
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2692"
general
weight: 0.35
hiddeco
<!-- entire-trail-link-start -->
https://entire.io/gh/entireio/cli/trails/1509
<!-- entire-trail-link-end -->
Summary
Agent turns no longer write anything to git. Older versions committed a full working-tree snapshot to a per-worktree shadow branch (
entire/<commit>-<worktree>) at every turn end. That was the source of runaway local storage, and cleaning those branches up at the wrong moment made uncondensed work unreachable. Turn ends now record pending work in session state only: the step count, the files the agent touched, and each touched file's git blob hash. A checkpoint is written only when you commit.Line attribution is removed entirely, including the AI/Human/Mixed labels in
entire blame, which now reports whether each line's commit is linked to a checkpoint. Checkpoint metadata no longer carriesinitial_attributionorcombined_attribution; entire.io derives the experts counts from those and must be told they stop arriving.Commits link to a session by file name: any committed path the session touched links it, except a new file at a path the agent deleted. Carry-forward after a partial commit compares the recorded hashes with the commit and the worktree, so a
git add -premainder, a pending deletion, or a session upgraded from the old state format keeps its uncommitted work. Gitignored files, submodule pointers, and paths inside a submodule or beneath a symlinked directory never enter the tracked files, so they can no longer keep a session pending forever; edits inside a submodule belong to the nested repository's own session. Whether a committed file still has uncommitted agent changes is asked ofgit status, so repositories withtext=autoorcore.autocrlfno longer keep fully committed files pending.Lifecycle decisions (condensation, the zombie sweep, orphan cleanup, doctor) key on one predicate over session state instead of whether a shadow ref exists. Pending step rows, explain of temporary checkpoints, incremental task checkpoints and the Claude Code post-todo hook install are gone.
checkpoint list --pendingnow previews what the next commit's checkpoint will contain.Claude Code gains a transcript prompt extractor, so its prompts no longer depend on
prompt.txtalone.Addresses #2663, #2378, #2350, #1730, #1807 and #2653. Supersedes trail 1486 (
soph/fix-shadow-after-midturn-commit), which patches code this PR deletes.Migrations
Turn ends no longer write shadow branches (entire/<commit>-<worktree>): pending work is tracked in session state and checkpoints are written only when you commit. Branches left by older versions are not removed automatically.
entire doctorandentire statusreport them, andentire doctor --forceorentire disable --uninstalldeletes theentire/<commit>-<worktree>form without touching session state. The oldest bareentire/<commit>form is only ever listed, since a branch of your own named after a short SHA looks the same;entire clean --allremoves it behind a confirmation. Do not use plainentire cleanfor this: it also clears pending session state. They hold full snapshots of your working tree, so run it once after upgrading. Deleting the branches frees no space by itself: a latergit gcreclaims it once their objects are two weeks old.git gc --prune=nowfrees it immediately, but it drops every unreachable object in the repository (recently dropped stashes included) and must only run when no other git process is active.entire blame --jsonreports a per-linestatus(checkpoint,commit,uncommitted) instead ofauthorshipandtag. Its summary reports checkpoint-linked, commit and uncommitted line counts instead of AI/Human/Mixed counts.New checkpoints no longer include
initial_attribution,combined_attributionorprompt_attributions; checkpoints written by older versions keep theirs, and rewrites (explain--generate, attach) carry them through unchanged. Session state files written by older versions still load; their attribution andlast_checkpoint_commit_hashkeys are dropped on the next save.The Claude Code post-todo hook is no longer installed, and any
entire enableprunes it and says so. Its subcommand stays so older hook configs keep working. An older CLI run against the same tracked.claude/settings.jsonreports the hooks as out of date and re-adds it; this CLI removes it again on the nextentire enable.Commit pending agent work before downgrading to a previous release: the previous CLI deletes ended but uncondensed session state when its shadow branch is missing, and this release never writes one.
entire session info --jsonandentire session current --jsonreport the number of turns not yet condensed into a checkpoint aspending_turns. The oldcheckpointsfield is still emitted with the same value for this release only and will be removed in the next one; switch scripts topending_turns.entire status --jsonaddslegacy_shadow_branches.Follow-ups, not in this PR
Downgrade safety: the previous CLI deletes ended but uncondensed session state when its shadow branch is missing, and this release never writes one, so rolling back after pending work discards it. The migration note covers it; a patch on the previous release line whose orphan check also requires no pending work, named as the minimum safe downgrade target, is a release-management follow-up (trail finding 01M4DD0R83YC).
Worktree scoping, deferred to the #2531 work: scoping the zombie sweep and doctor to the current worktree, retiring the stored transcript copy with the growth check moving to the live transcript position, prompts and transcript for guest-linked commits, and capture following the event's cwd. #2531 itself must be reworked after this lands, since it pins sessions through shadow-branch steps; #2486 is expected to close in its favour.
Tracked on the priority list for go-git (#DM2KFD6): its worktree hashing lacks gitattributes, filter, and index-aware CRLF handling, which is why this PR asks
git statusinstead of hashing; porting that logic into go-git would let the CLI drop the subprocess.Test plan
mise run check(fmt, lint, unit, integration, Vogon canary) andGOOS=windows go vet ./...on the final tree, with a cold lint cache, after merging main at375819df95. Every commit builds and vets on its own. A focused security review of the cross-worktree stored-transcript read (a path taken from on-disk session state, gated bygit worktree listregistration and the.entireanchor) found no findings. The only local failures are the known OpenCode seed-cache guard and the Claude config-probe timeout, which passes alone.New unit, integration and command tests cover: recorded-hash carry-forward (partial commits, pending, committed and re-created deletions, upgraded sessions, an unreadable worktree); name-based linking; gitignored and submodule paths on every capture route; the doctor legacy-branch check; the
--pendingpreview in text and JSON without a TTY; and the Claude prompt extractor against the real transcript fixture.Real-agent E2E passed on
44ebccb136for every leg (claude-code, codex, cursor-cli, copilot-cli, factoryai-droid, opencode, antigravity, roger-roger, and Windows): https://github.com/entireio/cli/actions/runs/37655720329. One changed expectation isTestInteractiveNewFileLinksAfterUserRewrite, which now expects a trailer after a user rewrites an agent-created file.🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->