0002 — A plugin is a crate, built in, selected in config
Decision
Interface crates live in this repository. A user implements an interface as a crate, adds it to their local build, and selects it by name in the configuration. The registry resolves names to the implementations linked into the binary.
Why
Zero overhead on the hot path (streaming, tool calls), full type safety, and exactly the workflow the project wants for sensitive parts such as authentication: an implementation that exists only in the build of the person who wrote it.
Rejected
- Dynamically loaded Rust libraries: Rust has no stable ABI; fragile and unsafe.
- Out-of-process plugins as the base: any language and isolation, but serialisation on the hot path. Kept as a possible later addition for tools, verifiers and frontends (CON-4).
- WebAssembly components as the base: a sandbox for third-party plugins, at the cost of complexity and limited system access. A possible later addition.
Amended by ADR 0015: plugins stay crates linked into the binary, and they hot-reload: the local build is rebuilt and the running binary swaps itself in the same terminal at a safe point, handing its in-memory view over to the new process, so sessions are not restarted.