Back
Lab · live experimentAI-native SDLC · dark factory2026 · one week of operations
Case Study #05

Engineering + DevOps + AI
= AI-native SDLC.

For a week I operated a software factory. Agents run the full ticket cycle: plan, build, verify, code review. A deterministic harness enforces contracts, budgets and gates. A human makes two decisions per ticket: approving the plan and merging. This is the model Gartner calls a dark factory. Built and tested in practice here: the architecture, the real costs and what broke.

Dark factory · Gartner, May 2026Agents: plan · build · verify · review2 human gates
runs / night-shift-02.log● 22.07.2026 · 01:12–05:47
01:56BAR-101 plan → build → verify → merge → Done
01:57BAR-104 plan → build → verify → merge → Done
02:00BAR-108 review ×2 → fix → merge → Done
02:09BAR-097 verify: change was faked → REJECTED
02:11BAR-110 plan → build → verify → merge → Done
02:14BAR-112 plan-reuse → build → verify → merge…
02:1914 more tickets that night
Reconstructed from real run artefacts · identifiers changed
4 roles
of agents: plan · build · verify · review
2
human decisions per ticket: plan and merge
50
tickets through the factory in one week
~$2.9 equiv.
inference cost per ticket — average
05:47 · dawn · the rest reads over coffee
Section markers:Businessvalue and numbers — read everythingTechhow it works under the hood — feel free to skip

I built a working software factory: agents plan, build, test and run code review, while a human makes exactly two decisions — approve the plan and merge the PR. Over one week I pushed 50 tickets through it. This is the record of that experiment: the architecture, the numbers and what broke. I may be wrong in plenty of places — but I have the data.

Vibecoding and CLI harnesses are great. Six problems remain.

Claude Code, Codex and similar CLI harnesses are a genuine productivity leap; code really does get written faster. But “agent + prompt” works beautifully right up to the first serious incident. Below are six problems I know from practice, and the mechanism the factory answers each of them with.

Problem 01 · the big one

No synergy between models

One model plans, writes and grades its own work. The strengths of every other model go unused, and the judge is a party to the case.

different models in different roles — Engines & models section ↓
Problem 02

Non-deterministic control

Whether a change is fine is decided by… the AI — on a vibe, not a contract. The verdict can differ on every run.

verdict = strict JSON contract · fail-closed · git is done by code, not by the agent
Problem 03

Unpredictable costs, no hard gates

A session can eat any budget, and no quality gate stops work that is heading the wrong way.

per-ticket budget · $/h circuit breaker · metrics per call
Problem 04

Slop code lands in the repo

Because nobody has the time (or the appetite) to read and reject generated PRs. Quality runs on trust.

verify on a fresh checkout · review loop · zero auto-merge
Problem 05

Wiring in external sources is painful

Task queue, project registries, CI, tracking — you can wire them into an agent session, but every seam is manual.

Linear, GitHub and registries wired in by deterministic harness code
Problem 06

No room for local models

Compliance and costs say “on-prem”, but a typical agent session is welded to a single cloud CLI.

role routing — a local LLM already runs the verify role today

AI tools are everywhere. The business impact is nowhere.

I know this from both sides. Developers report writing faster with a copilot and that is genuinely how it feels. Leaders looking at speed-to-market see no difference. Gartner measured that divergence, and the result is one of the starker numbers I have seen in productivity research:

98%
of engineering leaders say at least some of their teams use AI in software work. Adoption is effectively saturated.
2026 Gartner Software Engineering Survey · n=482
43 / 0%
43% of developers believe they are exceeding speed-to-market expectations. Agreeing with them: zero percent of engineering leaders. Gartner calls it the “reality gap”.
Gartner Developer Experience Assessment · n=6538
64 → 51%
64% of teams report less time on engineering tasks and 61% faster code reviews — but only 51% see a real improvement in speed to market.
2025 Gartner AI in Software Engineering Survey · n=299
Data · Gartner research, 2026Adoption saturated, gains visible at the task level and absent at the business levelAct I

Because a copilot speeds up fragments of the work, but the process and the structure stay the same. Queue, handoffs, review, release: everything still waits on a human exactly where it waited before. Writing time shrinks; waiting time does not.

The key distinction this whole write-up rests on looks like this:

Model A · a tool inside the old process
AI speeds up fragments. The process stays.
ticketdev+copilotreviewQArelease

Every step still belongs to a human. AI shortens the steps themselves but never touches the waiting between them. That is why the leader sees no effect.

Model B · the process redesigned around agents
Work enters through a gate and leaves through a gate. The middle is agentic.
plan OKbuildverifyreviewmerge

The human decides at the entrance and at the exit. In between, agents and a deterministic harness do the work. The structure of the process changes, so the change shows up in the results rather than only in how the team feels.

