Pipeline with Gates¶
Type: Automation architecture pattern
Definition¶
Pipeline with Gates is a multi-phase workflow where quality validation gates sit between each processing stage. Work moves forward only when the gate passes — if it fails, the work goes back for revision or triggers escalation. This pattern is used for work where quality at each stage matters more than speed: software builds (compile → test → deploy), research workflows (research → review → synthesize), and the Kelly Router software factory (intake → scaffold → build → QA → deploy). Gates are explicit, defined criteria — not subjective checkpoints.
How It Works¶
A pipeline with gates has alternating phases and gates. Each phase does specific work and produces an output artifact. The gate that follows validates that artifact: does it exist? is it non-empty? does it meet the defined criteria for this stage? If yes, the pipeline moves to the next phase. If no, work returns to the previous phase for revision.
In the Kelly Router software factory: Intake phase → Gate (project defined, requirements clear?) → Scaffold phase → Gate (structure correct, dependencies installed?) → Build phase → Gate (code compiles, tests pass?) → QA phase → Gate (QA passed?) → Deploy. Each gate is defined in AGENTS.md as part of the operating manual.
Gates are enforced by the Router, not by individual phases. The Router checks gate criteria before allowing work to proceed. If a gate fails, the Router either sends work back (revision loop) or escalates via RALPH if revision isn't resolving the issue.
The key principle: quality over speed. It's better to fail fast at a gate than to ship broken work. Gates prevent bad output from propagating to later stages where fixing it is more expensive.
Key Properties¶
- Alternating phases and gates — phase work → gate validation → next phase or revision/escalation
- Explicit gate criteria — defined upfront in AGENTS.md; not subjective or ad-hoc
- Router-enforced — the Router (not individual phases) checks gates before proceeding
- Revision loop on failure — gate fail → work returns to phase for correction → re-gate
- RALPH escalation — repeated gate failures trigger escalation, not infinite revision
- Quality over speed — fail fast at gates; late-stage bugs are more expensive to fix
Related Concepts¶
- kelly-router — the Router enforces gate criteria between phases
- quality-gates — individual gate validation logic; defined in AGENTS.md
- ralph-protocol — escalation when gates keep failing despite revision attempts
Source Chapters¶
- kelly-handbook-ch14-designing-stack — Pipeline with Gates defined as one of four core architecture patterns
- kelly-handbook-ch7-multi-agent — quality gates for multi-phase software factory
- kelly-handbook-ch11-software-factory — Kelly Router software factory phases and gates