Architecture

The system

GAOS is a graph-native agent operating system. Six layers, five control loops, and one thesis that decides every other design question: the graph is the primitive, not the prompt.

Two invariants everything else follows from

State lives in the graph. The orchestrator holds no authoritative state. Kill it mid-run and it rebuilds from vertices, edges and events. Anything an orchestrator keeps in process memory is state that a restart silently invents a new version of.

Every change emits an event. An event that was never written is a state change that never happened. This is not a logging convention — it is what makes replay possible at all, and it is why the event catalog is closed rather than open.

Why the graph and not a prompt chain

A prompt chain has no addressable intermediate state. You cannot ask it what a task depended on, which requirement justified a decision, or what exactly was sent to the model on attempt two — because none of that was ever a thing, only a substring. In a graph each of those is a vertex with edges, and the question is a traversal.

Six layers, and what each may never do

The “must never” column is the load-bearing one. Each entry is a specific way the layering has been broken before, in this kind of system.

LayerOwnsMust never
UI · Mission ControlA projection of graph state; operator actionsInvent state the graph does not have
API gatewayAuth, tenant scoping, request validation, event fan-outLet a tenant boundary be enforced further down only
OrchestrationPlanner, scheduler, review engine, retry policyHold long-lived state in process memory
ExecutionTurn supervision: one live turn per product workspace, a request id per attempt, polling, recovery by deadline. Before v0.29.0: detached processes, workspace leases, heartbeatsLose a turn it submitted, or start a second writer in a workspace
Model gatewayOne adapter, an HTTP client of ai-manager; cost and token accounting from its reply. Before v0.29.0: the CLI adapterLeak provider-specific shapes upward, or spawn a tool
ArcadeDBGraph, documents, events, full-text, time seriesBe bypassed by a side channel

Three layers outside the six

Since D-055 the model is not run by any of the six layers above. GAOS hands one turn at a time to ai-manager, which runs it through ai-claude-cli in the product's workspace. ai-claude-cli works the task with context; ai-manager shapes it with a workspace; GAOS shapes it with the product, the task details and the product's Blueprint. The contract between them is The gateway; what GAOS writes into the workspace is the Blueprint.

What happens when the orchestrator restarts

Because a turn runs in ai-manager and not in the orchestrator, a restart finds tasks that claim to be running. The recovery is a reconciliation, not a reset, and it rests on one ordering rule: every turn is recorded with its request id before it is sent. Reconcile in dashboard/runner.go and recoverTurns in dashboard/turns.go do the rest:

pseudocode
for run in runs where status in (STARTED, RUNNING) and run.requestId != "":
    reply = gateway.poll(run.requestId)
    if reply in (completed, failed):
        adopt(run)                     # TaskResumed(rule=adopted); finished like a supervised run
    else:                              # ai-manager no longer knows the request
        emit TaskOrphaned(rule=request-lost)
        hold(run.product) until run.startedAt + turn_deadline
        requeue(run.task)              # TaskResumed(rule=requeued), on a new session

for task in tasks where status in (DISPATCHED, RUNNING) and no turn was recorded:
    requeue(task)                      # READY; TaskResumed(rule=requeued)

A turn that cannot be proved finished is not assumed finished, and a lost one is not assumed dead. ai-manager keeps request records in memory, so a request it no longer knows may still be running in the workspace; the product stays held — the per-product graph lease of BR-38 allows one live turn per product — until the turn deadline has passed, and only then is the task requeued (D-060). The turn is made dead by waiting, because nothing can signal it. A task that claims to be running with no turn behind it never reached the gateway, so nothing anywhere can still be doing its work, and it goes straight back to READY. The gateway §recovery has the request-level detail.

Before v0.29.0 this was a lease-and-heartbeat reconciler

Work ran as detached processes under a workspace lease, and recovery compared the lease with the last heartbeat: adopt a live run, kill-then-requeue one whose supervisor had died, and orphan one whose lease had expired. The kill came first because a stale beat says the supervisor died, not the child, and requeuing without it could start a second writer in the same workspace (D-054). M14.7 deleted the detached runner, the lease and the heartbeat; the principle — never hand a workspace on while something may still be writing in it — survives as the hold above.

From an empty record to autonomous work

Seven stages, since the Blueprint became one. The interesting boundary is stage four, where the last human instruction runs out.

StageHumanSystemWrites to the graph
Product setupFills the record—Product, Requirement, Issue, AcceptanceCriterion, Artifact
BlueprintWrites policies, names knowledge sources, publishesProvisions the workspace, syncs the filesPolicy, KnowledgeSource, BlueprintVersion, Workspace
Readiness check—Scores the rubricProduct.readinessScore, ReadinessEvaluated
Workflow creationStates an objectivePlanner expands itWorkflow, Task, DEPENDS_ON, IMPLEMENTS
ExecutionMoves cards on the board, or nothingScheduler, one turn per workspace, reviewerTaskRun -PINNED_TO-> BlueprintVersion, ContextSlice, Review, Event
GateApproves, or does notHoldsApproval, Event
Close—Extracts the lessonKnowledge, Decision, Event

