# orbi-build/orbi architecture

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

- Interactive diagram: https://gitdiagram.com/orbi-build/orbi
- Repository: https://github.com/orbi-build/orbi

## Overview

Orbi is a self-hosted autonomous GitHub Issue-to-release agent. A scheduled Runner selects eligible Issues, claims work into an isolated worktree, delegates coding to Pi, then handles PR creation, independent review and gated merge; release Issues follow a release state machine. GitHub Issues, PRs, comments and releases are both the external collaboration surface and the documented record, rather than a local database. The README documents the end-to-end flow; source-index references and excerpts support the internal boundaries shown here, but not every runtime call was sampled.

Main entry points: [`src/orbi/runner.py`](https://github.com/orbi-build/orbi/blob/main/src/orbi/runner.py) (Runner), [`src/orbi/claim.py`](https://github.com/orbi-build/orbi/blob/main/src/orbi/claim.py) (Issue claim), [`src/orbi/cli.py`](https://github.com/orbi-build/orbi/blob/main/src/orbi/cli.py) (CLI), [`src/orbi/scheduler.py`](https://github.com/orbi-build/orbi/blob/main/src/orbi/scheduler.py) (Scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and scheduling"]
  node_cli["CLI<br/>[cli.py]"]
  node_scheduler["Scheduler<br/>[scheduler.py]"]
  node_platform_units["Platform units<br/>[systemd_deploy.py]"]
  node_runner["Runner<br/>[runner.py]"]
end

subgraph group_delivery["Issue delivery"]
  node_claim["Issue claim<br/>[claim.py]"]
  node_scene["Delivery scene<br/>[delivery_scene.py]"]
  node_labels["Label policy<br/>[delivery_labels.py]"]
  node_repo_policy["Repository policy<br/>[repo_config.py]"]
  node_gitops["Worktree operations<br/>[gitops.py]"]
end

subgraph group_execution["Agent execution"]
  node_pi["Pi execution<br/>[pi_process.py]"]
  node_pi_session["Pi session<br/>[pi_session.py]"]
end

subgraph group_closeout["Review and release"]
  node_review["Review and merge<br/>[review_merge.py]"]
  node_human_review["Human review<br/>[human_review.py]"]
  node_release["Release workflow<br/>[release.py]"]
end

subgraph group_foundation["Runtime foundations"]
  node_progress["Progress comments<br/>[progress.py]"]
  node_journal["Run journal<br/>[journal.py]"]
  node_config["Host configuration<br/>[config.py]"]
end

node_operator(("Operator"))
node_github(("GitHub"))

node_operator -->|"runs commands"| node_cli
node_cli -->|"starts tick"| node_runner
node_cli -->|"manages units"| node_scheduler
node_scheduler -->|"selects platform"| node_platform_units
node_scheduler -->|"schedules tick"| node_runner
node_runner -->|"dispatches work"| node_claim
node_runner -->|"runs agent"| node_pi
node_runner -->|"starts closeout"| node_review
node_runner -->|"dispatches release"| node_release
node_claim -->|"reads Issues"| node_github
node_claim -->|"classifies delivery"| node_scene
node_claim -->|"applies label policy"| node_labels
node_claim -->|"loads policy"| node_repo_policy
node_claim -->|"creates worktree"| node_gitops
node_pi -->|"uses session"| node_pi_session
node_pi -->|"works in worktree"| node_gitops
node_review -->|"opens and merges PR"| node_github
node_review -->|"routes findings"| node_human_review
node_release -->|"publishes release"| node_github
node_runner -->|"posts progress"| node_progress
node_progress -->|"updates comments"| node_github
node_runner -->|"records run"| node_journal
node_runner -->|"loads settings"| node_config
node_github -->|"supplies task state"| node_claim

click node_cli "https://github.com/orbi-build/orbi/blob/main/src/orbi/cli.py"
click node_scheduler "https://github.com/orbi-build/orbi/blob/main/src/orbi/scheduler.py"
click node_platform_units "https://github.com/orbi-build/orbi/blob/main/src/orbi/systemd_deploy.py"
click node_runner "https://github.com/orbi-build/orbi/blob/main/src/orbi/runner.py"
click node_claim "https://github.com/orbi-build/orbi/blob/main/src/orbi/claim.py"
click node_scene "https://github.com/orbi-build/orbi/blob/main/src/orbi/delivery_scene.py"
click node_labels "https://github.com/orbi-build/orbi/blob/main/src/orbi/delivery_labels.py"
click node_repo_policy "https://github.com/orbi-build/orbi/blob/main/src/orbi/repo_config.py"
click node_gitops "https://github.com/orbi-build/orbi/blob/main/src/orbi/gitops.py"
click node_pi "https://github.com/orbi-build/orbi/blob/main/src/orbi/pi_process.py"
click node_pi_session "https://github.com/orbi-build/orbi/blob/main/src/orbi/pi_session.py"
click node_review "https://github.com/orbi-build/orbi/blob/main/src/orbi/review_merge.py"
click node_human_review "https://github.com/orbi-build/orbi/blob/main/src/orbi/human_review.py"
click node_release "https://github.com/orbi-build/orbi/blob/main/src/orbi/release.py"
click node_progress "https://github.com/orbi-build/orbi/blob/main/src/orbi/progress.py"
click node_journal "https://github.com/orbi-build/orbi/blob/main/src/orbi/journal.py"
click node_config "https://github.com/orbi-build/orbi/blob/main/src/orbi/config.py"

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_scheduler,node_platform_units,node_runner toneBlue
class node_claim,node_scene,node_labels,node_repo_policy,node_gitops toneAmber
class node_pi,node_pi_session toneMint
class node_review,node_human_review,node_release toneRose
class node_progress,node_journal,node_config,node_operator,node_github toneIndigo
```

## Components

### Entry and scheduling

- [CLI](https://github.com/orbi-build/orbi/blob/main/src/orbi/cli.py): `src/orbi/cli.py`
- [Scheduler](https://github.com/orbi-build/orbi/blob/main/src/orbi/scheduler.py): `src/orbi/scheduler.py`
- [Platform units](https://github.com/orbi-build/orbi/blob/main/src/orbi/systemd_deploy.py): `src/orbi/systemd_deploy.py`
- [Runner](https://github.com/orbi-build/orbi/blob/main/src/orbi/runner.py): `src/orbi/runner.py`

### Issue delivery

- [Issue claim](https://github.com/orbi-build/orbi/blob/main/src/orbi/claim.py): `src/orbi/claim.py`
- [Delivery scene](https://github.com/orbi-build/orbi/blob/main/src/orbi/delivery_scene.py): `src/orbi/delivery_scene.py`
- [Label policy](https://github.com/orbi-build/orbi/blob/main/src/orbi/delivery_labels.py): `src/orbi/delivery_labels.py`
- [Repository policy](https://github.com/orbi-build/orbi/blob/main/src/orbi/repo_config.py): `src/orbi/repo_config.py`
- [Worktree operations](https://github.com/orbi-build/orbi/blob/main/src/orbi/gitops.py): `src/orbi/gitops.py`

### Agent execution

- [Pi execution](https://github.com/orbi-build/orbi/blob/main/src/orbi/pi_process.py): `src/orbi/pi_process.py`
- [Pi session](https://github.com/orbi-build/orbi/blob/main/src/orbi/pi_session.py): `src/orbi/pi_session.py`

### Review and release

- [Review and merge](https://github.com/orbi-build/orbi/blob/main/src/orbi/review_merge.py): `src/orbi/review_merge.py`
- [Human review](https://github.com/orbi-build/orbi/blob/main/src/orbi/human_review.py): `src/orbi/human_review.py`
- [Release workflow](https://github.com/orbi-build/orbi/blob/main/src/orbi/release.py): `src/orbi/release.py`

### Runtime foundations

- [Progress comments](https://github.com/orbi-build/orbi/blob/main/src/orbi/progress.py): `src/orbi/progress.py`
- [Run journal](https://github.com/orbi-build/orbi/blob/main/src/orbi/journal.py): `src/orbi/journal.py`
- [Host configuration](https://github.com/orbi-build/orbi/blob/main/src/orbi/config.py): `src/orbi/config.py`

### Other components

- **Operator**
- **GitHub**

## Connections

- Operator → CLI: runs commands (evidence: `README.md`)
- CLI → Runner: starts tick (evidence: `src/orbi/cli.py`)
- CLI → Scheduler: manages units (evidence: `src/orbi/cli.py`)
- Scheduler → Platform units: selects platform (evidence: `src/orbi/scheduler.py`)
- Scheduler → Runner: schedules tick (evidence: `README.md`)
- Runner → Issue claim: dispatches work (evidence: `src/orbi/runner.py`)
- Runner → Pi execution: runs agent (evidence: `README.md`)
- Runner → Review and merge: starts closeout (evidence: `README.md`)
- Runner → Release workflow: dispatches release (evidence: `src/orbi/runner.py`)
- Issue claim → GitHub: reads Issues (evidence: `README.md`)
- Issue claim → Delivery scene: classifies delivery (evidence: `src/orbi/claim.py`)
- Issue claim → Label policy: applies label policy (evidence: `src/orbi/claim.py`)
- Issue claim → Repository policy: loads policy (evidence: `src/orbi/claim.py`)
- Issue claim → Worktree operations: creates worktree (evidence: `README.md`)
- Pi execution → Pi session: uses session (evidence: `src/orbi/pi_process.py`)
- Pi execution → Worktree operations: works in worktree (evidence: `README.md`)
- Review and merge → GitHub: opens and merges PR (evidence: `README.md`)
- Review and merge → Human review: routes findings (evidence: `src/orbi/review_merge.py`)
- Release workflow → GitHub: publishes release (evidence: `README.md`)
- Runner → Progress comments: posts progress (evidence: `src/orbi/runner.py`)
- Progress comments → GitHub: updates comments (evidence: `src/orbi/progress.py`)
- Runner → Run journal: records run (evidence: `src/orbi/runner.py`)
- Runner → Host configuration: loads settings (evidence: `src/orbi/runner.py`)
- GitHub → Issue claim: supplies task state (evidence: `README.md`)
