Skip to content

AI Software Factories

Spinning Idea edited this page Nov 17, 2026 · 1 revision

AI Software Factories

An AI software factory is an autonomous production system that turns written requirements - issues, PRDs, tickets, alerts - into verified, production-ready code with minimal human intervention. Unlike first-generation AI coding assistants, where a developer prompts a pair-programming chatbot at a keyboard, a software factory operates as an asynchronous, event-driven assembly line: a daemon or webhook triggers the work, agent loops plan and implement in isolated environments, independent validation gates the result, and passing changes merge and deploy automatically.

The term "dark factory" borrows from lights-out manufacturing - factories that run with no humans on the floor. Dan Shapiro coined it for software; Cole Medin, Port, Mastra, Warp, and Cognition (Devin) have each operationalized it in different forms.

Scope: This page explains what a factory is, how one works, and catalogs real implementations - open-source harnesses, commercial platforms, and supporting tools - with links to learn more. It merges the content of AI-Software-Factory.md and AI-Software-Foundries-aka-Factories.md.


1. The paradigm shift: assistants → factories

┌─────────────────────────────────────────────────────────────────────────────┐
│ 1st Gen: Interactive Pair Assistants (Copilot, Chat UIs)                    │
│   Human developer prompts ──► LLM generates diff ──► Human reviews & tests  │
│   *Bottleneck: Human attention and manual typing required at every step*    │
└──────────────────────────────────────┬──────────────────────────────────────┘
                                       │ Paradigm Shift
                                       ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 2nd Gen: Autonomous AI Software Factories ("Dark Factories")                │
│   Spec / Ticket / Alert ──► Autonomous Multi-Agent Loop ──► Holdout Testing │
│   ──► Deterministic Gate ──► Auto-Merge ──► Canary / Blue-Green Deploy     │
│   *Bottleneck: Shifted upstream to spec clarity and downstream to tests*    │
└─────────────────────────────────────────────────────────────────────────────┘

Three properties define the shift:

  1. Trigger-driven operation - work initiates from GitHub issues, Linear/Jira tickets, Slack threads, Sentry alerts, or cron timers. No open editor required.
  2. Asynchronous 24/7 execution - agent workers run on remote servers, VMs, or container sandboxes, processing tasks in parallel across isolated git worktrees.
  3. Engineering as harness design - engineers stop writing line-by-line diffs and start designing acceptance criteria, governance rules, holdout tests, and scorecards.

Foundry vs. factory

Enterprise architecture distinguishes the upstream foundry (where intelligence and tools are provisioned) from the downstream factory (where code is produced):

Dimension AI Software Foundry AI Software Factory
Role Upstream enablement and tool fabrication Downstream autonomous execution and delivery
Artifacts Model catalogs, RAG engines, context graphs, agent SDKs Validated code, pull requests, test runs, deployments
Focus How models are evaluated, fine-tuned, governed How requirements are parsed, implemented, validated, shipped
Examples Azure AI Foundry, Palantir AIP/Foundry, HCLTech AI Foundry Archon, Warp Factories, Devin/MultiDevin, Mastra, Tempo

The foundry is the steel mill; the factory is the assembly line that consumes its output.


2. How a factory works

The reference architecture

                       ┌──────────────────────────────────────────────┐
                       │               GOVERNANCE LAYER               │
                       │    MISSION.md | FACTORY_RULES.md | CLAUDE.md │
                       │         (Protected, Immutable Rules)         │
                       └──────────────────────┬───────────────────────┘
                                              │ Read-Only Guidance
                                              ▼
┌─────────────┐   Issue / Event   ┌───────────────────────┐  Accepted   ┌────────────────────────┐
│  INCOMING   │ ────────────────► │  AGENT 1: TRIAGE      │ ──────────► │  AGENT 2: BUILDER      │
│  SPEC/PRD   │                   │  (Priority & Scope)   │             │  (Isolated Worktree,   │
└─────────────┘                   └───────────────────────┘             │   Static + Unit Tests) │
                                                                         └───────────┬────────────┘
                                                                                     │ Pull Request
                                                                                     ▼
