wololo
Get access

Quality Gates

Quality gates are checkpoints in the pipeline where work must meet specific criteria before advancing. Gates can be automated (CI, linting, type checking) or require specific agent or human approval. A PR that fails a gate stays at that stage until the issue is resolved or the circuit breaker trips.

Gate Types

GateTypeWhenWhat It Checks
CI GateAutomatedEvery pushBuild, lint, typecheck, unit tests
Code ReviewAgent (automated)After buildCode quality, patterns, potential issues
Architecture ReviewAgent (specific)On request or for complex PRsDesign decisions, scalability, patterns
Security GateAgent (specific)PRs touching auth/security surfacesAuth patterns, token handling, permissions
QA GateAgent (functional)After code reviewFunctional testing, regression, edge cases
E2E GateAgent (browser)After QABrowser-based end-to-end testing
Human GateHumanBefore mergeFinal approval and merge decision

Automated Code Review

Code review runs as a GitHub Action, triggered by a label. This keeps review infrastructure outside the agent fleet — no tmux session, no compute cost, just CI.

Flow

  1. PM agent adds the review-trigger label to the PR
  2. GitHub Action runs automatically
  3. Action analyzes the diff and posts findings as inline PR comments
  4. Action adds review-complete label
  5. Pipeline advances to the fix stage if there are actionable comments

Comment classification

When fix agents process review comments, they categorize each one:

CategoryAction
must-fixImplement the fix
should-fixImplement unless impractical
nitpickFix if trivial, skip if not
overengineeringSkip — the reviewer is suggesting unnecessary complexity

Security Gate

PRs that touch security-sensitive surfaces require architecture review before merge. This gate is mandatory and cannot be bypassed by agents.

Trigger conditions

The security gate applies when the PR is labeled security or touches any of:

  • Authentication paths (src/lib/auth*)
  • Middleware
  • Token handling or machine auth
  • IAM or service account permissions

Requirements before merge

  1. Architecture agent review comment posted in-thread
  2. CI green
  3. If emergency: explicit human override, then post-merge architecture review within 1 hour

Auto-Merge Conditions

For low-risk repositories, PRs can be auto-merged when all conditions are met:

  • Architecture agent approved
  • QA agent approved or tests passing
  • CI green
  • No unresolved review comments
  • Repository is configured for auto-merge (opt-in per repo)

High-value repositories always require human approval. Auto-merge is a convenience for infrastructure repos, documentation, and internal tooling — not production application code.

Circuit Breaker

The circuit breaker prevents infinite fix cycles. After N failed attempts (default: 3), the pipeline halts and requires human intervention.

Attempt 1: Fix agent addresses comments → new review → still failing
Attempt 2: Fix agent tries again → review → still failing
Attempt 3: Fix agent tries once more → review → still failing
           ↓
         agent-stuck label applied
         Pipeline halts
         Human triages

Why 3 attempts?

Empirically, if an agent can't fix review comments in 3 attempts, the issue is either:

  • A fundamental design problem (agent needs architectural guidance)
  • A misunderstanding of the review comment (agent is fixing the wrong thing)
  • A limitation of the agent's capabilities (task needs human implementation)

In all three cases, more automated attempts waste compute without progress.

Delivery Flow

The delivery flow ensures that changes reach users through a verified path:

Builder agent → QA agent → Human inbox
                  ↓
        Steven never hears about failures.
        All agents enforce this.

Failed QA loops back to the builder. Only clean, tested work reaches the human merge queue. This means the human reviewer sees only PRs that have already passed automated code review, addressed review comments, and passed E2E testing.