Architecture

Server And Store

Hono API, OpenAPI routes, Postgres tables, JSONB projections, artifacts, and migrations.

The server is a Hono app with zod-openapi route definitions. It publishes OpenAPI at /openapi.json and stores data through @isplay/postgres.

Server Responsibilities

ResponsibilityNotes
Validate inputZod schemas from @isplay/core and route-specific request schemas.
Enforce path/body ID consistencyPrevents writing a record under the wrong run, branch, or replay.
Store artifactsWrites JSON payloads to the artifact root and metadata to Postgres.
Build catalogs/contextReconstructs inventory and observed capabilities from records.
Run replay/experimentsRoutes can execute synchronously or enqueue durable local worker jobs with wait=false.
Return OpenAPI/openapi.json describes the HTTP surface.

Store Layout

TableRole
projectsProject root records.
runsCaptured execution records.
eventsOrdered events with unique (run_id, seq).
artifactsArtifact metadata and object keys.
projectionsJSONB records for model calls, tools, branches, replays, fixtures, experiments, context, analysis, and derived outputs.

Artifacts

Artifacts are payload files under .isplay/artifacts or ISPLAY_ARTIFACTS_DIR. Paths are validated to stay inside the artifact root. The server records SHA-256, size, MIME type, compression marker, redaction state, and metadata.

Migrations

isplay start runs migrations automatically after it starts or connects to Postgres. Direct server deployments should run the same migration path before serving capture traffic.

Error Handling

The API returns structured errors with code, message, details, request ID, retryability, and recoverability. See Errors for the exact shape.

On this page