# Protocol


Typed communication protocols over the closed kernel sums
`Transport` (TCP/Unix/Stdio) and `Serialization`
(JSON/Protobuf/Sexp/MsgPack). Both sums are defined in
`mb.descriptions` and re-exported here as
`protocol.Transport` / `protocol.Serialization`.

- **Smart constructor** `protocol.define { name; description?;
  transport; serialization; defaultPort?; portEnvVar?;
  capabilities; options?; }` proxies to
  `mb.operations.protocol` (eager structural validation against
  `ProtocolSpec.T`).

- **Built-in protocols** as typed values addressable as
  `protocol.builtins.{rpc,jsonRpc,dbus,grpc}`. Each carries a
  `CapabilitySet` drawn from `capabilities.builtins`.

- **`satisfies : ProtocolSpec → CapabilitySet → Bool`** is the
  capability cross-check (proxy to
  `mb.descriptions.runtime.protocolSatisfies`).

Consumer extension is through `H.ornament` on the kernel sums.
There is no `withTransports`/`withSerializations`/`withProtocols`
surface — extension via string-keyed attrset merge was a legacy
idiom and is intentionally absent.

