A dark factory turns a request into merged code and makes every decision along the way on its own. A lights-on factory applies governance before each action. A named person owns each change and answers at checkpoints, and an audit log ties every decision to that person. I built one, and it has been in production use for a week, so I don’t have solid numbers yet. It runs slower on purpose, because it puts judgment, comprehension, and accountability ahead of raw speed. Oversight is a dial, so a step that proves itself can go dark, still logged.
The case for the dark factory
The term comes from manufacturing. A lights-out plant runs with nobody on the floor, so nobody needs the lights on. The software version takes a ticket in and puts merged code out. Nobody approves anything in between.
The argument for it is a good one. Agents write code faster than any of us read it, and a person in the loop sets the pace of the whole line. If the tests are good and the blast radius is small, a human checkpoint adds wait time and catches nothing. Some work does belong in the dark: dependency bumps, formatting sweeps, a lint rule applied across a hundred files.
Two problems show up once you run everything that way, though.
The first is comprehension debt : code in production that nobody on the team understands. Each dark merge adds a little. Nothing breaks on the day it lands, so the debt stays invisible until an incident. Then the person on call opens a module for the first time and finds nobody who has read it. You pay the interest at the worst possible moment.
The second is accountability. A good dark factory logs everything, and it should. Both kinds need the same observability. But a dark factory’s log records what the factory decided with nobody’s name on it: which approach to take, what counts as done, whether a failed test was flaky. When one of those calls goes wrong, you find out from a customer, and the log names no owner.
What the lights buy you
My factory takes a written request and gives back a pull request with a live preview. Between the two it runs these stages: discovery, a plan, acceptance tests, implementation, checks, review, an end-to-end proof, and a business-level briefing. The agents do the work in every stage. The lights are the eight places where the factory stops and asks a person:
- questions, which discovery raises before anything is planned
- approve, for the plan itself
- checks, the acceptance tests you choose from what the plan proposed
- refused, when a guardrail blocked a call the agent tried to make
- refactor, review, and uat
- merge
Each checkpoint has a named owner. Today the requester answers the questions, approves the plan, and picks the acceptance tests. UAT has the strictest rule: only the person who asked for the change can sign it off. The factory refuses anyone else, because acceptance is the requester’s to give.
That ownership also decides how the factory scales. Each developer approves the plans for their own changes, so approvals grow with the number of branches and don’t pile up on one person. A lead signs off only on changes to the harness and the factory itself, and some of those belong to the platform team.
Ownership changes how a change reads afterward. When I open an old pull request, I don’t find a diff that appeared from nowhere. I find who asked for it, the plan they approved, the tests they chose, and the review findings they declined and why.
That record comes from the audit log, and the audit log is what separates the two kinds of factory. Both should log every action. A lights-on factory’s log also ties every decision to a person, so every answer and every refused tool call carries an actor. It’s append-only JSON lines, and nothing rewrites it, the factory included. Six months from now, you can answer “why does this endpoint return a 409” by finding who approved the change.
Branch protection, code owners, and required reviewers get part of the way there. But the record is spread across several tools, and it’s hard to piece together. Once an agent is the committer, those tools tie the change to the agent and not to a person. The factory’s audit log is written for auditors first. It also works as evidence when you want to tighten a constraint or widen what an agent may do.
The other thing the lights buy is the habit of reading. A plan approval takes a couple of minutes. In those minutes you learn what the change will touch before it touches it. Then you read the briefing at the end. The team ends up knowing the code the factory wrote, which is the defense against comprehension debt.
Approval fatigue is real, and a checkpoint can decay into a click. The design answers it in two ways. Every question the factory asks is a product-level one: is this the right plan, are these the right acceptance tests, does the change work in the preview. None of them asks a person to review a diff line by line. And when a checkpoint stops getting real attention, you can change its oversight instead of pretending someone is still reading.
Oversight is a dial
Lights-on governs every action, but a person doesn’t have to answer every checkpoint forever. Each checkpoint takes one of three settings:
- ask stops and waits for a person.
- hold waits for a set window, then takes the default answer unless a person answers first.
- auto takes the default answer immediately.
Four presets set all eight checkpoints at once, and you can override any checkpoint, either for every repository or for one repository:
# Oversight: how much a person is asked, checkpoint by checkpoint.
# high everything asks
# medium answers, checks, refactor and review hold; plan, refused calls, UAT and merge ask
# low most go to auto; the plan, refused calls, UAT and the merge hold
# off everything auto, except the merge, which never goes below hold
preset: high
checkpoints: {}
# questions: {level: hold, window_minutes: 30}
# merge: {level: hold, window_minutes: 240}
The dial controls who answers, never whether a gate holds. The tests, the guardrails, the quality gates, and CI run at every level. At off, the factory still runs every check and stops asking you about the result.
Some checkpoints also have a floor. Merge never goes below hold, so even at off a person is told before code lands on the base branch and has the hold window to stop it. You can make the factory nearly dark. You can’t make it land code without telling anyone.
Dark is not silent
When a checkpoint goes to auto, the decision still happens and still goes on the audit log. What changes is the owner. The log records it as the oversight setting’s decision, with actor oversight. It never records it as a person’s, so nobody can later mistake an automatic approval for a human one.
That checkpoint has gone dark in the strict sense: it decides on its own, and its log says so. You can audit it and turn it back up.
Who owns that setting is a question I haven’t settled. Right now I treat each step’s oversight as a measure of how far that step is trusted, and it can be set step by step. Oversight across the whole factory looks more like a platform decision.
What earns a checkpoint its darkness
So when do you turn it down? When the evidence says the checkpoint no longer catches anything. My factory counts escapes , meaning defects that got past every check. An escape is UAT failing, CI failing on the factory’s commit, the pipeline failing on the merge commit, a reverted merge, or a bug traced to the change. Each escape goes on its job and on the audit log, and it becomes evidence for which check to add.
The factory also tracks, finding by finding, whether review caught something no automated gate covered. If review keeps finding only what the gates already caught, review is redundant, and that checkpoint can move to hold. Decide the escape rate you’ll accept before you turn anything down. Then the number makes the call, not your patience on a busy week.
The measurement has a blind spot I’m still working out. Once a checkpoint goes dark, you stop seeing what it would have caught, and you learn about an escape only after it ships.
I run at high. Every checkpoint asks. That’s a choice, not a phase I’m waiting out. The product I work on changes quickly. The code the factory touches this month may be code nobody has read since last month. Comprehension debt piles up fastest there, and the checkpoints are how the team keeps up. I’m collecting the escape numbers anyway. The day a checkpoint stops catching anything, the evidence will already exist.
Your process is configuration
The checkpoints and the dial don’t depend on my particular process. Everything that describes how a team works belongs in declarative configuration. That means the kinds of request, the workflow each kind follows, and the stages in each one. It also means who owns each checkpoint, which gates run, and how far each dial turns. The factory reads the file and runs it. The process lives in configuration, and the code only knows how to execute a process. I use YAML, and the format could change. The structure can’t: a person should read the phases once and know the process.
Mine isn’t all the way there. Each stage’s settings live in YAML today: its model, its turn limit, and the tools it may not touch. So do each repository’s gates and the oversight dial. A request also carries its kind (a feature, a bug, or a change to something that works). But every kind runs the same stages, in an order set in code. Splitting each kind into its own declared workflow is what I’m building next, and the whole factory in one file looks like this:
workflows:
feature:
stages: [discover, plan, define, implement, checks, review, prove, comprehend, uat, merge]
bug:
# The acceptance test is already known: the reported symptom.
stages: [reproduce, plan, implement, checks, review, prove, uat, merge]
change:
stages: [discover, plan, implement, checks, review, prove, uat, merge]
stages:
plan:
model: claude-opus-5–5
max_turns: 40
tools: read-only
checkpoint: {owner: requester}
reproduce:
model: claude-sonnet-5–5
max_turns: 30
# Done when a test for the symptom exists and fails.
prove:
model: claude-sonnet-5–5
max_turns: 50
tools: read-only
uat:
manual: true
where: preview
checkpoint: {owner: requester}
gates:
- name: tests
run: make test
oversight:
preset: high
A feature and a bug fix need different things. A feature starts with discovery, because nobody knows yet what the change touches. It also needs acceptance tests defined before anything gets built. A bug arrives with its acceptance test already written in the report. The test for the original symptom has to fail before the fix and pass after it. So the bug workflow starts by reproducing the bug and skips the stage that defines tests. If the bug can’t be reproduced, it can’t be fixed yet, so it goes back to discovery. Run both through one pipeline and something gives. Either the bug pays for discovery it doesn’t need, or the feature skips work it does.
The plan runs read-only on the stronger model, because a wrong plan has the largest blast radius. The proof runs read-only too. Withholding the editor is the mechanism. A stage that checks the work can’t repair what it checks, so there’s nothing to argue past.
Gates name the repository’s own commands. A gate runs make test and doesn’t care what sits behind it, so a repo on a different stack changes one line and nothing else.
Manual steps are stages too
Not every stage needs an agent. UAT in my factory is a person’s job, and it happens before merge. Every change gets its own ephemeral environment, and the pull request carries a link to a running preview of it. The proof stage writes down the steps it walked. The requester opens the preview, follows those steps, and signs off or sends the work back.
To the factory, that’s a stage with manual: true, an owner, and a checkpoint like any other. It waits, and it records on the audit log who answered. It also enforces the rule the stage stands for. Only the requester can sign UAT off, and if the proof didn’t pass, the dial can’t pass UAT automatically, at any setting. I haven’t handled the cases where the requester is away or has left. For now, an admin can manage the job.
Whatever your team does by hand fits the same shape. A security review, a design sign-off, a check by compliance, a product manager’s look at the copy: each one is a stage with an owner. Declaring it costs one block in the file. Leave it out and it happens in a side channel, where the audit log never sees it.
The tool should fit your team
Most tools come with a process baked in, and the team bends to fit it. Adoption stalls at the first step that doesn’t match how the team works, and then people route around the tool.
A factory built from configuration works the other way. The machinery is the same everywhere: the stage runner, the gates, the audit log, the dial. The configuration is what makes it yours: which stages run, who owns each checkpoint, how far each dial turns, which gates you insist on. Two teams on the same factory can run very different processes, and both get the same audit trail.
One guardrail on that freedom matters. The operator is the person who runs the factory. A repository can always ask for more checks than the operator requires, but it can’t switch off the checks it’s held to. A repo that could disable its own gates would be marking its own homework.
Slower, on purpose
A lights-on factory runs slower than a dark one, because it’s synchronous. A plan waits for approval, and UAT waits for the requester. Each wait lasts as long as a person takes to get to it, and people have meetings. I haven’t timed the difference, but every checkpoint set to ask adds a person’s response time to the job.
So why accept the wait? What we deliver is value and outcomes. It always has been. Raw speed only helps if the code it produces is worth having, and the checkpoints are where a person decides that. Judgment stays where it’s needed: scope, the definition of done, and whether a change is worth making at all. Comprehension stays with the team, because someone read the plan and the briefing. Accountability has a name, because the person who owns the request has to accept the result.
Slow is smooth, and smooth is fast. You spend later what a dark factory saves up front, reverting a change nobody understood or reading a module for the first time mid-incident. You pay that cost early instead, in small, predictable amounts. Some have even gone so far as to call the dark factory harmful and I suspect that it’s because of this property: it builds technical debt. So the lights-on approach addresses that debt early rather than paying for it later.
You can start by writing your process down as stages. Pick one kind of request, bug fixes or features, and list every step a change goes through today, manual ones included. Name the owner of each step and the default answer if that person never responds. That list is your first workflow. Write it as YAML, then do the same for your second kind of request. Run it with every checkpoint set to ask. Turn one down only after the escape numbers say it no longer catches anything.
Top comments (0)