# reeveci/reeve architecture

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

- Interactive diagram: https://gitdiagram.com/reeveci/reeve
- Repository: https://github.com/reeveci/reeve

## Overview

#### Purpose and topology
Reeve is a Go-based, extensible CI/CD system organized as a multi-module workspace. Its control plane is `reeve-server`, execution is split between `reeve-worker` and `reeve-runner`, and plugins provide pipeline-specific behavior. Docker images package the server, worker, and runner for deployment.

#### Primary entry points
- Server process: `reeve-server/main.go`
- Worker process: `reeve-worker/main.go`
- Runner process: `reeve-runner/main.go`
- Operator CLI/tools: `reeve-tools/main.go`, with commands rooted at `reeve-tools/cmd/root.go`
- Example plugin executable: `plugin-example/main.go`

These are separate Go modules under the workspace (`go.work`), so they can be built and deployed independently.

#### Server: orchestration and API boundary
`reeve-server` is the CI/CD control plane. Its API layer exposes server-facing operations and worker interaction endpoints through `reeve-server/api/serve.go` and related message/worker handlers such as `reeve-server/api/worker-queue.go`, `reeve-server/api/worker-result.go`, and `reeve-server/api/worker-logs.go`.

Queue-processing stages are explicit:
- Trigger intake and pipeline initiation: `reeve-server/handle-trigger-queue.go`
- General message handling: `reeve-server/handle-message-queues.go`
- Notifications: `reeve-server/handle-notify-queue.go`

This separates external/API-driven events from asynchronous orchestration and notification work.

#### Plugin and pipeline contract boundary
The server runtime defines the plugin integration model in `reeve-server/runtime/contract.go`, `reeve-server/runtime/pluginapi.go`, and `reeve-server/runtime/pluginprovider.go`. Plugins are therefore not embedded into the main server API; they are supplied through a runtime/provider boundary.

`plugin-example/main.go` demonstrates the expected plugin shape. Shared plugin behavior is configured through environment-based settings, including enablement, trusted domains/tasks, and an optional Git setup task. This makes trust validation and task selection central boundaries before execution.

#### Execution path: worker and runner
The worker is the server-facing execution agent (`reeve-worker/main.go`). It is container-oriented: `reeve-worker/docker/docker-runner.sh` and `reeve-worker/docker/docker-entrypoint.sh` indicate that it prepares or launches runner workloads through Docker.

The runner is the task runtime (`reeve-runner/main.go`, `reeve-runner/runtime/runtime.go`) and has its own API serving layer in `reeve-runner/api/serve.go`. The likely control flow is: server queues work for workers; a worker creates/controls an isolated runner; the runner executes the assigned workload and reports status, logs, and results through worker-facing server APIs.

#### External services and infrastructure
Docker is a material runtime dependency, represented by image definitions for all deployable roles:
- `reeve-server/docker/Dockerfile`
- `reeve-worker/docker/Dockerfile`
- `reeve-runner/docker/Dockerfile`

The tooling includes Docker authentication support in `reeve-tools/cmd/login-docker.go`, suggesting registry access is part of operational workflows. Build/release image workflows are centralized in `scripts/build-docker.sh`, `scripts/push-docker.sh`, and `scripts/release.sh`.

#### Key control and data flow
1. A trigger enters the server API and/or trigger queue.
2. Server queue handlers select and orchestrate plugin-defined CI/CD work.
3. Work is dispatched to workers through the worker queue boundary.
4. Workers provision runners, using Docker as the execution isolation layer.
5. Runners execute tasks and return acknowledgements, logs, and results to server worker endpoints.
6. Server processes completion/messages and emits notifications through the notify queue.

The principal trust boundaries are server API ingress, plugin task/domain validation, and Docker-isolated execution in the worker/runner path.

Main entry points: [`reeve-server/handle-message-queues.go`](https://github.com/reeveci/reeve/blob/main/reeve-server/handle-message-queues.go) (Message handling), [`scripts/release.sh`](https://github.com/reeveci/reeve/blob/main/scripts/release.sh) (Image release scripts), [`reeve-runner/main.go`](https://github.com/reeveci/reeve/blob/main/reeve-runner/main.go) (Reeve Runner), [`reeve-server/api/worker-queue.go`](https://github.com/reeveci/reeve/blob/main/reeve-server/api/worker-queue.go) (Worker endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control plane"]
  node_server["Reeve Server<br/>control-plane process<br/>[main.go]"]
  node_server_api["Server API<br/>API layer<br/>[serve.go]"]
  node_trigger_queue["Trigger intake<br/>queue handler"]
  node_message_queue["Message handling<br/>queue handler"]
  node_notify_queue["Notifications<br/>queue handler"]
  node_worker_api["Worker endpoints<br/>worker API<br/>[worker-queue.go]"]
  node_plugin_runtime{{"Plugin runtime contract<br/>runtime boundary<br/>[contract.go]"}}
end

subgraph group_execution["Execution plane"]
  node_worker["Reeve Worker<br/>execution agent<br/>[main.go]"]
  node_worker_docker["Worker Docker launcher<br/>container launcher<br/>[docker-runner.sh]"]
  node_runner["Reeve Runner<br/>task process<br/>[main.go]"]
  node_runner_runtime["Runner runtime<br/>task runtime<br/>[runtime.go]"]
  node_runner_api["Runner API<br/>API layer<br/>[serve.go]"]
  node_docker{{"Docker<br/>container isolation"}}
end

subgraph group_plugins["Plugin boundary"]
  node_plugin_example["Example plugin<br/>plugin executable<br/>[main.go]"]
end

subgraph group_operations["Operations"]
  node_tools["Operator CLI<br/>operator tools<br/>[main.go]"]
  node_tools_root["Tool commands<br/>CLI command root<br/>[root.go]"]
  node_build_release["Image release scripts<br/>release automation<br/>[release.sh]"]
  node_server_image["Server image<br/>Docker image definition"]
  node_runner_image["Runner image<br/>Docker image definition"]
end

node_server -->|"serves"| node_server_api
node_server_api -->|"accepts triggers"| node_trigger_queue
node_trigger_queue -->|"initiates pipeline work"| node_message_queue
node_message_queue -->|"selects validated tasks"| node_plugin_runtime
node_plugin_example -.->|"implements"| node_plugin_runtime
node_message_queue -->|"dispatches work"| node_worker_api
node_worker -->|"polls and reports"| node_worker_api
node_worker_api -->|"feeds completions"| node_message_queue
node_message_queue -->|"queues notifications"| node_notify_queue
node_worker -->|"launches through"| node_worker_docker
node_worker_docker -->|"uses"| node_docker
node_docker -->|"isolates"| node_runner
node_runner -->|"executes with"| node_runner_runtime
node_runner -->|"serves"| node_runner_api
node_tools -->|"loads commands"| node_tools_root
node_build_release -->|"builds and publishes"| node_server_image
node_build_release -->|"publishes images via"| node_docker
node_build_release -->|"builds and publishes"| node_runner_image

click node_server "https://github.com/reeveci/reeve/blob/main/reeve-server/main.go"
click node_server_api "https://github.com/reeveci/reeve/blob/main/reeve-server/api/serve.go"
click node_trigger_queue "https://github.com/reeveci/reeve/blob/main/reeve-server/handle-trigger-queue.go"
click node_message_queue "https://github.com/reeveci/reeve/blob/main/reeve-server/handle-message-queues.go"
click node_notify_queue "https://github.com/reeveci/reeve/blob/main/reeve-server/handle-notify-queue.go"
click node_worker_api "https://github.com/reeveci/reeve/blob/main/reeve-server/api/worker-queue.go"
click node_plugin_runtime "https://github.com/reeveci/reeve/blob/main/reeve-server/runtime/contract.go"
click node_plugin_example "https://github.com/reeveci/reeve/blob/main/plugin-example/main.go"
click node_worker "https://github.com/reeveci/reeve/blob/main/reeve-worker/main.go"
click node_worker_docker "https://github.com/reeveci/reeve/blob/main/reeve-worker/docker/docker-runner.sh"
click node_runner "https://github.com/reeveci/reeve/blob/main/reeve-runner/main.go"
click node_runner_runtime "https://github.com/reeveci/reeve/blob/main/reeve-runner/runtime/runtime.go"
click node_runner_api "https://github.com/reeveci/reeve/blob/main/reeve-runner/api/serve.go"
click node_docker "https://github.com/reeveci/reeve/blob/main/reeve-worker/docker/Dockerfile"
click node_tools "https://github.com/reeveci/reeve/blob/main/reeve-tools/main.go"
click node_tools_root "https://github.com/reeveci/reeve/blob/main/reeve-tools/cmd/root.go"
click node_build_release "https://github.com/reeveci/reeve/blob/main/scripts/release.sh"
click node_server_image "https://github.com/reeveci/reeve/blob/main/reeve-server/docker/Dockerfile"
click node_runner_image "https://github.com/reeveci/reeve/blob/main/reeve-runner/docker/Dockerfile"

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_server,node_server_api,node_trigger_queue,node_message_queue,node_notify_queue,node_worker_api,node_plugin_runtime toneBlue
class node_worker,node_worker_docker,node_runner,node_runner_runtime,node_runner_api,node_docker toneAmber
class node_plugin_example toneMint
class node_tools,node_tools_root,node_build_release,node_server_image,node_runner_image toneRose
```

## Components

### Control plane

Server API, orchestration, and plugin contract.

- [Reeve Server](https://github.com/reeveci/reeve/blob/main/reeve-server/main.go): control-plane process · CI/CD orchestration service. · `reeve-server/main.go`
- [Server API](https://github.com/reeveci/reeve/blob/main/reeve-server/api/serve.go): API layer · Ingress plus worker interaction endpoints. · `reeve-server/api/serve.go`
- [Trigger intake](https://github.com/reeveci/reeve/blob/main/reeve-server/handle-trigger-queue.go): queue handler · Initiates pipelines from triggers. · `reeve-server/handle-trigger-queue.go`
- [Message handling](https://github.com/reeveci/reeve/blob/main/reeve-server/handle-message-queues.go): queue handler · Processes asynchronous orchestration messages. · `reeve-server/handle-message-queues.go`
- [Notifications](https://github.com/reeveci/reeve/blob/main/reeve-server/handle-notify-queue.go): queue handler · Emits completion notifications. · `reeve-server/handle-notify-queue.go`
- [Worker endpoints](https://github.com/reeveci/reeve/blob/main/reeve-server/api/worker-queue.go): worker API · Receives worker queue, results, and logs. · `reeve-server/api/worker-queue.go`
- [Plugin runtime contract](https://github.com/reeveci/reeve/blob/main/reeve-server/runtime/contract.go): runtime boundary · Validates and provides plugin-defined tasks. · `reeve-server/runtime/contract.go`

### Execution plane

Worker-provisioned isolated task runtime.

- [Reeve Worker](https://github.com/reeveci/reeve/blob/main/reeve-worker/main.go): execution agent · Server-facing agent that launches runners. · `reeve-worker/main.go`
- [Worker Docker launcher](https://github.com/reeveci/reeve/blob/main/reeve-worker/docker/docker-runner.sh): container launcher · Prepares and launches runner containers. · `reeve-worker/docker/docker-runner.sh`
- [Reeve Runner](https://github.com/reeveci/reeve/blob/main/reeve-runner/main.go): task process · Isolated assigned-workload runtime. · `reeve-runner/main.go`
- [Runner runtime](https://github.com/reeveci/reeve/blob/main/reeve-runner/runtime/runtime.go): task runtime · Executes assigned tasks. · `reeve-runner/runtime/runtime.go`
- [Runner API](https://github.com/reeveci/reeve/blob/main/reeve-runner/api/serve.go): API layer · Runner control interface. · `reeve-runner/api/serve.go`
- [Docker](https://github.com/reeveci/reeve/blob/main/reeve-worker/docker/Dockerfile): container isolation · Execution and deployment container runtime. · `reeve-worker/docker/Dockerfile`

### Plugin boundary

Extensible pipeline behavior.

- [Example plugin](https://github.com/reeveci/reeve/blob/main/plugin-example/main.go): plugin executable · Reference implementation of the plugin contract. · `plugin-example/main.go`

### Operations

Operator tooling and image release workflows.

- [Operator CLI](https://github.com/reeveci/reeve/blob/main/reeve-tools/main.go): operator tools · Administrative commands including registry login. · `reeve-tools/main.go`
- [Tool commands](https://github.com/reeveci/reeve/blob/main/reeve-tools/cmd/root.go): CLI command root · `reeve-tools/cmd/root.go`
- [Image release scripts](https://github.com/reeveci/reeve/blob/main/scripts/release.sh): release automation · Builds, pushes, and releases deployable images. · `scripts/release.sh`
- [Server image](https://github.com/reeveci/reeve/blob/main/reeve-server/docker/Dockerfile): Docker image definition · `reeve-server/docker/Dockerfile`
- [Runner image](https://github.com/reeveci/reeve/blob/main/reeve-runner/docker/Dockerfile): Docker image definition · `reeve-runner/docker/Dockerfile`

## Connections

- Reeve Server → Server API: serves
- Server API → Trigger intake: accepts triggers
- Trigger intake → Message handling: initiates pipeline work
- Message handling → Plugin runtime contract: selects validated tasks
- Example plugin → Plugin runtime contract: implements
- Message handling → Worker endpoints: dispatches work
- Reeve Worker → Worker endpoints: polls and reports · Returns status, logs, and results.
- Worker endpoints → Message handling: feeds completions
- Message handling → Notifications: queues notifications
- Reeve Worker → Worker Docker launcher: launches through
- Worker Docker launcher → Docker: uses
- Docker → Reeve Runner: isolates
- Reeve Runner → Runner runtime: executes with
- Reeve Runner → Runner API: serves
- Operator CLI → Tool commands: loads commands
- Image release scripts → Server image: builds and publishes
- Image release scripts → Docker: publishes images via
- Image release scripts → Runner image: builds and publishes
