Section650

Writing

TopicAI
Reading10 min

The AI Software Factory: From Coding Assistants to Autonomous Engineering Workflows

An AI software factory turns a well-defined ticket into a verified pull request by running coding agents inside the CI, review and approval controls a team already has. What it is, what vendors have actually shipped, a ticket-to-PR workflow, and how to tell whether it improves delivery.

By Ka Lun Chan · AI / Delivery / Engineering judgment

What is an AI software factory?

An AI software factory is a repeatable workflow that turns a well-defined ticket into a verified, reviewable pull request. Coding agents do most of the implementation. Independent tests, a separate reviewer, the CI pipeline and a human approval decide whether the change merges.

Generating code is already cheap. A factory is a proposal for making the slower part repeatable: verifying that each change does what the ticket requires.

A factory is worth piloting when verification is the bottleneck, tickets have clear acceptance criteria and CI results can be trusted. DORA’s State of AI-assisted Software Development report describes AI as an amplifier of an organization’s existing strengths and weaknesses.

How is a factory different from a coding assistant or an agent?

The difference is who drives the work and who checks it. A coding assistant completes code while you type or chat. A coding agent takes a task, reads the repository, edits files, runs commands and reports back, while a developer supervises. In a factory, agents work across defined stages from intake to merge, and the checks at each stage are ones the agents didn’t design.

Fig. 745-1 Assistant, agent and factory
LevelWho drivesUnit of workWho verifiesTypical failure
Coding assistantA developer, prompt by promptA suggestion or an editThe developer reads itAccepting plausible code without checking it
Coding agentThe agent, for one task, while a developer supervisesA task on a branchTests the agent chose to run, then the developerThe agent declares success early
Software factoryA defined workflow, triggered by a ticket or an eventA ticket through to an approved pull requestChecks the agents didn’t design, a separate reviewer, CI and a personAutomating a weak process at scale

What have CircleCI, Tessl and Factory actually shipped?

Several vendors adopted the term this year. Their descriptions of the workflow are useful, and their numbers deserve the usual caution.

CircleCI’s explainer describes six stages from intake to feedback. Chunk addresses validation by fixing flaky tests, extending coverage and opening pull requests. The docs mark it beta, while the launch post called it generally available. The roughly 60% fix figure in that post is one customer’s estimate.

Tessl started with spec-driven development and now describes a path “from skills, to loops, to factory”: written workflows and standards, then skills that run on their own, then many loops working together. Tessl Agent is in open beta. In its November press release, Tessl says that in its own internal use 80% of a week’s pull requests needed no human hand-editing, and that cost per pull request fell from $75 to $13. The release doesn’t say which week, how many pull requests, or how the cost was calculated.

Factory’s Factory 2.0 announcement describes a loop from intake through monitoring. Its documentation describes sandboxing and permission controls. A news report attributed a 31× delivery figure to Factory, while its enterprise page gave 7×. Neither explains how the figure was measured.

Outside the vendors, Stripe’s engineering blog describes coding agents producing more than 1,000 merged pull requests a week, each reviewed by people, running in isolated environments with no production or internet access. StrongDM has gone further, with a charter, as described by Stanford’s CodeX, under which humans neither write nor review code. CodeX raises the questions that follow: agents gaming their own tests, AI judging AI, and who is accountable when it breaks.

METR’s randomized trial found that experienced open-source developers took 19% longer with AI tools while believing they were faster. Its follow-up suggests newer tools may improve speed, with unreliable estimates. Neither study measures a complete ticket-to-merge factory.

Five ideas a factory is built from

Context engineering decides what the agent sees: the ticket, relevant code, written conventions and test commands. Irrelevant files can pull the agent toward the wrong code. See Context Engineering.

Harness engineering is the runtime around the agent: permissions, sandboxing, timeouts, budgets and logs. Birgitta Böckeler splits harness controls into guides, which steer the agent before it acts, and sensors, which check its work afterwards. See Harness Engineering: Control What Happens During a Run.

Agent orchestration decides which agent does which step, in what order, and what each one hands to the next. Anthropic’s guidance on building agents separates workflows, which follow predefined paths, from agents, which direct their own process. A factory should mostly be a workflow with agents inside the steps, so the path stays predictable.