┌─────────────┐     Auto-Merge    ┌───────────────────────┐   Fail      ┌────────────────────────┐
│ DEPLOYED TO │ ◄──────────────── │  AGENT 3: VALIDATOR   │ ◄────────── │  FIX / RETRY WORKFLOW  │
│ PRODUCTION  │  (All Gates Pass) │  (Independent Holdout)│ (Max ~2     │  (Fresh Context)       │
└─────────────┘                   └───────────────────────┘  Attempts)  └────────────────────────┘

The components

  1. The workflow harness - the deterministic engine that drives the pipeline: checks git status, parses labels, creates worktrees, branches on error codes, invokes agents in sequence. Examples: Archon (YAML DAGs), Mastra (TypeScript workflows), Warp factory.yaml.
  2. The execution agent - a headless coding CLI treated as an interchangeable UNIX utility: accepts a task prompt, edits files, returns a shell exit code. Examples: claude -p, codex exec, goose run, amp -x.
  3. The foundation model(s) - code reasoning and planning. Good harnesses route cheap extraction tasks to small models and hard implementation to frontier models.
  4. Isolated workspaces - one git worktree, container, or microVM per task so parallel runs never share runtime state.

The five structural pillars

Pillar What it means
Workflow-driven repository The repo itself defines issue → plan → build → test → PR; agents are swappable headless CLIs bound by an execution contract.
Automation engine + priority queue A daemon wakes on a timer (every 15–30 min) or webhook and works a strict queue: fix failing PRs → validate candidate PRs → build accepted issues → triage new backlog. Finish what's in-flight before starting new work.
Continuous deployment to real users A pipeline that merges but never deploys is a PR generator, not a factory. Passing PRs auto-merge and roll out (blue/green or canary) with automated revert on failed health checks.
Protected guidance layer Immutable governance files bound agent behavior. Any PR that modifies them is rejected automatically.
Validation harness + independence line The builder never grades its own work (see below).

The governance files

File Purpose
CLAUDE.md Repo conventions: package managers, code style, architecture patterns
MISSION.md Product goals, target users, explicitly out-of-scope features (triage rejects off-mission requests)
FACTORY_RULES.md Operational boundaries: max PR size, protected files, max fix attempts before human escalation
HOLDOUT.md / END-TO-END.md Hidden acceptance scenarios and documented user journeys the builder cannot see

The independence line - the core trust mechanism

The central risk in autonomous generation is an agent falsifying its own checks. Factories solve it by separating who builds from who verifies:

═══════════════════════════════════════════════════════════════════════════════
▲ THE VALIDATOR RUNS ABOVE THIS LINE (Strict Independence & Fresh Context)
│  • Deterministic Gate: Bash / CI script decides the merge, never a model.
│  • Holdout Scenarios: Acceptance tests never visible to the builder.
│  • Visual Judging: Headless browser regression & layout inspection.
│  • E2E User Journeys: Real browser automation on actual user flows.
───────────────────────────────────────────────────────────────────────────────
▼ THE BUILDER RUNS BELOW THIS LINE (Self-Correction in Isolated Worktree)
│  • Static Analysis: Linters, typecheckers (tsc, mypy), compilers.
│  • Unit Tests: Component-level tests authored with the implementation.
│  • Local Integration: Endpoint-level tests inside the worktree.
═══════════════════════════════════════════════════════════════════════════════

Core law: give an agent a check it can read and enough attempts, and it will modify the check to pass. Independence - a fresh-context validator plus a deterministic merge decision - is the only reliable defense.

Additional trust controls:

  • Protected operational perimeter - the factory cannot edit auth logic, rate limiters, deploy configs, or its own workflow code.
  • Fail-closed kill switch - a file or label that halts execution if health/status checks can't be confirmed.
  • Bounded retries - failed validation loops back to a fix workflow with a hard cap (~2 attempts), then escalates to a needs-human label.

3. Scaling to the enterprise: governance around the factory

Running one dark factory on a personal repo is easy; running dozens across an org raises governance questions - who owns an agent, which skills/MCP servers are vetted, and who answers when an agent's PR regresses production. Port (and similar IDPs like Cortex) answers this with a control plane around the factory:

  • Context Lake - continuously syncs repos, tickets, Slack, CI, and deployments into a software catalog. Planner agents query it (via MCP) for ownership, dependencies, and environment context before writing code.
  • Agent & skill registry - every agent has a human/team owner and a scope (read-only planner vs. read-write builder); skills and MCP servers are cataloged and versioned.
  • Scorecards (hard standards, not soft prompts) - Bronze (owner, README), Silver (CI, CODEOWNERS, PR template), Gold (green CI on main, zero critical CVEs). Graded programmatically on every merge.
  • Closed-loop self-healing - a failed check drops the score, files a structured issue, gets one-click human sign-off, and routes back to the factory to fix - restoring Gold status.

Organizational roles split accordingly: DevOps owns CI/runners, Platform Engineering owns the harness and scorecards, engineers write specs and holdout tests and approve high-risk PRs, and leadership sets the risk envelope and budget. Do not optimize for vanity metrics (tokens consumed, % of code AI-written); measure delivered outcomes:

Category Recommended metrics What it demonstrates
Delivery velocity Cycle lead time, deployment frequency, change failure rate, MTTR The line ships faster without destabilizing the system (DORA)
Autonomy level Issues resolved end-to-end without human edits; PRs merged via automated gates; fix loops per task How much of the lifecycle runs autonomously vs. needs intervention
Governance & cost Policy/scorecard violations intercepted pre-merge; blast radius of agent actions; cost per shipped feature Operations stay inside security boundaries with positive unit economics

4. Implementations

4.1 Open-source harnesses & reference implementations

Cole Medin's AI Software Factory + Archon

The canonical open-source dark factory: a Python daemon + systemd timers on a VPS that polls GitHub labels (factory:triaging, factory:accepted, factory:in-progress, factory:needs-fix), launches headless coding agents in git worktrees, and gates merges on independent holdout scenarios. Archon is the underlying YAML-DAG workflow engine.

Insights from the GPT-6 Astra demonstration: autonomous loops need models that follow user intent across multi-step planning without drifting from requirements; hosting on a remote VPS enables true 24/7 background execution; and GitHub labels function as the workflow state machine that dispatches Archon pipelines.

  • Links: ai-software-factory | Archon | dark-factory-experiment | server cheat sheet
  • Cost: Free OSS (MIT). $10–25/mo VPS + pay-per-token model costs ($0.40–2.50 per completed PR).
  • Use: bootstrap-ubuntu.sh on an Ubuntu 24.04 VPS, then factory.py init in your repo. See §6.
  • Strengths: total transparency, zero lock-in, battle-tested holdout validation and priority queue; swappable agent CLIs and models.
  • Limits: requires Linux server administration; single-machine scale bound by host CPU/RAM/disk.

Zazencodes software-factory-claude-code-v2

A Claude Code–based software factory implementation from the Zazencodes (Alex Ziskind) video series - headless Claude Code agents wired into an issue→build→validate→PR pipeline.

Mastra

TypeScript agent framework for deterministic, long-running factory pipelines: workflow DAGs, built-in LibSQL/Postgres storage, Sentry telemetry, GitHub webhook integration.

  • Links: Software factory guide | mastra-ai/mastra
  • Cost: Free OSS (Apache 2.0); self-hosted Node.js + your model keys.
  • Use: npm create mastra@latest then define triage/implement/validate steps as a createWorkflow DAG:
import { createStep, createWorkflow } from "@mastra/core";
import { z } from "zod";

