part 1 of 3
The factory
Sutra does not write the product. It runs the agents that do, and it decides when their work is good enough.
What Sutra is
Sutra is a bash supervisor, tmux, and opencode run agents on a pool of free AI models. You give it a target. Agents read about the target, plan it, build it, review each other, attack it with QA, fix what QA finds, and repeat until the quality bars are met.
There is no orchestration framework. Each agent is one tmux session running one episode with one brief. The supervisor dispatches episodes, waits for them, runs gates and decides what to dispatch next.
Four rules
Files are the only memory. Every phase reads and writes artifacts on disk: drafts, the contract, gate verdicts, the bug queue, the journal. The supervisor restarted at least three times during this run and lost nothing, because nothing lived in RAM.
Gates decide. Agents never self-certify. An agent can say a lane is done. Only a gate script can mark it done, by hitting real routes, counting real rows and running the build.
Free models only, $0. The dispatcher picks from an allowlist of free model IDs. When a model crashes or returns an empty episode, it rotates to the next one.
The operator writes only the factory. I fix the supervisor, the gates and the dashboard. Agents write the product. Across the whole run, git shows zero operator commits in the product code.
One pipeline
Every target goes through the same line. Each step ends in artifacts that the next step reads.
| Step | What happens | What it leaves behind |
|---|---|---|
| Read | Six reader agents study public product docs | Six drafts, 15.8 to 33.6 KB each |
| Contract | A critic merges the drafts and the contract gate checks it | A frozen contract: 140 routes, 30 pages, a 35-step user journey, 26 data models |
| Approve | One human yes | The only approval in the run |
| Build | Five lanes build in parallel, then content checks and cross-review | Backend, frontend, Postgres schema |
| Attack | QA agents try to break the app | A bug queue |
| Fix loop | Fix a batch, rebuild, re-audit, rescore | Scores and a shrinking queue |
| Converge | Stop only when every bar is met and critical bugs are zero | factory-complete |
The bars
Converge is not a feeling. It is six numbers, and all of them must pass at once.
| Instrument | Final | Bar |
|---|---|---|
| Functional parity against the contract | 97.5 | 90 or more |
| Craft, measured mechanically | 9.2 | 8.5 or more |
| Design verdict from the design auditor | APPROVE, 8.6 | APPROVE and 8.5 or more |
| Engineering checks | 9.2 (11 of 12) | 8.0 or more |
| Critical bugs open | 0 | 0 |
| Journey gate and external demo | pass (74 runs), HTTP 200 | pass, 200 |
The engineering score is 11 of 12 because one check failed: 62 TODO markers were still in the code. I left that in the score rather than tune the check.
What it built
A working issue tracker: boards, backlog, sprints, a JQL-style search, workflows, permissions, reports, notifications, keyboard shortcuts and dark mode. Backend, frontend and Postgres, all written by agents.
part 2 of 3
The run
October 10 to 11, 2026, on one cloud box. All times UTC.
Hour by hour
Box up. The probe finds 11 working free models.
I notice one model in the probe list is paid. It gets removed from the allowlist, and the allowlist becomes free-suffixed IDs only.
Six readers write six drafts. Two reader crashes are absorbed by model rotation.
Two false freezes. The chain marks a missing contract as frozen and sends five lanes out with nothing to build against. Part 3 covers why.
The first honest freeze: 140 routes, 30 pages, a 35-step journey, 26 models.
My one yes. Lanes build for real. Content checks reject the auth and API lanes as too thin and send them back.
QA attack. 130 bug rows land in the queue.
The churn. 60 fix cycles, almost nothing fixed. Part 3 covers why.
Real progress. Craft goes 7.8 to 9.0 to 9.2. Design judgment goes 7.5 to 8.2 to 8.4 to 8.6, APPROVE at 12:26.
The last two criticals. One is stale and gets cleared with evidence. One is real: a silent cascade delete, now blocked with a 409 and verified live. At 17:07 the loop converges.
Free models die all the time
210 episodes ran across 11 free models. The busiest model ran 53 of them. The pool needed 129 rotations, and 11 episodes were killed for stalling. Endpoints went away mid-episode with errors like “Endpoint is unavailable”, and some episodes exited cleanly having written nothing.
Rotation handled most of it. The dispatcher treats a crash or a near-empty episode as a failure and moves to the next model. The part that took longer to get right was heavy work. A design audit can write 80 to 140 KB, and a free model can go quiet for half an hour while it does. Part 3 has the cost of learning that.
What moved the scores
The craft score sat at 7.8 for a long stretch. One brief change moved it: the craft lane was told to adopt a UI primitive library. One episode added 13 Radix-based primitives and craft went to 9.0 in one batch, then 9.2 on the next.
The design verdict needed two more real fixes: native selects replaced with Radix components, and search state kept in the URL. After those, the design auditor re-ran on the live app and gave APPROVE at 8.6.
The bar was 8.5. The margin was one tenth of a point. I would rather say that than round it.
The bug ledger, honestly
The dashboard said 233 bugs closed. That is 233 closure entries. They cover 185 distinct bug IDs. About 93 were real fixes by agents. The other 140 were stale design blockers retired when a newer audit replaced them.
At converge, 12 non-critical bugs were still open, and 7 of those were stale duplicates of bugs already verified as fixed. Zero were critical.
What it cost
The agents cost $0. Every factory episode ran on a free model, enforced by the allowlist. The box cost about $5 to converge.
The $0 applies only to the factory. My own operator session on the laptop, the coding agent I used to diagnose and fix the factory, recorded $1.29.
part 3 of 3
What broke
About five hours of the run went to bugs in the factory, not the product. All seven were fixed with commits while the loop kept running.
1. The gate that could not fail
At 16:18 the gate log said the contract was missing. In the same second, the factory log said the contract gate had passed and froze it. Five build lanes went out with no contract.
The cause was the last line of run_gates.sh: tail -1 "$RESULT". A shell script returns the exit code of its last command. tail succeeded, so the gate script always exited 0. Every gate function recorded its verdict correctly and the script threw it away.
tail -1 "$RESULT"
exit $RC # added: return the gate's real status, not tail'sAfter the fix, the gate failed honestly, and the chain refined the contract instead of building on nothing. I also added a halt: if the contract is not frozen after three gate cycles, the chain stops.
2. The stale twin
At 17:46 the same false freeze happened again. A deploy had restored an old copy of the gate script at a second path, and the chain called that one. The fix was to delete the twin and keep one canonical gate script. The chain never false-froze again: the next 8 contract passes all match real cycles.
3. The scheduler that counted every agent twice
From 22:51 to 02:35 the fix loop ran 60 cycles and the fixed count went from 11 to 25. The factory log held 122 throttle events, some reading “at max parallel (6/4)” with only two or three agents alive.
The scheduler counted running agents with pgrep -fc "opencode run". Each episode is a bash wrapper plus the opencode process, and both match. Two live agents read as four, which was the limit, so every dispatch was refused.
# before: matches the wrapper and the worker
RUNNING=$(pgrep -fc "opencode run")
# after: count real agent sessions
RUNNING=$(tmux ls -F '#{session_name}' | grep -c '^agent-')Zero throttle events after the fix. The next cycles did 30 to 40 minutes of real work each.
4. Waits that matched old work
104 of the 210 episodes ended with no end marker. The waits looked for an end marker in any agent log, so a marker from a finished episode satisfied the wait for a new one instantly. The loop then re-dispatched, and the dispatcher killed the session that was still running.
The fix had two parts. Waits now read only the newest log, captured before dispatch. And the loop never kills a running episode: if the tmux session exists, it waits.
5. A fix loop that never re-judged design
The loop fixed craft bugs and re-measured craft, but nothing re-ran the design auditor. APPROVE could never arrive, however good the app got. Each fix cycle now rebuilds the app, runs the two design auditors against the live app, and rescores. That was wired in before the fix phase began. The design score moved only because those re-audits ran.
6. The leash that killed heavy work
The sweep killed any agent whose log had not changed for 20 minutes, later 30. A design audit writing a 138 KB verdict looks frozen for that long on a free model. Three heavy audits were killed mid-write, and because the auditor wrote its verdict at the very end, each kill lost everything.
The fix was a per-role leash, 45 minutes for the heavy auditors, and a brief change: write the verdict incrementally, so a killed episode still leaves a usable verdict on disk. After that, the remaining kills hit dead model draws with nothing to lose.
7. A work list that rotted
Every design audit appended new blockers and nothing closed the old ones. By the morning, 111 design blockers were open, and the craft lane was picking them oldest-first. Episodes reported that the bugs they were sent to fix were already fixed.
Now, when a real audit completes, older design blockers are marked superseded, and batches pick newest-first. The supersede log retired 140 stale blockers in two passes. The next cycle’s fixed count was 176.
What I took from it
- Test that a gate can fail. One
tail -1caused two false freezes and ten wasted lane episodes. - Count what you mean. A scheduler that matches process names will double-count wrappers.
- Waits must point at the new work. Never at any log that happens to contain a marker.
- Size the leash per role. Free models go quiet while they write. Heavy roles need a longer leash and incremental writes.
- Work lists go stale faster than agents work. Supersede on every real audit.
- Two auditors are useful until you need one number. Same app, same hour, one auditor scored 4.1 and the other 7.5 to 8.2. That spread was never calibrated, and it is bigger than the 0.1 margin the run passed by.
- The operator is still a bottleneck. 37 messages from me over the run, one approval, three real interventions. Everything except the approval should be the machine’s job next time.
Next
The next run starts from these fixes. Calibrate the two design auditors against each other. Run tests on every fix, not just at the end. Keep journey-gate test data out of the product’s home screen: the journey gate ran 74 times and left a test project behind each time.