Repository navigation
feat(agents): git checkpoints after each feature-agent step (spec 138) - #931
Merged
Merged
Conversation
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
…elpers Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
…ervices Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
… cases Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
… node Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
…t is archived Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
…tore policy Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
…e imports Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
arielshad
pushed a commit
that referenced
this pull request
Oct 11, 2026
<p align="center"> <a href="https://github.com/shep-ai/shep"> <img src="https://raw.githubusercontent.com/shep-ai/shep/main/docs/screenshots/shep-card.jpg" alt="Shep — run multiple AI agents in parallel" width="720" /> </a> </p> # 🚀 Shep [v1.241.0](/compare/v1.240.0...v1.241.0) · _2026-10-11_ > Your organization does not have access to Claude. Please login again or contact your administrator. ### ✨ Features * **agents:** emit decision.answered and decision.defaulted telemetry (spec 136) ([#929](#929)) ([1e1f859](1e1f859)), closes [#922](#922) [#925](#925)     * **agents:** git checkpoints after each feature-agent step (spec 138) ([#931](#931)) ([26265ed](26265ed)), closes [#925](#925)     * **web:** put the SDLC board behind a feature flag, off by default ([#932](#932)) ([e71f138](e71f138)), closes [#925](#925) ### 🐛 Bug Fixes * **cli:** wait for the conpty host to exit when a terminal closes ([#928](#928)) ([94a846d](94a846d)), closes [#925](#925) [#925](#925) ## 📦 Install or update ```bash # upgrade an existing install npm i -g @shepai/cli@1.241.0 # or run instantly without installing npx @shepai/cli@latest ``` ## 💬 Join the community [💬 **Discord**](https://discord.gg/ES6tdVFfur) · [📖 **Docs**](https://github.com/shep-ai/shep#readme) · [⭐ **Star on GitHub**](https://github.com/shep-ai/shep) · [🐛 **Report an issue**](https://github.com/shep-ai/shep/issues) --- <sub>🤖 Released autonomously by Shep — built by parallel AI agents working in isolated git worktrees. Try it: `npx @shepai/cli`</sub> Co-Authored-By: Shep Bot <shep-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
After every feature-agent step that can change files, Shep now snapshots the feature's worktree into a hidden ref,
refs/shep/checkpoints/<featureId>/<seq>-<node>, and records it in SQLite. Users can then:Why
Implements
specs/138-git-checkpoints/: workstream T4 of the T3 Code review (docs/competitors/t3code.md, "What Shep Should Take" §3).Until now a run kept only its end state, the branch. Nobody could answer "what did implement change, and what did repair change after it?", or undo one bad step without editing git by hand.
Capture
Capture follows T3's approach and never touches the user's branch, HEAD, index or files:
GIT_INDEX_FILE.add -A, thenwrite-tree.commit-treewith a fixed identity and no signing, thenupdate-ref.All writes run with
core.fsync=objects,reference.withCheckpointwrapper covers every file-changing node of the full, fast and exploration graphs.Diff
Diffs run
git diffbetween two checkpoint commits and are cached in-process. The unified-diff parser previously inGitPrService(with a hand copy in the GitHub review service) is now one shared module.Restore
Restore first captures a
pre-restorecheckpoint, so a restore can itself be undone. It then runsclean -fd,read-tree --reset -uandreset -q. The working tree matches the checkpoint, ignored files are kept, and the branch is not moved, so nothing already pushed is rewritten.A single
CheckpointRestorePolicygates restore, and the list exposes its answer as a typedCheckpointRestoreBlocker. It refuses unless all three hold:Cleanup
Refs and rows are deleted when the worktree is removed (post-merge cleanup, delete) or the feature is archived (manual or auto-archive).
Data model
GitCheckpoint.GitCheckpointKindandCheckpointRestoreBlocker.git_checkpoints. 169 belongs to feat(web): review cleanup — per-area feature flags, ASPM off by default #925, which is merged into this branch.Screenshots / Recording
Storybook (
Features/Checkpoints/*) with fixture data. Light and dark.Testing
Real git (global/system config isolated, signing off, worktree path with a space):
tests/integration/infrastructure/services/git/git-checkpoint.service.test.tsgit status, HEAD, branch and index unchanged.GIT_INDEX_FILEthe "index untouched" test goes red.Repository:
tests/integration/infrastructure/repositories/sqlite-git-checkpoint.repository.test.ts(non-default round-trip, UNIQUE per feature, delete, idempotent migration).Use cases (
tests/unit/application/use-cases/features/checkpoints/)Pipeline:
with-checkpoint.test.tsandcheckpoint-capture.test.ts, plus graph-level tests asserting which nodes capture in the full, fast and exploration graphs (validate nodes never capture).Cleanup hooks: archive, auto-archive watcher, worktree cleanup, delete.
CLI:
checkpoints.command.test.ts.Web:
checkpoints-tab.test.tsx(per-step, baseline, compare, restore confirm/refusal, blocker, empty, error), plus drawer tab visibility.DI: the bootstrap test resolves every new token and goes red without the registration.
Storybook:
CheckpointList(Default / RestoreDisabled / WithPreRestore / WithoutRestore),CheckpointCompareBar,CheckpointRestoreDialog(Default / Pending / Closed),CheckpointsTab.Local results, on the tree merged with
main:lint,format:check,typecheck,check:storiesandgenerate(no drift) all pass.test:unit: 15,043 passed.test:int: 2,160 passed. The first run had 7 failures independency-path-traversal, caused by the unpatchedextract-zipI had installed into the sandbox as a stand-in; with the repo patch applied, all pass.build,build:webandbuild:storybookpass.Checklist
pnpm lintpassespnpm format:checkpassespnpm typecheckpassespnpm test:unitandpnpm test:intpasspnpm buildsucceedspnpm build:storybookandpnpm build:websucceed; every new component has a colocated.stories.tsxpnpm generateran andoutput.tsplusapis/json-schema/are committeddomain/orapplication/file imports anything frominfrastructure/🤖 Generated with Claude Code
https://claude.ai/code/session_01V37fpj6cexvgoExiG9SHKj
Generated by Claude Code