Repository navigation
Description
ST1 — sandbox/v1 Protobuf contract (shared wire IDL)
Part of the SandboxTransport epic (see epic #89). Shared foundation — both the backend (TypeScript) and the worker (Go) codegen from this; build it first.
Spec: docs/specs/2026-07-08-sandbox-transport-grpc-design.md §4. Decision: ADR-0024.
Problem
The harness↔sandbox contract must be language-neutral so a worker can be any runtime (Go, Python, Rust, …) — driver #2 in the spec (§1). A TypeScript interface with JSON+base64 frames (the superseded revision) locked workers to TS. The .proto IDL is the source of truth; TS and Go are just two generated clients.
Goal
Define sandbox/v1 exactly as spec §4 — two services, no registry service, no Selector (matching stays in the harness pool):
SandboxWorker.Attach(stream WorkerFrame) returns (stream ServerFrame)— worker dials in, one bidi stream.worker→relay:Hello | Heartbeat | Chunk | End | ExecError.relay→worker:Exec | Abort.SandboxExec.Exec(ExecRequest) returns (stream ExecEvent)+Abort(AbortRequest) returns (AbortResponse)— harness↔relay, in-cluster only.
Frame/message set per §4: Hello (id, labels, capabilities, image, arch, capacity_max, trust), Heartbeat{} (liveness only), Exec (req_id, command, bytes stdin, timeout_s, streaming), Abort, Chunk (bytes data), End (sint32 exit_code), ExecError, ExecRequest, ExecEvent, AbortRequest, AbortResponse.
- Binary, not base64 —
bytes stdin/bytes dataride protobuf's native binary encoding (§4 notes, §8). - Harness owns leases —
Hellocarries onlycapacity_max; the worker never self-reportscapacity_in_use(§4 notes).
Non-goals (this task)
- No registry/matching service and no
Selectormessage (matching stays inselect-sandbox, §6). - No transport/worker implementation (ST2/ST3/ST4).
- No mTLS fields on the wire — bearer token lives at the edge, mTLS is an additive upgrade (§9, §13.4).
Acceptance
.protocompiles cleanly; TypeScript stubs (for the backend) and Go stubs (for the worker) both generate and are wired into their respective builds.- Field numbers and
oneoflayout match spec §4 verbatim. - Codegen is reproducible in CI (documented
buf/protocinvocation; no hand-edited generated code).
Touches
New proto/sandbox/v1/…; codegen wiring for TS (backend package) and Go (worker module); build/CI hooks. This artifact is what the worker plan consumes and the backend plan publishes.
Next step
Land the .proto + codegen; then ST2/ST3 (backend) and ST4 (worker) build against it in parallel. Plan lives locally in docs/plans/ per contributor.
Activity
Merge pull request #91 from pdettori/feat/sandbox-v1-proto
docs: register SandboxTransport (ST) track in the milestone registry