Skip to content

feat: sandbox/v1 protobuf contract + codegen (ST1, #84) - #91

Merged
pdettori merged 7 commits into
rossoctl:mainfrom
pdettori:feat/sandbox-v1-proto
Jul 9, 2026
Merged

pdettori merged 7 commits into
rossoctl:mainfrom
pdettori:feat/sandbox-v1-proto

Conversation

@pdettori

@pdettori pdettori commented Jul 9, 2026

Copy link
Copy Markdown
Member

Implements ST1 (#84), epic #89. Publishes the language-neutral sandbox/v1 Protobuf contract (spec §4) plus reproducible TypeScript + Go codegen — the shared foundation the backend and Go worker tracks generate their clients from.

What's here

  • proto/sandbox/v1/sandbox.proto — verbatim spec §4: two services (SandboxWorker.Attach bidi, SandboxExec.Exec/Abort), 13 messages, binary bytes for stdin/data, capacity_max on Hello only. No registry service, no Selector, no mTLS wire fields.
  • buf codegen from one buf.gen.yaml: ts-proto (grpc-js output) → @sh/k8s-sandbox/src/gen; protoc-gen-go + protoc-gen-go-grpc → a self-contained gen/go module. Generated stubs are committed and drift-checked.
  • CI proto job: buf lint → buf generate → drift check (git diff over both generated trees, incl. untracked) → go build/go test. Enforces reproducible, never-hand-edited codegen.

Scope

Contract + codegen only. The SandboxTransport seam, the relay, GrpcRelayTransport, and the Go worker are separate follow-up tracks (ST2–ST5) that consume this .proto. Rationale and rejected alternatives are in ADR-0024.

Verification

  • buf lint clean; the TS stubs typecheck and a vitest round-trips Hello/Exec/End (including a negative sint32 exit_code); the Go stubs go build and go test round-trip. The TS and Go stubs were verified to agree on the wire (field numbers, bytes, zigzag sint32).

Assisted-By: Claude Code

pdettori added 6 commits July 9, 2026 16:40
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
The generated sandbox/v1 stub imports only @bufbuild/protobuf/wire and
@grpc/grpc-js (reqId uses a local longToNumber helper), so long and
protobufjs were unused direct dependencies. Both remain available
transitively via @grpc/proto-loader.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Stage generated trees before diffing so a future .proto whose codegen
output is untracked also fails the gate, not just edits to tracked stubs.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Comment thread gen/go/go.mod Fixed
Trivy (GitHub Advanced Security) flagged gen/go/go.mod on PR rossoctl#91:
google.golang.org/grpc v1.68.0 CVE-2026-33186 (CRITICAL, fixed 1.79.3),
plus HIGH/MEDIUM in golang.org/x/net v0.29.0 and golang.org/x/sys v0.25.0.

Bump grpc 1.68.0->1.82.0, x/net 0.29.0->0.57.0, x/sys 0.25.0->0.47.0,
protobuf 1.36.4->1.36.11 (all >= their fixed versions). go mod tidy raised
the module go directive to 1.25.0, so the CI proto job now reads its Go
version from gen/go/go.mod (go-version-file) instead of a hardcoded 1.23.
Generated stubs are unchanged (codegen plugin pins untouched; no drift).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori
pdettori merged commit d56f054 into rossoctl:main Jul 9, 2026
10 checks passed
@pdettori
pdettori deleted the feat/sandbox-v1-proto branch July 9, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants