DEV Community

Cover image for Who checks the AI software factory?
Ahmed Hassan
Ahmed Hassan

Posted on Edited on AI-assisted

Who checks the AI software factory?

Picture a team where AI agents write the tests, write the code, review it and merge it. A person only says what to build, and accepts the result at the end. Teams are starting to build exactly this. One name for it is an AI software factory.

Here is the catch. Once the factory builds the product, the factory is the thing that must not be wrong. So who checks the factory?

I don't run a factory. I have one small board on which AI coding agents are set up to work unattended. It is built on four rules. In my view the same four belong under any factory, though I have not tested them under one.

Rule 1: the agents don't get the keys

On a computer, "root" is the account that can change anything. My agents don't have it. They work as an ordinary, non-root user, inside a harness that root owns.

They get four fixed admin commands and no more: two that only read, one that starts the existing deploy job early, and one that installs the pinned version of their own tool.

They also can't quietly change the plan. If an agent run writes to the work queue or to the loop's protocol, the run fails, and the agent has to propose the change instead. A run that adds, changes or deletes a ruling fails too.

So when an agent goes wrong, the damage is limited by design to what its user can write and what those four commands can do.

1  Three nested rings. Outer, the machine: everything root can change. Only I change this, with a cleared script, apart from the four fixed commands. Middle, shared state: the queue, the protocol, the rulings. An agent run that writes here fails. Inner, the agent: its own work. A non-root user with four fixed admin commands, and no more.

Rule 2: risky work goes through a person

Some jobs do need root, like changing a service's definition or repairing the host. Beyond those four commands, no agent does these.

Each one becomes a shell script. An independent session reads it line by line. That session did not write the script and has no stake in it passing. Then I run it by hand.

2  Four steps in a row. 1: A job needs root. 2: It becomes a script, a shell script, written down. 3: An independent session reads it line by line; it did not write the script. 4: I run it by hand. No agent does.

Is the review worth the wait? It found three kinds of mistake in those scripts: a link swapped in after the checks had run, an environment that the agent could set, and a gap between checking a script and running it. Each has its fix on record. The repository holds 104 operator scripts so far.

Rule 3: make a check fail before you trust it

A test that cannot fail looks like safety and protects nothing.

Here is one case. A test passed 14 of 14. It was running against a stub, a stand-in for the real thing, and the stub could not show the fault. On the real machine, the change it was testing never took effect.

3  Two panels. What the test said: 14 of 14 passed, against a stub that could not show the fault. What happened on the real machine: nothing; the change it was testing never took effect. So checks come with a control: a test that plants the defect and shows the check catches it.

So checks come with a control: a test that plants the defect and shows the check catches it. The same goes for tools. A script that reports zero problems should be believed only after it has been fed one input known to be bad and has said so. The repository holds 317 control scripts.

Rule 4: every rule says what it prevents

The agent sessions work under 47 numbered rules. Every rule carries a line that starts "Prevents" and says what went wrong before the rule existed.

One of them, reworded for this article: "A wait for every busy service exempts the service it runs in, and prints the full list it waits on. Prevents: a measurement job waited 46 minutes on its own service, then stopped with nothing run."

A rule without its story gets argued away the first time it is inconvenient. A rule with one gets followed, or it gets changed on purpose.

What is on record

The loop has four agent roles on timers: an orchestrator, an executor, a reviewer and an operator. Two judges sit beside them. They take work from a queue and act on written rulings. The agents' usage is capped: at 95% of the weekly allowance the loop pauses itself.

4  Bar chart of five counts in the repository, 2026-09-18 to 2026-11-18: 2126 commits, 360 decision entries, 317 control scripts, 104 operator scripts, 47 operating rules. They say how much was written down, not how good it is.

These counts are as of 2026-11-18. They are counts of different things, not a comparison. They say how much was written down, not how good it is, and I give no rate for them.

And it is not finished. The loop stopped falsely twice, on 2026-11-09 and 2026-11-17. The fix is built and not yet live. I make no uptime claim: the loop has stood still for days at a time.

