Purpose of this page: explain the transport contract that both the
server and the CLI consume, and the rules that keep it honest.
Layer 3
http/contract/ (transport contract)
The transport contract, with no koa in sight. Every operation id, method, path, lifecycle status and zod schema lives here exactly once.
Components
Operation registry
Registry data, not branches. Each declared operation appears once and carries:
· a typed path segment tuple — resource, subresource, action, system, parameter
· a lifecycle: routed, stubbed, or absent (post-mvp)
· zod schemas for request and response
· an OpenAPI emitter that generates the published documents
Inbound edges
| From | Meaning |
|---|---|
| DaemonClient | renders requests from the registry |
| middleware chain | matches routes via the registry |
Rules
- A
routedentry binds to exactly one command or query. Astubbedentry binds to the shared 501 handler and names no command. - A path is a typed segment tuple, never a string. Every resource segment is singular.
- OpenAPI documents are generated, never committed. The registry equals the proposal contract; a test in
npm run verifyenforces it. - This layer imports no koa. That is what lets the CLI consume it as a client of a remote daemon.