const triageStep = createStep({
  id: "triage-issue",
  inputSchema: z.object({ issueBody: z.string() }),
  execute: async ({ context }) => {
    // Query LLM to evaluate priority against MISSION.md
    return { accepted: true, priority: "high" };
  },
});

export const factoryWorkflow = createWorkflow({
  name: "DarkFactoryPipeline",
  steps: [triageStep /*, implementStep, validateStep */],
});
  • Strengths: full TypeScript type safety, transactional storage, step memoization, drops into existing Node backends.
  • Limits: you build the workflow logic yourself (unlike turnkey Warp/Devin); TypeScript-centric.

lee-to/ai-factory

Zero-config spec-driven harness: one CLI routes requirements to whichever agents you have installed (Claude Code, Cursor, Windsurf, Codex CLI).

  • Link: github.com/lee-to/ai-factory
  • Cost: Free OSS.
  • Limits: no autonomous scheduling or independent holdout validation; best for solo spec-driven development.

dewantrie/ai-software-factory

Central factory generator for polyrepo orgs - synchronizes rules, linter profiles, and prompt libraries across heterogeneous microservices.

muhammadsami987123/AI-Software-Factory

Visual multi-agent development workspace structuring requirements, architecture, API plans, and reviews.

4.2 Commercial platforms

Devin / MultiDevin (Cognition)

Autonomous cloud software engineer in persistent sandboxed microVMs (shell, editor, browser). MultiDevin is the factory orchestrator: a central Manager Agent ingests epics or Jira backlogs, decomposes specifications into discrete subtasks, and coordinates up to ~10 worker agents in parallel sandboxes - each worker branch is compiled, tested, and submitted as a PR.

npm install -g devin-cli
devin login && devin init
devin run --team-size 5 "Refactor auth layer to OAuth2 PKCE, update tests, generate migrations"
  • Strengths: turnkey, zero infra, dedicated microVM per task, browser-based visual debugging.
  • Limits: enterprise price point; closed-source engine internals.

Warp Factories

Declarative "Factories as Code": a versioned factory.yaml defines repos, secrets, integrations (Slack/Linear/Jira), and a Foreman agent that orchestrates Triage → Spec → Implement → Review specialist agents on managed cloud runners.

  • Links: warp.dev/factories | docs | demo
  • Cost: Early access; usage-based pricing planned (compute + tokens).
  • Use: commit factory.yaml at repo root, then warp factory apply -f factory.yaml; dispatch via @factory mentions or ticket labels:
schemaVersion: v1alpha1
name: core-services-factory
repositories:
  - { owner: my-org, name: backend-api }
secrets: [NPM_TOKEN, DATABASE_URL]
integrations:
  - { type: slack, channel: "#eng-factory-feed" }
  - { type: linear, team: "BACKEND" }
agentDefaults: { model: auto, runner: warp-cloud-standard }
  • Strengths: versionable factory definitions; native Slack/Linear/Jira dispatch; managed runners.
  • Limits: limited early access; proprietary orchestration less customizable than OSS harnesses.

Tempo

Event-driven issue-to-PR factory: ingests Slack customer feedback, Sentry alerts, and Linear issues; a Reproduction agent writes a failing test first, a Fix agent iterates until it passes, a Review agent opens the PR.

  • Link: tempo.new/software-factory
  • Cost: Free starter tier; ~$49–199/mo by PR volume.
  • Use: connect GitHub + Slack/Sentry, set triage rules in .tempo/factory.json, tag @tempo fix on an issue:
{
  "monitoredChannels": ["#customer-bugs"],
  "autoReproduce": true,
  "maxFixAttempts": 3,
  "targetBranches": ["main"]
}
  • Strengths: shortest mean-time-to-resolution loop (telemetry → reproduction → fix); reproduction test prevents speculative fixes.
  • Limits: bug-fix focused, less suited to large refactors; relies on third-party sandboxing.

Encore & Cortex

Infrastructure-aware path: Encore (Go/TypeScript framework) parses service declarations into cloud architectures and gives every branch an isolated preview environment for holdout testing; Cortex adds enterprise scorecards and compliance auditing for agent PRs.

  • Links: Encore article | Cortex
  • Cost: Encore free OSS; Encore Cloud from ~$99/mo. Cortex enterprise per-seat.
  • Use: encore app create, declare infra in code (e.g. new SQLDatabase("users", { migrations: "./migrations" })), let agents validate against encore preview environments.
  • Strengths: removes cloud plumbing for agents; instant preview envs enable real E2E holdouts; static service graphs prevent architectural drift.
  • Limits: requires adopting Encore for backends (Go/TS); not a wrapper for arbitrary legacy polyglot codebases.

4.3 Governance, review & supporting tools

Port

Enterprise IDP and governance harness around the factory (see §3): Context Lake, agent/skill registry, Bronze-Silver-Gold scorecards, closed-loop self-healing via MCP.

  • Link: port.io/blog/ai-software-factory
  • Cost: Free up to 15 seats; enterprise per-seat.
  • Use: connect GitHub/Slack, define blueprints + scorecards, expose the Port MCP server to planner agents:
// Example Agent blueprint
{
  "identifier": "agent",
  "title": "AI Agent",
  "properties": {
    "owner": { "type": "string" },
    "scope": { "type": "string", "enum": ["read-only", "read-write", "deploy"] },
    "assignedRepo": { "type": "string" }
  }
}
{
  "mcpServers": {
    "port": {
      "command": "npx",
      "args": ["-y", "@port-labs/port-mcp-server"],
      "env": { "PORT_CLIENT_ID": "...", "PORT_CLIENT_SECRET": "..." }
    }
  }
}
  • Strengths: ownership/accountability layer; Context Lake kills dependency hallucinations; scorecards are non-bypassable floors.
  • Limits: doesn't execute code itself - needs external agents; initial blueprint/ingestion setup required.

Plannotator

A human-in-the-loop workspace for staying on top of agents: shape and annotate plans, review diffs, share with the team, and send structured feedback back to agents in one click. Fills the human-review gap that even dark factories keep at the trust boundary.

  • Link: github.com/backnotprop/plannotator
  • Cost: Free open source.
  • Use: run alongside your coding agent (Claude Code, OpenCode, etc.) as the review/annotation layer before or after agent runs.

Dynamous AI

Education and architecture community (Cole Medin) teaching the underlying factory mechanics. The Agentic Coding Course covers five disciplines: PRD-first requirements, modular protected rules (CLAUDE.md / FACTORY_RULES.md / MISSION.md), command-ification of repeated tasks, context resets between planning/implementation/verification, and treating bugs as harness-hardening opportunities.

  • Link: dynamous.ai
  • Cost: ~$79/mo or ~$712/yr membership (promos of 20–40% common).
  • Use: courses + private template repos (worktree scripts, triage labels, systemd units) applied to your own infra.
  • Strengths: model-agnostic principles that outlast tooling churn; verified reference code; active builder community.
  • Limits: education and templates, not a managed control plane; you run the infrastructure.

4.4 Upstream AI foundries (context, not factories themselves)

Platform Role
Azure AI Foundry Model catalogs, agent SDKs, enterprise identity, multi-agent orchestration
Palantir AIP & Foundry Enterprise Ontology + decision-action layer
HCLTech AI Foundry Managed enterprise AI enablement

5. Comparison matrix