Run deterministic checks such as build, lint, types and tests before spending time on judgment-heavy review. Set a stopping rule before the loop starts. See Loop Engineering.

Feedback systems turn repeated failures into permanent fixes. If the reviewer flags the same mistake twice, add a lint rule, a structural test or a line in AGENTS.md so the next run can’t make it. Böckeler calls this the steering loop, and it is what separates a factory that improves from one that keeps producing the same findings.

A ticket-to-PR workflow with Claude and Codex

The pipeline below is a proposed pilot. It extends a two-agent review design with an intake gate, acceptance tests written before implementation and CI triggers. Claude implements in the example, while Codex tests and reviews. Keep testing and review independent of implementation whichever tools fill the roles.

Fig. 745-2 From ticket to pull requestSteps 01 and 08 belong to a person.
  1. Intake gate

    The ticket needs acceptance criteria, a scope and a risk label. Anything vague goes back to a person before an agent touches it.

  2. Context pack

    The ticket, the repository’s AGENTS.md rules, the relevant files and the commands that build and test the project.

  3. Acceptance tests

    Codex writes tests from the ticket alone, in its own worktree, before any implementation exists. They land in a path the implementer can read and can’t edit.

  4. Implement

    Claude Code works in a fresh worktree with write access to its branch only, no production credentials and a network allowlist. It runs the unit tests and opens a draft pull request.

  5. CI checks

    Build, lint, type checks, unit tests, the held acceptance tests and a security scan. Cheap deterministic checks run first.

  6. Independent review

    Codex reviews the diff against the ticket and the repository rules. Each finding names a location, the failure it expects and the evidence that would confirm it.

  7. Fix or escalate

    Failures go back to Claude with the evidence. Three failed verifications, or any out-of-scope change, and the run stops and reports.

  8. Human approval

    A person reads the pull request, the findings and the test evidence, then approves or rejects. Branch protection counts only that approval.

Steps 05 to 07 repeat until the change passes or the attempt limit is reached. The agent that writes the code never writes or edits the tests that judge it.

The cited Claude Code GitHub Action and Codex review documentation describe unattended runs. Repository instructions should complement tests, branch protection and required approvals.

Step 03 matters most. If the same agent writes the code and the tests, it tends to test what it built rather than what the ticket asked for. Tests written from the ticket first, by a different agent, and held read-only, give the implementation something it can’t quietly bend.

What happens when verification fails?

The failure goes back to the implementing agent with evidence: the failing check, the input, the expected and actual result, and any review finding. The agent says what it will change before it changes it. After three failed verifications, or as soon as the fix needs something outside its scope, the run stops and a person gets a short report.

Count verification failures, not tool calls. Reading files and rerunning a quick test are part of one attempt. Each attempt must be different: an attempt that repeats a failed idea is a stop signal, whatever the count. Under all of that, the harness enforces a hard ceiling on time and cost, so a bug in the loop logic can’t become an unbounded bill.

Escalate early when an acceptance test looks wrong. The implementing agent should never be allowed to fix a test to make it pass. It reports why it thinks the test is wrong, and a person decides. The same applies to contradictory requirements, flaky checks and any change that touches authentication, payments or data migrations.

Isolation, permissions and approval

Each run gets its own worktree or container, created fresh from the main branch. Isolation needs checking as well as configuring. On this site, a build from a fresh worktree once ran without the production environment file, rendered different content and still passed validation.

Give each agent the least privilege the step needs. The implementer can read the repository and write to its own branch. It has no production credentials and a network allowlist limited to package registries. The reviewer reads and comments. Check the defaults, because they differ: Claude Code’s sandbox is off unless you turn it on, while Codex’s cloud agent runs offline by default and removes secrets before the agent starts.

Treat ticket text, issue comments, dependency files and web pages as untrusted input. Prompt injection is first on OWASP’s list of risks for LLM applications, including hidden instructions in external content. OWASP lists excessive agency separately and traces it to excessive functionality, permissions and autonomy. A factory with write access and an open network is exactly that combination.

