# caponetto/ai-dev-orchestrator architecture

> Architecture diagram of the GitHub repository caponetto/ai-dev-orchestrator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/caponetto/ai-dev-orchestrator
- Repository: https://github.com/caponetto/ai-dev-orchestrator

## Overview

AI Dev Orchestrator runs locally defined workflows through AI coding-agent CLIs, enforcing workflow and governance stages while producing versioned artifacts. Users start, inspect, resume, and control runs through the CLI or dashboard; runs progress through intake, role-based work, review, and completion. The graph preserves the documented agent, artifact, recovery, and dashboard capabilities. Source excerpts support selected internal calls; broader subsystem links are documented in the README, and unsampled wiring is omitted or marked unverified.

Main entry points: [`packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts`](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts) (Workflow Lifecycle), [`packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts`](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts) (Agent Sessions), [`packages/recovery/src/infrastructure/recovery/recovery-manager.ts`](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/recovery/src/infrastructure/recovery/recovery-manager.ts) (Crash Recovery), [`packages/cli/src/index.ts`](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/cli/src/index.ts) (CLI Commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI Commands<br/>[index.ts]"]
  node_dashboard["Dashboard UI<br/>[App.tsx]"]
end

subgraph group_compose["Application Composition"]
  node_composition["Composition Root"]
end

subgraph group_orchestrate["Workflow Orchestration"]
  node_workflow["Workflow Lifecycle"]
  node_action["Action Dispatch"]
  node_guards["Workflow Guards<br/>[guard-checker.ts]"]
  node_review["Review Interpretation"]
  node_schemas["Workflow Contracts<br/>[workflow-engine.ts]"]
end

subgraph group_domain["Agent and Artifact Services"]
  node_runner["Agent Sessions"]
  node_adapters["Vendor CLI Adapters"]
  node_prompts["Prompt Engine"]
  node_roles["Role System<br/>[role-system.ts]"]
  node_policy["Policy Evaluation"]
  node_governance["Governance Gates<br/>[transition-gate.ts]"]
  node_artifacts[("Artifact Store")]
  node_dependency["Artifact Impact"]
end

subgraph group_runtime["Run State and Visibility"]
  node_recovery["Crash Recovery"]
  node_persistence[("Run Persistence")]
  node_journal[("Run Journal")]
  node_server["Dashboard Services"]
  node_diagnostics["Diagnostics"]
end

node_user(("Operator"))
node_agent{{"Agent CLIs"}}

node_user -->|"runs commands"| node_cli
node_user -->|"monitors runs"| node_dashboard
node_cli -.->|"starts runs"| node_composition
node_composition -.->|"configures"| node_workflow
node_workflow -->|"dispatches actions"| node_action
node_workflow -->|"checks guards"| node_guards
node_workflow -->|"interprets reviews"| node_review
node_workflow -->|"uses contracts"| node_schemas
node_action -.->|"dispatches work"| node_runner
node_runner -->|"routes sessions"| node_adapters
node_adapters -.->|"invokes CLI"| node_agent
node_runner -.->|"requests prompts"| node_prompts
node_prompts -->|"renders role context"| node_roles
node_workflow -.->|"evaluates policies"| node_policy
node_workflow -.->|"enforces gates"| node_governance
node_workflow -->|"collects artifacts"| node_artifacts
node_dependency -->|"tracks impact"| node_artifacts
node_workflow -.->|"checkpoints state"| node_persistence
node_workflow -.->|"appends events"| node_journal
node_recovery -->|"restores state"| node_persistence
node_recovery -->|"rebuilds from journal"| node_journal
node_dashboard -.->|"requests run views"| node_server
node_server -.->|"serves diagnostics"| node_diagnostics

click node_cli "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/cli/src/index.ts"
click node_dashboard "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard/src/App.tsx"
click node_composition "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/cli/src/composition-root.ts"
click node_workflow "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts"
click node_action "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/action-dispatcher.ts"
click node_guards "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/guard-checker.ts"
click node_review "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/review-result-interpreter.ts"
click node_schemas "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/schemas/src/workflow/workflow-engine.ts"
click node_runner "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts"
click node_adapters "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/agent-adapters/src/claude-code-adapter.ts"
click node_prompts "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/prompt-engine/src/infrastructure/default-prompt-engine.ts"
click node_roles "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/schemas/src/runner/role-system.ts"
click node_policy "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/policy-engine/src/infrastructure/default-policy-engine.ts"
click node_governance "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/governance/src/infrastructure/governance/transition-gate.ts"
click node_artifacts "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/artifacts/src/infrastructure/artifact-system/filesystem-artifact-store.ts"
click node_dependency "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dependency-graph/src/infrastructure/default-impact-analyzer.ts"
click node_recovery "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/recovery/src/infrastructure/recovery/recovery-manager.ts"
click node_persistence "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/core/src/infrastructure/state-persistence/default-state-persistence.ts"
click node_journal "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/journal/src/infrastructure/default-journal-writer.ts"
click node_server "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard-server/src/dashboard/dashboard-http-server.ts"
click node_diagnostics "https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard-server/src/diagnostics/default-diagnostics-engine.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_dashboard toneBlue
class node_composition toneAmber
class node_workflow,node_action,node_guards,node_review,node_schemas toneMint
class node_runner,node_adapters,node_prompts,node_roles,node_policy,node_governance,node_artifacts,node_dependency toneRose
class node_recovery,node_persistence,node_journal,node_server,node_diagnostics,node_user,node_agent toneIndigo
```

## Components

### User Interfaces

- [CLI Commands](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/cli/src/index.ts): `packages/cli/src/index.ts`
- [Dashboard UI](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard/src/App.tsx): `packages/dashboard/src/App.tsx`

### Application Composition

- [Composition Root](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/cli/src/composition-root.ts): `packages/cli/src/composition-root.ts`

### Workflow Orchestration

- [Workflow Lifecycle](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts): `packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts`
- [Action Dispatch](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/action-dispatcher.ts): `packages/workflow/src/infrastructure/workflow-engine/action-dispatcher.ts`
- [Workflow Guards](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/guard-checker.ts): `packages/workflow/src/infrastructure/workflow-engine/guard-checker.ts`
- [Review Interpretation](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/workflow/src/infrastructure/workflow-engine/review-result-interpreter.ts): `packages/workflow/src/infrastructure/workflow-engine/review-result-interpreter.ts`
- [Workflow Contracts](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/schemas/src/workflow/workflow-engine.ts): `packages/schemas/src/workflow/workflow-engine.ts`

### Agent and Artifact Services

- [Agent Sessions](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts): `packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts`
- [Vendor CLI Adapters](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/agent-adapters/src/claude-code-adapter.ts): `packages/agent-adapters/src/claude-code-adapter.ts`
- [Prompt Engine](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/prompt-engine/src/infrastructure/default-prompt-engine.ts): `packages/prompt-engine/src/infrastructure/default-prompt-engine.ts`
- [Role System](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/schemas/src/runner/role-system.ts): `packages/schemas/src/runner/role-system.ts`
- [Policy Evaluation](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/policy-engine/src/infrastructure/default-policy-engine.ts): `packages/policy-engine/src/infrastructure/default-policy-engine.ts`
- [Governance Gates](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/governance/src/infrastructure/governance/transition-gate.ts): `packages/governance/src/infrastructure/governance/transition-gate.ts`
- [Artifact Store](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/artifacts/src/infrastructure/artifact-system/filesystem-artifact-store.ts): `packages/artifacts/src/infrastructure/artifact-system/filesystem-artifact-store.ts`
- [Artifact Impact](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dependency-graph/src/infrastructure/default-impact-analyzer.ts): `packages/dependency-graph/src/infrastructure/default-impact-analyzer.ts`

### Run State and Visibility

- [Crash Recovery](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/recovery/src/infrastructure/recovery/recovery-manager.ts): `packages/recovery/src/infrastructure/recovery/recovery-manager.ts`
- [Run Persistence](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/core/src/infrastructure/state-persistence/default-state-persistence.ts): `packages/core/src/infrastructure/state-persistence/default-state-persistence.ts`
- [Run Journal](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/journal/src/infrastructure/default-journal-writer.ts): `packages/journal/src/infrastructure/default-journal-writer.ts`
- [Dashboard Services](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard-server/src/dashboard/dashboard-http-server.ts): `packages/dashboard-server/src/dashboard/dashboard-http-server.ts`
- [Diagnostics](https://github.com/caponetto/ai-dev-orchestrator/blob/main/packages/dashboard-server/src/diagnostics/default-diagnostics-engine.ts): `packages/dashboard-server/src/diagnostics/default-diagnostics-engine.ts`

### Other components

- **Operator**
- **Agent CLIs**

## Connections

- Operator → CLI Commands: runs commands (evidence: `README.md`)
- Operator → Dashboard UI: monitors runs (evidence: `README.md`)
- CLI Commands → Composition Root: starts runs
- Composition Root → Workflow Lifecycle: configures
- Workflow Lifecycle → Action Dispatch: dispatches actions (evidence: `packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts`)
- Workflow Lifecycle → Workflow Guards: checks guards (evidence: `packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts`)
- Workflow Lifecycle → Review Interpretation: interprets reviews (evidence: `packages/workflow/src/infrastructure/workflow-engine/lifecycle-controller.ts`)
- Workflow Lifecycle → Workflow Contracts: uses contracts (evidence: `packages/schemas/src/workflow/workflow-engine.ts`)
- Action Dispatch → Agent Sessions: dispatches work
- Agent Sessions → Vendor CLI Adapters: routes sessions (evidence: `packages/runner/src/infrastructure/runner-system/agent-session-request-router.ts`)
- Vendor CLI Adapters → Agent CLIs: invokes CLI
- Agent Sessions → Prompt Engine: requests prompts
- Prompt Engine → Role System: renders role context (evidence: `packages/prompt-engine/src/infrastructure/default-prompt-engine.ts`)
- Workflow Lifecycle → Policy Evaluation: evaluates policies
- Workflow Lifecycle → Governance Gates: enforces gates
- Workflow Lifecycle → Artifact Store: collects artifacts (evidence: `README.md`)
- Artifact Impact → Artifact Store: tracks impact (evidence: `README.md`)
- Workflow Lifecycle → Run Persistence: checkpoints state
- Workflow Lifecycle → Run Journal: appends events
- Crash Recovery → Run Persistence: restores state (evidence: `packages/recovery/src/infrastructure/recovery/recovery-manager.ts`)
- Crash Recovery → Run Journal: rebuilds from journal (evidence: `packages/recovery/src/infrastructure/recovery/recovery-manager.ts`)
- Dashboard UI → Dashboard Services: requests run views
- Dashboard Services → Diagnostics: serves diagnostics