Implementation Type Orchestration Isolation Validation Cost Best for
Cole Medin / Archon OSS harness Python daemon + systemd + Archon YAML DAGs Git worktrees on VPS Independent validator + holdout tests Free + VPS + tokens Full self-hosted control
Zazencodes v2 OSS reference Claude Code–centric scripts Worktrees/sessions Scripted validation Free + Claude usage Learning Claude Code factories
Mastra OSS framework TypeScript workflow DAGs Node env + worktrees Programmatic step validation Free TS teams building custom factories
Devin / MultiDevin Commercial platform Manager agent + parallel workers Cloud microVM per task Compiler/lint/browser checks SaaS (ACUs, enterprise) Turnkey autonomous issue resolution
Warp Factories Commercial platform Declarative factory.yaml + Foreman Managed cloud runners Review agent + CI gates Early access Teams wanting managed "factories as code"
Tempo Commercial platform Event hooks (Slack/Sentry/Jira) Ephemeral containers Mandatory reproduction test Freemium Auto-fixing production bugs from alerts
Encore & Cortex Framework + IDP Infra-aware service graphs Preview environments per branch E2E preview tests + scorecards Free OSS / $99+ Backend teams on Go/TS
Port Governance IDP Context Lake + scorecards + MCP Delegated to agent runner Bronze/Silver/Gold scorecards Free ≤15 seats Enterprise multi-agent governance
Plannotator Review tool Human-in-the-loop UI n/a Human annotation of plans/diffs Free OSS Keeping humans in the loop
lee-to / dewantrie / sami OSS utilities CLI prompt routing Varies Manual Free Lightweight spec-driven dev
Dynamous AI Education Patterns & blueprints Community templates Holdout methodology ~$712/yr Mastering factory mechanics

6. Self-host quickstart (Archon pattern)

The concrete path for the Cole Medin factory, based on the server cheat sheet.

Prerequisites: Ubuntu 24.04 server with ≥8 GB RAM; git, Python 3.10+, bun, uv; GitHub CLI with workflow scope; an authenticated coding agent (Codex or Claude Code).

# 1. SSH key + firewall: allow only SSH/HTTP/HTTPS inbound
ssh-keygen -t ed25519 -f ~/.ssh/factory -N ""     # on your local machine
ssh -i ~/.ssh/factory root@<vps-ip>

# 2. Bootstrap the server
curl -sSL https://raw.githubusercontent.com/coleam00/ai-software-factory/main/bin/bootstrap-ubuntu.sh | bash
source ~/.profile

# 3. Authenticate GitHub
gh auth login --hostname github.com --git-protocol https --web -s workflow
gh auth setup-git && gh auth status

# 4a. Authenticate Codex (enable "Device code authorization" in ChatGPT settings first)
codex login --device-auth
codex exec "say hi"

# 4b. Alternative: Claude Code token auth
#   On local machine:  claude setup-token
#   On server:
echo 'export CLAUDE_CODE_OAUTH_TOKEN=<token>' >> ~/.factory-env && chmod 600 ~/.factory-env
echo 'source ~/.factory-env; export IS_SANDBOX=1' >> ~/.profile && source ~/.profile
claude auth status

# 5. Install the factory in your repo
gh repo clone <you>/<app> ~/<app>
git clone https://github.com/coleam00/ai-software-factory ~/ai-software-factory
cd ~/<app> && python3 ~/ai-software-factory/bin/factory.py init

Configure model tiers in ~/.archon/config.yaml - small tasks route to cheaper effort levels, large tasks to high-effort reasoning:

defaultAssistant: codex
assistants:
  codex: { model: gpt-6-astra, modelReasoningEffort: medium }
tiers:
  small:  { provider: codex, model: gpt-6-astra, effort: medium }
  medium: { provider: codex, model: gpt-6-astra, effort: medium }
  large:  { provider: codex, model: gpt-6-astra, effort: high }

Runtime verification requirements (under /root/private, chmod 700):

  1. The test harness starts a fresh instance of the candidate build on an isolated local port.
  2. The candidate root refreshes from the delivering checkout before each run (not a static dir).
  3. The app must expose a /build-id endpoint returning the candidate commit digest so the verifier can confirm the running process matches the PR code.
# 6. Verify + go live
cd ~/<app>
python3 factory/consumer.py doctor
python3 factory/consumer.py list
# File a test issue, run one lifecycle in the foreground, approve the PR, then:
systemctl enable --now factory-timer.timer

Day-to-day operations:

# Status: recent ticks, active runs, running build ID
journalctl -u factory-timer.service -n 50 --no-pager

