Inside the factory
The stations most factories share, the state machine that moves work between them, and the four ways a run can end.
No two factories are built the same way, but the published ones converge on a similar line of narrow stations, each a small loop with one job, joined by a state machine that lives outside any agent's context.
The stations
Turn an event into a work item and decide whether it's worth a run. Vercel's AI SDK factory classifies every issue first (Vercel). See What starts a factory.
Prove the problem exists before fixing it. Cloudflare's Astro factory has a reproduction agent and a diagnosis agent that "instruments the code"; the fix agent then "converts the reproduction into tests before implementing a solution" (InfoQ). Vercel's analysis step writes a probe to confirm a feature is really missing. This station is what stops a factory from "fixing" bugs that aren't there.
Break the work into buildable units. Heavier at the enterprise end: 8090's line runs Refinery (requirements into a PRD), Foundry (PRD into architecture), then Planner (architecture into agent tasks) before any code is written (Ry Walker). Lighter factories skip it for small fixes.
The goal loop proper: edit, run tests, iterate until checks pass. Usually one agent in an isolated sandbox. This is the part every coding agent already does, which is why vendors insist that "the agent is one component inside a factory" (Mastra).
Check the change against something the implementing agent didn't write. StrongDM runs end-to-end scenarios stored outside the codebase "similar to a 'holdout' set in model training", against behavioural clones of third-party services (Simon Willison). Cloudflare ships a preview release and asks the original reporter to confirm the fix before a PR is even opened (InfoQ). See Where the leverage is.
A separate agent reviews the diff, then (almost everywhere) a human approves it. At Vercel, "nothing is merged without approval from a human on the AI SDK team" (Vercel). Stripe's Minions produce PRs with "zero human-written code" that engineers still review (ByteByteGo).
Watch what shipped and feed problems back into intake. Factory's "Factory 2.0" pitch is exactly this closed loop: bug reports and customer feedback become planned changes, code, tests, reviews, deployments and monitoring (Factory). PostHog argues it's the station most factories are missing (PostHog).
One agent per station
The strongest shared design choice: many narrow agents beat one capable generalist. Vercel built dedicated agents for bug reproduction, bug fixes, PR review, backports, docs updates, feature analysis and feature implementation. Their advice is "Build one agent per task"; a single agent equipped with every skill "would come with a higher maintenance and troubleshooting burden" (Vercel). primary source
Factory's product moved the same way, from one generalist Droid to a coordinator handing work to role-specific Droids for code, review, docs, test and knowledge (Masuda). secondary reporting
State lives outside the agents
Stations hand off through something durable and inspectable, never through one long shared context:
| Factory | Where state lives |
|---|---|
| Cloudflare Astro | Issue labels as a state machine (triage needed … fix verified), plus a report.md file each subagent reads and appends to (InfoQ) |
| OpenAI Symphony | The Linear board. Each issue maps to a workspace; the orchestrator restarts agents that stall or crash (Help Net Security) |
| Gas Town | Beads, a git-backed issue ledger Yegge calls the atomic unit of work; "convoys" bundle related beads (Yegge) |
| 8090 | A knowledge graph linking requirements, architecture and implementation (Ry Walker) |
| Vercel Board | A shared message board agents post to and read from (Vercel) |
This is the context-and-memory problem solved by brute force: if each station starts fresh and reads the ticket, nothing rots.
Deterministic where possible, agentic where needed
Stripe calls its pipelines blueprints: "a sequence of nodes where some nodes run deterministic code, and other nodes run an agentic loop". Running linters and pushing the branch are hard-coded; fixing CI failures gets an agent. And the agent gets a fixed budget: "At most two rounds of CI. If the code doesn't pass after the second push, the branch goes back to the human engineer" (ByteByteGo). secondary reporting
The same instinct appears in GitHub's guidance for its Markdown-defined Agentic Workflows: use them for tasks that benefit from flexibility, not for core build and release processes that need strict reproducibility (htek.dev).
How a run ends
Vercel sorts every run into one of four outcomes, and only one of them ships (Vercel):
- Success
- The change is correct and goes to human review.
- Flawed
- The agent produced something wrong. Fix the factory: better prompts, context or eval cases.
- Blocked
- The agent lacked something it needed. Fix the environment: provision the missing access, data or tool.
- Manual
- The work needs a person. Hand it back.
The point of the taxonomy is that failures are bug reports against the factory, not the product. A flawed run isn't patched by hand and forgotten; it becomes a new eval case so the next run doesn't fail the same way. That's the loop around the factory, and it's what separates a factory from a cron job that calls an agent.
What starts a factory
Factories run on events, not prompts. The triggers in use today, and the intake filter that decides which events deserve an agent run.
Where the leverage is
What teams running factories say actually moved the needle. Rarely the model; mostly verification, environments, scaffolding, context and attention.