🏭 New: Factoryfile, a Terraform-like file format that describes a whole software factory as a graph Β· see the landing page β†’ Β· by Diego Pacheco
2026 Β· agentic engineering

Software that builds software.

A software factory is not a bigger agent. It is many small agent loops, each with walls around it, fed by a queue of work and drained through gates into production, with people running the whole thing from above.

1968Bob Bemer coins the idea
20–30%of Warp's PRs run through factories
$1,000tokens/engineer/day (StrongDM CTO)
01 Β· what is it

The loop is the atom.
The factory is the loop at scale.

The dream of software built on a repeatable, measurable production line goes back to Bob Bemer's 1968 paper "The economics of program production". For fifty years it mostly fell flat, because you can't stamp out ideas the way you stamp out car parts. Coding agents changed that, and the factory is built in three layers.

Loop

One agent, one job, on repeat. Gather context, act, check the result, go again until a condition is met. You stop prompting turn by turn and instead design the small system that prompts the agent for you.

Harness

The walls around a loop. The sandbox it runs in, the tools it can reach, the memory that survives between runs, and the gates that decide what "done" means. Give a raw model no harness and it will spin forever.

Factory

Many harnessed loops at once. A queue of signals goes in: bugs, feedback, requirements. Work is triaged, specced, built, tested, reviewed, secured, shipped and monitored. Monitoring produces new signals, so it never stops.

FACTORY Β· org chart made of loops
HARNESS
LOOP
"This system must improve over time by observing itself. The incremental units of this system are AI agents."Factory 2.0 Β· Matan Grinberg & Eno Reyes Β· June 15, 2026
02 Β· benefits

Why teams are retooling

Making one engineer faster is no longer the goal. The factory turns the whole delivery lifecycle into a system you can instrument, measure and improve.

24/7

Always-on throughput

Agents work the queue while the team sleeps. Bugs, dependency bumps and migrations stop waiting for a free human.

βˆ‘

Compounding learning

Every session, review and incident flows back into the loop. A security finding shapes the next code review.

↻

Workflows as code

Factories are version controlled, so they can be rolled back, canary tested and improved like any other code.

βš–

Model independence

Route each step to the model with the right cost, speed and quality. When models get cheaper, the whole factory gets cheaper.

βŒ–

Humans move upstream

People spend their time on intent, architecture and specs. Reviewing a 200-line plan replaces a long code review.

β–€

Full traceability

Every action leaves a record that traces back to a human-defined intent, which is useful for audits and post-mortems.

⛨

Sovereignty

Run it in the cloud, bring your own key, or run it air-gapped. What the factory learns stays inside your walls.

⇉

Parallelism

One spec can fan out to N agents at once. Throughput is limited by how fast you can verify, not by headcount.

03 Β· concerns

Generation is a wide mouth.
Verification is the narrow neck.

"The fundamental constraint in a software factory isn't how much code we can churn out: it's how quickly we can verify it."Addy Osmani Β· Software Factories, Light and Dark
BOTTLENECK

The review queue backs up

Generation keeps growing while human attention doesn't. The real problem isn't volume, it's a surplus of bad PRs passing gates nobody trusts.

COMPREHENSION

Nobody understands the code

If people stop reading the code, they stop understanding the software. Debugging an incident at 3am in code no human has read is a new kind of debt.

TRUST

Built by agents, tested by agents

Stanford CodeX asks who trusts code that agents wrote and agents validated, especially when a security company is the one dropping human review.

DRIFT

Long loops wander off

Dex Horthy's rule of thumb: an agent holds up for 3 to 10 steps and starts losing the thread past 20. Long loops hide mistakes in the corners.

COST

The token bill

"$1,000 in tokens per engineer per day" was meant as a provocation, but it shows that cost has moved from salaries to inference.

HYPE

Vendor-shaped narratives

Much of the writing on this comes from vendors and consultancies. Productivity claims like "3–5x" are mostly unverified.

04 Β· who is doing it

The factory floor, 2026

Some sell control planes that run the whole loop. Others own one station on the line. A few big companies built their own.

05 Β· inner loop + outer loop

Two loops, two clocks

The terms come from the cloud-native era. The inner loop is the edit-run-verify cycle on your machine. The outer loop is everything after you push. Agents are now taking over both, and humans own the loop around them.

Inner loop seconds β†’ minutes

One agent goes through investigate β†’ implement β†’ run β†’ verify, then repeats. It lives in the IDE or CLI. The judge is fast and deterministic: compiler, tests, linter, types. Most AI use so far sits here.

Outer loop hours β†’ days

Issue β†’ PR β†’ CI β†’ review β†’ deploy β†’ observe β†’ new issue. The agents run on their own infrastructure, not your laptop, and are kicked off from Slack, Jira, Linear or GitHub, like Devin and GitHub's Copilot coding agent.

Human loop weeks β†’ quarters

Intent, architecture, policy and deciding which checks earn trust. Osmani's advice: "own the outer loop". Your job becomes designing the loops, not running each turn.

06 Β· a factory with a complex loop

Watch the line run itself

A real factory is a graph, not a straight pipeline. Forward edges move work ahead, and bounded back edges send it back when a gate says no. An observer agent watches every run and tunes the harness, so the factory gets better at building the more it builds.

0shipped
0retries
0incidents
0mhuman minutes
harness quality 20%

Forward edges

signal β†’ triage β†’ spec β†’ plan β†’ build Γ—3 β†’ test β†’ review β†’ security β†’ ship β†’ monitor.

Bounded back edges

Failed tests go back to build at most 3 times. When retries run out, work goes back to spec, so a retry loop always has a way out.

Outcome routes

A review rejection goes back to spec, a security finding back to build, and a canary rollback back to triage as a new signal.

The loop that edits the loop

The observer scores runs and opens PRs against prompts, skills and model choices, so the failure rate falls as harness quality rises.

06Β½ Β· describe the factory as code

Factoryfile: one file, the whole factory

The simulator above is a graph. Factoryfile, an open project by Diego Pacheco, writes that graph down. It is a block format like main.tf, checked like a compiler, that declares factories, agents, stages, forward edges and bounded loops, so any tool can lint, render or run the same factory.

"Stages are the nodes, next lists are the forward edges, and loops are named back edges that stop when until is met or after max passes."Diego Pacheco Β· Factoryfile
  • One format, five parsers. Python 3.15, a Rust reference, Java 25, Go 1.26 and TypeScript 7 on Bun, all with identical error messages.
  • Two tools. factoryfile-lint (E001–E010, W001–W008) and factory-cli --render Β· --render-ui.
  • Bounded back edges. loop blocks with until and max, plus exhausted fallbacks, so a retry loop always has a way out.
  • Gates and routes. verdict maps and on routes for passed/failed and yes/no outcomes, plus run stages for test, ship and merge.
  • Eight factories included. XP, RUP, Scrum, Kanban, waterfall, spiral, gated-release, and the repository's own Factoryfile.
Open the Factoryfile landing page β†—
version = "1" factory "xp" { description = "Extreme Programming with pairs of agents" entry = "test-first" agent "pair" { role = "driver and navigator" tools = ["Read", "Edit", "Bash"] content = <<PROMPT You write the test first, then the code that makes it pass. PROMPT } stage "test-first" { agents = ["pair"] next = ["acceptance"] } stage "acceptance" { agents = ["pair"] content = "Run the acceptance tests of every story." } loop "tdd" { from = "test-first" to = "test-first" until = "every test is green and the code is clean" max = "20" } }
07 Β· self-closed systems

Close the loop, and the system steers itself

An open system needs a human to carry each output back in as the next input. A self-closed system feeds itself: production telemetry becomes new work, results become evals, and evals change the harness. It is control theory applied to an engineering org.

SETPOINT

Intent & specs

What "correct" looks like, written precisely enough for a machine to check. This is the only part humans have to supply.

SENSORS

Telemetry, tests, evals

Deterministic, cheap, frequent and hard to fake. A sensor that drifts or can be gamed makes the loop unstable.

ACTUATORS

Agents with scoped permissions

They change code, config and the harness itself, but only inside the walls the harness allows.

THE CATCH

A closed loop can lock onto the wrong target

If the sensor is wrong, the loop optimizes the wrong thing faster. You need anchors outside the loop: humans setting the setpoint, red-team agents and independent scenarios that the builders never see.

Standardized inputs

Reproducible environments, repo instructions and well-scoped tasks, never "login is broken sometimes".

Deterministic verification

Builds, types, linters, tests and scans give the agent machine-readable evidence that the work is done.

Continuous instrumentation

An execution record of every step, so failures can be replayed and turned into new evals.

Self-improvement

Observer agents score a share of runs and open PRs that adjust prompts, skills and model choice.

08 Β· lit vs dark factories

Where do you leave the lights on?

The name comes from lights-out manufacturing. At FANUC's plant near Mount Fuji, robots build about 50 robots per 24-hour shift and can run unattended for up to 30 days. In software, a lit factory keeps humans reading at the points where judgment matters. A dark factory lets agents scope, build and ship without anyone reading the details.

LIT Β· humans at the gates
πŸ’‘ Lit factoryπŸŒ‘ Dark factory
Who reads codeA human reads what comes out before it shipsNobody. Validation replaces code review
Where judgment livesUpstream, in product, design, architecture and plan reviewSpecs, scenarios and the harness itself
Trade-offJudgment and focus, paid for in speedSpeed, paid for in understanding and the risk of breakage
Fails as"All lit": a giant review bottleneck"All dark": tearing it all down four months later
Public faceMost enterprises, CodeRabbit-style risk-based reviewStrongDM: "code must not be written by humans" and "code must not be reviewed by humans"

πŸŒ‘ A loop earns the dark when…

  • the check is cheap and runs often
  • the oracle can't be easily faked: green/red tests, type gates, property tests, a review agent with a real rubric
  • the oracle answers immediately and doesn't drift
  • the loop is short (3 to 10 steps)
  • a machine, not just you, can prove "done"

πŸ’‘ Keep the lights on when…

  • a wrong answer is expensive and only a person can catch it
  • subtle production bugs slip past tests
  • the blast radius is large
  • the decision will shape a year or more of work
  • the main risk is a misunderstood requirement
"The hard, skilled job is deciding where to put each switch."Addy Osmani