# Re-drive a held PR (fix the underlying hold comment first)
python3 factory/consumer.py redrive <pr-number>

# If the pinned Archon source was modified ("Factory refused: Pinned source has changes"):
rm -rf ~/.cache/factory/archon/<revision>
cd ~/<app> && python3 ~/ai-software-factory/bin/factory.py init

7. Implementation roadmap

  1. Stabilize the pipeline - kill flaky tests; enforce format/typecheck/lint on every push; PR templates + CODEOWNERS.
  2. Establish the guidance layer - write CLAUDE.md, FACTORY_RULES.md, MISSION.md.
  3. Deploy an open-source runner - Archon or Mastra on an isolated VPS; label-based triage; worktree isolation.
  4. Implement the holdout principle - independent validator with fresh context; hidden acceptance tests; a deterministic script - never a model - makes the merge call.
  5. Layer enterprise governance - Port Context Lake + scorecards; automated issue creation on production check failures to close the self-healing loop.

8. Visual workflows (mermaid)

These diagrams render on the GitHub wiki. They show the same architecture from three angles: enterprise governance, the dark factory lifecycle, and the daily operating loop.

Enterprise harness around the factory

flowchart TD
    subgraph EnterpriseContext["Enterprise Context Lake"]
        GH[GitHub] --> CL[(Port Context Lake)]
        Jira[Jira / Linear] --> CL
        Slack[Slack] --> CL
        CI[CI / Telemetry] --> CL
    end

    subgraph FactoryLine["AI Software Factory Execution"]
        Plan[Plan Release] --> Split[Split into Issues]
        Split --> Laps[Parallel Worktree Laps]
        Laps --> Review[2 Independent Reviewers]
        Review --> Merge[Merge to Main]
    end

    subgraph Standards["Port Scorecards"]
        Bronze[Bronze: Owner, README, gitignore] --> Silver[Silver: CI, CODEOWNERS, PR Template]
        Silver --> Gold[Gold: CI Passing on Main]
    end

    subgraph HealingLoop["Closed-Loop Self-Healing"]
        Fail[Check Fails / CI Goes Red] --> PortIssue[Port Files Issue with Logs]
        PortIssue --> HumanApprove[Human Owner Signs Off]
        HumanApprove --> FixRun[Factory Picks & Resolves Issue]
    end

    CL -->|Owner + Standards| FactoryLine
    FactoryLine -->|Graded on Merge| Standards
    Standards -->|Degraded Rule| Fail
    FixRun -->|Restores Gold| FactoryLine

    style EnterpriseContext fill:#141d2b,stroke:#3d5573,color:#e6edf3
    style FactoryLine fill:#141d2b,stroke:#3d5573,color:#e6edf3
    style Standards fill:#141d2b,stroke:#3d5573,color:#e6edf3
    style HealingLoop fill:#141d2b,stroke:#3d5573,color:#e6edf3

    classDef node fill:#1f2b3d,stroke:#5b8dc9,stroke-width:1.5px,color:#e6edf3
    classDef store fill:#16321f,stroke:#3fb950,stroke-width:1.5px,color:#d7f0dc
    classDef good fill:#16321f,stroke:#3fb950,stroke-width:1.5px,color:#d7f0dc
    classDef alert fill:#3d1f22,stroke:#f85149,stroke-width:1.5px,color:#ffd6d3
    classDef human fill:#2a2410,stroke:#f0a848,stroke-width:1.5px,color:#ffd9a0

    class GH,Jira,Slack,CI,Plan,Split,Laps,Review,Merge,Bronze,Silver,FixRun node
    class CL store
    class Gold good
    class Fail,PortIssue alert
    class HumanApprove human

    linkStyle default stroke:#5b8dc9,stroke-width:1.5px,color:#a8c3e0
Loading

Dark factory lifecycle blueprint

