Platform architecture
Presentation, orchestration, plugins, model providers, and durable evidence stay deliberately separated.
Presentation boundary
Next.js never imports or executes an environment. It creates runs through Fastify, submits normalized human actions, and renders state received from REST and WebSocket contracts.
Orchestration boundary
The runner resolves registered components, resets episodes, routes turns to the active participant, enforces budgets, emits normalized events, invokes evaluators, and commits the run record.
Plugin boundary
Environment plugins own rules and authoritative state. Agent plugins own decision logic. Evaluators own scoring. Runtime adapters own execution. The shared contracts package keeps every boundary explicit.
Provider boundary
Model calls happen only in server-side agent plugins. An environment receives a normalized AgentAction and never needs to know whether it came from a baseline policy, a human, or a model routed through OpenRouter.
Evidence boundary
Run records, events, evaluations, snapshots, and replay frames are persisted independently from the web process. REST is the recovery source of truth; WebSocket is the low-latency live view.