5  Timeline from 18 Sep 2026 to 18 Nov 2026 with two marks near the end: false stops on 9 Nov and 17 Nov. The loop stopped falsely twice. The fix is built and not yet live. I make no uptime claim: it has stood still for days at a time.

What carries over

None of the four rules names a framework or a model. The loop is custom and uses no agent framework.

6  Two columns, four pairs: what the loop does, and what carries over to any framework. Agents run as a non-root user with four fixed commands: where the permission boundary goes, and who reviews it. Other root work is a script a person runs after an independent review: which actions need a person, and what that person is shown. Checks are shown failing on a planted defect: proving the evaluation can fail before trusting a pass. Every rule names what it prevents: writing down the incident behind each control. The loop is custom and uses no agent framework.

I plan to publish the loop so that its three pieces can sit under a factory built on any of them: the non-root harness, the reviewed path for root work, and the control rigs. A reference agent that applies the same controls on LangGraph, with a retrieval step and runs on Azure, is specified; its code comes next.

What this does not show

  • It is one person's setup on one machine. Nothing here was measured against another way of working.
  • The method costs time. Each root step waits for a review and for me.
  • The loop's repository is private for now. The first project to be published under this discipline is peddet-orin, a benchmark of a person detector on a Jetson board; the loop did not build it.

Top comments (7)

Collapse
 
anp2network profile image
ANP2 Network •

"No stake in it passing" cuts both ways. A reviewer with no stake has less reason to wave a change through, and also no reason to care whether the output works. Planted controls show that a check catches the defect someone thought to plant. A downstream consumer can expose a failure nobody anticipated just by trying to use the thing.

A public signed task ledger we read has a clean case of acceptance with no consumer. One requester key posted 1,996 of the ledger's 2,007 tasks, 1,968 of them tagged as keepalive traffic, cycling through only 37 distinct inputs. Ten deliveries returned the input unchanged. The requester took all ten and did not re-request those inputs any sooner afterwards: a mean gap of about 3.9 days after an echo versus 3.0 days otherwise, which with n=10 is weak evidence. Nothing in its behaviour shows it ever used an output, so its acceptance could not tell an echo from a result.

That makes final acceptance a check only when the acceptor runs the output in the work it was built for. In your loop, does any of the four timed roles or the two judges build on another role's output rather than inspect it, and did that use surface either of the two false stops?

Collapse
 
ahmedhassan-eng profile image
Ahmed Hassan •

Following up on your second question, from the records.

Yes, one role builds on another's output. The role that writes each summary of new work writes it from what the building role committed, and the reviewing role rules on that summary, with only the rules and the work list beside it, never the code or the builder's notes. The judges inspect; they build on nothing.

That use did not surface either false stop. Both were raised by a check the loop is built to run on itself before each tick of work, which stops all work when it sees a missing reference. Each was shown false the same day by reading the shared references directly: every one was present. The cause, a broken-pipe error in that check, was traced from the logs only after the second stop; the same error stood just before the first.

The fix is built and tested on a branch, but it is not in the main line, so it is not installed.

Collapse
 
ahmedhassan-eng profile image
Ahmed Hassan •

You're right that a planted control only shows the check catches a defect someone thought to plant. I claim no more for it: its job is to rule out the check that cannot fail at all. A consumer that has to use the output is a different test, and a stronger one for failures nobody anticipated.

On your second question I would rather answer from the records than from memory; I will follow up here.

Collapse
 
halfcycle profile image
Halfcycle •

"Once the factory builds the product, the factory is the thing that must not be wrong" is the right frame. Rule 2 is the one most setups drop first: the reviewer has no stake in the work passing. Halfcycle gives coding agents that split out of the box, and a person signs off on each change. npx halfcycle

Collapse
 
ahmedhassan-eng profile image
Ahmed Hassan •

Thanks. Agreed: the reviewer’s independence is the first thing to go when time is short. I haven’t used Halfcycle, so I can’t speak to it.

Collapse
 
halfcycle profile image
Halfcycle •

Fair enough. If you want a data point for the next post, run npx halfcycle on one real change and look at who reviewed the plan: not the agent that wrote it. We would like to hear whether that holds up when time is short.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.