ADR-0004 — Minimal runtime document
Status: Accepted (with a scoped deferral)
Context
Section titled “Context”The Cloud Run serving path must not drag in the build-time foundry, and should not carry more of AIR than execution needs.
Decision & current state
Section titled “Decision & current state”- Dependency boundary (done + enforced).
@anvil/runtimeand@anvil/mcp-runtimeimport only@anvil/air— never@anvil/compiler,@anvil/generators, or@anvil/harness. A boundary test (packages/cli/src/architecture.test.ts) fails the build if that edge ever appears, and asserts the same for the declared dependencies. - Compiled projections (done). The generator emits
operations.manifest.json,schemas.compiled.json, anderrors.compiled.json— minimal projections with no descriptions, examples, or provenance — and only approved operations are compiled in. - Deferred, honestly.
buildMcpServerstill binds the full AIROperationtype on the execute path. This is a type-shape coupling, not a dependency-graph leak (the serving packages already pull in nothing from the foundry). Trimming the boundOperationto a dedicatedRuntimeOperationtype is low residual value and is listed as a remaining risk rather than done with a fake seam.
Consequences
Section titled “Consequences”- Cold-start-sensitive imports on the serving path are already minimal and guarded by tests.
- The residual (full
Operationshape at runtime) is documented, not hidden.