Architecture

The graph

33 vertex types, 3 document types, 38 edge types in ArcadeDB — one engine covering graph, document and event store. This is the shape, the conventions every type obeys, and the handful of decisions that are expensive to reverse.

Six modelling principles

  1. Schema-full where machines read, schema-less where humans write. Task, Event and Review are strict. Requirement and Artifact are hybrid — a human filling a record should not hit a validation error for writing a sentence.
  2. A business id alongside the physical RID. ArcadeDB gives every record a #bucket:position. Events reference the business id, never the RID — a RID is a storage address, and an event stream that encodes storage addresses cannot survive a migration.
  3. One edge type per relationship. Never a generic REL with a type property. This is described in the source document as the single biggest performance decision in the model, and it is: a typed edge is an index; a property filter on a generic edge is a scan of everything.
  4. The event stream is a first-class type. Append-only, never updated, time-partitioned.
  5. Heavy payloads go EXTERNAL. ContextSlice.rendered, Prompt.template, Artifact.body — or to object storage.
  6. Tenancy is a database boundary first, a property second. One ArcadeDB database per tenant — and keep tenantId on every vertex anyway.

Two supertypes

Every vertex extends GaosVertex; every edge extends GaosEdge. The audit and identity properties are defined once.

sql · ArcadeDB
CREATE VERTEX TYPE GaosVertex;
CREATE PROPERTY GaosVertex.id        STRING   (mandatory true, notnull true);
CREATE PROPERTY GaosVertex.tenantId  STRING   (mandatory true, notnull true);
CREATE PROPERTY GaosVertex.createdAt DATETIME;
CREATE PROPERTY GaosVertex.updatedAt DATETIME;

CREATE EDGE TYPE GaosEdge;
CREATE PROPERTY GaosEdge.createdAt DATETIME;
CREATE PROPERTY GaosEdge.createdBy STRING;

The vertex types

GroupTypes
Product master Tenant · Product · Requirement · Issue · AcceptanceCriterion · Artifact · Metric
Code graph Repository · File · Function · Commit
Execution Workflow · Task · TaskRun · Prompt · ContextSlice · Workspace
Capacity Agent · Room · CalendarSlot
Judgment & memory Review · Approval · Decision · Knowledge · Meeting

Three of these carry BUCKETS 8 because they are the high-volume ones: Task, TaskRun, and the code-graph types.

Why Task and TaskRun are separate

Folding attempts into the task destroys per-retry evidence. Each attempt has its own cost, its own model, its own failure signature and its own log — and the retry policy is a function of exactly those. Collapse them and the second attempt overwrites the reason the first one failed.

Three document types, not vertices

TypeBucketsWhy a document
Event16Append-only, scanned in order, never traversed backwards
Snapshot—A fold checkpoint; one per 500 events and one per closed workflow
Sample8Time series; no relationship to express

v0.86.0 adds one event and no type (D-128): NoticeRaised (a line the notifier would send, kept whether or not WhatsApp is on: the cleaned, screened text, the notice kind, the card and the pull request; never a destination). It feeds the bell and the Notifications page.

v0.66.0 adds one event and no type (D-104): ThirdPartyConfigured (an operator bound, rebound or disabled a product’s third-party platform: the alias, the kind, the switch and the platform’s product code, never a credential, an address or a person). The binding itself is the Product document field thirdParty, like autoFix, so no DDL changes. The people GAOS reads from the platform live in memory only and are in no event (BR-63).

