Skip to main content
Version: Next

System architecture

The reference view shows what Orion is made of, layer by layer, and where it falls short of an enterprise platform. The flow view shows how one idea moves through it.

Reference view​

Orion's reference architecture as a layered stack. From top to bottom: experience (the orion CLI, the watch board, Slack, Claude Code commands, orion web); the autonomous AI workflow (plan, deliver, recover); AI agents and models; knowledge and data; runtime; and integrations (Jira, GitHub, Slack, Claude). Governance and observability run as pillars down both sides. Dashed boxes mark gaps: evaluation, retention, shared service and production feedback; identity and audit are marked partial.

The middle stack runs from the people using Orion down to the platforms it calls. Governance and observability are pillars because they apply to every layer.

Solid boxes are built. Dashed boxes are layers an enterprise AI delivery platform needs that Orion lacks or has only in part.

GapTodayStatus
EvaluationOrion's own evals/cases holds a starter example, not real cases, so "green" says little on its own about agent work landing unattendedgap
Retentionwatch logs and events.jsonl accumulate; nothing prunes themgap
Shared serviceone machine, one user, by design; no high availability, no team queuegap
Production feedbackorion aiops reads Orion's own run logs; nothing brings incidents from the shipped product back as ticketsgap
Identitya Slack approver allowlist and a local web login; no SSO, no secrets vaultpartial
Auditthe events log is complete but local and editable, not tamper-evidentpartial

The Roadmap tracks progress on each gap.

Flow view​

The flow view in three bands. 1, Plan: orion new interviews you, then orion plan KEY runs toolkit, intent, constitution, spec, spec-branch-sync, plan, analyze, scaffold, evals, remote, scaffold-publish, decompose, release and clone, with four steps tagged spec-kit; you approve the Jira tree once. 2, Deliver: orion watch claims tickets labelled ORION; work routes, implements, runs QA and pushes each on its own branch; collect assembles ready branches, runs CI and lands them on develop, sending a red batch's culprit back to its agent. 3, Inside every stage: the supervisor starts claude -p in an isolated workspace, every tool call passes the orion hook, and the record goes to ~/.orion and each workspace's events.jsonl.

1. Plan​

orion new interviews you about the idea. orion plan KEY then runs its planning chain, ending in a Jira Epic / Story / Task tree, which you approve once before anything is created. Each step skips itself when its artifact exists, so re-running plan resumes. Inception has the detail.

2. Deliver​

orion watch KEY claims queued tickets (label ORION) one sweep at a time. Each ticket is routed, implemented, tested by QA, pushed and marked ready on its own branch. collect assembles ready branches into a batch, runs CI once and lands it on develop. A red batch is split until the culprit is found, and the culprit goes back to an agent. A failed ticket is retried at most twice, then named under NEEDS YOU. Landing needs no click unless slack.merge_approvers names people. Construction has the detail.

3. Inside every stage​

The supervisor starts claude -p in an isolated workspace. Every tool call goes through orion hook (breaker, gate, shield), which blocks deterministically. The record lives under ~/.orion and in each workspace's .orion/events.jsonl. The sandbox has the detail.

Orion and its toolkits​

Orion owns orchestration, gating, artifacts and the tracker contract. An external toolkit supplies the method inside a stage: a delegated skill runs as one step in a stage Orion is already sequencing and reports a verdict back. It never decides what runs next, never merges, and keeps no record of its own.

ConcernOwner
Deterministic enforcement: loops, budgets, wall clock, gatesOrion
Isolated sandboxed workspacesOrion
Process supervision: kill, quota wait, retry, notifyOrion
Cross-project lesson memoryOrion
Review, security, testing, PR, docs, work decompositionthe toolkit (nj-agents by default)
Constitution, spec, plan, analyze for a new projectspec-kit by default

So Orion declines any part of a toolkit, such as a workflow engine, that wants to decide what runs next. The reasoning and two worked examples are in ADR 0001, ADR 0002 and ADR 0021.

The toolkit block in orion.json maps a stage to a command and rejects a block that expresses an order (nj-agents and other toolkits).

Where spec-kit comes in​

A new project's orion.json delegates the four planning steps tagged spec-kit in the flow view:

StepDefault command
constitution/speckit-constitution
spec/speckit-specify
plan/speckit-plan
analyze/speckit-analyze

decompose then reads spec-kit's tasks.md to build the ticket tree. Change any of these in toolkit.stages; a project whose stages name no spec-kit command never installs it. Background: ADR 0019, ADR 0021, ADR 0022.

Storage​

Config, event logs and the audit trail are plain files you can read, grep and diff, and config can carry inline _comment_* explanations beside its values. Without SQLite, Orion stays a single static binary with no cgo. An advisory lock protects the shared state under ~/.orion across processes (ADR 0004).

Code layout​

The Go packages under internal/ are grouped by role:

GroupWhat it covers
planningdiscovery, decomposition, provisioning, the tracker, the toolkit, adoption, workspaces
deliverythe watch, a ticket's run, collecting and landing, the queue, claims, the supervisor, advisors, promotion and the changelog
guardrailsthe hooks, breaker state, budget, quota handling, process-safe locking
reportingevents, reports, cost, aiops, the dashboards, export, the web server, notifications, Slack
plumbingconfig, credentials, the agent roster, lessons, sessions, doctor, update checks

The generated Packages page lists every package and what it is for.

What neither view shows​

  • Releasing a milestone in detail: Releasing a milestone.
  • The advisor path for a question an agent cannot answer, and how a recommendation becomes a decision: Advisors and decisions.
  • The package-level call graph. It is not documented.