A factory runs dark when nobody is on the floor, so nobody needs the lights. For software it means this: a ticket comes in from Jira, Linear, GitHub or Slack, and agents take it through spec, code, tests, review and release. A person appears only when the factory asks for one.
We have been building one since October. We didn’t write our own coding agent. OpenHands, Claude Code and Codex already work in a sandbox and produce a pull request well, so the factory runs them. Our time went into the platform around them.
It isn’t finished. The backend runs end to end in our acceptance tests, against local stand-ins for the outside services, and hasn’t merged real work yet. So read what follows as the design and the code behind it, not as results from production.
Autonomy is set per project
At one end is assisted: a person approves every gate. At the other is dark: nobody does. Before you move a project up a level, its page replays the project’s recent gates under the new level, so you see which decisions would have gone through without you.
Even in dark mode, some changes always wait for a person: anything under protected paths, such as migrations, auth or billing, and anything the approval policy lists. No level, judge or timeout overrides that.
The platform merges, the agent doesn’t
The rules that matter most are in platform code, where an agent can’t talk its way around them.
Agents commit inside their sandbox, and that is all they can do to the repository. Pushing, opening the pull request and merging happen in the platform after the step, only into a protected branch and only with green CI.
Every approval, judge verdict, check result and review is recorded against the commit it saw. If a new commit lands after an approval, the approval no longer counts and the gate waits again.
Each run also gets a number that goes up whenever its task is restarted or replaced, and every side effect checks that number first: a push, a comment, a status change, a merge. An old run that is still going can’t write anything. Without this, a cancelled run could re-run a finished task against production.
A live run has exactly one writer. Commands such as approve, pause or retry go to the run’s workflow in Temporal, a durable workflow engine, which accepts or refuses them against its own state. The database only mirrors that state, so the two can’t disagree.
Checks before judges
Every decision in a pipeline, whether a gate passes or which branch to take, goes through a chain: rules first, then a model acting as judge, then a person. The first link that is sure decides. A link that isn’t sure passes the question on.
If a check can answer a question, a model doesn’t get to. When coverage, a test or a scanner fails, no judge can overrule it, because merging already requires every check to pass on the current commit.
| Question | Answered by |
|---|---|
| Do the new lines have tests? | A check: at least 80% of new lines covered |
| Is the code harder to follow than before? | A check: complexity no higher than on the target branch |
| Would the tests notice a broken line? | A check: mutation score of at least 70% on changed files |
| Did the API get slower? | A check: p95 latency within 10% of the target branch |
| Does the change do what the spec says? | A judge once it is calibrated, a person until then |
| Does the interface look right? | A person |
| Architecture, money, anything irreversible | A person, always |
Scanners only block problems the pull request introduces. Findings that were already in the target branch go to a separate report, so an old repository doesn’t stop every change on the first day.
Judges are trusted by their record
An LLM judge can be right on one change and wrong on the next, and a single answer won’t tell you which. A new judge therefore starts in shadow mode: it decides silently, a person makes the real decision, and both are recorded. Then it moves to advisory, where the person sees its recommendation. It may decide on its own only once its agreement with people over its recent decisions meets the thresholds the team has set, and that switch is logged like any other change.
The number we care about most is false approvals, where the judge said yes and the person said no. A false rejection costs a retry; a false approval can cost a bug in production. If the rate goes over the limit, the judge is moved back to advisory without anyone having to notice.
Caution is cheap to accept and expensive to give up. A verdict that adds caution, such as rejecting, adding a check or calling a person, is accepted at any confidence. A verdict that removes caution needs high confidence, and a judge that doesn’t answer in time counts as a cautious verdict, never as a pass.
A different model reviews
A model reviewing its own work tends to agree with itself. The critic step has a rule for that: its model must come from a different provider than the model that wrote the code, and sit in the same tier of our model catalogue or a higher one. If no model fits, the step fails straight away and says which rule it couldn’t meet, rather than reviewing quietly with the same model.
The critic’s job is to break the change: run the tests, mutate the changed lines, compare what the code does with what the spec asked for.
Formal models where they pay
For a few kinds of code, tests aren’t enough: payments and idempotency, retries and queues, locks, state machines. A project can attach a TLA+ or Quint model to an invariant such as “an order is charged at most once”. Checking a model is slow, so the factory checks one only when a change touches that invariant’s code, and checks them all overnight.
Formal models go stale: the code moves on and the model doesn’t. The same check counts invariants whose code changed while their model file didn’t, and sends any such change to a person. For most invariants, property-based tests on the real code give most of the value and can’t go stale, which is why formal models are opt-in.
Timeouts on gates
People don’t answer everything in time, and a gate that waits forever stops the line. The next thing we are adding is a timeout: after an hour, the gate takes the judge’s recommendation if it is confident enough, or the cautious option. A wait on a protected path or the approval policy will never time out, and every decision made on silence will be listed in the daily digest.
When a person rejects work and gives a reason, the reason becomes a proposed lesson. Accepted lessons go into the context of agents doing the same kind of step, and we plan to measure whether they cut rework.
We built a simulation first
Before the backend existed, the dashboard ran on a deterministic simulation in the browser, with tasks, agents and gates moving on a fast clock. It let us argue about the product with numbers before there was anything real to run. The backend now replaces it behind the same API, and every field in the admin has a test that shows what it changes.
If you are building one
Start by writing down where a person must always decide, and make that a rule in code that nothing can bypass. Then turn every other decision into one of two things: a check with a number in it, or a judge whose record against people you measure. Everything a model decides should sit in the second group, and it should stay in advisory until the numbers say otherwise.