Loop 027

The autonomy-loop builder-reviewer loop

An autonomy-loop workflow in which a builder and adversarial reviewer pass a git baton between worktrees and prove each new test can catch its fix.

Ready-to-use prompt

Copy the loop

Use autonomy-loop for [repository task] after the test, build, and lint gates pass. Run /autonomy-loop:autonomy-init, then start builder and reviewer in separate worktrees. The builder reads LOOP-STATE.md, makes one bounded change, and adds a red-before, green-after test. The reviewer reruns the gates and proves the test by reverting or mutating the fix. Accept only on both passes; park protected or repeated-failure work for a human. Finish with the commit, gate evidence, test proof, trust tier, and risks.

Verify / stop

Every accepted wave passes autonomy-loop's proof-of-test gate.

The new test fails without the change, passes with it, every configured gate passes, and protected production changes remain human-gated.

Context and guidance When to use it, steps, safety notes, and related loops
Published
Updated

Use this when

Use autonomy-loop when a repository has deterministic test, build, and lint gates plus a task suited to repeated builder-reviewer handoffs.

How to run it

  1. Initialize autonomy-loop, configure deterministic gates and protected paths, and create separate builder and reviewer worktrees.
  2. Have the builder read LOOP-STATE.md, implement one bounded change, add a red-before, green-after test, and hand off.
  3. Have the reviewer rerun every gate and use revert-or-mutate proof to show the test catches the change.
  4. Accept only on both passes; otherwise return findings or park the wave for a human when a circuit breaker fires.

Why it works

Separate worktrees and a git-backed LOOP-STATE.md baton keep the roles independent and resumable. The revert-or-mutate check catches tests that execute code without proving the fix.

Implementation note

The source implementation uses autonomy-loop commands, separate worktrees, and a git-backed baton. Treat local hooks as tripwires, not a security boundary, and keep protected changes behind enforced approval.