Skip to content
GitHub
Reference

Protocols

OHS Protocols are typed Python Protocols a context publishes for synchronous, in-process invocation by apps/* framework deliverables — never by another context’s application code. Each Protocol module under <context>.contracts.protocols.* is the single source of truth for the call surface; the concrete implementation lives in the publisher’s application layer per ADR-065.

Wiring is composition-root work: HTTP handlers in apps/api consume Protocols via FastAPI Depends(); agent tools in apps/workers compose Protocols into the caller’s tool list at startup. The caller never sees the Protocol or its implementation directly — just an opaque tool callable or a dependency-injected object.

For the doctrine on when to publish a Protocol vs route through an event, see Contract Surfaces.

ProtocolOwner (callee)Purpose
WorldAgentRunnerspectral.worldsSynchronous World Agent invocation — ask() and chat() for operator-direct chat handlers and bridge tools