Software Factory Configuration

This page contains information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. The development, release, and timing of any products, features, or functionality may be subject to change or delay and remain at the sole discretion of GitLab Inc.
Status Authors Coach DRIs Owning Stage Created
proposed samdbeckham Imjaydip fabiopitino dmishunov james.casey samdbeckham devops ai-powered 2026-10-19

Summary

The Software Factory moves a unit of work from intent to a merge request that is ready to merge, by passing it through a fixed sequence of Stages. Each Stage is carried out by an AI flow, with humans able to step in at defined Checkpoints.

This document defines how a project configures its factory, and the contracts between Stages that the configuration declares: what triggers each Stage, which flow runs, where humans approve, and what must be true before work moves on. How each Stage works internally is owned by the team responsible for it, and is out of scope.

Motivation

The factory is being built in parallel by several teams, with prototypes exploring different approaches. Each prototype reads its own configuration, and that configuration has already grown in different and incompatible shapes. Today the same configuration file is read by more than one tool, each with its own idea of which keys it holds and what they mean, and some of the triggers a factory depends on can only be created by hand.

Without a single definition of the configuration:

  • Each Stage makes its own assumptions about how it is triggered and what it hands on.
  • Projects cannot move between prototypes, or onto the product, without rewriting their configuration.
  • Decisions about configuration get re-made, or made differently, in different places.
  • Setting up a factory takes manual steps that the product cannot check.

Goals

  • Define the factory configuration file and its schema.
  • Define the contracts between Stages that the configuration declares.
  • Define how the configuration determines when a work item enters the factory and advances between Stages.
  • Make factory setup a single action: the product creates everything a factory needs from the configuration, with no manual triggers.
  • Record decisions about the configuration, and link to where they were made.

Non-Goals

  • Describing the overall architecture of the factory.
  • Prescribing the internals of any individual Stage. Each Stage is owned by its own team.
  • Flow identity and authorization. The configuration chooses which flow runs, and so which identity acts on the repository, but how that identity is granted and scoped is owned elsewhere. Contact: @eduardobonet.
  • Factories that span more than one repository.
  • How factories are shared, versioned, and enabled. The factory is an AI Catalog item, and gets these from the AI Catalog like every other item.
  • Choosing how much autonomy the factory has for each work item, such as asking a human, letting the agent decide, or running fully automatically. The configuration sets whether each Stage is manual for the whole factory.
  • Using external agents, such as Claude Code or Codex, for a Stage.
  • Tracking what a factory costs. The only cost control in the configuration is max_fix_runs.
  • Planning, resourcing, or scheduling the work.
  • Replacing product requirements. This document links to them.

Proposal

Stages

The configuration has one fixed key for each Stage, in this order:

  1. Triage
  2. Plan
  3. Build
  4. Verify
  5. Review
  6. Ship

Stages cannot be added, removed, or renamed in the configuration. A project can skip a Stage. See ADR 010.

What the configuration declares for each Stage

In the end state, the configuration declares for each Stage:

  • Which work item Status the Stage maps to, and so what triggers it.
  • Which flow runs.
  • Where the Checkpoints are.
  • Which Exit checks must pass before work moves on.
  • Where work goes when the Stage fails.

Iteration 1 covers the first two, and a limited form of Checkpoints. Exit checks and failure routing are not in Iteration 1.

Configuration

A factory is configured with a YAML file in the repository of the project that publishes it. That file is the single source of truth. When it changes on the default branch, it is validated and published to the AI Catalog as a factory item. See ADR 001.

A factory is published once and enabled anywhere. Other projects use it by enabling the catalog item. Projects that get their factory configuration from the AI Catalog have no file. For example, one project can publish a shared factory that every project in a group enables. A change to it is made once, in the project that publishes it, and never writes to the repositories of the projects that use it.

Changes to the configuration are reviewed and approved through merge requests, in the same way as changes to code.

