Teemu Piirainen

The eight quality gates AI-written code passes.

Eight gates sit between a feature request and production. A change has to pass all of them, and the one that stops the most is gate 4.

Quality pipeline for AI-written code

Eight gates. Code must pass through all of them before it reaches production.

Human-ledAI AgentPersistent Memory

Feature request

Requirements definition

Acceptance criteria as contracts. ~70% of my work time

Human

Architecture design

Breaks work into subtasks. Catches design flaws early

Agent

Implementation

One subtask at a time → tests per file, +90% coverage

Agent

Validator

Independent agent → must PASS before any commit

Blocker

PASS

Commit → next subtask

FAIL

↑ Back to gate 3

Code review

4 parallel agents → each catches what the others miss

Agent

CI/CD pipeline

Automated safety net beyond agent checks

Automation + Agent

Human review → merge

My code review. The only manual approval gate

Human

Deploy verification

Validates after deploy. Quality beyond merge

Agent

Long-term
memory

Next session
starts smarter

Every gate
stores learnings

Persistent

Production

Scroll sideways to read the whole diagram.

What each gate prevents, and what it costs to run, is in the article this diagram comes from.

How I validate quality when AI agents write my code The same system seen as orchestration: who owns what