You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KubectlTransport and GrpcRelayTransport are only safely swappable (driver #2) if they demonstrably satisfy the sameSandboxTransport contract, and the remote path only counts as real once a genuine Go worker pod serves a leaf end-to-end over :443.
Goal
Prove equivalence and land the live gate (§11 testing table):
Conformance battery — one shared spec run against bothKubectlTransportandGrpcRelayTransport: round-trip every op (read/write/bash/grep), abort mid-stream, timeout, reconnect→dedup, output-cap. This is what makes the two transports safely interchangeable. (The battery is authored here and is the same suite ST2 uses to prove its refactor inert.)
Manifest-shape test — a vitest that parses the relay + worker Deployment YAML directly (no kustomize in CI), matching the existing manifest-shape pattern.
Live gate — a real Go worker pod dialing the in-cluster relay over :443; one leaf end-to-end on Kind, then OCP, following the existing leaf-smoke pattern.
Non-goals (this task)
New transport behavior (owned by ST2/ST3) or worker behavior (ST4).
The deferred items (mTLS, multi-replica HA, private mesh, extra-language workers, HTTP/1.1 traversal — §13.4).
Acceptance
The same conformance suite is green against both transports (identical observable contract).
Manifest-shape vitest parses relay + worker Deployment YAML and passes in CI.
Live leaf smoke passes with the Go worker → relay :443 path on Kind, then on OCP (gated by the existing live-smoke env vars).
Touches
Shared conformance suite (k8s-sandbox tests, exercised by ST2 + ST3); Go contract tests (ST4); deploy/knative/ relay + worker manifests + smoke drivers (leaf-smoke.sh extension); CI wiring.
Next step
Green here retires the epic's core scope; deferred follow-ups (§13.4) stay tracked in the epic's Deferred section.
ST5 is the slice that proves the remote path end-to-end with a real Go worker over the network: worker dials the relay, the harness leases the mirrored grpc record and runs a leaf through GrpcRelayTransport, first on Kind then on OCP. It depends on #87 (ST4, the Go worker) and on #86 (ST3, backend — merged).
Already landed in ST3 (#86 / PR #93) — do NOT redo
Unit-level cross-transport conformance is done. The shared runConformance battery already runs against both transports — runConformance("KubectlTransport", …) and runConformance("GrpcRelayTransport", …) — proving they satisfy the identical SandboxTransport contract. ST5's job is the live analog, not re-proving this at the unit level.
Relay Deployment + its manifest-shape vitest exist (deploy/knative/relay-deployment.yaml, single replica, Service on :8443; packages/knative-server/test/relay-deployment.test.ts), wired into the base + OCP kustomizations (OCP overlay already rewrites the relay image to GHCR).
Harness dispatch + flag gating (SH_REMOTE_SANDBOX, select-sandbox → GrpcRelayTransport, transport-blind run-leaf) is in and inert when off.
ST5 deliverables (the live gate)
Worker deploy surface — a worker Deployment manifest for the in-cluster smoke (there is none yet) + a manifest-shape vitest mirroring relay-deployment.test.ts; wire it into the base + OCP kustomizations. (The worker binary/image is ST4: worker — Go reference worker (dial Attach, run/stream/abort, dedup, dual timeout) #87's; ST5 owns its deployment for the gate.)
Reachability + auth wiring — for the Kind/OCP smoke an in-cluster worker can dial the relay ClusterIP sandbox-relay.default.svc:8443 directly (plaintext) — start there, it's the simplest path. The relay needs SH_RELAY_TOKEN/SH_RELAY_TOKEN_<id> + REDIS_URL; the worker Deployment carries the matching Bearer token + its sandbox_id; the harness needs SH_REMOTE_SANDBOX=1 + SH_RELAY_ADDR. The production external-worker path (relay Attach on :443 behind an ingress/Route with TLS, and SandboxExec locked to in-cluster via a NetworkPolicy per spec §9) is a follow-on — decide whether ST5 includes the NetworkPolicy/Route or defers them to a hardening slice.
leaf-smoke.sh relay path — deploy/knative/leaf-smoke.sh has no relay/SH_REMOTE_SANDBOX hooks yet. Extend it (or add leaf-relay-smoke.sh) to: deploy relay + worker, wait for the presence record to appear in the Redis pool (redis-cli HGETALL sh:sandbox:records), run one leaf with SH_REMOTE_SANDBOX=1 so it leases the grpc record, assert the verdict/output, and assert the record is removed when the worker stops.
Live cross-transport gate — run the same leaf workload through the pod path (KubectlTransport, flag off) and the worker path (GrpcRelayTransport, flag on) and assert identical verdicts — the live equivalent of the unit conformance battery.
Kind → OCP progression — green on Kind first, then OCP 4.20 (the repo's live-gate pattern).
Acceptance gates (spec §10 / §13.2)
Flag off ⇒ existing e2e green (path fully inert).
Worker connect ⇒ presence record appears in the pool; removed on stream close.
A leaf completes end-to-end via the relay (streamed stdout, correct exit code).
Relay restart (or worker disconnect) ⇒ in-flight exec fails ⇒ leaf retry re-leases a healthy sandbox (no mid-exec durability).
Output-cap truncation and dual-ended timeout exercised against the live worker.
Starting point
The Level-2 (full-path) recipe in #87 is the entry point — SH_REMOTE_SANDBOX=1 + SH_RELAY_ADDR + a leased grpc record. Reference material: proto/sandbox/v1/sandbox.proto (§8 semantics), packages/sandbox-relay/src/relay.ts (park/presence/routing), packages/k8s-sandbox/src/grpc-relay-transport.ts (harness-side reqId correlation / Chunk.stream split / dedup / deadline / output cap), and the existing deploy/knative/leaf-smoke.sh as the template to extend.
Status check — code vs. acceptance (as of docs/turn-sse-streaming-spec, 2026-08-26)
The unit-level equivalence is in place, but the live gate does not exist, and it is blocked on #87 (the worker is a HELLO WORLD stub that runs no commands, so no leaf can complete through the remote path).
Done ✅
Shared conformance battery runs against both transports — same suite, packages/k8s-sandbox/test/conformance.ts, invoked by:
Covers: stdout+exit code, streaming stdout/stderr (stderr excluded from stdout), stdin forwarding, non-zero exit, timeout, abort/signal, idempotent close(). (Both run against scripted fakes, not a live backend.)
No worker Deployment manifest-shape test — only the relay manifest is covered. remote-worker/worker-deployment.yaml / deploy/knative/worker-example.yaml are unparsed by any vitest.
No live gate at all. No smoke driver exercises the real worker → in-cluster relay :443 path — leaf-smoke.sh and the other deploy/knative/*.sh contain no RELAY_ADDR / remote-worker / :443 remote path. Nothing runs one leaf end-to-end on Kind, then OCP (§11 / §13.3).
Even with a smoke driver, an end-to-end leaf cannot run through the remote path today because the #87 worker doesn't execute commands. #87's real bash/timeout/abort must land first.
Net: transports are proven interchangeable against mocks; the remote half has never executed a real command end-to-end. Remaining: worker manifest test + live leaf smoke (Kind → OCP) on the genuine worker→relay:443 path.
The Go worker (#87, PR #172) is done: it runs real commands, enforces timeout_s,
kills process groups on abort, dedups redelivered req_ids, and reconnects while
preserving its cache. 56 tests, go test -race ./... green in CI.
The acceptance battery ST4 landed (and its limits)
All seven of ST4's criteria pass over real gRPC against a real bash, driven by an
in-process fake relay (remote-worker/internal/relaytest):
TestContractBash — stdout/stderr on distinct stream enums, real exit 7
grep
TestContractGrepStreamsMultipleChunks — ~149 KiB, ≥2 chunks, each ≤32 KiB
abort mid-stream
TestContractAbortMidStream — asserts a sentinel file stops growing, proving the process group died rather than that reads merely stopped
timeout
TestContractTimeout — sleep 30 at timeout_s: 1 → ExecError{"timeout:1"} in ~1s
reconnect → dedup
TestContractReconnectDedup — drops the stream, reattaches, redelivers; asserts the marker file still holds one line
Two things ST4 deliberately did not prove, which are ST5's job:
The fake relay is self-authored. It encodes this repo's reading of the wire
contract, and a double written from the same reading can agree with a misreading.
ST4 shipped a gated interop test (TestLiveRelayInterop, SH_LIVE_RELAY=1) that
drives read/write/bash against the real relay via SandboxExec.Exec — but it has never been run. It skips without the env var and CI has no relay. Running
it is the cheapest first step of ST5's live gate.
Cross-transport equivalence is untested. ST4's battery runs only against GrpcRelayTransport's worker side. ST5's conformance battery against both
transports is what actually discharges driver M5: Compaction-checkpoint fast path + budget voter #2.
Findings from ST4 that bear on ST5 specifically
A cache hit re-emits only the terminal frame, never the output chunks. A
redelivered streaming exec returns its exit code with zero output — a
redelivered cat file yields exit 0 and empty content. The worker is
spec-compliant (§8 says "re-emit the cached terminal result", and End has
nowhere to put output), so this is a contract gap, not an implementation bug. ST5's conformance battery should assert whatever behavior you decide is
correct here, because the two transports will differ:KubectlTransport has
no dedup cache at all, so it re-runs and returns output.
gRPC MaxCallRecvMsgSize is unconfigured on the worker's dial. A base64
write payload over the 4 MiB default kills the whole stream, not just that
exec, and triggers a reconnect. Worth an explicit max write size in the
conformance battery, and a decision on both ends.
streaming: false is the proto3 default and was untested over the wire until
late in ST4. Any conformance battery should drive it explicitly.
Reachability note for the live gate
remote-worker/DESIGN.md records that the harness's default-deny egress policy did
not permit the relay, so with SH_REMOTE_SANDBOX=1 every remote exec was silently
denied and timed out. deploy/knative/harness-egress-policy.yaml carries the rule
now; a deployment predating that fix needs the documented patch.
Two things the live gate must handle (found validating the remote path manually)
I ran the full remote path in a local kind cluster today — leaf → relay → worker pod, no kubectl exec in the path (details on #89). Two traps bit me, and both matter for this
issue's conformance battery and smoke script:
1. A green run does not prove the remote backend served it.select-sandbox builds candidates = [...pods, ...grpcRecs] and leases least-loaded-first, so with idle
in-cluster sandbox pods present, a pod wins even with SH_REMOTE_SANDBOX=1. My first
remote run returned a correct-looking verdict that had been produced by an Alpine pod, not
the worker. So leaf-smoke.sh's relay path must assert which backend executed, not
just that the leaf succeeded. The cheap way: pick a file that differs between backends —
the sandbox-N pods are Alpine and the worker image is RHEL, so /etc/os-release gives
opposite answers and the verdict text names the OS it read.
2. deploy/knative/relay-deployment.yaml omits SH_RELAY_TOKEN. Relay auth is
fail-closed, so applying it as-is gives a relay that rejects every Attach. Worth fixing in
the manifest.
Operational notes for whoever writes the script: kubectl set env does not work on a
Knative Service (no kind "Service" is registered) — use a merge patch, and preserve the
container's volumeMounts or the Knative webhook rejects the patch.
Already green and not needing repeat work here: the gated SH_LIVE_RELAY=1 interop test
passes against the real relay, and the shared conformance battery already runs against both transports (runConformance("KubectlTransport", …) and runConformance("GrpcRelayTransport", …)), including output-cap, transport-side dedup, and
the dual-ended deadline. So this issue's remaining substance is the live gate itself rather
than the battery.
A one-command laptop version of the demo is filed separately as #174.
ST5 complete — the live gate exists, on Kind and on OpenShift
All three acceptance bullets discharged. Branch: 12 commits; make typecheck, make test (605 passed / 13 skipped) and go test -race ./... green.
Conformance battery — both per-call transports
The shared battery now also holds both transports to the output cap, which previously only GrpcRelayTransport enforced: packages/k8s-sandbox/src/exec.ts carried an unbounded buffer behind a TODO(M3) while spec §8 advertised the cap as a seam-level guarantee. The constants moved onto the seam (transport.ts) and the assertion into conformance.ts, so neither transport can regress alone.
The battery also now asserts the cap stops the producer — client.abort on the gRPC side, child.kill on the kubectl side. That coverage had been deleted as redundant when the cap case moved into the battery, and it was not redundant: with it gone, removing child.kill from exec.ts still passed.
What this does not establish. There is a thirdSandboxTransport — persistentExecInPod — it is uncapped, it serves Read/Write/Edit/Ls/Find (extension.ts:53-59), and it is not in the battery. Spec §8, ADR-0024 and transport.ts all claimed a seam-wide guarantee; all three now name the exception. Tracked as #180.
Manifest-shape vitest
packages/knative-server/test/worker-deployment.test.ts covers both worker manifests — the third-party copy-and-edit surface and the sed-filled template — and enforces the memory budget that runner.go and the Deployment each described in comments while nothing checked: 2 × effective concurrency × BufferCap ≤ limit, using the concurrency that actually runs rather than only an override. Every assertion was verified to fail against a mutated manifest. The TS↔Go cap coupling is now pinned by a test rather than by prose.
Live gate — Kind → OCP
deploy/knative/relay-leaf-smoke.sh: 8/8 on Kind, twice consecutively, and 8/8 on OpenShift (api.rosso1.kubestellar.org, worker image built into that cluster's internal registry — nothing published). Assertions: presence with transport=grpc; the Alpine-vs-RHEL discriminator verified before being relied on; remote Alpine→CLEAR and Red Hat→FLAGGED; presence cleared when the Attach stream closes; a worker disconnect re-leasing a healthy sandbox; the control run on the pod path; the relay removed on teardown.
Twice on Kind rather than once because the presence assertion was flaky — 3 failures in 5 runs. Cause: a single HGETALL fired immediately after kubectl rollout status, which returns when the pod is merely Running, while registration happens later when the worker dials Attach. The generated worker Deployment has no readinessProbe and shouldn't — its readiness is the Attach stream, which no HTTP/TCP probe can observe. Now a bounded poll.
The new disconnect assertion carries its limitation inline: with the worker alive a pod also returns FLAGGED for Alpine, so it proves recovery, not routing. That was demonstrated deliberately — commenting out the delete and watching it pass for the wrong reason. The routing proof remains the Alpine/Red Hat pair asserted while the worker is the only lease candidate.
The three gates the leaf smoke structurally cannot express
packages/k8s-sandbox/test/live-relay.test.ts (gated on SH_LIVE_RELAY=1) — the leaf's request shape is a grep verdict, so it cannot ask for a sleep, a flood, or a mid-exec kill. Run live against a real relay and a real Go worker, 3/3, each for a checkable reason:
Case
Evidence
dual-ended timeout
rejected timeout:2 in 2009 ms, against a 30 s sleep and a 120 s fallback deadline
output cap
returned 98,323 of 1,000,000 bytes, marker at byte 98,304 = 3×32 KiB against a 2-chunk cap — exactly one chunk of overshoot, confirming the documented asymmetry over real Chunk frames
worker disconnect
rejected worker disconnected7 ms after SIGKILL, worker built and killed by the test itself
This is also the only independent check on the hermetic battery, whose fakes are self-authored — a double written from the same misreading of the contract will agree with that misreading.
Divergences recorded rather than papered over
Spec §8 gained an "Accepted divergences" section: KubectlTransport applies no default deadline while GrpcRelayTransport always applies 120 s, and the battery cannot see it because its timeout case always passes an explicit timeout (#182); and a bash flood is SIGKILLed but reported to the model as success, because Pi treats a null exit code as non-failing and createPodBashOps discards stdout (#181).
Fixed along the way
A truncated read could be written back into a file. Once KubectlTransport gained the cap it became persistentExecInPod's fallback on channel death; readFile discarded exitCode; Pi's Edit is read-whole-file → write-whole-file. So a >8 MiB Edit plus a channel death wrote 8 MiB and the truncation marker back into the source, nondeterministically. readFile now refuses to return content it cannot vouch for.
Also: req_id uniqueness (#179) — the relay keyed sinks by req_id per sandbox, so a collision detached one caller and interleaved both execs' output, silently.
Activity
docs: register SandboxTransport (ST) track in the milestone registry
pdettori commentedon Jul 10, 2026
ST5 scope — integration & live gate
ST5 is the slice that proves the remote path end-to-end with a real Go worker over the network: worker dials the relay, the harness leases the mirrored grpc record and runs a leaf through
GrpcRelayTransport, first on Kind then on OCP. It depends on #87 (ST4, the Go worker) and on #86 (ST3, backend — merged).Already landed in ST3 (#86 / PR #93) — do NOT redo
runConformancebattery already runs against both transports —runConformance("KubectlTransport", …)andrunConformance("GrpcRelayTransport", …)— proving they satisfy the identicalSandboxTransportcontract. ST5's job is the live analog, not re-proving this at the unit level.deploy/knative/relay-deployment.yaml, single replica,Serviceon:8443;packages/knative-server/test/relay-deployment.test.ts), wired into the base + OCP kustomizations (OCP overlay already rewrites the relay image to GHCR).SH_REMOTE_SANDBOX,select-sandbox→GrpcRelayTransport, transport-blindrun-leaf) is in and inert when off.ST5 deliverables (the live gate)
Deploymentmanifest for the in-cluster smoke (there is none yet) + a manifest-shape vitest mirroringrelay-deployment.test.ts; wire it into the base + OCP kustomizations. (The worker binary/image is ST4: worker — Go reference worker (dial Attach, run/stream/abort, dedup, dual timeout) #87's; ST5 owns its deployment for the gate.)sandbox-relay.default.svc:8443directly (plaintext) — start there, it's the simplest path. The relay needsSH_RELAY_TOKEN/SH_RELAY_TOKEN_<id>+REDIS_URL; the worker Deployment carries the matchingBearertoken + itssandbox_id; the harness needsSH_REMOTE_SANDBOX=1+SH_RELAY_ADDR. The production external-worker path (relayAttachon:443behind an ingress/Route with TLS, andSandboxExeclocked to in-cluster via a NetworkPolicy per spec §9) is a follow-on — decide whether ST5 includes the NetworkPolicy/Route or defers them to a hardening slice.leaf-smoke.shrelay path —deploy/knative/leaf-smoke.shhas no relay/SH_REMOTE_SANDBOXhooks yet. Extend it (or addleaf-relay-smoke.sh) to: deploy relay + worker, wait for the presence record to appear in the Redis pool (redis-cli HGETALL sh:sandbox:records), run one leaf withSH_REMOTE_SANDBOX=1so it leases the grpc record, assert the verdict/output, and assert the record is removed when the worker stops.KubectlTransport, flag off) and the worker path (GrpcRelayTransport, flag on) and assert identical verdicts — the live equivalent of the unit conformance battery.Acceptance gates (spec §10 / §13.2)
Starting point
The Level-2 (full-path) recipe in #87 is the entry point —
SH_REMOTE_SANDBOX=1+SH_RELAY_ADDR+ a leased grpc record. Reference material:proto/sandbox/v1/sandbox.proto(§8 semantics),packages/sandbox-relay/src/relay.ts(park/presence/routing),packages/k8s-sandbox/src/grpc-relay-transport.ts(harness-side reqId correlation /Chunk.streamsplit / dedup / deadline / output cap), and the existingdeploy/knative/leaf-smoke.shas the template to extend.Assisted-By: Claude Code
docs: mark RC1 AuthBridge PoC Accepted; apply Z3/Z5 mechanism-superse…
pdettori commentedon Aug 26, 2026
Status check — code vs. acceptance (as of
docs/turn-sse-streaming-spec, 2026-08-26)The unit-level equivalence is in place, but the live gate does not exist, and it is blocked on #87 (the worker is a HELLO WORLD stub that runs no commands, so no leaf can complete through the remote path).
Done ✅
packages/k8s-sandbox/test/conformance.ts, invoked by:transport-conformance.test.ts:39→runConformance("KubectlTransport", …)grpc-relay-transport.test.ts:55→runConformance("GrpcRelayTransport", …)close(). (Both run against scripted fakes, not a live backend.)packages/knative-server/test/relay-deployment.test.ts(single-replica Deployment + Service, entrypoint, kustomization refs).Missing ❌
Deploymentmanifest-shape test — only the relay manifest is covered.remote-worker/worker-deployment.yaml/deploy/knative/worker-example.yamlare unparsed by any vitest.:443path —leaf-smoke.shand the otherdeploy/knative/*.shcontain noRELAY_ADDR/ remote-worker /:443remote path. Nothing runs one leaf end-to-end on Kind, then OCP (§11 / §13.3).Blocking dependency
Even with a smoke driver, an end-to-end leaf cannot run through the remote path today because the #87 worker doesn't execute commands. #87's real bash/timeout/abort must land first.
Net: transports are proven interchangeable against mocks; the remote half has never executed a real command end-to-end. Remaining: worker manifest test + live leaf smoke (Kind → OCP) on the genuine worker→relay:443 path.
pdettori commentedon Aug 27, 2026
ST4 is complete — what ST5 inherits
The Go worker (#87, PR #172) is done: it runs real commands, enforces
timeout_s,kills process groups on abort, dedups redelivered
req_ids, and reconnects whilepreserving its cache. 56 tests,
go test -race ./...green in CI.The acceptance battery ST4 landed (and its limits)
All seven of ST4's criteria pass over real gRPC against a real
bash, driven by anin-process fake relay (
remote-worker/internal/relaytest):TestContractRead—cat <file>TestContractWrite—base64 -d > <file>on stdin, asserts file bytesTestContractBash— stdout/stderr on distinct stream enums, real exit 7TestContractGrepStreamsMultipleChunks— ~149 KiB, ≥2 chunks, each ≤32 KiBTestContractAbortMidStream— asserts a sentinel file stops growing, proving the process group died rather than that reads merely stoppedTestContractTimeout—sleep 30attimeout_s: 1→ExecError{"timeout:1"}in ~1sTestContractReconnectDedup— drops the stream, reattaches, redelivers; asserts the marker file still holds one lineTwo things ST4 deliberately did not prove, which are ST5's job:
contract, and a double written from the same reading can agree with a misreading.
ST4 shipped a gated interop test (
TestLiveRelayInterop,SH_LIVE_RELAY=1) thatdrives read/write/bash against the real relay via
SandboxExec.Exec— but ithas never been run. It skips without the env var and CI has no relay. Running
it is the cheapest first step of ST5's live gate.
GrpcRelayTransport's worker side. ST5's conformance battery against bothtransports is what actually discharges driver M5: Compaction-checkpoint fast path + budget voter #2.
Findings from ST4 that bear on ST5 specifically
redelivered streaming exec returns its exit code with zero output — a
redelivered
cat fileyields exit 0 and empty content. The worker isspec-compliant (§8 says "re-emit the cached terminal result", and
Endhasnowhere to put output), so this is a contract gap, not an implementation bug.
ST5's conformance battery should assert whatever behavior you decide is
correct here, because the two transports will differ:
KubectlTransporthasno dedup cache at all, so it re-runs and returns output.
MaxCallRecvMsgSizeis unconfigured on the worker's dial. Abase64write payload over the 4 MiB default kills the whole stream, not just that
exec, and triggers a reconnect. Worth an explicit max write size in the
conformance battery, and a decision on both ends.
req_idis not unique per worker (see ST4: worker — Go reference worker (dial Attach, run/stream/abort, dedup, dual timeout) #87). ST5 will hit this the moment theharness runs more than one replica against a shared sandbox.
streaming: falseis the proto3 default and was untested over the wire untillate in ST4. Any conformance battery should drive it explicitly.
Reachability note for the live gate
remote-worker/DESIGN.mdrecords that the harness's default-deny egress policy didnot permit the relay, so with
SH_REMOTE_SANDBOX=1every remote exec was silentlydenied and timed out.
deploy/knative/harness-egress-policy.yamlcarries the rulenow; a deployment predating that fix needs the documented patch.
Assisted-By: Claude Code
docs(notes): move the ST4 write-ups out of the repo and into the issues
pdettori commentedon Aug 27, 2026
Two things the live gate must handle (found validating the remote path manually)
I ran the full remote path in a local kind cluster today — leaf → relay → worker pod, no
kubectl execin the path (details on #89). Two traps bit me, and both matter for thisissue's conformance battery and smoke script:
1. A green run does not prove the remote backend served it.
select-sandboxbuildscandidates = [...pods, ...grpcRecs]and leases least-loaded-first, so with idlein-cluster sandbox pods present, a pod wins even with
SH_REMOTE_SANDBOX=1. My firstremote run returned a correct-looking verdict that had been produced by an Alpine pod, not
the worker. So
leaf-smoke.sh's relay path must assert which backend executed, notjust that the leaf succeeded. The cheap way: pick a file that differs between backends —
the
sandbox-Npods are Alpine and the worker image is RHEL, so/etc/os-releasegivesopposite answers and the verdict text names the OS it read.
2.
deploy/knative/relay-deployment.yamlomitsSH_RELAY_TOKEN. Relay auth isfail-closed, so applying it as-is gives a relay that rejects every Attach. Worth fixing in
the manifest.
Operational notes for whoever writes the script:
kubectl set envdoes not work on aKnative
Service(no kind "Service" is registered) — use a merge patch, and preserve thecontainer's
volumeMountsor the Knative webhook rejects the patch.Already green and not needing repeat work here: the gated
SH_LIVE_RELAY=1interop testpasses against the real relay, and the shared conformance battery already runs against
both transports (
runConformance("KubectlTransport", …)andrunConformance("GrpcRelayTransport", …)), including output-cap, transport-side dedup, andthe dual-ended deadline. So this issue's remaining substance is the live gate itself rather
than the battery.
A one-command laptop version of the demo is filed separately as #174.
Assisted-By: Claude Code
pdettori commentedon Aug 28, 2026
ST5 complete — the live gate exists, on Kind and on OpenShift
All three acceptance bullets discharged. Branch: 12 commits;
make typecheck,make test(605 passed / 13 skipped) andgo test -race ./...green.Conformance battery — both per-call transports
The shared battery now also holds both transports to the output cap, which previously only
GrpcRelayTransportenforced:packages/k8s-sandbox/src/exec.tscarried an unbounded buffer behind aTODO(M3)while spec §8 advertised the cap as a seam-level guarantee. The constants moved onto the seam (transport.ts) and the assertion intoconformance.ts, so neither transport can regress alone.The battery also now asserts the cap stops the producer —
client.aborton the gRPC side,child.killon the kubectl side. That coverage had been deleted as redundant when the cap case moved into the battery, and it was not redundant: with it gone, removingchild.killfromexec.tsstill passed.What this does not establish. There is a third
SandboxTransport—persistentExecInPod— it is uncapped, it serves Read/Write/Edit/Ls/Find (extension.ts:53-59), and it is not in the battery. Spec §8, ADR-0024 andtransport.tsall claimed a seam-wide guarantee; all three now name the exception. Tracked as #180.Manifest-shape vitest
packages/knative-server/test/worker-deployment.test.tscovers both worker manifests — the third-party copy-and-edit surface and the sed-filled template — and enforces the memory budget thatrunner.goand the Deployment each described in comments while nothing checked:2 × effective concurrency × BufferCap ≤ limit, using the concurrency that actually runs rather than only an override. Every assertion was verified to fail against a mutated manifest. The TS↔Go cap coupling is now pinned by a test rather than by prose.Live gate — Kind → OCP
deploy/knative/relay-leaf-smoke.sh: 8/8 on Kind, twice consecutively, and 8/8 on OpenShift (api.rosso1.kubestellar.org, worker image built into that cluster's internal registry — nothing published). Assertions: presence withtransport=grpc; the Alpine-vs-RHEL discriminator verified before being relied on; remote Alpine→CLEAR and Red Hat→FLAGGED; presence cleared when the Attach stream closes; a worker disconnect re-leasing a healthy sandbox; the control run on the pod path; the relay removed on teardown.Twice on Kind rather than once because the presence assertion was flaky — 3 failures in 5 runs. Cause: a single
HGETALLfired immediately afterkubectl rollout status, which returns when the pod is merely Running, while registration happens later when the worker dialsAttach. The generated worker Deployment has no readinessProbe and shouldn't — its readiness is the Attach stream, which no HTTP/TCP probe can observe. Now a bounded poll.The new disconnect assertion carries its limitation inline: with the worker alive a pod also returns FLAGGED for Alpine, so it proves recovery, not routing. That was demonstrated deliberately — commenting out the delete and watching it pass for the wrong reason. The routing proof remains the Alpine/Red Hat pair asserted while the worker is the only lease candidate.
The three gates the leaf smoke structurally cannot express
packages/k8s-sandbox/test/live-relay.test.ts(gated onSH_LIVE_RELAY=1) — the leaf's request shape is a grep verdict, so it cannot ask for a sleep, a flood, or a mid-exec kill. Run live against a real relay and a real Go worker, 3/3, each for a checkable reason:timeout:2in 2009 ms, against a 30 s sleep and a 120 s fallback deadlineChunkframesworker disconnected7 ms after SIGKILL, worker built and killed by the test itselfThis is also the only independent check on the hermetic battery, whose fakes are self-authored — a double written from the same misreading of the contract will agree with that misreading.
Divergences recorded rather than papered over
Spec §8 gained an "Accepted divergences" section:
KubectlTransportapplies no default deadline whileGrpcRelayTransportalways applies 120 s, and the battery cannot see it because its timeout case always passes an explicit timeout (#182); and a bash flood is SIGKILLed but reported to the model as success, because Pi treats a null exit code as non-failing andcreatePodBashOpsdiscards stdout (#181).Fixed along the way
A truncated read could be written back into a file. Once
KubectlTransportgained the cap it becamepersistentExecInPod's fallback on channel death;readFilediscardedexitCode; Pi's Edit is read-whole-file → write-whole-file. So a >8 MiB Edit plus a channel death wrote 8 MiB and the truncation marker back into the source, nondeterministically.readFilenow refuses to return content it cannot vouch for.Also:
req_iduniqueness (#179) — the relay keyed sinks byreq_idper sandbox, so a collision detached one caller and interleaved both execs' output, silently.Assisted-By: Claude Code
fix(k8s-sandbox): enforce the output cap in KubectlTransport too
fix(k8s-sandbox,sandbox-relay): make req_id unique across replicas
test(knative-server): manifest-shape test for both worker Deployments
docs(spec,adr): correct §7/§8 and record the req_id + output-cap deci…
test(deploy/knative): assert a worker disconnect re-leases a healthy …