flowchart TD
    Spec([Human Writes Spec / Issue]) --> Triage[Daemon / Triage Agent]

    subgraph GuidanceLayer["The Protected Guidance Layer"]
        C_MD[CLAUDE.md: Conventions]
        F_MD[FACTORY_RULES.md: Boundaries]
        M_MD[MISSION.md: Scope & Goals]
    end

    GuidanceLayer -.->|Read-Only Guardrails| Triage
    GuidanceLayer -.->|Read-Only Guardrails| Builder

    Triage -->|Accepted Label| Builder[The Builder Agent<br/>Headless CLI in Git Worktree]

    subgraph BelowLine["Below the Independence Line"]
        Builder --> StaticCheck[Static Types & Linter]
        StaticCheck --> UnitTests[Unit & Component Tests]
    end

    UnitTests --> Validator[The Validator Agent<br/>Fresh Context & Diff Inspection]

    subgraph AboveLine["Above the Independence Line"]
        Validator --> Holdout[Holdout Acceptance Scenarios]
        Holdout --> Visual[Visual Regression / Browser Run]
        Visual --> DeterministicGate{Deterministic Gate<br/>Bash / CI Decision}
    end

    DeterministicGate -->|Pass| Deploy[Blue/Green Deployment<br/>Live to Real Users]
    DeterministicGate -->|Fail: max 2 retries| FixRetry[Fix Workflow / Needs-Fix]
    FixRetry --> Builder
    DeterministicGate -->|Fail: exhausted| NeedsHuman[Needs-Human Label & Alert]

    style GuidanceLayer fill:#141d2b,stroke:#f0a848,color:#ffd9a0
    style BelowLine fill:#141d2b,stroke:#3d5573,color:#e6edf3
    style AboveLine fill:#141d2b,stroke:#3d5573,color:#e6edf3

    classDef node fill:#1f2b3d,stroke:#5b8dc9,stroke-width:1.5px,color:#e6edf3
    classDef actor fill:#22304a,stroke:#6cb6ff,stroke-width:1.5px,color:#e6edf3
    classDef guard fill:#2a2410,stroke:#f0a848,stroke-width:1.5px,color:#ffd9a0
    classDef decision fill:#2a2410,stroke:#f0a848,stroke-width:2px,color:#ffd9a0
    classDef good fill:#16321f,stroke:#3fb950,stroke-width:1.5px,color:#d7f0dc
    classDef alert fill:#3d1f22,stroke:#f85149,stroke-width:1.5px,color:#ffd6d3

    class Spec actor
    class Triage,Builder,StaticCheck,UnitTests,Validator,Holdout,Visual,FixRetry node
    class C_MD,F_MD,M_MD guard
    class DeterministicGate decision
    class Deploy good
    class NeedsHuman alert

    linkStyle default stroke:#5b8dc9,stroke-width:1.5px,color:#a8c3e0
Loading

Daily operating loop

sequenceDiagram
    autonumber
    actor Developer as Human Engineer
    participant Manager as Manager Agent
    participant Worktree as Worker Agents (Worktrees)
    participant Validator as Independent Validator
    participant Staging as Staging Cluster
    participant Prod as Production

    Developer->>Manager: Plan Release (PoC Spec or Epic PRD)
    Manager->>Manager: Split into decoupled parallel issues
    loop Parallel Laps (One per Worktree)
        Manager->>Worktree: Assign Issue (Pick)
        Worktree->>Worktree: Implement code & run local unit tests
        Worktree->>Validator: Submit candidate PR
        Validator->>Validator: Run independent holdouts & E2E checks
        alt All checks pass
            Validator->>Manager: Approved
            Manager->>Staging: Merge PR & deploy to staging
        else Checks fail
            Validator->>Worktree: Return error logs (Max 2 laps)
        end
    end
    Developer->>Staging: Test & evaluate release experience
    alt Release passes user feel
        Developer->>Prod: Promote to Production
    else Flaws detected
        Developer->>Manager: File new issues into loop
    end
Loading

9. Sources & further reading

Clone this wiki locally