The configuration has two layers. See ADR 007:

  • The project configuration is the file of the project that publishes a factory. It holds what that factory chooses: its Statuses, which Stages are enabled, how each one runs, and the settings of individual Stages.
  • The factory definition says how every factory works: the triggers of each Stage, their rules, the default flows, and what a project needs enabled. It is the same for every factory.

In Iteration 1, a project that enables a factory gets it as it is published. Changing part of it means publishing a separate factory. Overriding parts of a shared factory without publishing a separate one is future work.

The product owns both layers, and everything created from them. The factory definition can be developed outside the product for now, so it can change quickly, but it moves into the product by the end of M2, and before M3. See ADR 002.

Iteration 1

Iteration 1 is the smallest configuration that a project can set up in one action and that runs end to end. It stays as close as possible to what is already built, and changes only what is needed to make the configuration coherent and complete.

Timeline

When What
30 November 2026 Iteration 1 is decided.
End of the 19.7 milestone, 11 December 2026 The product is brought in line with the Iteration 1 decisions.
End of M2, and before M3 The factory definition moves fully into the product, and the Triage and Relay flows become foundational flows. See ADR 002.

In Iteration 1

  • The file. .gitlab-dap-factory.yml at the root of the repository of the project that publishes a factory, read from the default branch. It holds the project configuration only. Projects that get their factory configuration from the AI Catalog have no file.
  • The factory definition. The seven triggers the factory runs today, held in the monolith as a versioned YAML file. See ADR 005 and ADR 009.
  • The Stage flow. What the factory runs today, which may change: Plan’s gate runs in the Triage flow, a human can approve a held Workplan, and a merge that unblocks a Task starts it. See ADR 004.
  • Flows. The default flows are foundational flows, which Enable turns on in the project if they are missing. The Triage and Relay flows are custom flows until they are foundational, and a group enables them once. The product does not turn on custom flows for a project. See ADR 002.
  • The Stages. The six fixed Stages. Each Stage is enabled or not, and a disabled Stage is skipped. See ADR 010.
  • For each enabled Stage: its Status, whether it is manual, meaning people do it and no flow runs, whether it has a Checkpoint, meaning a human moves the work on after the flow, which flow runs if not the default, and whether the merge requests it creates are marked ready when it finishes.
  • The Status that approves a held Workplan, for the Checkpoint between Plan and Build.
  • Metadata under each Stage, for settings that only the Stage’s flow reads, such as the marker label and milestone for Triage. The product does not read it, so flows can change it freely.
  • Settings of individual Stages that the product reads, such as the reviewer and maximum number of fix runs for Review.
  • Status. A work item’s Stage is tracked by its Status. This is a stopgap, and open for discussion. See ADR 006.
  • Publishing. A change to the file on the default branch is published as a new version of the project’s factory item in the AI Catalog. This is in progress.
  • Sync. Sync builds the project’s flow triggers from the factory definition and the project configuration, and creates every trigger a factory needs. There are no manual triggers.
  • Validation. One set of rules runs in the Factory Editor, as a note on merge requests that change the file, and before each version is published. An invalid file is not published, and the last published version keeps running.

The schema is in ADR 003, and what Sync creates is in ADR 005.

How Iteration 1 maps to the end state

End state Iteration 1
Status A Status for each enabled Stage
Flow Each Stage that is not manual runs the factory definition’s flow for that Stage, unless the factory chooses another. A manual Stage runs no flow.
Checkpoint checkpoint: true on a Stage, or the Status that approves a held Workplan. A human moves the work item to the next Status.
Exit check None. Marking merge requests ready on Build acts as one.
Failure routing None. The Review Stage stops its fix loop and marks the merge request as a draft.

When the configuration changes

An invalid file is not published, so nothing changes, and running work carries on with the last published version.

A valid change is published as a new version, and the new version only changes the triggers. Work that is already running carries on. Whether it picks up the change depends on how far through the factory it is: a work item that has not yet reached a changed Stage is started by the new trigger.

