feat(loop): add autonomous run-loop with planner agent and frozen gate - #1
Open
senblet wants to merge 1 commit into
Open
feat(loop): add autonomous run-loop with planner agent and frozen gate#1senblet wants to merge 1 commit into
senblet wants to merge 1 commit into
Conversation
Adds an end-to-end autonomous path: a human writes TASK.md, a planner
subagent turns it into an executable contract, then the loop iterates to
green without further input.
The planner's deliverable is the gate, not a checklist — each plan item
must name the check that proves it, so "the plan is done" is decided by
verify.sh rather than by self-assessment.
Three rails keep that honest:
- the freshly-written gate must exit non-zero before work starts, so a
vacuous gate can't hand the run instant fake success
- verify.sh and TASK.md are fingerprinted into STATE.md and re-checked
every pass, so editing the gate mid-run aborts instead of passing
- the planner runs the four-box test itself and can return REFUSED,
replacing the human who used to say "this shouldn't be a loop"
With no human watching, escalation becomes a clean abort with a written
reason rather than working around the contract.
New: TASK.md, .claude/agents/planner.md,
.claude/commands/run-loop.md, scripts/hashes.sh
Modified: LOOP.md, STATE.md, scripts/verify.sh, CLAUDE.md, README.md,
.claude/commands/{iterate,setup-loop}.md
Co-Authored-By: Claude Opus 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.
Adds an end-to-end autonomous path to the template: a human writes
TASK.md, a planner subagent turns it into an executable contract, then the loop iterates to green without further input.The core idea
The planner's deliverable is the gate, not a checklist. Each plan item must name the
checkthat proves it, so "the plan is done" becomesverify.shexiting 0 rather than the agent's own judgment. An agent that decides its own plan is complete is just self-assessment with extra steps — this keeps the template's central invariant intact under full autonomy.Three rails
scripts/hashes.shfingerprintsverify.shandTASK.mdintoSTATE.md; every pass re-checks them. Editing the thing that judges you is how a loop manufactures success, so a mismatch aborts the run.REFUSEDfor unloopable tasks — replacing the human who used to say "this shouldn't be a loop."With nobody watching, escalation means a clean abort with a written reason, never working around the contract.
/run-loopphasesFiles
New:
TASK.md,.claude/agents/planner.md,.claude/commands/run-loop.md,scripts/hashes.shModified:
LOOP.md(two new stop conditions: stuck, tampering),STATE.md(phase + fingerprint fields),scripts/verify.sh(freeze note; fail-closed default unchanged),.claude/commands/iterate.md(hash check, never-edit-the-gate rule),.claude/commands/setup-loop.md(scoped to project setup only),CLAUDE.md,README.mdNotes
/run-loopdeliberately does not commit. An unattended run producing unreviewed commits is a worse default than one leaving a diff.Testing
No test framework in this repo (markdown + two shell scripts). Both scripts pass
bash -n,hashes.shruns clean, andverify.shstill fails closed atexit=1as intended.Run
/iterateby hand on a real task before trusting/run-loop— what needs proving is whether the gate is honest, not whether the agent can code.🤖 Generated with Claude Code