# vercel-labs/eve-software-factory-template architecture

> Architecture diagram of the GitHub repository vercel-labs/eve-software-factory-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vercel-labs/eve-software-factory-template
- Repository: https://github.com/vercel-labs/eve-software-factory-template

## Overview

Foreman is an AI software factory: work arrives through GitHub, Linear, HTTP intake, or the eve channel, then is triaged and routed through specialist stations to a reviewed draft pull request. The README also documents clarification, research, CI repair, and pull-request summaries. The graph preserves those capabilities, but the source excerpts are incomplete; edges for unsampled subsystems rely on README statements, and uncertain internal wiring is omitted.

Main entry points: [`agent/agent.ts`](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/agent.ts) (Foreman orchestrator), [`agent/channels/github.ts`](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/github.ts) (GitHub events), [`agent/channels/intake.ts`](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/intake.ts) (Ticket intake), [`agent/lib/triage/run.ts`](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/run.ts) (Task triage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Work intake"]
  node_github_channel["GitHub events<br/>[github.ts]"]
  node_linear_channel["Linear sessions<br/>[linear.ts]"]
  node_http_intake["Ticket intake<br/>[intake.ts]"]
  node_ticket_model["Ticket handling<br/>[ticket.ts]"]
  node_eve_channel["Eve channel<br/>[eve.ts]"]
end

subgraph group_workflow["Orchestration and triage"]
  node_foreman["Foreman orchestrator<br/>[agent.ts]"]
  node_triage["Task triage<br/>[run.ts]"]
  node_triage_decisions["Triage decisions<br/>[decisions.ts]"]
  node_pretriage["Clarification routing<br/>[pretriage.ts]"]
end

subgraph group_stations["Agent stations"]
  node_classifier["Classifier<br/>[agent.ts]"]
  node_researcher["Researcher<br/>[agent.ts]"]
  node_analyst["Analyst<br/>[agent.ts]"]
  node_implementer["Implementer<br/>[agent.ts]"]
  node_reviewer["Reviewer<br/>[agent.ts]"]
  node_station_tools["Station dispatch<br/>[run_reviewer.ts]"]
end

subgraph group_repo["Repository operations"]
  node_repo_sandbox["Repository sandbox<br/>[repo-sandbox.ts]"]
  node_approval["Approval policy<br/>[approval.ts]"]
  node_github_cli["GitHub command policy<br/>[cli.ts]"]
  node_credential_lease["Scoped credentials<br/>[lease.ts]"]
  node_ci_diagnosis["CI diagnosis"]
end

subgraph group_state["Memory and artifacts"]
  node_memory[("Factory memory<br/>[brain.ts]")]
  node_artifacts["Station artifacts<br/>[tools.ts]"]
end

node_github_actor(("GitHub users"))
node_linear_actor(("Linear users"))
node_http_actor(("HTTP callers"))
node_requester(("Task requester"))

node_github_actor -->|"triggers"| node_github_channel
node_linear_actor -->|"delegates"| node_linear_channel
node_http_actor -->|"submits ticket"| node_http_intake
node_requester -->|"starts task"| node_eve_channel
node_http_intake -->|"renders ticket"| node_ticket_model
node_http_intake -->|"starts session"| node_foreman
node_github_channel -->|"dispatches work"| node_foreman
node_linear_channel -->|"starts pipeline"| node_foreman
node_eve_channel -->|"starts task"| node_foreman
node_foreman -->|"triages work"| node_triage
node_triage -->|"classifies task"| node_triage_decisions
node_triage -->|"checks readiness"| node_pretriage
node_pretriage -->|"asks questions"| node_classifier
node_foreman -->|"dispatches stations"| node_station_tools
node_station_tools -->|"runs on demand"| node_researcher
node_foreman -->|"plans work"| node_analyst
node_foreman -->|"executes plan"| node_implementer
node_foreman -->|"requests review"| node_reviewer
node_analyst -->|"uses checkout"| node_repo_sandbox
node_implementer -->|"implements changes"| node_repo_sandbox
node_implementer -->|"hands off branch"| node_reviewer
node_reviewer -->|"returns verdict"| node_foreman
node_foreman -->|"checks permissions"| node_approval
node_approval -->|"parses commands"| node_github_cli
node_repo_sandbox -->|"uses scoped tokens"| node_credential_lease
node_github_channel -->|"handles red CI"| node_ci_diagnosis
node_foreman -->|"loads shared notes"| node_memory
node_analyst -->|"saves analysis"| node_artifacts
node_researcher -->|"saves findings"| node_artifacts

click node_github_channel "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/github.ts"
click node_linear_channel "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/linear.ts"
click node_http_intake "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/intake.ts"
click node_ticket_model "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/intake/ticket.ts"
click node_eve_channel "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/eve.ts"
click node_foreman "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/agent.ts"
click node_triage "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/run.ts"
click node_triage_decisions "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/decisions.ts"
click node_pretriage "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/pretriage.ts"
click node_classifier "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/classifier/agent.ts"
click node_researcher "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/researcher/agent.ts"
click node_analyst "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/analyst/agent.ts"
click node_implementer "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/implementer/agent.ts"
click node_reviewer "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/reviewer/agent.ts"
click node_station_tools "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/tools/run_reviewer.ts"
click node_repo_sandbox "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/repo-sandbox.ts"
click node_approval "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/approval.ts"
click node_github_cli "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/cli.ts"
click node_credential_lease "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/lease.ts"
click node_ci_diagnosis "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/tools/diagnose_ci_failure.ts"
click node_memory "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/memory/brain.ts"
click node_artifacts "https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/artifacts/tools.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_github_channel,node_linear_channel,node_http_intake,node_ticket_model,node_eve_channel,node_github_actor,node_linear_actor toneBlue
class node_foreman,node_triage,node_triage_decisions,node_pretriage toneAmber
class node_classifier,node_researcher,node_analyst,node_implementer,node_reviewer,node_station_tools toneMint
class node_repo_sandbox,node_approval,node_github_cli,node_credential_lease,node_ci_diagnosis,node_requester toneRose
class node_memory,node_artifacts,node_http_actor toneIndigo
```

## Components

### Work intake

- [GitHub events](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/github.ts): `agent/channels/github.ts`
- [Linear sessions](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/linear.ts): `agent/channels/linear.ts`
- [Ticket intake](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/intake.ts): `agent/channels/intake.ts`
- [Ticket handling](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/intake/ticket.ts): `agent/lib/intake/ticket.ts`
- [Eve channel](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/channels/eve.ts): `agent/channels/eve.ts`

### Orchestration and triage

- [Foreman orchestrator](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/agent.ts): `agent/agent.ts`
- [Task triage](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/run.ts): `agent/lib/triage/run.ts`
- [Triage decisions](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/decisions.ts): `agent/lib/triage/decisions.ts`
- [Clarification routing](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/triage/pretriage.ts): `agent/lib/triage/pretriage.ts`

### Agent stations

- [Classifier](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/classifier/agent.ts): `agent/subagents/classifier/agent.ts`
- [Researcher](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/researcher/agent.ts): `agent/subagents/researcher/agent.ts`
- [Analyst](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/analyst/agent.ts): `agent/subagents/analyst/agent.ts`
- [Implementer](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/implementer/agent.ts): `agent/subagents/implementer/agent.ts`
- [Reviewer](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/subagents/reviewer/agent.ts): `agent/subagents/reviewer/agent.ts`
- [Station dispatch](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/tools/run_reviewer.ts): `agent/tools/run_reviewer.ts`

### Repository operations

- [Repository sandbox](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/repo-sandbox.ts): `agent/lib/github/repo-sandbox.ts`
- [Approval policy](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/approval.ts): `agent/lib/github/approval.ts`
- [GitHub command policy](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/cli.ts): `agent/lib/github/cli.ts`
- [Scoped credentials](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/github/lease.ts): `agent/lib/github/lease.ts`
- [CI diagnosis](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/tools/diagnose_ci_failure.ts): `agent/tools/diagnose_ci_failure.ts`

### Memory and artifacts

- [Factory memory](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/memory/brain.ts): `agent/lib/memory/brain.ts`
- [Station artifacts](https://github.com/vercel-labs/eve-software-factory-template/blob/main/agent/lib/artifacts/tools.ts): `agent/lib/artifacts/tools.ts`

### Other components

- **GitHub users**
- **Linear users**
- **HTTP callers**
- **Task requester**

## Connections

- GitHub users → GitHub events: triggers
- Linear users → Linear sessions: delegates
- HTTP callers → Ticket intake: submits ticket
- Task requester → Eve channel: starts task
- Ticket intake → Ticket handling: renders ticket (evidence: `agent/channels/intake.ts`)
- Ticket intake → Foreman orchestrator: starts session (evidence: `agent/channels/intake.ts`)
- GitHub events → Foreman orchestrator: dispatches work
- Linear sessions → Foreman orchestrator: starts pipeline
- Eve channel → Foreman orchestrator: starts task
- Foreman orchestrator → Task triage: triages work
- Task triage → Triage decisions: classifies task (evidence: `agent/lib/triage/run.ts`)
- Task triage → Clarification routing: checks readiness (evidence: `agent/lib/triage/pretriage.ts`)
- Clarification routing → Classifier: asks questions
- Foreman orchestrator → Station dispatch: dispatches stations (evidence: `agent/tools/run_reviewer.ts`)
- Station dispatch → Researcher: runs on demand
- Foreman orchestrator → Analyst: plans work
- Foreman orchestrator → Implementer: executes plan
- Foreman orchestrator → Reviewer: requests review
- Analyst → Repository sandbox: uses checkout
- Implementer → Repository sandbox: implements changes
- Implementer → Reviewer: hands off branch
- Reviewer → Foreman orchestrator: returns verdict
- Foreman orchestrator → Approval policy: checks permissions
- Approval policy → GitHub command policy: parses commands (evidence: `agent/lib/github/approval.ts`)
- Repository sandbox → Scoped credentials: uses scoped tokens (evidence: `agent/lib/github/repo-sandbox.ts`)
- GitHub events → CI diagnosis: handles red CI
- Foreman orchestrator → Factory memory: loads shared notes
- Analyst → Station artifacts: saves analysis
- Researcher → Station artifacts: saves findings
