Verification as a Gate
In Factory, an agent’s own report is commentary; the exit code is the evidence.
Why Independent Verification?
Section titled “Why Independent Verification?”A completion message cannot prove that the declared checks ran in the intended worktree. The worker therefore repeats verification outside the agent process.
Factory workers enforce an independent verification gate:
- The agent finishes writing code and calls its completion tool.
- The orchestrator worker executes the ticket’s exact
Verification Commandin the worktree. - If the command exits non-zero:
- The run does not advance to a successful handoff.
- Failure output and receipt data are retained.
- Recovery policy decides whether the ticket is retried, returned to the queue, or held for a human.
Writing Verification Commands
Section titled “Writing Verification Commands”A robust verification command should verify both functionality and style:
bun test event-runtime/lib/dispatch.test.mjs && bun run format:check && bun run lintNegative Testing & Falsifiability
Section titled “Negative Testing & Falsifiability”When authoring a regression test, observe it fail against the pre-fix implementation and pass after the fix. A test that already passes does not demonstrate the reported failure mode.