Towards the Dark Factory: The Agent Feeds the Backlog

Part 4 of 5 in the “Towards the Dark Factory” series
In Saumya Tyagi’s plan for a dark factory the backlog is wired to spec generation: a ticket tagged for the bot becomes a spec without a person retyping it. We took the wiring in the other direction first. Before the agents could consume the backlog, they had to write it, and it turned out that most of the backlog of Sestava is the process’s own output: incidents becoming rules, reviewers parking findings, device reports becoming numbered issues, and a contract file that is rewritten from a retrospective every day.
Part 1 said that every line in the “working with agents” section of CLAUDE.md was paid for by an incident. This part shows the mechanism.
The rule about rules
The contract file has a section called Constant improvement, three sentences long:
Every incident, stall, rework or slow step is written down the same day in the current
docs/workflow-retrospective-<date>.mdand becomes one of three things: a rule in this file, a change to a skill, or an issue. A retrospective entry with none of the three is unfinished. Bottlenecks get an entry too, with the optimisation considered, even when it is not taken.
That is the whole mechanism. The retrospective is a table with four columns: a number, what happened, what it cost, and what it became. Three files exist as of 30 September: one started on the 26th that grew to 37 rows over the following days, one for the 29th with 15, and the 30th’s, kept open through the day, which closed at 29 rows when it was merged on 1 October. Each file ends with a Bottlenecks section, each bottleneck with the optimisation considered, and a short What worked and should not change list, which is the part people forget to write.
The rows are written by agents, mostly by the coordinator, from the ledgers and the pull request bodies, and each row’s last column is checked at the day’s end: no rule, no skill change, no issue means the row is not done. The day’s file goes out as a docs-only pull request, one of the two kinds (docs-only and site-only) allowed to travel alone, because it skips the Swift gates.
What a row looks like
Some rows, in one or two sentences each, with the rule they produced. These are the ones that shaped the process most.
git add -A in a shared checkout swept another agent’s untracked plan draft into an unrelated commit, and the force-push to undo it was, rightly, refused. Rule: stage explicit paths; never rewrite pushed history; fix forward.
Two plan writers verified their plans by building full copies of the repository. One overwrote the other’s copy and 2.5 GB of copies filled the disk. Rule: one scratch directory per agent, named after the agent, deleted on finish; no copy of the repository outside a git worktree; no mutation runs in scratch copies.
A gate was run before the last commit. Lighthouse passed locally on the blog branch, three commits followed, and CI failed on the SEO score. Rule: every gate in a pull request’s table ran after the branch’s last commit, and the table names the commit.
A fix was verified in a build that differs from production, three times in one day. The blog’s smoke build had drafts and therefore a fourth top-bar link; a two-row layout tested only there reached every production page. Rule: a change to a shared layout or template is compared with main in the production build, every page outside the feature identical or each difference named.
An issue was filed from the code and a theory before the device was measured (“the phone does not vibrate”); the owner’s test showed a tick that is felt in the hand and not in a pocket, and the title changed twice. Rule: an issue from a device report states what was observed and marks the cause as suspected until it is measured.
A brief told an implementer to log at info level, and info messages are kept in memory only, so the trace written to find a hang would not have survived the force-quit. The review caught it. Rule: a diagnostic log for a hang or a crash is notice or higher.
A brief contradicted the reviewed plan. The implementer followed the plan. Rule: where a brief and a reviewed plan differ, the plan wins and the report says so.
The first Dependabot configuration grouped only minor and patch updates, so four npm majors opened one pull request each, immediately, and four failed on known-breaking majors. Rule: one grouped pull request per ecosystem, monthly, majors bumped deliberately in a wave.
The coordinator contradicted a merged spec (calories on phone-only workouts) without reading it, and the owner agreed with the wrong recommendation. Rule: a recommendation to the owner that touches a merged spec quotes the spec’s section.
Not every row becomes a rule. The row about xcodebuild options kept in one shell variable (zsh does not word-split an unquoted expansion; the build exited 64 at once) became a change to a skill: options go inline or in an array. The row about the Linux gate refusing to chown 914 read-only files of a mutation runner’s checkout became an issue. The row about a transient failure of the permission classifier became a note, with “issue candidate for the harness, not the repo” written next to it, which is also an allowed outcome as long as it is written.
The contract as compressed retrospectives
The effect on CLAUDE.md is visible in its history: 38 commits in six days, 201 words to 1,435. The “Working with agents” section is the retrospectives with the stories removed. A reader who wants to know why “one booted simulator at a time” is a rule can follow the date to the row and the row to the pull request.
This is the part of Tyagi’s article we recognised most, and did differently. He describes AGENTS.md files and progressive-disclosure docs, an idea he credits to OpenAI’s Harness Engineering, as the way the factory knows its own conventions. Ours is the same file, but it has an editor, and the editor is the retrospective. In that section, a rule that was not paid for by an incident is not there; a rule that was, is there the same day.
The issue-filing skill
The second output of a row is an issue, and issues are also the roadmap. Filing one is done through a project skill, filing-issues, because the first days produced titles with a type prefix instead of an area, bodies that stated a decision with no way to tell when it was done, and links to files from memory that did not exist. The skill fixes the shape:
- Before creating: search for a duplicate (
gh issue list --searchwith two key words) and comment on it instead; verify every path you will link exists. - Title:
<area>: <imperative, under 70 chars>, area one of core, app, studio, site, format, ops. - Labels, exactly two or three: one type (
roadmap,bug,enhancement,documentation, orfrom-reviewfor a finding a review deferred) plus onearea:*, plus a phase label when it needs the backend phase. - Body, these headings in this order, each one to four lines: Why, What, Done when (a checklist a reviewer can tick), Depends on, Links, Origin (who decided or reported it, on which date, where).
- After filing: put it on the roadmap board with one script that does the placement in three GraphQL calls.
The duplicate search became “not optional” the day two Claude sessions filed issues at the same time from two design handoffs, and the board script exists because the first board edits ran as one gh call per field per item; a zsh word split broke two of them, a scheduled retry never ran and the GraphQL budget hit its limit once. Both are rows in the retrospective.
A label worth naming: needs-petr. It marks an issue that waits on the owner for a decision, a sign-in or a device check, with one line under Why saying what exactly. As of 30 September, 18 issues carry it. That is the human’s queue, and Part 5 (30 October) is about it.
Reviewers park, they do not block
The third source of backlog is the reviewer. A review verdict has three grades: changes required, approved with minors, approved. A minor does not block a merge, and it does not vanish either: the skill says a deferred finding gets its own issue, titled as the finding, labelled from-review plus the area, with the review’s own words under Why, the smallest fix under What, and the pull request line under Links. One issue per finding, never one per review.
As of 30 September, 25 of the 120 issues carry from-review. A few, to show the grain: the review of the site’s top-bar fix deferred three minor findings (focus-ring contrast, focus on a narrowing bar, very large letters) to an issue before the merge. The review of the launch fix from Part 3 left two “not covered” lines in the pull request body, a bounded wait when the audio warm-up hangs and the same pattern outside launch, and each became an issue before the merge. A reviewer of the mutation runner noticed it counts a build failure as a kill, which is wrong in a direction that flatters the score; that is an issue too. The CSV decoder has cases without a test; issue.
The point is not the count. It is that an approved merge leaves no finding in a chat transcript. Everything the reviewer thought and did not fix is on the board, in the shape the next agent can pick up without this conversation.
Device reports become numbered issues
The owner’s pass on the second TestFlight build produced ten findings in under an hour, one morning. They were filed as one issue with numbered findings, each stating what was observed, with hypotheses labelled as hypotheses (“not yet tested: (a) the Live Activity’s update after Resume or at a step change is dropped while the app runs in the background […]”). The issue then grew by comments as each check on the list was done: pass, or a new numbered finding. Three separate issues came out of the same passes when a finding turned out to be its own bug: the haptic too faint to feel in a pocket, a Summary that does not say why a workout was not saved, a Start that can go dead after a Summary. The first was fixed by the night run in Part 3 and the dead Start on the evening of 30 September; the Summary was still in the queue as this was written.
One finding on that list produced a ruling from the owner, then a correction of the ruling, then a rule. The ruling said the app does not estimate calories for a phone-only workout. It contradicted a spec merged that same morning, eight hours earlier, which chose an estimate marked “Estimated”. The coordinator had recommended without reading the spec, and the owner had agreed; the correction came eighteen minutes after the ruling. The ruling is suspended on the issue, nothing was implemented from it, and the rule about quoting the spec’s section came from it.
Where the wiring still runs through a person
Tyagi’s wiring turns a tagged ticket into a spec automatically. Ours does not, and we want to be precise about where the person is. A roadmap issue becomes a spec through a brainstorming session with the owner and an adversarial review; the owner approves the spec. A plan is written from the spec and reviewed; the owner approves the plan. From there to the pull request the agents run alone, and a bug issue skips the spec and goes straight to a night run. So the automatic part is the middle and the end; the beginning, ticket to spec, still runs through a person, and for a product, we think that is the right place for it to run.
What we did not expect is how much of the backlog the process writes for itself. Of the 120 issues, 25 came from reviews, a good fraction from device passes and retrospectives, and the rest from the design handoffs and the launch plan. The agents are not only working through the backlog; on many days they write more of it than anyone, and the contract file they work under is the sediment of what they wrote.
Part 5, the last, on 30 October: what the human is still for, what auto-merge would need here, and the wager from Part 1, settled.
This is Part 4 of the Towards the Dark Factory series. Part 1: Level 2 to Level 3 in a Week. Part 2: The Wall. Part 3: The Agent Sets the Pace. Part 5: Where the Human Still Is (coming on 30 October).
Related: How We Use Claude Code Skills · Linting the Prompt Layer
Cover photo by Homa Appliances on Unsplash.