Diagram 01A tool in the old process vs a process built around agentsAct I
Definition · dark factory

An autonomous SDLC execution unit: agents plan, build, test and package work under harness control. At the entrance sits the intake gate — an agent checks whether a request is fit for production and sends unclear inputs back to a human. At the exit, the inspection gate — a human reviews the output together with its evidence trail. Nobody walks the factory floor in between. Gartner sees four types of such factories: research, plan, implement and verify.

C.A. Swan, “Dark Factories, Run by AI Agents, Will Power the Zero-Friction SDLC”, Gartner, 26 May 2026 (G00855838). A dark factory is the operating unit of the target state Gartner calls the zero-friction SDLC.
Definition · harness

The shared control layer around the agents. It gives them the right context, limits their tool access, records every action and checks outputs against organisational standards. At Gartner it is built and governed by a central platform team so every factory runs on the same controls. Here it is deterministic code: verdict contracts, gates, budgets, routing and artefacts. This word comes back throughout the text.

My research question was simple:

How much of this model can be built today, on consumer CLI subscriptions — and where are the real limits?

How work flows through the factory.

Linear is both the queue and the control panel. A ticket enters the factory, an agent plans, a human approves the plan by dragging a card — and from that moment until the PR is ready, nobody sits at a keyboard.

mastra · workflows / ticket-pipeline
The ticket-pipeline workflow graph: intake, the plan-clarify loop, finalize-plan, the approve-plan gate and the ops-path / code-path branch

This graph really runs — on the Mastra framework.

The factory is built on Mastra — an open TypeScript framework for agents and workflows. There are other options in this class; Mastra simply fit: workflows as a graph of deterministic steps, a human gate wired directly into the graph, and the run panel you can see in the screenshots.

Intake is deterministic code, and approve-plan is a human gate inside the graph — not a convention an agent can overlook; a plan without an unambiguous verdict ends as a hard BLOCKED.

Screenshot from the implementation · Mastra

localhost · mastra / ticket-pipeline · recent runs
The Mastra panel: the ticket-pipeline workflow (8 steps), the approve-plan gate and the Recent runs list from the night of 22 July
Screenshot from the implementationRecent runs — including the 1:56–2:11 runs overnight and the red ones: the factory rejecting its own workMastra

The foundation of autonomy: a deep distrust of agents.

Principle 01

Deterministic code does git, CI, routing and budgets. Agents only think.

The factory commits, not the agent. An agent never touches git, never triggers CI, never manages branches. Everything that can be done in code is done in code — because code is predictable and an agent is not.

Principle 02

Fail-closed everywhere.

An agent’s verdict is a strict structural contract (a JSON block). A missing verdict or an ambiguous one means STOP, never guess. A review without an unambiguous LGTM means: there are comments.

Principle 03

Two human gates, zero auto-merge.

Control through kanban states, not a chat with a bot. Plan approval and merge — both decisions can be made from a phone: drag the card, /approve, /reject.

Principle 04

Isolation and scope.

A worktree per ticket. The builder’s changes must be a subset of the files declared in the approved plan. File reservations across tickets, a merge queue, and re-verify on every move of main.

Principle 05

Multi-engine with role routing.

Plan, verify, review and build can each run on a different model — routing per role, domain and project. Cheaper models wherever they suffice; zero dependence on a single vendor.

Principle 06

Economics built in from day one.

A per-ticket budget, a $/h circuit breaker, plan-reuse (“we do not generate a plan without a reason”) and full metrics per call: cost, time, first-pass — per stage and per model.

Mapping onto Gartner’s vocabulary — including what does not match
My plan → build → verify pipeline=the plan / implement / verify factories (no research)The contracts, budgets and routing layer=harnessAmbiguity gate: the planner asks the author=intake gate — agent-owned at Gartner tooGate 2 · PR merge=inspection gateGate 1 · human plan approval=surplus — Gartner’s model has no human here

That last row matters more than the rest. In Gartner’s model an agent owns the intake gate and the only human gate sits at the exit. I keep an extra gate at the entrance because with a one-person team and 2026-era models I would rather pay a minute of attention for a plan than an hour for the cleanup. It is a deliberate step back from the target model, not an implementation of it.

The model that wrote the code never grades its own work.

Every role in the factory can run a different model — and that is a direct source of quality. The planner thinks broadly, the builder writes, the verifier and reviewer look at the result with fresh, foreign eyes — the same principle behind having a colleague review your code rather than yourself. The second decision: every engine is the vendor’s native CLI harness (Claude Code from Anthropic, Codex from OpenAI), not a bare API — the agentic loop, the tools and the repo handling are years of engineering tuned to a specific model, and I am not going to rebuild that myself. My harness orchestrates harnesses: contracts, gates and budgets on top, the vendor’s whole agentic engineering underneath.

