Expand description
M8: agent API server. Spec §12.3.
HTTP/JSON server exposing the same operations as the CLI. The server
is stateful (it owns a Store instance) so agents don’t pay sandbox
startup cost per request.
Endpoints:
POST /v1/parse { source } → CanonicalAst | [SyntaxError]
POST /v1/check { source } → { ok: true } | [TypeError]
POST /v1/publish { source, activate? } → [{ stage_id, sig_id, status }]
GET /v1/stage/
Web (lex-tea v2, read-only HTML; human-only audit + triage):
GET / → activity stream (recent attestations)
GET /web/attention → exceptions queue (Failed / Inconclusive,
stale merge sessions)
GET /web/trust → per-producer rollup (pass rate, latest
failure)
GET /web/branches → branch list
GET /web/branch/
Modules§
Functions§
- serve
- serve_
mcp_ stdio - MCP server (#171). Same
Stateshape as the HTTP server, stdio transport instead of TCP. Designed for hosts that spawnlex serve --mcpas a subprocess and pipe JSON-RPC over stdin/stdout. - serve_
on - Test/embedded entry: takes an already-bound
Serverand runs until it stops accepting requests. Returns immediately when theServeris dropped on another thread.