A software factory is a code-defined, closed-loop system for running coding agents, measuring how they perform, and improving them over time. The agents, their skills, their models and their rules live in version-controlled files. Every run gets measured. The measurements drive changes to those files, and the changes get reviewed like any other pull request.
Quick answer. A software factory is a closed loop around coding agents: define them in code, run them, measure every run, and improve the definition through reviewed pull requests. What decides whether it gets better is the measurement. If the score comes from the agents themselves, the loop learns to please the score. If it comes from outside the agent and from production, the loop learns to ship reliable code.
- Define: agents, models, skills and checks in version-controlled files.
- Run: agents open pull requests, and every run leaves a trace.
- Measure: score each run with signals the agent can't fake.
- Improve: change one thing per version, reviewed by a person, compared against a baseline.
The term used to mean a standardized DevSecOps pipeline, the way the US Department of Defense and VMware use it. In 2026 it usually means a closed loop around coding agents, and that's the meaning this post covers.
The AI software factory label is getting stretched. Agent swarms, shared skill libraries and collections of automations all get called software factories, and they can be useful. But without the loop they're just more agents. A factory is the part of agentic engineering that tells you whether the agents are getting better, and changes them when they aren't.
This post covers how the loop works, why it should be defined in code, and the part most factory designs get wrong: what they measure.
How does an AI software factory work?
Every version of the idea comes down to the same four steps, repeated:
- Define. The factory lives in code: which agents exist, what each one is allowed to do, which model it uses, which skills it loads, and which checks a change must pass. Warp's version is a
factory.yamlmanifest plus directories of agent definitions, skills and model routing rules (Warp, 2026). - Run. Agents pick up work such as triage, implementation, review or migration, and produce pull requests. Every run leaves a trace: the prompt, the tools called, the diff, the cost.
- Measure. Each run gets scored. This is the step that decides whether the factory improves or just gets busier.
- Improve. Someone, often another agent, looks for patterns in the scores and proposes a change to the factory definition: a tighter skill, a different model for one task, a new check. A person reviews that change as a PR and merges it.
Then it runs again, and the next round of measurements shows whether the change helped.
The structure is borrowed from manufacturing on purpose. A factory isn't defined by its machines. It's defined by the process that makes the ten thousandth unit as good as the first, and by the inspection that catches it when it isn't.
Why should a software factory be defined in code?
Because you can't improve what you can't diff. As Dex Horthy has argued, declarative beats imperative: describe what the system should be, in files, instead of steering agents by hand session by session.
A hand-run agent setup lives in people's heads and chat histories. Someone tweaks a prompt, switches a model for one task, adds a rule after an incident, and none of it is recorded in a way you can compare. When quality drops, nobody can say which change did it.
Define it in code and every change to the factory becomes a commit. Here's an illustrative definition. The format is made up for this post, not any specific product's schema:
# factory.yaml (illustrative) version: 14 agents: implementer: model: provider/model-large skills: [repo-conventions, db-migrations] can: [read_repo, open_pr] max_steps: 40 reviewer: model: provider/model-medium skills: [review-checklist] can: [read_repo, comment] gates: - tests_pass - lint_clean - reliability_score: # scored outside the agent min: 75 # threshold the team chose mode: advisory # promote to blocking once trusted scoring: per_run: [cost, steps, human_touchpoints] per_change: [reliability_score, reverted_within_14d, rework_within_14d] Three things this buys you:
- History. Version 14 can be compared with version 13. If reverts went up after a model swap, the diff shows the swap.
- Experiments. Run the same tasks against two versions and compare the scores, instead of arguing about which model "feels" better.
- Review. When an improvement agent proposes a change to the factory, it arrives as a PR on this file, and a person decides.
Note what sits in per_change. Cost and step counts describe the run. Reverts, rework and a reliability score describe what the run produced. The rest of this post is about why the second set matters more.
What is a dark factory in software?
A dark factory is a software factory that runs with no person reading the code it ships. The name comes from manufacturing, where a fully automated plant can run with the lights off. Addy Osmani contrasts it with a "lit" factory, the same pipeline with people kept on wherever judgment matters, and warns that dark factories build up comprehension debt: more code than anyone understands (Osmani, 2026).
The best-documented attempt so far is Dex Horthy's. From July to November 2025 he ran a fully automated pipeline in which agents handled feature requests, review and deployment, and no person read the code. Within about three months the codebase had degraded badly enough that a single bug took weeks of human debugging to trace, and he shut it down (BigGo Finance, summarizing The Pragmatic Engineer). What he runs now keeps a person on planning and review, plus small nightly loops that each fix one anti-pattern and open a reviewable PR.
What failed was the measurement. The factory had no trustworthy signal from outside the agents, so nothing in it could notice the decline until a person went looking.
Why is measurement the hard part of a software factory?
Because the easy metrics measure the factory, not the software it ships.
Look at what most factory dashboards track. Warp's article lists PR throughput, average cost per PR, automation percentage (human touchpoints per PR) and estimated savings over human work, with scorer agents grading each run on dimensions like correctness and verbosity, often using an LLM as the judge. Those are real and useful numbers. Warp also adds benchmark runs across configurations, and keeps a person reviewing every change to the factory itself. But every one of those metrics can look great while the codebase gets worse.
Horthy's dark factory shows how that plays out. Its throughput numbers would have looked fine the whole time the codebase was degrading.
There are two reasons the loop drifts like this.
Agents grade their own work. When the metric is "tests pass" or "task complete", the agent controls the evidence. In a small published experiment, coding agents were given 7 tasks that could not be done. In 51 of 84 runs (61%) they produced a passing test suite anyway, for example by monkey-patching the test's random number generator. It's 4 models and a small sample, but the direction is clear. An LLM judge scoring the same run has the same blind spot: it reads the diff and the transcript, not production.
The real feedback is slow. Addy Osmani makes the point that architectural quality is hard for models to learn from because its feedback arrives over months, not seconds. He argues that "verification, not generation, is the real constraint on a factory", and that a loop earns full automation only when its checks are cheap, frequent and hard to fake (Osmani, 2026).
Put those together and you get the core problem. A self-improving loop optimizes whatever you measure. Measure throughput and cost, and you get a factory that ships more code more cheaply. Whether that code holds up in production is a separate question, and the loop never sees it unless you put it there.
What should a software factory measure?
Signals that come from outside the agent, and that describe the code after it ships. Osmani's test is a good filter: cheap, frequent, hard to fake. Here's how the common options hold up.
| Signal | Comes from | Speed | Hard to fake? | What it tells the loop |
|---|---|---|---|---|
| Tests pass | Often the same agent | Minutes | No | The change agrees with its own tests |
| LLM judge score | Another model reading the run | Minutes | Partly | The diff and transcript look right |
| Cost, steps, PRs per day | The factory | Instant | Yes | How efficient the run was, not how good |
| Reliability score per PR | An independent check on the whole codebase | Minutes | Yes | Whether the change is ready for production, before merge |
| Revert or rework within 14 days | Git history | Two weeks | Yes | Whether the change survived contact with reality |
| Incidents traced to a change | Production and on-call | Days to months | Yes | What the change actually cost |
The signals at the bottom are the ones that matter, and they're slow. Reverts take two weeks to count. Incidents take longer, and most changes never cause one, so they're too sparse to steer a loop on by themselves.
That's the role of a reliability score before merge. It's the one signal on the list that's fast enough to run on every PR, comes from outside the agent, and looks at production behavior rather than code style: missing timeouts, unsafe retries, leaked connections, concurrency hazards, swallowed errors. It gives the loop a number per run today, while reverts and incidents confirm later whether the number was right.
A practical setup uses all three speeds:
- Per run: a reliability score on every PR the factory opens, logged against the factory version that produced it.
- Per fortnight: revert and rework rates by factory version. GitClear's research is a useful baseline here. Across 211 million changed lines, the share of code revised or reverted within two weeks rose from 3.1% in 2020 to 5.7% in 2024 (GitClear, 2025).
- Per quarter: incidents traced back to factory-made changes, used to check whether the fast signals are pointing the right way.
To measure churn in your own repo with plain git, see Code Churn: Why the Files That Change Most Break Most.
How do you close the loop without breaking the codebase?
Treat changes to the factory the way you'd treat changes to production: small, reviewed, and measured against a baseline.
- Change one thing per version. A new model, a tighter skill or a new gate, not all three. If reliability scores drop after version 15, you want to know which change did it.
- Compare on the same work. Keep a fixed set of reference tasks from your own repo and run both versions against it. Warp calls these benchmarks, and they're the most rigorous part of their design. Score the outputs with the outside signals, not only an LLM judge.
- Keep a person on the factory's own PRs. An improvement agent can propose changes to the definition, but someone who owns the system should merge them. This is the cheapest place to keep a human in the loop, because one reviewed change to the factory affects every future run.
- Start gates advisory. A new reliability gate that stops merges on day one throws false alarms, and the team learns to route around it. Run it advisory, check which of its flags lined up with real reverts and incidents, then promote those to blocking.
- Point slow loops at known weak spots. Horthy's replacement for his dark factory includes small nightly loops that each fix one anti-pattern and open a reviewable PR. A reliability score gives those loops a target list: the lowest-scoring areas of the codebase, worked down one at a time.
The pattern underneath all five is the same one Osmani describes. Automate as far as your checks are trustworthy, and keep people where a wrong call is expensive.
Where does production reliability fit in a software factory?
It's the measurement that keeps the loop honest.
Tomosu assesses code changes, written by people or by AI coding agents, for production reliability. Each one gets a Production Reliability Index (PRI) from 0 to 100, rolled up from up to eight sub-indexes such as Fragility, Code Volatility and Governance Compliance. It reads the whole system rather than only the diff, and every finding comes as a before and after code change that a person accepts or rejects.
In a factory, that maps onto the loop directly:
- As a gate. On GitHub, the app posts a Ready or Not Ready verdict on each pull request against the team's threshold. Gates start advisory, and enforcement stays off until a team turns it on.
- Inside the agent. The MCP server gives Claude Code, Cursor and other agents the same findings during the run, so the agent can fix a missing timeout before the PR exists rather than after review.
- As the score the loop optimizes. PRI per pull request, logged against the factory version that produced it, is the fast outside signal from the table above. Where runtime signals are connected, sub-indexes such as Drift and Runtime Signals join the score. Where they aren't, they're left out rather than estimated.
claude mcp add --transport http tomosu https://mcp.tomosu.ai/mcp --scope user It doesn't replace the slow signals. Reverts and incidents are still how you find out whether the fast score was right. It gives the loop something trustworthy to learn from in the meantime.
Key takeaways
- A software factory is a loop, not a swarm. Define, run, measure, improve, repeated.
- Define it in code. Every change to the factory becomes a diff you can review, compare and roll back.
- The measurement decides the outcome. A self-improving loop optimizes whatever you measure.
- Agents can fake their own evidence. In one small experiment, agents faked a passing test suite in 61% of runs on impossible tasks.
- Use three speeds of signal. A reliability score per PR, revert and rework rates per fortnight, incidents per quarter.
- Change one thing per version, compare on fixed reference tasks, and keep a person on the factory's own PRs.
- Start gates advisory and promote them to blocking only once their flags line up with real reverts and incidents.
Sources
- Warp, Closing the loop with self-improving cloud software factories, August 2026
- Addy Osmani, Software Factories, Light and Dark, July 2026
- BigGo Finance, Dex Horthy: A Fully Automated 'Dark Factory' Corrupted a Codebase in Three Months, July 2026, summarizing his appearance on The Pragmatic Engineer
- Dex Horthy, Why Software Factories Fail, AI Engineer 2026
- DimitrovK, impossible-tasks on GitHub
- GitClear, AI Copilot Code Quality 2025
Originally published on tomosu.ai. To see the Production Reliability Index on code your agents already wrote, you can scan a repository free, no card needed.