Role · thinks broadly
Planner
Breaks the ticket into a plan of files and steps; when something is unclear it asks instead of guessing.
model A · frontier
Role · writes
Builder
Implements strictly within the approved plan, inside an isolated worktree.
model B · fast at code
Role · checks
Verifier
Fresh checkout, checks and e2e — it never sees the builder’s context, so it does not take its word for anything.
model C · can be local
Role · reviews
Reviewer
Adversarial code review of the PR in a review→fix loop, max 3 rounds, fail-closed.
model D · not the builder
One model for everythingIt writes and then grades its own work in a single session — the judge is a party to the case. On top of that you pay the most expensive model’s rate for every single action.
The factoryOne writes, another grades — a synergy of strengths: frontier plans, fast codes, cheap (or local) verifies. Routing per role, domain and project.
Principles 01 and 05 in practiceNative CLI harnesses + a local LLM in the verify role · routing per role and project · no vendor lock-inrouting.yaml · engines/

On an ambiguous ticket the factory asks the author.

The cheapest moment to catch a mistake is before the first line is written. When the planner finds a ticket ambiguous, it asks the author numbered questions with options and a recommendation — instead of quietly picking the “most likely” interpretation. The answer comes back into the very same run. That is the intake gate in practice.

BAR-093 · planner comment in LinearStylised reconstruction of the artefact

Question 1/1 · The ticket says “add data export”. It specifies neither the format nor the scope:

ACSV export of the current view (simplest, no API changes)
BCSV + JSON export through the existing endpoint, with a date filterrecommended
CA full export module with scheduling (outside this ticket’s scope?)
The author (from a phone, 40 s later): “B” → the answer returns to the run and the plan is written without guessing.

The control panel is an ordinary kanban.

The board states in Linear are the factory states. Dragging a card is a command: from “Plan awaiting approval” to “Build” means /approve. The entire control surface — gates included — fits in a phone.

linear.app · br-factory · issues
The Linear board for the br-factory project: Backlog, Build, Done (23) and Canceled columns — factory tickets with linked PRs
Screenshot from production · LinearThe br-factory board — 23 tickets Done, cards with linked PRs; column states = factory statesgates = columns
Decision · the control layer

I went with Linear, but it could just as well be whatever tool the team already manages tickets in. The principle matters more than the brand: zero new frontend for the business. The factory plugs into where the business already works — and surfaces gates, planner questions and run statuses right there. The ticket, the plan approval and the merge live in the same place as the rest of the team’s work.

runs/BAR-108/run-0722-0143/
├── plan.md — plan of files and steps
├── approval.json — who, when, through which gate
├── build.log — the builder’s full transcript
├── verify.json — verdict + 42 tests
├── review-r1.md · review-r2.md
├── screenshots/ — app state after the change
└── metrics.jsonl — cost/time per call

Every run leaves a complete set of artefacts.

Plan, approval, builder log, verification verdict, review rounds, screenshots and metrics — per ticket, per run. When something goes wrong there is no “no idea what the agent did”. There is a folder.

Real structure · file names from the repo

What the factory delivered — in numbers.

Every dollar figure is the inference cost equivalent reported by the CLI on consumer subscriptions — not the project cost. I publish them because without specifics you cannot discuss the economics of this model.

Night shift #222 Jul · 01:12–05:47
Tickets picked up → Done20 → 18
Rejected by the factory itself2
Time with no human~4 h
Engine calls166
Inference cost equivalent$31 equiv.
Cost per finished ticket~$1.7 equiv.
Tests in the morning42/42
Including 1 correct BLOCKED for “already implemented” — the factory did not fake work. The pilot app grew from a bare counter into a full PWA.
A week of operations20–27 Jul 2026
Tickets pushed through50
Engine calls390
Engine runtime~18.6 h
Inference cost equivalent$145 equiv.
Cost per ticket · average~$2.9 equiv.
Call success rate: plan94/95
build · review78/87 · 76/76
The cost of human supervision: plan approvals and merges — single minutes per ticket. Not just the pilot: 2 PRs in a private production repo, on premium models, within an $8/ticket budget.
Metric glossary — what these actually mean
Inference cost equivalent ($ equiv.)
What the same calls would cost at the model’s API list price. The factory runs on flat CLI subscriptions, so this is a consumption measure — it lets you model the economics before moving to API pricing and scale.
Engine call
One run of an agent in one role (plan, build, verify or review) for one ticket. A ticket usually consumes several calls once fix rounds are counted.
Call success rate (e.g. plan 94/95)
How many calls of a given role ended with a correct, contract-compliant result — no error, timeout or restart. The equivalent of a “first-pass” metric.
Cost per ticket
The summed cost equivalent of every call for one ticket — from the plan to the last review round, fixes included.

This section matters more than the wins.

None of this worked straight away. Below are real failures from the week of operations — each with the concrete mechanism built in response.

