Patterns
Pattern: Quality Gates
Pattern: Quality Gates
Category: Orchestration Source: Internal usage (Role Factory, QA Engineer), FOR-0012 (Goal Setting and Monitoring) Status: Active
When to Use
When a multi-stage process needs checkpoints to ensure each stage's output meets minimum quality standards before proceeding. Prevents bad outputs from propagating through a pipeline and accumulating errors.
How It Works
- Define explicit quality criteria for each stage's output (scoring rubric, checklist, acceptance tests)
- At the end of each stage, evaluate the output against these criteria
- If the output passes the gate, proceed to the next stage
- If it fails, take corrective action:
- Return to the previous stage for rework
- Route to an improvement loop (evaluator-optimizer)
- Escalate to a human for decision
- Log gate results for traceability and trend analysis
- Optionally set different thresholds for different risk levels
Example
The Role Factory has explicit gate thresholds: a role scoring below 10/15 returns to DESIGN (major rework). A role scoring 10-12 enters AUTO-IMPROVE (automated fixing). A role scoring 13+ proceeds to DEPLOY. These gates ensure only quality roles reach production.
Tradeoffs
| Pro | Con |
|---|---|
| Prevents low-quality outputs from reaching production | Adds latency at each checkpoint |
| Clear, measurable standards replace subjective assessment | Overly strict gates block progress |
| Creates accountability and traceability | Requires well-defined criteria — vague gates are useless |
| Enables different handling for different severity levels | Gate maintenance overhead as standards evolve |
Factory Usage
- Role Factory TEST stage: Score-based gates (< 10 = redesign, 10-12 = auto-improve, 13+ = deploy).
- QA Engineer validation (
departments/quality-assurance/qa-engineer-quinn/agent.md): Quinn validates roles against a 7-point checklist before certification. - Production Line quality gates: Each production line has a
quality-gates.mddefining checkpoints between stages.