A change to the factory definition reaches a project when the project updates. See ADR 008.

Who can choose a flow

The configuration chooses which flow runs in each Stage, and so which flow acts on the repository. In Iteration 1:

  • The flow is a flow from the AI Catalog, or a foundational flow such as developer/v1.
  • A foundational flow is turned on in the project when the factory is enabled, if it is missing. A custom flow must already be enabled.
  • The change must reach the default branch, and Sync only applies it when the person who merges or pushes it can manage flow triggers in the project. That is the Maintainer role by default.

Not in Iteration 1

  • Exit checks and failure routing. See Next iteration.
  • What the Ship Stage does. See Open questions.
  • Running more than one factory in a project.
  • Turning on custom flows for a project automatically.
  • Sharing a factory across top-level groups. See ADR 001.
  • Choosing the entry work item types.
  • Overriding parts of a shared factory without publishing a separate one.
  • Locking managed triggers so that only the factory can change them. See ADR 005.

Next iteration: Exit checks

The next iteration plans Exit checks and exit criteria, so that a Stage, not its flow, decides when work moves on, and flows report their outcome without moving work themselves.

Iteration 1 leaves these rough edges, which Exit checks address:

  • checkpoint has no effect on Triage, because the Triage flow sets the next Status itself. More flows are likely to do the same.
  • mark_merge_requests_ready on Build is an Exit check written as a setting. Turning it off stops Review from starting.
  • A factory with Plan enabled must also enable Triage, because Plan’s gate runs in the Triage flow. A factory can choose otherwise in its file, and the validator rejects it.

All three come from flows moving work between Stages themselves.

The next iteration also adds default Verify and Ship flows, for M2. They can do nothing at first, but they mean every factory run shows all six Stages.

Design and implementation details

Iteration 1 builds on flow triggers. Sync turns each enabled Stage of the published factory that is not manual into one or more managed flow triggers. The finishing flow of one Stage sets the Status that starts the next, and that Status starts the next Stage. Review is driven by merge request events rather than by a Status.

The project configuration describes Stages, and the factory definition turns them into triggers. A factory’s file does not change when the factory definition does, or if the runtime moves away from triggers.

The Software Factory Configuration PRD informs the direction beyond Iteration 1: per-Stage Checkpoints and Exit checks, a per-Stage evaluator that decides when a Stage is complete, and tracking the Stage outside of Status. It is inspiration for the end state, not a specification of it.

Decisions

ADR Decision Status
010 The six Stages are fixed Accepted
001 Factory configuration is a repository file published to the AI Catalog Accepted
002 The product owns the factory configuration and its definition Accepted. Where the definition lives in the end state is open
003 The Iteration 1 configuration schema Accepted
004 The Stage flow and which work item each Stage acts on. Iteration 1 runs what runs today, which may change Accepted for Iteration 1, open for the end state
005 Sync creates every trigger a factory needs Accepted
006 Iteration 1 tracks the Stage with Status Accepted for Iteration 1, as a stopgap
007 The configuration has two layers Accepted
008 Projects update to changes in the factory definition when they choose Accepted
009 The factory definition format Accepted