Failure 01

Semantic conflicts at 4+ parallel tickets

Two tickets green apart, red together: the changes did not collide in the files, they collided in the logic.

merge queue + re-verify on every move of main
Failure 02

An oscillating review→fix loop

The reviewer demanded a change, the fix made it, the next round demanded the opposite. Round and round.

memory of previous rounds + oscillation detection
Failure 03

Zombie runs and hanging processes

A run lost its engine, the process hung for hours, the worktree stayed occupied.

hard timeouts + orphan adoption after a restart
Failure 04

Time budgets were killing slower models

A 5-minute limit on planning killed a frontier-class model mid-thought.

per-model calibration — plan: 5 → 12 min
Overarching takeaway

Most of this work is reliability engineering.

Prompts are a rounding error. The substance lives in the contracts, timeouts, queues, budgets and artefacts around the agents. And that is exactly what you cannot buy in a box — it is the difference between adopting a tool and owning a process.

What I am not claiming
  • I am not saying “enterprise-ready”. This is a one-person experiment across two repos: a pilot PWA (50 tickets) and my own product (2 PRs). I only claim that the patterns — gates, contracts, fail-closed — are portable and the operational experience is real.
  • The $ figures are the API equivalent reported by the CLI on consumer subscriptions, not the project cost.
  • I am not claiming “no humans”. The human sits in two well-defined places, and that is the point.

What I would carry over into a large organisation.

This already works outside the lab
Itaú Unibanco

Autonomous agents at enterprise scale: throughput up 20–30%, lead time down 15%, 70% of vulnerabilities remediated autonomously, test coverage doubled to 90%.

Revvity

A small, blended team plus a spec-driven harness: the path from concept to working software went from weeks to days.

Gartner cites both in its dark factory note (May 2026) as organisations converging on this model — before they have fully adopted it.
01

Start with one repeatable stream of work, not with a “transformation”.

A factory is repeatable work under the control of a harness, not a team structure or an application portfolio. One stream, measurable from the first ticket, tells you more than a year-long change programme.

02

The harness is a central product, built by one platform team.

Contracts, budgets, routing and artefacts built once, not N copies inside product teams. Gartner puts it more sharply: the harness is where governance lives, so duplicating it across teams duplicates the risk.

03

The competency profile shifts: spec-and-inspect.

Writing precise inputs and critically auditing outputs, closer to a security review than a code review. 51% of CIOs say skills evolution is outpacing what the talent market supplies, so this profile has to be grown in-house.

04

Measure from day one: cost, time, first-pass, per stage.

Without them you cannot tell adoption theatre from an advantage. These are exactly the numbers a copilot rollout never leaves behind, and the ones an enterprise needs to decide.

Next step

How could a model like this work in your organisation?

What the organisation gets
Control and pace

Waiting for decisions, manual QA and review disappear from the middle of the process. The human stays where they are indispensable: at the decisions. Every run leaves a full set of artefacts, so control does not cost you pace.

Model synergy

More output from the same models: frontier plans, fast codes, another one reviews. Two heads beat one — and every role runs at a rate that matches the task.

Local models

Role routing allows self-hosted models: lower inference costs and data that stays inside the organisation — the natural path for compliance.

Your own production process

A central control system lets you codify your unique software development process — and evolve it like a product, instead of inheriting someone else’s workflow from a tool.

If the copilot budget is spent and the business impact is nowhere to be seen — look in the process. That is exactly the problem I spent the last week working through first-hand.

The AI SDLC Readiness Sprint is 2–3 weeks of working together: you walk away with a readiness assessment, a harness architecture for your stack and a pilot plan for one stream of work.

AI SDLC Readiness Sprint2–3 weeks
  1. SDLC mapping and picking the stream of work for the pilot — repeatable and measurable.
  2. Harness and gate design for your stack: contracts, fail-closed, budgets, artefacts.
  3. Metric definition — cost, time, first-pass per stage, from day one.
  4. Pilot plan — or running the pilot with your team as stage 2.
Consulting, not build · details and pricing in a call

Sources: the terms “dark factory”, “intake/inspection gate”, “harness”, “spec-and-inspect” and the Itaú Unibanco and Revvity cases come from C.A. Swan, “Dark Factories, Run by AI Agents, Will Power the Zero-Friction SDLC” (Gartner, 26 May 2026, G00855838). The Act I statistics: 2026 Gartner Software Engineering Survey (n=482), Gartner Developer Experience Assessment Survey (n=6538) and 2025 Gartner AI in Software Engineering Survey (n=299), via notes G00844726 and G00843105. All of it paraphrased rather than quoted. Gartner does not endorse or sponsor this experiment, and those surveys reflect their respondents rather than the market as a whole. The architecture, the code, the numbers from my own pipeline and the mistakes are mine.