0024: In-repo varlink framing (spike S1-a)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
ADR-0024: In-repo varlink framing (spike S1-a)
Section titled “ADR-0024: In-repo varlink framing (spike S1-a)”- Status: Accepted
- Date: 2026-11-01
- Related: ADR-0005
Context
Section titled “Context”The core IPC is varlink over unix sockets (ADR-0005). The spec required
a spike to choose between the zlink crate, the official varlink
crate, and hand-rolled framing over tokio.
Options considered (spike S1-a, 2026-11-01)
Section titled “Options considered (spike S1-a, 2026-11-01)”zlink0.8.0 (updated 2026-10-29, active): async-first on tokio, withzlink-codegengenerating client/server code from.varlinkfiles. Healthy project (talk at All Systems Go 2025).varlink13.0.0 (updated 2025-10-20): the official Rust implementation, sans-io core; also built around IDL-first codegen.- In-repo framing crate over tokio: NUL-delimited JSON messages,
more/continuesstreaming, named errors, theorg.varlink.service.*bootstrap methods.
Decision
Section titled “Decision”Implement an in-repo crate ibexwall-varlink (server + client framing)
with serde_json + tokio only.
Rationale:
- Our contract pipeline is proto-first: Rust types generate the
IDL (
cargo xtask schemas). Both crates are designed IDL-first (codegen consumes.varlink); adopting them means a double-generation pipeline (Rust → IDL → codegen → Rust) with a new drift class and a codegen step in every build. - The wire protocol is small and fully specified; ~a few hundred lines in-tree keep the root daemon’s only input surface directly auditable, versioned with the contracts, and dependency-free beyond what we already ship.
- We need unusual control on the server side anyway: per-connection peer credentials (SO_PEERCRED, ADR-0025), per-method authorization hooks before dispatch, and streaming backpressure for events.
Consequences
Section titled “Consequences”- We own protocol edge cases (partial reads, oversized messages,
malformed JSON,
oneway) with unit tests; a fuzz target for the framing lands with the fuzz suite (SEC-08). - Switching to
zlinklater is possible via ADR revision if framing maintenance costs exceed the switch cost; the interfaces themselves are unchanged (the IDL inspec/is authoritative). - The
org.varlink.service.GetInfo/GetInterfaceDescription/GetVendorInformationbootstrap methods are served from the same generated IDL, so clients built with official tooling still work.