How are the gRPC contracts between the processes written, generated, and checked?
Decided 2026-10-04: A. Commit generated code. The decision and its reasons are in the I52I52 (closed): S04-architecture, S09-policy-credentials-audit, S10-tech-stack: first .proto contracts and settings schemaS04-architecture says all IPC is protobuf over gRPC and S10-tech-stack adds proto/ "with the first RPC". comment that starts Decision (2026-10-04):. Source: I52I52 (closed): S04-architecture, S09-policy-credentials-audit, S10-tech-stack: first .proto contracts and settings schemaS04-architecture says all IPC is protobuf over gRPC and S10-tech-stack adds proto/ "with the first RPC".. Affects S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded., S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice. and S02-toolchainS02-toolchain: ToolchainStandardize how this repository manages runtime versions, repo tasks, and CI..
The problem
Section titled “The problem”Figure 1. The contracts I52I52 (closed): S04-architecture, S09-policy-credentials-audit, S10-tech-stack: first .proto contracts and settings schemaS04-architecture says all IPC is protobuf over gRPC and S10-tech-stack adds proto/ "with the first RPC". asks for. Two of them can’t be written yet (red labels). Not every link is gRPC: descriptors pass from wb-vmd as SCM_RIGHTS messages, and wb-netd hands each stream to wb-proxyd as raw bytes behind a header. The guest end is adversarial and may run an older version.
Options
Section titled “Options”The issue lists the generated-code question without options. These are mine.
Each option leaves the SEC* controls unchanged. The contracts themselves serve SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy.: every handler that reads guest bytes gets a fuzz target (S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…).
Sub-decisions
Section titled “Sub-decisions”Impact
Section titled “Impact”| Requirement | A. Commit | B. Build time | C. Mixed |
|---|---|---|---|
| NFR07-maintainabilityNFR07-maintainability: MaintainabilityMost code is cross-platform Go. one contract, small native parts | one generator | one generator | two generators |
| FR17-same-everywhereFR17-same-everywhere: Same on every hostThe same wb commands, flags, policy files, and behavior on every host OS. same build on every OS | plain build | extra step on Windows | plain build |
Offline mise run ci (S02-toolchainS02-toolchain: ToolchainStandardize how this repository manages runtime versions, repo tasks, and CI.) | local plugins | local plugins | local plugins |
| Review noise | generated diffs | none | Go diffs |
| Lint and spelling configuration | path exclusions | as today | Go exclusions |
Evidence
Section titled “Evidence”- verified The repository has no
proto/directory yet, and neithergo.modnorPackage.swiftdeclares a dependency, so no existing code needs migrating. - verified S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice. names
grpc-go,grpc-swift,swift-protobufandbuf, and putsproto/at the repository root (“Libraries”, “Repository layout”). - verified A
remoteplugin inbuf.gen.yamlis “hosted on either the public BSR at https://buf.build or a private BSR”. Alocalplugin is a binary on disk (buf.gen.yaml reference). - verified mise resolves
buftoaqua:bufbuild/buf(mise registry buf), andgo get -tooladds atoolline togo.mod(go help get, Go 1.27.1). - verified The grpc-swift 2 quick start uses
swift-tools-version: 6.1and.macOS("15.0")(grpc-swift-2 README). - verified cspell runs over every tracked file, and
cspell.jsonexcludes no generated paths. SwiftLint checks every file underpackages/wraithbox-swift/Sourcesfor size (.swiftlint.yml). - verified The Go tasks CI runs on Windows are single plain commands (S02-04-goS02-04-go: Go on Three Operating SystemsHow the Go module is checked on macOS, Linux and Windows, and how its tasks run under Windows cmd.exe.).
- inferred gRPC sends messages over HTTP/2 and has no way to pass a file descriptor, so
SCM_RIGHTSneeds its own socket. - verified golangci-lint skips files marked
Code generated … DO NOT EDIT.by default: it reports 0 issues on the generated Go code of I159I159 (closed): proto: first contracts, wb-vmd boot, state and guest connections, wb-guestd helloThe first production code for wb-vmd and wb-guestd needs a contract to build against.. - verified
grpc-swift-protobufshipsprotoc-gen-grpc-swift-2, which SwiftPM builds andbufruns as a local plugin (I159I159 (closed): proto: first contracts, wb-vmd boot, state and guest connections, wb-guestd helloThe first production code for wb-vmd and wb-guestd needs a contract to build against.). - assumed That descriptors from
wb-vmdkeep working in another process. That is X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest?.
What this unblocks
Section titled “What this unblocks”- The design pull request with
proto/, the settings schema and thebuftasks. The tooling, layout, settings,state.dbrule and stream header can be written now. - Every builder of a host process: they share contracts instead of inventing them.
- Still open: the terminal stream (I46I46 (closed): S05-cli, S06-vm-lifecycle: session lifecycle, detach, sleep and failureS05-cli and S06-vm-lifecycle describe starting a session and its summary at the end, but not what happens in between, or when things go wrong:), the
wb-vmdcontract (X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest?), and the version rule (I48I48 (closed): S04-architecture: process supervision, failure, version skew and host resource limitsS04-architecture names the processes but not how they are supervised, what happens when one fails, or how they are upgraded:).
Details and glossary
Why buf breaking matters here. wb-guestd in an old image may talk to a newer wb-hostd (I48I48 (closed): S04-architecture: process supervision, failure, version skew and host resource limitsS04-architecture names the processes but not how they are supervised, what happens when one fails, or how they are upgraded:). buf breaking compares the .proto files with those on main and fails on a change that would break an old peer, such as a renamed field. That turns the compatibility rule into a check instead of a review habit.
Why strict settings. A misspelled key in config.toml, such as a resource limit, would otherwise be ignored without a word. An error that names the key is what NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. asks for.
Glossary
- protobuf (
.proto): a language-neutral way to describe messages. Code generators turn one description into Go and Swift types. - gRPC: remote procedure calls over HTTP/2 using protobuf messages.
buf: a tool that lints.protofiles, checks for breaking changes, and runs code generators.- Plugin: a code generator
bufruns, one per language. - Drift: committed generated code that no longer matches what the generator would make from the current
.protofiles. SCM_RIGHTS: the Unix mechanism for passing an open file descriptor from one process to another over a Unix socket.