Open questions

  • What does the Ship Stage do: merge, deploy, or something else? Ship decides the security scope of the factory, so it needs an answer before it runs automatically.
  • Does fixing a failed pipeline belong to the Verify Stage or the Review Stage?
  • What happens after Plan, and how does the next Task of a plan start, in the end state? See ADR 004.
  • Flows cannot use Skills from the AI Catalog yet. The Triage and Relay flows need this to stop running code from outside the product, so it is a priority. See ADR 002.
  • Can work enter the factory as a merge request, rather than as a work item?
  • Where does feedback from finished work go? For example, if the factory merges ten merge requests and three need a follow-up fix from a human, nothing in the configuration carries that back to Triage or Plan.
  • Where is a work item’s Stage recorded, if not in its Status? The direction is a factory state that only the factory can change. See ADR 006.
  • Does the factory definition stay in the monolith, or move to a separate factory service with its own APIs? See ADR 002.
  • How can a project override parts of a shared factory, without publishing a separate one? See ADR 007.
  • Should each Stage declare the state it leaves work in, rather than the Stage it hands work to, so that Stages are not linked and hybrid factories are easier to express? See ADR 007.
  • Can a factory work with only the default work item Statuses, and should Build, Verify, and Review be tracked against merge requests rather than work items? When a work item has several merge requests in different Stages, which Stage is the work item in? See ADR 006.
  • How can a human take a work item or merge request out of the factory, for a while or for good?
  • What happens to follow-up tasks that are created during a review and added to the same work item?
  • Should Review be one loop that fixes everything that is pending, such as review feedback, failed pipelines, and merge conflicts, rather than separate triggers that can run at the same time on one merge request? Whose verdicts count: only the Duo Code Review bot’s, or also other checks, and reviews that a human starts?
  • Should approving a plan be a feature of its own, rather than a Status? See ADR 004.
  • Where are publishing errors shown, other than the Factory Editor and the note on the merge request, and how are a factory’s owners told? See ADR 001.

Glossary

Software Factory
The system that moves a unit of work from intent to a merge request that is ready to merge, through a fixed sequence of Stages.
Stage
One of the fixed steps in the factory: Triage, Plan, Build, Verify, Review, or Ship.
Status
The work item status. A Stage maps to one or more Statuses, but a Status is not a Stage.
Factory marker
The flag on a work item that shows it is being worked on by the factory.
Checkpoint
A point in a Stage where a human must approve before work continues.
Exit check
A condition that must be true before a Stage is complete.
Iteration 1
The first, smallest version of the configuration. See Iteration 1.
Project configuration
What a factory chooses, in the .gitlab-dap-factory.yml of the project that publishes it.
Factory definition
How every factory works: its triggers, their rules, and its default flows. The same for every factory.
Manual Stage
A Stage that people do. No flow runs, and a human moves the work on.
Sync
The step that makes a project’s flow triggers match its published factory.
Managed trigger
A flow trigger that Sync creates and owns. Edits made to it elsewhere are replaced on the next Sync.

Alternative Solutions

Each ADR records the alternatives it considered.

References


Software Factory ADR 001: Factory configuration is a repository file published to the AI Catalog
Status Accepted. Context A project needs to configure how its factory runs: which flow runs in each …
Software Factory ADR 002: The product owns the factory configuration and its definition
Status Accepted. Whether the factory definition stays in the monolith in the end state is open. …
Software Factory ADR 003: The Iteration 1 configuration schema
Status Accepted. Context Iteration 1 needs a schema that a project can set up in one action, and …
Software Factory ADR 004: The Stage flow and which work item each Stage acts on
Status Accepted for Iteration 1. Open for the end state. Iteration 1 runs what the factory runs …
Software Factory ADR 005: Sync creates every trigger a factory needs
Status Accepted. Context Today Sync creates one trigger for each active Stage: A Status trigger for …
Software Factory ADR 006: Iteration 1 tracks the Stage with Status
Status Accepted for Iteration 1, as a stopgap. Open for the end state. Context The factory needs to …
Software Factory ADR 007: The configuration has two layers
Status Accepted. Context A factory needs two kinds of information: What a factory chooses: its …
Software Factory ADR 008: How changes to the factory definition reach projects
Status Accepted. Context The factory definition changes while a project’s configuration stays …
Software Factory ADR 009: The factory definition format
Status Accepted. This ADR decides the principles of the format. The details are settled in the merge …
Software Factory ADR 010: The six Stages are fixed
Status Accepted. Context Every factory moves work through the same sequence of Stages: Triage, Plan, …