Done means evidence, not assertion
Tests, types, coverage, review — enforced before the agent can close. Your existing test suite is the truth. TRW just makes skipping it impossible.
pytest — full suite, structured pass/fail, structured output
mypy --strict — zero type errors required
Line coverage ≥ build_check_coverage_min (default 85%)
trw-adversarial-auditor — per-finding pass / warn / block
trw_deliver() fires — all prior gates satisfied
AI agents complete tasks convincingly
AI fluency is not correctness. Without a gate, “done” means “the agent stopped typing.” The prose is confident, the code compiles, and the PR description is thorough. None of that is evidence.
GitHub Actions run after merge — too late. The CI failure is already in main, the review is already approved, and the signal arrived at the worst possible moment. TRW runs verification in-session, before the agent can declare completion. The test suite runs. Types are checked. A separate adversarial auditor reviews the output. The session cannot close until every gate passes.
The five gates
Every verification phase must clear all five gates before trw_deliver() is permitted to fire. This is Phase 4 VALIDATE of the lifecycle. Each gate is independently verifiable and logged to build-status.yaml.
| Tool / gate | What it checks | Configuration |
|---|---|---|
| trw_build_check | pytest + mypy --strict | Caches result to build-status.yaml |
| coverage floor | Line coverage ≥ threshold | build_check_coverage_min (default 85) |
| trw_review | Structured per-finding verdict | pass / warn / block per finding |
| trw-adversarial-auditor | Independent agent audit | Runs separately from implementer — breaks confirmation bias |
| stop-ceremony.sh | Session-exit enforcement | Blocks up to 2 exits until trw_deliver() fires |
The hook that can't be ignored
Hooks are the load-bearing primitive. When your AI CLI fires its session-stop event, TRW's stop-ceremony hook inspects whether verification ran and whether trw_deliver() was called. If either is missing, the hook rejects the stop and prepends a warning to the next tool response. The same wiring is active across all five supported CLI profiles — Claude Code, Codex, Cursor, Aider, and opencode — because the trigger is a lifecycle event, not a client-specific command.
The hook allows up to two rejections before an operator override becomes available. The design errs toward rigor: a delayed close is recoverable; unverified code merged to main is not.
→ session ends
→ stop-ceremony hook fires
→ verification gates evaluated
[stop-ceremony] ERROR: trw_build_check not called this session.
[stop-ceremony] ERROR: trw_deliver not called this session.
Complete validation before closing. (Rejection 1 of 2)
$ _
Truthfulness before velocity
“Truthfulness > Quality > Knowledge > Velocity. Never misrepresent the state of the work. Never bypass verification.”
Unverified code is not a fast path — it is deferred debt. When a build gate fires, it is not slowing delivery; it is preventing a class of failure that costs significantly more to fix after merge. Verification is the operational expression of the truthfulness principle: the agent's claim that something works must rest on evidence, not on fluent prose.
Pairs with
Requirements
Verification checks the acceptance criteria written in your PRD. Without requirements, there is nothing to verify against.
Workflows
Verification is Phase 4 of the 6-phase workflow. The stop-ceremony hook is the phase gate — you cannot skip ahead.
Memory
Build outcomes from verification close the Q-learning loop that scores memory entries over time.
Common questions
Does verification slow down the agent?
Can I skip verification if I need to ship fast?
What if my tests are flaky and the gate fires incorrectly?
What if I don't have tests yet?
Can I customize which gates run?
What's the coverage floor and can I override it?
Stop shipping unverified code
Every gate in TRW is a commitment: the agent cannot close until the evidence exists. Access is currently limited while onboarding hardens.
# one-line install — pulls trw-mcp from PyPI
$ curl -fsSL https://trwframework.com/install.sh | bash