v0.52.0 adds six events and two types (D-091): DefectReported (a defect of a case was recorded, by its key and kind, never its text), DefectTriaged (the verdict and, for a downgrade, its code), DefectStateChanged (a defect moved between open, triaged, fixing, fixed and closed, by a rule), FixPROpened (GAOS opened a draft pull request: repository, number and branch), FixPRStateChanged (the pull request went draft, ready, merged or closed) and AutoFixConfigured (an operator changed a product's auto-fix settings: the alias, the new values and the kind of write token, never the template text). The new types are Defect, one record per reported defect, and FixPR, one per pull request GAOS opened; neither is in an event beyond its key. Task gains autoAt.

v0.48.0 adds five events and one type (D-088): PullRequestOpened, PullRequestMerged and StagingDeployed (a pull-request event or the staging callback was planned into cards), ContactNotified (a notification was attempted: the contact's alias, the kind and the outcome, never the destination) and TaskLabeled (an operator changed a card's label). The new type is Contact, a GitHub account mapped to a notification destination, which is in no event; Task gains labels and dedupKey.

v0.42.0 adds two events and no type (D-082): ConversationArchived (a finished card's conversation archived or restored, by the signed-in account, which now also fills Event.actor) and ConversationPruned (the prune's certificate: which attempts' prompt, reply and question documents were emptied, each one's SHA-256 and length, what survives, and how the gateway sessions fared — never a session id). A prune sets Artifact.body to an empty string; the artifact's row, every event, run record and context slice stay.

Since v0.41.0 an event carries the wall-clock time it was emitted at (D-081): an at key, unix seconds on the dashboard's clock, beside the reducer's delta in payload. ts stays the database's own write time; a row written before v0.41.0 has no at and is read at its ts, corrected by the database's zone. The board reads a card's TaskPlanned and TaskMoved events by that clock to say how long the card spent in each status and how much of it no AI was working on it — a read, never a stored rollup.

Event carries a seq LONG that is monotonic and gapless per tenant. That invariant is what makes a single writer per tenant a requirement rather than a preference — a gap in the sequence is an event that was lost, and a fold cannot tell the difference between a gap and a deletion.

The edges, and two direction rules

All 32 edge types are UNIQUE. The full list is in the source document; these are the load-bearing ones:

edge types
OWNS · HAS_REQUIREMENT · HAS_ISSUE · HAS_CRITERION · HAS_ARTIFACT
HAS_WORKFLOW · HAS_TASK · DEPENDS_ON · IMPLEMENTS · SATISFIES
HAS_RUN · EXECUTED_BY · USES_WORKSPACE · USES_PROMPT · ASSEMBLED · USES_CONTEXT
MODIFIES · GENERATES · REVIEWED_BY · GATED_BY
LEARNS_FROM · APPLIES_TO · PRODUCES · DISCUSSES · HAS_PARTICIPANT
CONTAINS · CALLS · USES_REPOSITORY · TRACKS_METRIC · GOVERNS · SEATED_IN · RESERVED_BY

Two directions that are easy to get backwards

DEPENDS_ON points from the dependent to its prerequisite, so out('DEPENDS_ON') is the set of things that must finish first. Reverse it and the READY-task scan silently returns the wrong tasks.

USES_CONTEXT hangs off ContextSlice, not Task. Each attempt keeps its own context evidence; attaching it to the task means attempt two overwrites what attempt one was actually given.

The indexes that matter

PurposeIndex
The scheduler — runs every tickTask (tenantId, status, priority) NOTUNIQUE
Identity(tenantId, id) UNIQUE on Product, Workflow, Task, TaskRun, Agent, Issue, Knowledge
Orphan detectionTask (status, leaseUntil) · Workspace (state, leaseUntil)
DispatchAgent (tenantId, role, availability)
ReplayEvent (entityId, seq) · Event (tenantId, seq) UNIQUE · Event (tenantId, ts)
Retry policyTaskRun (failureSignature)
RecallKnowledge (tags BY ITEM) · Knowledge (summary) FULL_TEXT

Invariants, each with a detection query

These are checked continuously and feed a health panel, rather than being assumed:

The one query to understand first

Everything the scheduler does starts here — find work whose prerequisites are all done:

sql · ArcadeDB
SELECT FROM Task
WHERE tenantId = :tenant
  AND status = 'PENDING'
  AND out('DEPENDS_ON')[status <> 'DONE'].size() = 0
ORDER BY priority DESC
LIMIT 20

This is why DEPENDS_ON's direction is not a matter of taste, and why Task (tenantId, status, priority) is the index the whole system's throughput rests on.

Storage and retention

DataRetention
EventFull fidelity 90 days, then cold archive
SampleRaw 14 days, then downsampled
TaskRun logsBy reference, in object storage
SnapshotOne per 500 events, one per closed workflow
Everything elseIndefinitely — this is the audit trail; it is the product

Migrations are a numbered directory plus a SchemaVersion document. Additive first. Never rename an edge type in place — every event that referenced it becomes unreadable, and the events are the one thing that cannot be regenerated.

Connecting to it here

Since 2026-11-02 both tiers use one ArcadeDB 26.7.2, the shared instance on clinodb, reached over WireGuard through a relay that publishes on the tunnel address only (deploy/clinodb/compose.arcade-bridge.yml). The tiers are kept apart by database and by user, each user refused on the other's database:

TierURLDatabaseUser
devhttp://10.10.0.5:2480gaos_devgaos_dev
prodhttp://10.10.0.5:2480gaosgaos_prod

The readiness probe answers 204, not 200

GET /api/v1/ready returns 204 No Content. Measured against both live instances on 2026-08-07. A health check written against 200 reports every healthy database as unreachable, and you go looking at the network for an hour.

What the gateway adds

Decided on 2026-11-02, and applied in v0.24.0 as dashboard/schema/11-blueprint.sql except the Workspace changes, which land with M14.4. The move to ai-manager as the gateway (D-055) gives each product a Blueprint and a workspace, and the graph three new vertex types and five new edges — 28 vertex types and 37 edges, 365 DDL statements.

ChangeWhat it records
Policy, KnowledgeSourceThe technical and coding sections of a Blueprint, and the repositories it must follow
BlueprintVersionAn immutable, content-addressed publication; TaskRun -PINNED_TO-> it
Workspace, reusedOne per product, by id (HOSTED_IN), plus the product's reviewer workspace (D-071); its leasedBy and leaseUntil become one live turn per product
TaskRunThe request id recovery polls, the session id, the pinned version, the stored reply
Six eventsBlueprintPublished, WorkspaceProvisioned, BlueprintSynced, SessionOpened, SessionLost, TaskReordered

Agent, Room, CalendarSlot and Meeting go dormant with the floor, which v0.29.0 deleted: nothing writes them, and nothing deletes them, so an old stream still folds. The full proposal, with draft DDL and two new invariants, is §15 of artifacts/v1/gaos-arcadedb-model.html; under BR-05 it lands in dashboard/schema/, dashboard/events.go and the fold together.

M15 adds two events and a status, and no type. An agent that needs the operator's decision ends its turn on a question (D-064): QuestionAsked and QuestionAnswered join the execution group, Task.status gains AWAITING_INPUT, and Artifact.kind gains question — both widened in place by dashboard/schema/12-questions.sql, two more statements. The inbox is a projection of the two events, so there is no Question vertex to keep in step with them.

What is not built yet

Both tiers now carry this schema, and the dashboard reads and writes it. dashboard/store_arcade.go landed on 2026-08-17 as the implementation dashboard/store.go declared the interface for, and the binary applies the DDL itself from an embedded copy on every boot — idempotent, so a restart is a no-op. The half above it is there too: dashboard/scheduler.go decides as a pure function of the graph, and since v0.29.0 every attempt is one turn through ai-manager (the gateway), written as a TaskRun with the ContextSlice it was given and the Blueprint version it is pinned to, and recorded with its request id before it is sent. Real models have answered those turns (deploy/acceptance/live-aim-run.sh). What is not built is what judges the result — nothing reviews what a run produced, and no guard ends a retry loop. The board that renders over the graph moves only when a task does: since v0.30.0 every task status change is a TaskMoved event, folded by dashboard/taskfold.go, and the simulated floor that used to stand in for work was deleted in v0.29.0.

The event stream is no longer a window over its own tail. Until v0.11.0 it was a ring buffer of a hundred and sixty entries, with each entry carrying a photograph of the whole floor and the replay cursor shifted whenever the window moved — everything older than the window was unreachable, which is the opposite of what BR-04 asks an append-only record to be. It is now the whole record, unbounded, and an event carries the delta a reducer folds rather than a floor. Replay is a fold from the nearest snapshot forward, snapshots are an optimisation the fold is tested without, and the read-only handle replaced the flag the architecture document named as the thing that will eventually be forgotten. The fold test — TC-050 and TC-051, one of the three acceptance tests BRD §4.1 names — ran for the first time on 2026-08-17.

The DDL itself is no longer only a document. On 2026-08-16 it was extracted into ten runnable files under dashboard/schema/ and applied to a scratch ArcadeDB 26.7.2, the version D-043 pins: 321 statements at the time, applied clean and idempotent on a second run — 323 today, since D-037's deferred task state brought two TaskRun properties with it. That first run is where the value was — 53 statements failed, and reconciling them produced two amendments to the data model, with a third following on 2026-08-17 when the store first wrote to the graph (D-047). D-045 is a dialect difference: edge uniqueness is a unique index on (`@out`, `@in`), not a UNIQUE keyword on the type, which this version rejects outright. D-046 is not a dialect difference but an error in the model: partitioned('tenantId') requires tenantId to be unique, which would have permitted one Task per tenant, so it is withdrawn.

The complete DDL, the query cookbook and the full property lists are in artifacts/v1/gaos-arcadedb-model.html, amended in place at §04, §09 and §13 with a callout on each. The runnable, reconciled copy is dashboard/schema/, applied by deploy/schema/apply.sh, and dashboard/schema/RECONCILIATION.md records every deviation with the commands to reproduce the measurement.