04 - Ticket Loop
Ticket Loop
Section titled “Ticket Loop”Each code ticket follows a red/green/refactor rhythm with review gates attached.
flowchart TD
A["start"] --> B["write failing behavior test"]
B --> C["commit with [red]"]
C --> D["post-red"]
D --> E["implement smallest passing behavior"]
E --> F["verify"]
F --> G["post-verify"]
G --> H["write adversarial review prompt"]
H --> I["subagent-review"]
I --> J["reconcile-subagent-review"]
J --> K["open-pr"]
K --> L["poll-review"]
L --> M["advance"]
Red Comes Before Green
Section titled “Red Comes Before Green”For behavior-changing code tickets:
- Write one failing test through a public interface.
- Commit it with a
[red]suffix. - Run
post-red. - Implement only enough code to pass.
Tickets with no testable behavior declare Red: skip.
Verify Before Review
Section titled “Verify Before Review”The usual inner loop is:
bun run verify:quietBefore publishing a PR, run the broader check expected by the repo, usually:
bun run ci:quietHandoffs
Section titled “Handoffs”Every ticket gets a handoff under:
.agents/delivery/<plan-key>/handoffs/<ticket-id>.mdRead it before resuming. It is the durable context for the active slice.
Why The Loop Is So Explicit
Section titled “Why The Loop Is So Explicit”The sequence prevents three common failures:
- implementing before proving the behavior gap
- publishing before a cold review pass
- claiming review was clean when git history says otherwise
This is why the order matters. The orchestrator is a state machine, not a suggestion list.