Why “Gate First” Is the Key to Reliable Multi‑Agent Workflows
The article explains how the Gate First principle in Routa separates task completion, evidence verification, and session boundaries, ensuring that each agent receives a structured, consumable state instead of just a final output, thereby reducing rework and preserving failure reasons for future iterations.
When the author opened a Routa card that was already marked Done , they discovered that although the delivery status was finished, the session boundary had not disappeared. This discrepancy illustrates the core challenge that the Gate First principle aims to solve: breaking down “completion” into multiple, verifiable states such as story readiness, implementation finish, evidence completeness, and archival readiness.
Multiple “completion” states on a single card
The system distinguishes between story preparation, implementation, evidence sufficiency, and mere workflow progression. In the Todo stage, Routa first validates the story contract (canonical YAML, INVEST gate, empty artifact gate) before allowing the card to move to development, ensuring the next agent can take over without loss.
Rework is expected, not exceptional
The card ran eight times, forming a miniature delivery pipeline (Backlog, Todo, Development, Review, Re‑development, Re‑review, final reporting). Each failure was recorded rather than overwritten, preserving the reasons why a review gate blocked progress (e.g., dirty worktree, uncommitted changes). This ledger of rework helps subsequent agents avoid repeating the same mistakes.
Evidence must be a consumable state, not just attached files
Even with seven attached artifacts, the system did not consider the card “evidence complete” because it lacked a structured evidence bundle. The evidence model requires a unified summary that includes AC compliance, test results, clean worktree status, commit hash, and final deliverables, turning raw materials into a state the system can read.
New trace‑digest implementation
A new source file src/core/trace/run-digest.ts generates a TraceRunDigest by pairing tool_call / tool_result entries, summarizing successful and failed tools, missing results, observed verification commands, accessed files, hotspots, retries, and evidence gaps.
For the Gate, this digest provides an audit‑level trace state covering evidence coverage, failures, verification commands, file accesses, VCS gaps, and context paths.
For the Crafter, it offers a lightweight pre‑flight view indicating which files were touched, recent failures, and high‑risk hotspots.
This role‑specific slicing turns the Gate from a post‑mortem reviewer into a proactive auditor and the Crafter from a repeat‑tester into a risk‑aware starter.
Harness enforces runtime ownership boundaries
The red “lease expired” warning in the UI signals that the embedded ACP process’s ownership lease has ended, preventing another instance from restoring the session. Thus, a card can be Done and archived while its runtime context remains protected, avoiding uncontrolled cross‑instance recovery.
Overall engineering principle
Gate First advocates organizing verifiable state first, then deciding what each subsequent agent should see and be allowed to advance. Implementing this requires:
A task contract that defines when a card is truly ready to start.
A rework ledger that records why a previous round was blocked.
An evidence model that compresses screenshots, tests, diffs, etc., into a consumable state.
Runtime boundary controls that prevent cross‑instance, cross‑process, or cross‑worktree recovery from breaking system guarantees.
The Routa card examined by the author embodies all these components, demonstrating that Gate First is less a role preference and more a robust engineering principle: “Organize verifiable state before organizing collaboration.”
phodal
A prolific open-source contributor who constantly starts new projects. Passionate about sharing software development insights to help developers improve their KPIs. Currently active in IDEs, graphics engines, and compiler technologies.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
