Repository navigation
docs: SandboxTransport remote-exec design (language-neutral gRPC) - #78
Merged
Merged
Conversation
This was referenced Jul 9, 2026
aslom
approved these changes
Jul 9, 2026
aslom
left a comment
Contributor
There was a problem hiding this comment.
LGTM - I will work on local Go executable to verify design
Design for a pluggable harness-sandbox exec seam: a SandboxTransport interface with the existing kubectl-exec kept as the local fast path and a new Redis Streams per-sandbox request/response channel for sandboxes that can only dial outward. Sequences rollout by trust level and defers untrusted-BYO (SPIFFE reverse-tunnel, Approach B) to the same seam. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Replace the Redis-Streams remote-exec transport with a language-neutral protobuf contract served over one gRPC bidi stream on :443, and relocate the spec to the canonical docs/specs/ directory. - Protobuf IDL as the contract; any-language workers (Go reference worker) - gRPC-native HTTP/2 over :443 (firewall-friendly), single bidi Attach stream - Single-replica, presence-only relay; matching stays in the existing pool - Per-sandbox bearer token at the edge; SPIFFE/mTLS deferred - Frame semantics (req_id / dedup / dual-timeout / output-cap) carried verbatim - Drop RedisChannelTransport and @sh/sandbox-worker; keep the SandboxTransport interface + KubectlTransport rename refactor Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Record the language-neutral gRPC SandboxTransport decision from the 2026-07-08 spec as ADR-0024 (Accepted), and add its index row to the ADR README. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
pdettori
force-pushed
the
docs/sandbox-transport-remote-exec
branch
from
July 9, 2026 15:45
ed9cc1a to
77d19d1
Compare
This was referenced Jul 9, 2026
pdettori
added a commit
that referenced
this pull request
Jul 9, 2026
Add an ST-track section to the spec registry for the SandboxTransport gRPC design (spec 2026-07-08, ADR-0024, PR #78). Records the epic (#89) and its backend (#84-#86) vs. worker (#87) + integration (#88) split, consistent with the existing Z2/Z3 harness-vs-sandbox framing. Additive only; no frozen tables touched. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Design spec (docs only — no code) for a pluggable
SandboxTransportseam between theharness and the sandbox, so sandboxes can run outside the harness's cluster (self-hosted /
laptop / on-prem / other cloud / bring-your-own). The sandbox dials out; the harness
never reaches in.
Spec:
docs/specs/2026-07-08-sandbox-transport-grpc-design.mdUpdate (why this PR changed)
This PR originally proposed a Redis-Streams transport (a per-sandbox
sbx:<id>:req|reschannel served by a TS
@sh/sandbox-worker). After further brainstorming we revised thedesign. The Redis approach got the direction right — invert connectivity so the sandbox
dials out — but pinned down two things that limit reach and portability:
a worker had to be TS (or hand-reimplement the frames). This can't meet the
heterogeneity / any-language-BYO driver.
allow only
:443, and it forces a Redis availability dependency into the exec path.The revised design keeps the outbound-dial insight and the frame semantics verbatim
(
req_idcorrelation, at-least-once + dedup, dual-ended timeout, per-exec output cap), andchanges only the encoding and transport.
Revised approach
sandbox/v1); any language with gRPC codegen can host aworker. TS becomes just one generated client.
:443— one full-duplexAttachbidi stream the workeropens outbound; commands come down the response half. Firewall-friendly, no inbound rules.
(Connect's HTTP/1.1 fallback was rejected — full-duplex bidi needs HTTP/2 regardless.)
Attachstreamto the harness's in-cluster
SandboxExeccalls, and mirrors connected workers into theexisting Redis sandbox pool. No HA, no presence glue, no matching logic in the relay.
select-sandbox— a remote sandbox is justanother pool entry that resolves to a
GrpcRelayTransportinstead of aKubectlTransport.honest proof the contract is language-neutral.
the same endpoint later.
Kept vs dropped
SandboxTransportinterface +KubectlTransportrename (apure, behavior-preserving refactor) and all frame semantics.
RedisChannelTransportand the TS@sh/sandbox-workerare not built;Redis returns to being only the pool/session/leaf-queue substrate, never the exec wire.
Deferred (explicit non-goals)
Untrusted-BYO SPIFFE/mTLS · multi-replica relay HA · private-mesh reachability
(Headscale/WireGuard) · additional-language workers · HTTP/1.1-only proxy traversal — all
additive behind the same seam.
Housekeeping
The spec was relocated from
docs/superpowers/specs/todocs/specs/(the canonicallocation where all other specs live); the old Redis spec file is removed in this update.
Assisted-By: Claude Code