feat: batch execute — one shared worktree, commit per plan, checkpoint gates - #26
Open
erkamdemirci wants to merge 1 commit into
Open
feat: batch execute — one shared worktree, commit per plan, checkpoint gates#26erkamdemirci wants to merge 1 commit into
erkamdemirci wants to merge 1 commit into
Conversation
…t gates execute handles one plan per invocation, each in its own cold worktree. This adds `execute all` / `execute <range>`: the backlog runs through a single shared batch worktree (git worktree add -b advisor/batch-<slug>), provisioned once, executors dispatched serially in plans/README.md order with one commit per plan. - Baseline gate before the first dispatch: red baseline stops the batch — pre-existing failures poison every review. - Verification is layered: per plan, the reviewer re-runs the plan's SCOPED done criteria (cheap by construction); the repo's FULL gate runs at checkpoints — every 3-5 approved plans, after HIGH-risk plans, and at batch end. On checkpoint failure, bisect the per-plan commits. - plan-template: Done criteria split into Scoped / Full gate layers sized to the plan's blast radius. - BLOCK in a batch rolls back (git reset --hard <last-good>, untracked leftovers scoped to in-scope paths only) and continues with the next non-dependent plan; dead executors get the same treatment. - File-disjoint plans (pairwise-disjoint Scope sections) may still fan out to parallel per-plan worktrees; any overlap forces serial. The isolation model is unchanged: executors edit only inside a disposable worktree, the user's checkout is never touched, merging stays the user's decision. This changes worktree count, not the guarantee. Implements shadcn#25. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Implements #25.
Problem
executehandles exactly one plan per invocation, and each invocation provisions its own worktree. Executing a six-plan backlog means six dispatches babysat by the operator and six toolchain warm-ups, with the full done-criteria suite re-run per plan — even though the skill already writesplans/README.mdas a dependency-ordered queue. Everything needed to run the backlog end-to-end is already on disk; the invocation surface just can't express it.Change
execute all/execute <range>(e.g.execute 001-004) runs the backlog through one shared batch worktree instead of a worktree per plan:git worktree add <path> -b advisor/batch-<slug>from the user's HEAD, provision it, then run the repo's full gate as a baseline. Red baseline → stop: pre-existing failures poison every subsequent review, and "restore the baseline" is the real plan Reword security audit guidance for defensive remediation #1.plans/README.mdorder (dependencies enforced), one commit per plan, commit SHA in the report. Plans with pairwise-disjoint Scope sections may still fan out to parallel per-plan worktrees; any overlap forces serial.git clean -fdworktree-wide) and continues with the next plan that doesn't depend on the blocked one. A dead executor (stale IN PROGRESS, dirty worktree) gets the same treatment before the next dispatch.git worktree add, branch creation, reset-to-last-good) — still confined to the disposable worktree.What doesn't change
Every existing guarantee, verbatim: the advisor never edits code; executors edit only inside a disposable worktree; the user's checkout is never touched; merging stays the user's decision. A lone
execute <plan>behaves as before (its "checkpoint" is simply its own end). This changes worktree count, not the isolation model.Composes with #24 (warm provisioning) but doesn't depend on it — batch mode already amortizes provisioning to once per batch; #24 makes that once cheap too.
🤖 Generated with Claude Code