Problem
Sub-agents self-report "done" but there is no automated verification. The Constitution (Article II) demands ground-truth verification, but today that verification is manual — the parent must poll worktree diffs, check compilation manually, and trust agent claims. With 30+ agents running in parallel, manual verification doesn't scale.
Scope
Add post-agent verification gates that run automatically after an agent completes:
- Compile gate —
cargo check -p codewhale-tui (or equivalent for non-Rust projects)
- Test gate —
cargo test -p codewhale-tui -- {{agent_specific_tests}}
- Lint gate —
cargo clippy -p codewhale-tui -- -D warnings
- Review gate — Spawn a reviewer agent that reads the diff and flags risks
Gate behavior
- Pass → artifact is promoted, dependent agents can proceed
- Fail → agent is retried with the failure output as context (up to N retries)
- Timeout → treated as fail, retried
- Escalate → after N retries, escalate to parent for human decision
Non-goals
- Not replacing human code review. Gates are automated checks; human review comes later.
- Not enforcing gates on every agent type. Scouts and explorers skip gates.
Acceptance
- Agent completes → compile gate runs → test gate runs → lint gate runs
- Review gate runs on diffs exceeding a configurable threshold
- Failed agent retries with failure context appended to prompt
- After 3 retries, failure is escalated to parent
- Gates are configurable per agent type and per WhaleFlow node
Related
Problem
Sub-agents self-report "done" but there is no automated verification. The Constitution (Article II) demands ground-truth verification, but today that verification is manual — the parent must poll worktree diffs, check compilation manually, and trust agent claims. With 30+ agents running in parallel, manual verification doesn't scale.
Scope
Add post-agent verification gates that run automatically after an agent completes:
cargo check -p codewhale-tui(or equivalent for non-Rust projects)cargo test -p codewhale-tui -- {{agent_specific_tests}}cargo clippy -p codewhale-tui -- -D warningsGate behavior
Non-goals
Acceptance
Related
crates/tui/src/core/engine.rs(mode/approval/trust)