# ngoclinh93qt/orca-bot-factory architecture

> Architecture diagram of the GitHub repository ngoclinh93qt/orca-bot-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ngoclinh93qt/orca-bot-factory
- Repository: https://github.com/ngoclinh93qt/orca-bot-factory

## Overview

Orca Bot Factory is an automation framework for a bot team that takes GitHub issues through a software delivery line, with a person retaining design and architecture decisions. The engine schedules station work and provides shared run support; the dev line defines stages, station configuration, and bookkeeping, while bot profiles supply role identity. The README documents the main dispatch, logging, and metrics relationships, but no source excerpts were provided, so implementation-level calls and finer-grained data flows are omitted.

Main entry points: [`engine/bin/tick.sh`](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/tick.sh) (Scheduled tick), [`lines/dev/PLAYBOOK.md`](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/PLAYBOOK.md) (Delivery stages), [`engine/bin/log-run.sh`](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/log-run.sh) (Run log), [`lines/dev/stations.tsv`](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/stations.tsv) (Station dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Shared engine"]
  node_tick["Scheduled tick<br/>[tick.sh]"]
  node_brief["Station brief<br/>[brief.sh]"]
  node_leases["Work leases<br/>[lease.sh]"]
  node_workspaces["Worktrees and cleanup<br/>[bot-workspace.sh]"]
  node_model_fallback["Model fallback"]
  node_runlog[("Run log<br/>[log-run.sh]")]
end

subgraph group_devline["Dev line"]
  node_stations["Station dispatch<br/>[stations.tsv]"]
  node_workflow["Delivery stages<br/>[PLAYBOOK.md]"]
  node_bookkeeping["Line bookkeeping"]
  node_github_setup["GitHub setup<br/>[setup-github.sh]"]
end

subgraph group_bots["Bot roles"]
  node_roles["Bot identities"]
end

subgraph group_integrations["External integrations"]
  node_issues[("GitHub issues")]
  node_agents(("Orca bots"))
  node_product[("Product repository")]
  node_metrics["Bot Metrics"]
end

node_owner(("Owner"))

node_issues -->|"picks up"| node_tick
node_tick -->|"dispatches"| node_stations
node_stations -->|"assigns work"| node_agents
node_workflow -->|"guides stages"| node_agents
node_roles -->|"defines identity"| node_agents
node_agents -->|"builds and tests"| node_product
node_owner -->|"decides design"| node_workflow
node_tick -->|"uses"| node_brief
node_tick -->|"uses"| node_leases
node_tick -->|"runs worktrees"| node_workspaces
node_tick -->|"falls back"| node_model_fallback
node_tick -->|"records runs"| node_runlog
node_bookkeeping -->|"keeps stage books"| node_workflow
node_github_setup -->|"sets up board"| node_issues
node_runlog -->|"feeds"| node_metrics

click node_tick "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/tick.sh"
click node_stations "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/stations.tsv"
click node_workflow "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/PLAYBOOK.md"
click node_bookkeeping "https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/lines/dev/bin"
click node_brief "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/brief.sh"
click node_leases "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/lease.sh"
click node_workspaces "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/bot-workspace.sh"
click node_model_fallback "https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/engine/bin"
click node_runlog "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/log-run.sh"
click node_roles "https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/bots"
click node_github_setup "https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/bin/setup-github.sh"

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_tick,node_brief,node_leases,node_workspaces,node_model_fallback,node_runlog toneBlue
class node_stations,node_workflow,node_bookkeeping,node_github_setup toneAmber
class node_roles toneMint
class node_issues,node_agents,node_product,node_metrics toneRose
class node_owner toneIndigo
```

## Components

### Shared engine

- [Scheduled tick](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/tick.sh): `engine/bin/tick.sh`
- [Station brief](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/brief.sh): `engine/bin/brief.sh`
- [Work leases](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/lease.sh): `engine/bin/lease.sh`
- [Worktrees and cleanup](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/bot-workspace.sh): `engine/bin/bot-workspace.sh`
- [Model fallback](https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/engine/bin): `engine/bin`
- [Run log](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/engine/bin/log-run.sh): `engine/bin/log-run.sh`

### Dev line

- [Station dispatch](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/stations.tsv): `lines/dev/stations.tsv`
- [Delivery stages](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/PLAYBOOK.md): `lines/dev/PLAYBOOK.md`
- [Line bookkeeping](https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/lines/dev/bin): `lines/dev/bin`
- [GitHub setup](https://github.com/ngoclinh93qt/orca-bot-factory/blob/main/lines/dev/bin/setup-github.sh): `lines/dev/bin/setup-github.sh`

### Bot roles

- [Bot identities](https://github.com/ngoclinh93qt/orca-bot-factory/tree/main/bots): `bots`

### External integrations

- **GitHub issues**
- **Orca bots**
- **Product repository**
- **Bot Metrics**

### Other components

- **Owner**

## Connections

- GitHub issues → Scheduled tick: picks up (evidence: `README.md`)
- Scheduled tick → Station dispatch: dispatches (evidence: `README.md`)
- Station dispatch → Orca bots: assigns work (evidence: `README.md`)
- Delivery stages → Orca bots: guides stages (evidence: `README.md`)
- Bot identities → Orca bots: defines identity (evidence: `README.md`)
- Orca bots → Product repository: builds and tests (evidence: `README.md`)
- Owner → Delivery stages: decides design (evidence: `README.md`)
- Scheduled tick → Station brief: uses (evidence: `README.md`)
- Scheduled tick → Work leases: uses (evidence: `README.md`)
- Scheduled tick → Worktrees and cleanup: runs worktrees (evidence: `README.md`)
- Scheduled tick → Model fallback: falls back (evidence: `README.md`)
- Scheduled tick → Run log: records runs (evidence: `README.md`)
- Line bookkeeping → Delivery stages: keeps stage books (evidence: `README.md`)
- GitHub setup → GitHub issues: sets up board (evidence: `README.md`)
- Run log → Bot Metrics: feeds (evidence: `README.md`)
