Engineering
Acceptance Scenario Lockstep
Pin the target with executable scenarios before the agent starts changing code.
Use when
A coding agent is about to implement a feature where success could be interpreted three different ways.
Cadence
Before and during ambiguous feature work
Verification
The same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.
Structured loop spec
| Field | Value |
|---|---|
| Name | Acceptance Scenario Lockstep |
| Category | Engineering |
| Trigger | Before and during ambiguous feature work |
| Objective | Pin the target with executable scenarios before the agent starts changing code. |
| Allowed inputs | Relevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop |
| Allowed actions | Translate the request into 3-7 user-visible scenarios, including at least one failure or edge case.; Mark which scenarios are in scope, out of scope, or require approval before work starts.; Turn the in-scope scenarios into tests, fixtures, or a checklist that can be rerun unchanged.; Implement only the smallest change needed for those scenarios.; Run the scenarios and stop if new behavior would broaden scope, affect billing/data/security, or require product judgment. |
| Verification | The same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved. |
| Stop condition | Stop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required. |
| Budget | Set a time, turn, token, retry, file, or dollar cap before running the loop. |
| Approval boundary | Human approval required before publishing, sending, deleting, spending, changing accounts, touching production, or making reputational/legal/financial commitments. |
| Safe output | Pull request, patch, report, or evidence log |
| Works with | Claude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent |
Steps
- Translate the request into 3-7 user-visible scenarios, including at least one failure or edge case.
- Mark which scenarios are in scope, out of scope, or require approval before work starts.
- Turn the in-scope scenarios into tests, fixtures, or a checklist that can be rerun unchanged.
- Implement only the smallest change needed for those scenarios.
- Run the scenarios and stop if new behavior would broaden scope, affect billing/data/security, or require product judgment.
Prompt
Run the Acceptance Scenario Lockstep loop. Use it before ambiguous feature work. First convert the request into 3-7 user-visible scenarios with clear in-scope, out-of-scope, and approval-required labels. Make the in-scope scenarios executable as tests, fixtures, or a repeatable checklist before implementation. Implement only against those scenarios, rerun them unchanged, and stop for approval if the work broadens scope or touches billing, data, security, or product judgment.Run in Claude Code
Paste this into Claude Code (or any tool-using agent) to run the loop bounded: one change per round, the same verification every round, durable state files, and explicit stop conditions.
Run the "Acceptance Scenario Lockstep" loop from AI Loop Library (https://ailooplibrary.com/loops/acceptance-scenario-lockstep/) as a bounded loop.
Goal: Pin the target with executable scenarios before the agent starts changing code.
Rules: one change per round; run the same verification every round (The same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.); append each round to docs/loops/acceptance-scenario-lockstep/progress.md and update docs/loops/acceptance-scenario-lockstep/state.json; stop on verifier pass, 8 rounds, 3 consecutive failed verifications, no progress, a blocker, or anything needing human approval (money, production, outbound, deletion). Finish with a proof report: rounds used, changes made, verification output, remaining risk, and the next human decision.