Software Factory

AI software factory · Dark factory · Agentic delivery pipeline

Written by Darjus Kazakevic · reviewed

Specs go in, tested software comes out, and nobody reads the code.

Spec-driven development still has a person check the diff. That stops working when agents write more code in a day than a team can read in a week. An AI software factory removes the step: agents plan, write, test and merge, and no person writes or reviews the code. It is also called a dark factory, after the factories that run with the lights off because nobody works on the floor.

So quality has to come from somewhere else. People write the specs. A separate set of end-to-end scenarios, kept where the agents cannot read them, decides whether a build ships. Every outside service is replaced by a fake that behaves like it, so the scenarios can run thousands of times without touching production.

In essence — Once agents write all the code, quality can no longer come from reading it. It has to come from what people still control: the spec going in and the checks coming out.

When to reach for it

Reach for it when

  • Agents write more code than people can review
  • Correct behaviour can be checked from the outside, end to end
  • Outside services can be faked faithfully

Reconsider when

  • You cannot yet say what correct looks like — build by hand first
  • A mistake is costly and hard to catch in a test: payments, safety, compliance
  • The volume of change does not justify the token spend

The parts

The intake
Specs that describe behaviour, written and approved by people. It is the only place human intent enters the line, so it is where review time goes.
The line
Agents that plan, implement and fix in parallel, each in its own sandbox and branch. Nobody watches it run, so it needs hosted harnesses, a job queue and budgets, not a person at a keyboard.
Holdout scenarios
End-to-end user stories kept outside anything the agents can read. A build is scored on how many scenario runs a user would accept. The agents never see them, so they cannot write code that only passes the test.
Service twins
Fakes of each outside service — sign-in provider, issue tracker, chat — that copy its API and its odd behaviour. Scenarios run against them as often as needed, with no rate limits, bills or risk to real data.

Design rules

Move review to the two ends
People stop reading diffs, so put their time on the spec going in and the scenarios coming out. A team that skips both has not built a factory. It has stopped checking.
Hide the exam from the students
If an agent can read a test, it will sooner or later change the code, or the test, until it passes. Keep the gating scenarios in a store the line cannot read, and change them only through human review.
Fake the world, not the code
Mocks inside the code are written by the same agents and prove little. Twins of outside services sit behind the network boundary, so the code that ships is the code that was tested.
Budget it like a production system
A factory spends tokens around the clock. Cap each job and each day, and track spend per shipped change, or one looping job costs more than an engineer.

Common pitfalls

  • Letting the line read or edit the scenarios. The score climbs; the product does not improve.
  • Twins that drift from the real service, so everything passes in the factory and fails in production.
  • Treating a high pass rate as proof. It covers only the stories someone thought to write.