The AI software factory:
how the code gets validated.
Every line of code in my current project is written by AI agents. This is the validation flow that makes it safe to ship.
AI writes the code. The system earns the trust.
The orchestrator owns the workflow. Sub-agents own the work. Artifacts own the state.
Human: locked docs
🔒 requirements · 🔒 acceptance criteria · 🔒 architecture rules · 🔒 agent files
AI executes documented decisions. Humans make undocumented decisions.
Coordinates the work, never the code.
requirements analyst
written together with the human. ~70% of the human's time goes here
architect
reads the spec → plan, splits into small implementation tasks
Task loop ×N · 1–X rounds per task
developer
implements one task, runs scoped tests
task validator
reruns checks · compares the diff against the acceptance criteria
PASS → commit · next task
FAIL → new developer context
final validation
Agent · Opus⚙ lint · types · tests · build · etc.
architecture
compliance ×2
bug
detection
security
& logic
▼ every finding re-verified
FAIL → reopens the task · back through the task loop
PR creation & memory update
opens the draft PR · curates session learnings into long-term memory
the locked docs are
the first artifacts
artifacts own the state
∞ Repository CI
AI PR review (different model)
Human: risk review
reviews the risk, not every line. auth, payments and security get the deep read
If I ship it, I own it. When the factory fails, I harden the factory.
The reasoning behind each gate, and what happens when one of them fails, is in these two posts.
How I validate quality when AI agents write my code 5 months, 100% Claude Code, zero architectural drift