Covendocs

API architecture diagrams

A visual map of Coven's local socket API: route topology, compatibility handshake, errors, event cursors, live control, launch lifecycle, and daemon authority.

1 min read

Last updated: 2026-05-24

This page collects the API architecture diagrams that live across the Coven source docs and makes them visible from the docs website in one place. Use it as the visual companion to Coven Local API, Client Integration, Session Lifecycle, Authentication and local access, and Safety Model.

Diagram sources
DiagramSource docPurpose
API route topologydocs/API.mdShows the local Unix socket, /api/v1 router, and current endpoint families.
Compatibility handshakedocs/CLIENT-INTEGRATION.mdShows how clients fail closed before using sessions, events, or actions.
Structured error envelopedocs/API-CONTRACT.mdShows how parse, routing, validation, lookup, and runtime failures become stable error codes.
Incremental event readsdocs/API-CONTRACT.mdShows afterSeq cursor pagination and crash-safe resume behavior.
Session launch lifecycledocs/SESSION-LIFECYCLE.mdShows daemon validation, PTY spawn, event persistence, and terminal status updates.
Daemon authority boundarydocs/ARCHITECTURE.md / docs/SAFETY-MODEL.mdShows why clients are UX layers and the Rust daemon owns enforcement.

Route Topology

The public v0 contract is local HTTP over the user's Unix socket. The route prefix is /api/v1; legacy unversioned aliases are early-MVP compatibility only.

Rendering diagram…

Compatibility Handshake

Clients should use GET /api/v1/health before assuming response shapes from any other route. apiVersion: "coven.daemon.v1" is the contract guard; covenVersion is diagnostics metadata.

Rendering diagram…

Structured Error Envelope

All failures return a structured envelope. Clients should branch on error.code, not on message text.

Rendering diagram…

Incremental Event Reads

Events are append-only and use monotonic seq values. Persisting nextCursor.afterSeq lets clients resume event reads after a client crash or daemon restart.

Rendering diagram…

Live Session Control

Live input and kill are accepted only for daemon-verified live sessions. Completed, failed, killed, archived, or orphaned sessions are replay/log surfaces.

Rendering diagram…

Session Launch Lifecycle

Launches are project-scoped. The daemon canonicalizes the project root and working directory, validates the harness id, inserts the session record, spawns the harness with argv APIs, then persists output and exit events.

Rendering diagram…

Daemon Authority Boundary

Clients may validate for UX, but daemon validation is the enforcement boundary. Unknown API versions, unsupported harness ids, invalid session ids, unknown action ids, and outside-root working directories fail closed.

Rendering diagram…
Was this page helpful?No

Last updated on

On this page