Autonomy begins when the scheduler can find a READY task without a human naming it. That requires four things at once: an acyclic dependency graph, a capable agent for the role, a product with no live turn (the graph lease of BR-38), and a readiness gate that passed. Miss any one and the work queues instead of starting — which is the correct failure, and the one the product's board and its blocking reasons are there to make visible.

Splitting work, and choosing who does it

A task is atomic when it has one concern, one workspace, and at least one acceptance criterion. A task with two concerns cannot be scored, because a single number now describes two independent outcomes.

The workRoleModel tierReview
Schema migration, money, authBackend + Securitytopalways an extra reviewer
Public API contractArchitecttopnormal
New feature inside an existing boundaryBackend / Frontendmidnormal
Tests, docs, refactorQAlownormal
A retrysame roleone tier above the last attemptnormal

Scoring, and when to stop trying

Every completed run is scored on five dimensions and reduced to one number:

formula
final = 0.45·correctness
      + 0.20·completeness
      + 0.15·safety
      + 0.10·quality
      + 0.10·efficiency
ScoreVerdict
85–100accept
70–84accept, and plan a cleanup task
50–69iterate with a widened context slice
30–49escalate one model tier
0–29stop, and call a design review
safety < 60immediate stop, regardless of the total

The guardrails are what stop a loop, not the scoring

max_retry_count 3 per task · max_escalation_count 2 per task · same_failure_signature_limit 2 · exponential cooldown with a cap · a budget cap per workflow and per tenant · human intervention at two escalations or any safety veto. A scoring function alone will happily retry forever at 68.

The failure signature — a hash of the normalised error — is what decides retry versus design review. Two attempts failing the same way is not bad luck; it is a problem the model cannot see, and a third attempt at a higher tier will fail identically.

Knowledge maturity, scored out of 100

The planner refuses work it cannot plan. The rubric is machine-checkable on purpose — a human judgement of “is this spec good enough” is not repeatable, and the whole point is to stop a vague record producing a vague plan.

ItemPointsItemPoints
Problem statement8Criteria coverage12
Goals8Behaviour diagram10
Domain rules12Data model8
Out of scope6Repository linked8
Stories exist10Decisions8
Success metrics5Verification strategy5
BandScoreWhat the planner will do
INSUFFICIENT0–44Refuses to plan
MINIMUM45–69Everything gated, mid-tier cap, no auto-merge
WORKING70–89Normal autonomy
COMPLETE90–100Low-risk changes may auto-merge

A record also decays. The effective score is the raw score minus a drift penalty:

formula
drift_penalty = min(25,
      4 × months_since_last_review
    + 6 × (boundary_files_changed > 0)
    + 8 × (open_contradictions > 0))

Crossing a band downward emits ReadinessDropped. A document that was accurate a year ago and has not been read since is not a specification; it is a historical artifact, and the planner should treat it as one.

Replay

formula
state(t) = fold(reduce, events.filter(e => e.ts <= t), snapshot_before(t) ?? empty)

reduce must be pure, total, and order-stable by (ts, seq). Pure so it can be re-run; total so an unknown event type cannot crash a replay of last month; order-stable so two events in the same second cannot produce two different pasts.

Replay scopes are Workflow, Task, Meeting, and Comparison. Route replay through a read-only store handle, not a flag — a flag is one forgotten branch away from a replay that writes.

Build order

Ten deliverables, sequenced. Mission Control is number nine, and that is deliberate.

  1. Graph schema and event store
  2. Task state machine
  3. Product master and readiness scoring
  4. Planner producing a static task graph
  5. Runner with one supervised turn (a detached process until v0.29.0)
  6. Review, scoring and retry policy
  7. Context assembly
  8. Approval gates
  9. Mission Control and replay
  10. Meetings, knowledge extraction, multi-repo

Resist starting with the visual layer

It is the most rewarding to build and the least load-bearing. This repository has done exactly that anyway — see the changelog — but for a stated reason: the first thing worth proving was the deployment path, and a dashboard is the only component that exercises all of it. The engineering floor that first shipped was moved by a simulation; v0.29.0 deleted both, and since then the board moves only when real work, through ai-manager, moves a task.

Where this lives in the repository

PathWhat it is
artifacts/v1/gaos-architecture.htmlThe full design document this page summarises
artifacts/v1/gaos-arcadedb-model.htmlThe complete schema — see The graph
artifacts/v1/gaos-mission-control.htmlThe UI prototype the dashboard was ported from
dashboard/Mission Control — Go, stdlib only, HTMX
dashboard/events.goThe closed event catalog, as typed constants
dashboard/store.goThe seam both stores implement — unchanged since it was written
dashboard/store_arcade.goThe ArcadeDB store: reads and writes the graph
dashboard/arcade.goThe ArcadeDB client — ready probe, query, command, transaction
dashboard/adapter.goThe model-gateway seam; reshaped to Submit/Poll by M14.2
The gateway, BlueprintThe contract with ai-manager and ai-claude-cli, and what GAOS writes into a product's workspace