Keep human approval gates where the cost of a mistake is high: at intake for anything labelled high-risk, before every merge, and before any production deploy. GitHub’s own coding agent follows the same rule, since it can’t approve or merge its own pull request and the person who requested it can’t approve it either.

How to start small

Pick one class of ticket, measure how your team handles it today, run the workflow by hand before automating it, and expand only after the numbers hold. Good first candidates are small bug fixes with a clear reproduction and flaky-test fixes.

  1. Weeks 1–2: choose the ticket class, record a baseline for the six metrics below, write the AGENTS.md rules and fix the flaky tests you already know about.
  2. Weeks 3–6: run the pipeline manually. A developer triggers each step, reads every transcript and logs every run, including the failures.
  3. Weeks 7–10: automate the triggers in CI for that ticket class. Keep the human approval, the three-attempt limit and a cost ceiling per run.
  4. After that: add a second ticket class only when the first holds steady for a month, and review the escalations each month for harness fixes.

The weeks are illustrative. Start with the smallest ticket class and expand after the checks and handoffs work.

How do you know it improves delivery?

Measure the same ticket class with and without the factory, and include failed runs in the cost. Lead time on its own can mislead, because a factory can cut time to pull request while doubling the time a reviewer spends reading it. DORA’s delivery metrics, including change fail rate and deployment rework rate, give you a stability check alongside the speed numbers.

Fig. 745-3 Six measures for a factory pilot
MetricHow to measure itWhat to watch for
Lead timeTicket marked ready to pull request merged, and on to productionTime spent waiting for a human reviewer
First-pass acceptanceShare of factory pull requests approved with no failed verification and no human code editsRising while escaped defects also rise
Escaped defectsDefects found after merge that trace back to a factory changeCompare with DORA’s change fail rate for the same services
ReworkShare of factory changes modified or reverted within 30 daysClean merges followed by quiet rewrites
Cost per accepted changeModel, CI and human review cost, including failed runs, divided by merged changesCounting only the runs that succeeded
Human review effortReviewer minutes per accepted change, plus escalations and the time to resolve themThe cost moving from writing code to reading it

Where it breaks

Incorrect requirements are the biggest risk. A factory given the wrong requirement builds it correctly, passes its acceptance tests and ships the wrong thing. That is why the intake gate belongs to a person.

Tests can pass without proving anything. An assertion that checks the code’s current output instead of the intended behavior goes green every time. Böckeler notes that verifying functional behavior remains largely unsolved for coding agents. Review the acceptance tests themselves, and consider mutation testing on the code paths that matter.

Agent output varies from run to run. The same ticket can produce a clean fix one day and a strange one the next. Keep a small set of past tickets with known good outcomes and rerun them whenever you change the model, the prompts or the harness.

GitClear reported an increase in cloned code while refactoring fell. Its analysis was observational. Track duplication and maintenance alongside delivery speed.

Sources

The references below cover the vendor features and reported research. The pipeline, roadmap and metric definitions are proposals for a trial.

Short answers

What is an AI software factory?

An AI software factory is a repeatable workflow that turns a well-defined ticket into a verified, reviewable pull request. Coding agents do most of the implementation, while independent tests, a separate reviewer, CI checks and a human approval decide whether the change merges.

How is a software factory different from a coding assistant or a coding agent?

A coding assistant suggests code while a developer drives. A coding agent completes one task end to end while a developer supervises. A software factory runs agents across defined stages, from intake to merge, with checks the agents did not design, retry limits and escalation to a person.

How do you measure whether an AI software factory works?

Compare the same class of tickets before and after on lead time, first-pass acceptance, escaped defects, rework, cost per accepted change and human review effort. If review effort or escaped defects rise while lead time falls, the factory is moving work around rather than improving delivery.

What changes for engineering leaders

The job moves from assigning and reviewing code to designing the system that produces it, and owning what that system ships.

Define which work can enter the factory, what counts as verified, who approves each step and who owns a failure after merge. For guidance on matching verification to risk, see How to Verify AI-Generated Code.

Discuss what you’re building A code review workflow with Claude and Codex