carlos / platform Public

activator: tee every log connection of a gVisor run unit

Rastrillo demos on a gVisor box (dev demo box-1) died right after
binding app.sock. systemd opens StandardOutput=file: afresh for each
command of a unit, and the gVisor run unit's ExecStartPre (runsc
delete -force) connects to the log socket before ExecStart (runsc run).
The agent's log listener teed only the first connection and closed the
rest unread, so the guest's stdout was a closed socket: its first log
write ("rastrillo: serving") got EPIPE and SIGPIPE killed it, a clean
exit to systemd (SuccessExitStatus 141). Latent since gVisor demos
landed (de380c2c); the earlier witness starter writes nothing first.

On a gVisor box the run role's listener (listenLogsEach) now tees every
connection of the invocation, bounded at 8. The systemd family keeps
the one-connection listener. Admission is a plain counter owned by the
accept loop that grows only when it admits, so it stops at its limit.
New tests pin the ExecStartPre order, the systemd refusal, the bound,
exhaustion, and that the gVisor drop-in always sets one runsc command.

Reviews: Astra code review, no findings in the change; its pre-existing
tee weakness is #936. Census gvisor-empty-execstart (prepareKeyedAt
body, activator envelope) approved on #280 by Astra in round 2, after
round 1's P2 (a counter that could wrap) was fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from gvisor-empty-execstart into main.
claude agent, operated by paul@keymail.dev 01110d22f03dee6adccd06d1ed4e60e87ff7925e parent 929f786
7 files changed, +347 −24
  • docs/superpowers/notes/census-proposal-gvisor-empty-execstart.md +19 −0
  • internal/activator/gvisor_log_socket_test.go +187 −0
  • internal/activator/loglistener.go +77 −23
  • internal/activator/prepare.go +9 −1
  • internal/instancectl/gvisor_execstart_test.go +49 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-gvisor-empty-execstart.tsv +5 −0

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-gvisor-empty-execstart.md b/docs/superpowers/notes/census-proposal-gvisor-empty-execstart.md
new file mode 100644
index 000000000..3d6e5221f
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-gvisor-empty-execstart.md
@@ -0,0 +1,19 @@
+# Census approval: gvisor-empty-execstart
+
+Ruling `census-ruling-gvisor-empty-execstart`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/activator/prepare.go` `ExecBackend.prepareKeyedAt` | body | unchanged (13) | on a gVisor box (b.SandboxEffective == execsandbox.EffectiveGVisor, set by Configure at agent startup) the run role's log listener is listenLogsEach, which tees every connection of the invocation (bounded at 8) instead of only the first: the gVisor run unit's ExecStartPre=-runsc delete connects to the same StandardOutput=file: socket before ExecStart, so the one-connection listener refused the main runsc run's connection and the guest died of SIGPIPE on its first log write. Same socket path, same agent-owned listener, same emitter; no file, path or env read added or moved; the systemd family keeps listenLogs |
+
+Envelopes re-pinned: `internal/activator`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/activator/prepare.go` `ExecBackend.prepareKeyedAt`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling zddr4, with no further change from this branch beyond carrying main's new early return into the six-value signature. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen prepareAt, which is now its wrapper; it also returns the instance key's layer and reads no env for the cmd role; same reads, same nested launch paths;rev3=census-ruling-wake-latency-2;basis=takes an optional timer and marks its steps with time.Now() (dirs, admin token, instance key, env, control socket, key gate, logs); no read added or moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, run and seed roles only, under a 30 s context (haSecretsBudget): the token producer is ensureAdminTokenFor(hctx, rt, p) (on this nested path the same beneath producer, EnsureAdminTokenBeneath's, plus the HA mint decision inside it); ensureInstanceKeyFor now gets hctx instead of context.Background(), so the key's bucket read is bounded by 30 s as well as configReadTimeout; the env is launchEnvLayer(hctx, rt) (instanceEnvLayer for a non-HA host; for an HA host one capture, published and acknowledged); a test seam (haLaunchHooks.afterGate, nil in production) is called before the producers. The separate haMintGate and haSecretsReady calls are gone (final fix F2). Sites against main: -registry:Host (the rt.Host+".env" argument EnsureAdminTokenBeneath took) and +whole:Route (rt to launchEnvLayer); the cmd role and a non-HA host are unchanged;rev3=census-ruling-rootfs-fleet-followups;basis=names the process for the role log listener: release.ProcessWeb when rt.Rootfs() and the role is run, else none, passed to logEmitter; reads rt.Runtime through Rootfs(); no file, path or env read added or moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty;rev3=census-ruling-region-ha-p1b3b-s;basis=Native sidecar run units use the existing nested secrets preparation and acknowledged sealed publication, but bind no app control listener. Existing run and seed reads unchanged.
+
+Seal: `b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369` → `44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-gvisor-empty-execstart.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/gvisor_log_socket_test.go b/internal/activator/gvisor_log_socket_test.go
new file mode 100644
index 000000000..9ca393ada
--- /dev/null
+++ b/internal/activator/gvisor_log_socket_test.go
@@ -0,0 +1,187 @@
+package activator
+
+import (
+ "net"
+ "os"
+ "path/filepath"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/applog"
+ "github.com/carlosframework/platform/internal/execsandbox"
+ "github.com/carlosframework/platform/internal/instancectl"
+)
+
+// The gVisor run unit (instancectl gvisorDropIn) runs ExecStartPre=-runsc
+// delete -force before ExecStart=runsc run, and systemd opens the unit's
+// StandardOutput=file: socket afresh for each command. So the log socket
+// sees ExecStartPre's connection first, empty and closed at once, and only
+// then the main process's.
+//
+// Under the one-connection listener the main process's connection was the
+// refused one: the guest's first log write got EPIPE, SIGPIPE killed it
+// (status 141, a SuccessExitStatus, so systemd said "Deactivated
+// successfully"), and every Rastrillo demo on dev demo box-1 died right
+// after binding app.sock ("rastrillo: serving" is its first write).
+//
+// This drives the listener production's prepare binds for a gVisor box's
+// run role, through the real socket, in the unit's connection order.
+func TestGVisorRunLogListenerTeesTheMainProcessAfterExecStartPre(t *testing.T) {
+ t.Parallel()
+ b, _ := newRootfsBackend(t)
+ b.SandboxEffective = execsandbox.EffectiveGVisor
+ rt := rootfsRoute(b)
+ rt.Runtime = ""
+ sink := applog.NewSink("box1", time.Now)
+ b.Logs = sink
+ _, ctl, logs, _, _, err := b.prepareKeyedAt(rt, instancectl.RoleRun, rt.Socket, 0, nil)
+ if err != nil {
+ t.Fatalf("prepareKeyedAt: %v", err)
+ }
+ if ctl != nil {
+ t.Cleanup(func() { ctl.Close() })
+ }
+ t.Cleanup(func() { logs.Close() })
+ sock := b.logSocketFor(rt.Host, instancectl.RoleRun, 0)
+
+ // ExecStartPre: runsc delete -force of a container that is not there
+ // connects, writes nothing and exits.
+ pre, err := net.Dial("unix", sock)
+ if err != nil {
+ t.Fatalf("ExecStartPre dial: %v", err)
+ }
+ pre.Close()
+
+ // ExecStart: runsc run, whose guest logs once it has bound its socket.
+ main, err := net.Dial("unix", sock)
+ if err != nil {
+ t.Fatalf("ExecStart dial: %v", err)
+ }
+ defer main.Close()
+ if _, err := main.Write([]byte("INFO rastrillo: serving\n")); err != nil {
+ t.Fatal(err)
+ }
+ // The connection must still be open for the guest's later writes: a
+ // closed one is what killed it.
+ main.SetReadDeadline(time.Now().Add(200 * time.Millisecond))
+ if _, err := main.Read(make([]byte, 1)); err == nil || !isTimeout(err) {
+ t.Fatalf("the main process's log connection was closed under it (read: %v)", err)
+ }
+ if _, err := main.Write([]byte("second line\n")); err != nil {
+ t.Fatalf("second write: %v", err)
+ }
+ got := drainAppLines(t, sink, 2)
+ if got[0].Msg != "INFO rastrillo: serving" || got[1].Msg != "second line" {
+ t.Fatalf("app lines = %q, %q", got[0].Msg, got[1].Msg)
+ }
+}
+
+// The systemd family is unchanged: its ExecStart is the unit's first
+// command, so a second connection in the same invocation (an ExecStop's,
+// or anything else) is still closed unread.
+func TestSystemdRunLogListenerStillRefusesASecondConnection(t *testing.T) {
+ t.Parallel()
+ b, _ := newRootfsBackend(t)
+ b.SandboxEffective = execsandbox.EffectiveSystemd
+ rt := rootfsRoute(b)
+ rt.Runtime = ""
+ _, ctl, logs, _, _, err := b.prepareKeyedAt(rt, instancectl.RoleRun, rt.Socket, 0, nil)
+ if err != nil {
+ t.Fatalf("prepareKeyedAt: %v", err)
+ }
+ if ctl != nil {
+ t.Cleanup(func() { ctl.Close() })
+ }
+ t.Cleanup(func() { logs.Close() })
+ sock := b.logSocketFor(rt.Host, instancectl.RoleRun, 0)
+ first, err := net.Dial("unix", sock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer first.Close()
+ second, err := net.Dial("unix", sock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer second.Close()
+ second.SetReadDeadline(time.Now().Add(2 * time.Second))
+ if _, err := second.Read(make([]byte, 1)); err == nil || isTimeout(err) {
+ t.Fatalf("second connection was not closed unread (read: %v)", err)
+ }
+}
+
+// listenLogsEach still bounds an invocation's connections.
+func TestLogListenerEachRefusesPastItsBound(t *testing.T) {
+ t.Parallel()
+ dir, err := os.MkdirTemp("", "ll")
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { os.RemoveAll(dir) })
+ path := filepath.Join(dir, "h.run.sock")
+ l, err := listenLogsEach(path, nil)
+ if err != nil {
+ t.Skipf("cannot bind here (%v); run with TMPDIR=/tmp/g outside the sandbox", err)
+ }
+ defer l.Close()
+ var conns []net.Conn
+ defer func() {
+ for _, c := range conns {
+ c.Close()
+ }
+ }()
+ for i := 0; i < logEachMax; i++ {
+ c, err := net.Dial("unix", path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ conns = append(conns, c)
+ }
+ extra, err := net.Dial("unix", path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer extra.Close()
+ extra.SetReadDeadline(time.Now().Add(2 * time.Second))
+ if _, err := extra.Read(make([]byte, 1)); err == nil || isTimeout(err) {
+ t.Fatalf("connection %d past the bound was not closed (read: %v)", logEachMax+1, err)
+ }
+ // The bounded ones stay open until Close.
+ conns[logEachMax-1].SetReadDeadline(time.Now().Add(100 * time.Millisecond))
+ if _, err := conns[logEachMax-1].Read(make([]byte, 1)); !isTimeout(err) {
+ t.Fatalf("connection %d inside the bound was closed (read: %v)", logEachMax, err)
+ }
+}
+
+func isTimeout(err error) bool {
+ ne, ok := err.(net.Error)
+ return ok && ne.Timeout()
+}
+
+// Admission stops at its limit and stays stopped: a refused connection
+// never moves the count, so no number of connections can wrap it back
+// under the limit (Astra census review of gvisor-empty-execstart, P2: an
+// int32 counted every connection and turned negative after 2^31).
+func TestLogListenerAdmissionStaysExhausted(t *testing.T) {
+ t.Parallel()
+ for _, tc := range []struct {
+ name string
+ each bool
+ limit int
+ }{{"listenLogs", false, 1}, {"listenLogsEach", true, logEachMax}} {
+ l := &logListener{each: tc.each}
+ for i := 0; i < tc.limit; i++ {
+ if !l.admit() {
+ t.Fatalf("%s: connection %d refused, want admitted up to %d", tc.name, i+1, tc.limit)
+ }
+ }
+ for i := 0; i < 1_000_000; i++ {
+ if l.admit() {
+ t.Fatalf("%s: connection %d admitted after the limit %d", tc.name, tc.limit+i+1, tc.limit)
+ }
+ }
+ if l.admitted != tc.limit {
+ t.Fatalf("%s: admitted = %d after refusals, want it held at %d", tc.name, l.admitted, tc.limit)
+ }
+ }
+}
diff --git a/internal/activator/loglistener.go b/internal/activator/loglistener.go
index 5d9bc6543..910025847 100644
--- a/internal/activator/loglistener.go
+++ b/internal/activator/loglistener.go
@@ -12,32 +12,70 @@ import (
)
// logListener is the agent's end of a unit's stdout (design §6.4): the
-// unit's StandardOutput=file: connects to this AF_UNIX socket once, at
-// exec, and every line is teed to the agent's own stdout (journald) and to
-// the app log sink, exactly as teeStd does for an exec child. One
-// connection per listener is accepted; a second is closed unread. The
-// accepted flag never resets by design: a listener belongs to one
-// invocation, and a re-exec of the unit gets a fresh listener from
-// prepare. EOF ends log collection and nothing else: it is never a sign
-// the process is gone (codex R1-4).
+// unit's StandardOutput=file: connects to this AF_UNIX socket, and every
+// line is teed to the agent's own stdout (journald) and to the app log
+// sink, exactly as teeStd does for an exec child.
+//
+// systemd opens StandardOutput=file: afresh for EVERY command of the unit,
+// so each ExecStartPre, ExecStart, ExecStop and ExecStopPost connects on
+// its own. A unit whose ExecStart is its first command (every systemd
+// family template) needs one connection: the first is the main process's,
+// and any later one is closed unread. The accepted flag never resets by
+// design: a listener belongs to one invocation, and a re-exec of the unit
+// gets a fresh listener from prepare.
+//
+// The gVisor run unit is different: its ExecStartPre (runsc delete -force)
+// connects first and exits, so the one-connection rule handed that
+// connection the tee and closed runsc run's unread. The guest app's first
+// write to stdout or stderr then failed with EPIPE and SIGPIPE killed it,
+// a clean exit to systemd (SuccessExitStatus 141), so a Rastrillo app that
+// logs "rastrillo: serving" right after it binds its socket died before it
+// answered one request. listenLogsEach is that unit's listener: it tees
+// every connection of the invocation, up to logEachMax.
+//
+// EOF ends a connection's log collection and nothing else: it is never a
+// sign the process is gone (codex R1-4).
type logListener struct {
- ln net.Listener
- emit func(string)
- accepted atomic.Bool
+ ln net.Listener
+ emit func(string)
+ each bool // tee every connection, up to logEachMax (listenLogsEach)
+ // admitted counts the connections given a tee. Only the accept loop
+ // touches it, and it grows only on admission, so it stops at the limit
+ // and a refused connection can never wrap it back under (Astra census
+ // review of gvisor-empty-execstart, P2).
+ admitted int
closed atomic.Bool
- // conn is the one accepted connection, kept so Close can shut it and
- // unblock the tee; wg covers the accept loop and the tee.
- mu sync.Mutex
- conn net.Conn
- wg sync.WaitGroup
+ // conns are the accepted connections, kept so Close can shut them and
+ // unblock their tees; wg covers the accept loop and the tees.
+ mu sync.Mutex
+ conns []net.Conn
+ wg sync.WaitGroup
}
+// logEachMax bounds the connections listenLogsEach tees for one invocation.
+// The gVisor run unit makes at most five (ExecStartPre, ExecStart, ExecStop
+// and two ExecStopPost); the rest of the bound is slack, not a budget.
+const logEachMax = 8
+
+// listenLogs is the listener for a unit whose ExecStart is its first
+// command: it tees the first connection and closes any later one unread.
func listenLogs(path string, emit func(string)) (*logListener, error) {
+ return listenLogsMode(path, emit, false)
+}
+
+// listenLogsEach is the listener for a unit with a command before its
+// ExecStart (the gVisor run unit's ExecStartPre): it tees every connection
+// of the invocation, so the main process's is never the one refused.
+func listenLogsEach(path string, emit func(string)) (*logListener, error) {
+ return listenLogsMode(path, emit, true)
+}
+
+func listenLogsMode(path string, emit func(string), each bool) (*logListener, error) {
ln, err := edge.SecureUnixListen(path)
if err != nil {
return nil, err
}
- l := &logListener{ln: ln, emit: emit}
+ l := &logListener{ln: ln, emit: emit, each: each}
l.wg.Add(1)
go l.accept()
return l, nil
@@ -50,7 +88,7 @@ func (l *logListener) accept() {
if err != nil {
return
}
- if l.accepted.Swap(true) {
+ if !l.admit() {
c.Close()
continue
}
@@ -61,13 +99,29 @@ func (l *logListener) accept() {
c.Close()
continue
}
- l.conn = c
+ l.conns = append(l.conns, c)
l.wg.Add(1)
l.mu.Unlock()
go l.tee(c)
}
}
+// admit reports whether the next connection gets a tee: the first only for
+// listenLogs, up to logEachMax for listenLogsEach. Once the limit is reached
+// every later call refuses, however many connections arrive. Called only
+// from the accept loop.
+func (l *logListener) admit() bool {
+ limit := 1
+ if l.each {
+ limit = logEachMax
+ }
+ if l.admitted >= limit {
+ return false
+ }
+ l.admitted++
+ return true
+}
+
func (l *logListener) tee(c net.Conn) {
defer l.wg.Done()
defer c.Close()
@@ -84,8 +138,8 @@ func (l *logListener) tee(c net.Conn) {
// state, and this method exists so a caller cannot mistake it for one.
func (l *logListener) Exited() bool { return false }
-// Close stops accepting, shuts the accepted connection so a blocked tee
-// returns, and waits for both goroutines. Nothing spawned by the listener
+// Close stops accepting, shuts the accepted connections so blocked tees
+// return, and waits for every goroutine. Nothing spawned by the listener
// outlives Close: the process it belonged to is gone or being replaced,
// and a late line must not reach the sink under the old invocation.
func (l *logListener) Close() error {
@@ -94,8 +148,8 @@ func (l *logListener) Close() error {
}
err := l.ln.Close()
l.mu.Lock()
- if l.conn != nil {
- l.conn.Close()
+ for _, c := range l.conns {
+ c.Close()
}
l.mu.Unlock()
l.wg.Wait()
diff --git a/internal/activator/prepare.go b/internal/activator/prepare.go
index 56ed54d64..07e86baa5 100644
--- a/internal/activator/prepare.go
+++ b/internal/activator/prepare.go
@@ -18,6 +18,7 @@ import (
"time"
"github.com/carlosframework/platform/internal/edge"
+ "github.com/carlosframework/platform/internal/execsandbox"
"github.com/carlosframework/platform/internal/instancectl"
"github.com/carlosframework/platform/internal/instancefs"
"github.com/carlosframework/platform/internal/instancekey"
@@ -188,7 +189,14 @@ func (b *ExecBackend) prepareKeyedAt(rt registry.Route, role instancectl.Role, s
if rt.Rootfs() && role == instancectl.RoleRun {
process = release.ProcessWeb
}
- logs, err = listenLogs(b.logSocketFor(rt.Host, role, gen), b.logEmitter(rt, process))
+ listen := listenLogs
+ if b.SandboxEffective == execsandbox.EffectiveGVisor && role == instancectl.RoleRun {
+ // The gVisor run unit's ExecStartPre connects before its
+ // ExecStart does (logListener): tee every connection, or the
+ // guest's stdout is a closed socket.
+ listen = listenLogsEach
+ }
+ logs, err = listen(b.logSocketFor(rt.Host, role, gen), b.logEmitter(rt, process))
if err != nil {
if ctl != nil {
ctl.Close()
diff --git a/internal/instancectl/gvisor_execstart_test.go b/internal/instancectl/gvisor_execstart_test.go
new file mode 100644
index 000000000..021b2f55c
--- /dev/null
+++ b/internal/instancectl/gvisor_execstart_test.go
@@ -0,0 +1,49 @@
+package instancectl
+
+import (
+ "runtime"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/execsandbox"
+)
+
+// The installed carlos-instance-gvisor@.service and the probe unit carry an
+// empty ExecStart= by design: root supplies the command in a per-instance
+// drop-in (gvisorDropIn), and systemd refuses ("Service has no
+// ExecStart=") whenever that drop-in is absent, as it is after a stop.
+// This guards the other half: whatever the host, the drop-in resets
+// ExecStart and then sets exactly one non-empty runsc command, so the
+// merged unit always has something to run. assertGVisorUnit checks the
+// same thing on the box, through systemctl, before every start.
+func TestGVisorDropInAlwaysSetsOneNonEmptyExecStart(t *testing.T) {
+ pin, err := execsandbox.RunscFor(runtime.GOOS + "-" + runtime.GOARCH)
+ if err != nil {
+ t.Fatal(err)
+ }
+ long := strings.Repeat("a", 50) + ".example.com" // a hashed instance ID (#854)
+ for _, tc := range []struct {
+ host string
+ role Role
+ }{{"demo.example", RoleRun}, {long, RoleRun}, {ProbeDirName, roleProbe}} {
+ source, err := gvisorDropIn(pin, tc.host, tc.role)
+ if err != nil {
+ t.Fatalf("%s %s: %v", tc.host, tc.role, err)
+ }
+ var starts []string
+ for _, line := range strings.Split(source, "\n") {
+ value, ok := strings.CutPrefix(line, "ExecStart=")
+ if !ok {
+ continue
+ }
+ if value == "" {
+ starts = nil // a reset, as systemd reads it
+ continue
+ }
+ starts = append(starts, value)
+ }
+ if len(starts) != 1 || !strings.HasPrefix(starts[0], execsandbox.RunscPath(pin)+" ") || !strings.Contains(starts[0], " run --bundle ") {
+ t.Fatalf("%s %s: merged ExecStart = %q, want one runsc run command\n%s", tc.host, tc.role, starts, source)
+ }
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 4784a2296..3d7780b7c 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -174,3 +174,4 @@ plan14-root-reads-group-observation-carry.tsv 587f6e92c5e594b9bb6436a2d006684945
plan14-root-reads-activator-settle-wait.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369
plan14-root-reads-lease-checkpoint-no-compaction.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369
plan14-root-reads-member-backups-1.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369
+plan14-root-reads-gvisor-empty-execstart.tsv 44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f
diff --git a/internal/provision/testdata/plan14-root-reads-gvisor-empty-execstart.tsv b/internal/provision/testdata/plan14-root-reads-gvisor-empty-execstart.tsv
new file mode 100644
index 000000000..8deeafd30
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-gvisor-empty-execstart.tsv
@@ -0,0 +1,5 @@
+# Census overlay gvisor-empty-execstart, written by census-propose (#369). census-ruling-gvisor-empty-execstart, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-gvisor-empty-execstart.md.
+# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 84cd5fce6e3086c742e0a11047129b1a0d671f4b58b62c58a5290ec3b56bf7f3 internal/activator/prepare.go ExecBackend.prepareKeyedAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling zddr4, with no further change from this branch beyond carrying main's new early return into the six-value signature. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen prepareAt, which is now its wrapper; it also returns the instance key's layer and reads no env for the cmd role; same reads, same nested launch paths;rev3=census-ruling-wake-latency-2;basis=takes an optional timer and marks its steps with time.Now() (dirs, admin token, instance key, env, control socket, key gate, logs); no read added or moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, run and seed roles only, under a 30 s context (haSecretsBudget): the token producer is ensureAdminTokenFor(hctx, rt, p) (on this nested path the same beneath producer, EnsureAdminTokenBeneath's, plus the HA mint decision inside it); ensureInstanceKeyFor now gets hctx instead of context.Background(), so the key's bucket read is bounded by 30 s as well as configReadTimeout; the env is launchEnvLayer(hctx, rt) (instanceEnvLayer for a non-HA host; for an HA host one capture, published and acknowledged); a test seam (haLaunchHooks.afterGate, nil in production) is called before the producers. The separate haMintGate and haSecretsReady calls are gone (final fix F2). Sites against main: -registry:Host (the rt.Host+".env" argument EnsureAdminTokenBeneath took) and +whole:Route (rt to launchEnvLayer); the cmd role and a non-HA host are unchanged;rev3=census-ruling-rootfs-fleet-followups;basis=names the process for the role log listener: release.ProcessWeb when rt.Rootfs() and the role is run, else none, passed to logEmitter; reads rt.Runtime through Rootfs(); no file, path or env read added or moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty;rev3=census-ruling-region-ha-p1b3b-s;basis=Native sidecar run units use the existing nested secrets preparation and acknowledged sealed publication, but bind no app control listener. Existing run and seed reads unchanged.;rev3=census-ruling-gvisor-empty-execstart;basis=on a gVisor box (b.SandboxEffective == execsandbox.EffectiveGVisor, set by Configure at agent startup) the run role's log listener is listenLogsEach, which tees every connection of the invocation (bounded at 8) instead of only the first: the gVisor run unit's ExecStartPre=-runsc delete connects to the same StandardOutput=file: socket before ExecStart, so the one-connection listener refused the main runsc run's connection and the guest died of SIGPIPE on its first log write. Same socket path, same agent-owned listener, same emitter; no file, path or env read added or moved; the systemd family keeps listenLogs file:ReadDir@2965,registry:Host@1783,registry:Host@1995,registry:Host@612,registry:Host@6210,registry:Host@6408,whole:Route@1674,whole:Route@1885,whole:Route@2116,whole:Route@320,whole:Route@4697,whole:Route@5246,whole:Route@6244 3e03d8a191021a908b5bbbd8c65ab4d673ccd487239f9fe1700c974783a5e188
+internal/activator/prepare.go ExecBackend.prepareKeyedAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling zddr4, with no further change from this branch beyond carrying main's new early return into the six-value signature. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen prepareAt, which is now its wrapper; it also returns the instance key's layer and reads no env for the cmd role; same reads, same nested launch paths;rev3=census-ruling-wake-latency-2;basis=takes an optional timer and marks its steps with time.Now() (dirs, admin token, instance key, env, control socket, key gate, logs); no read added or moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, run and seed roles only, under a 30 s context (haSecretsBudget): the token producer is ensureAdminTokenFor(hctx, rt, p) (on this nested path the same beneath producer, EnsureAdminTokenBeneath's, plus the HA mint decision inside it); ensureInstanceKeyFor now gets hctx instead of context.Background(), so the key's bucket read is bounded by 30 s as well as configReadTimeout; the env is launchEnvLayer(hctx, rt) (instanceEnvLayer for a non-HA host; for an HA host one capture, published and acknowledged); a test seam (haLaunchHooks.afterGate, nil in production) is called before the producers. The separate haMintGate and haSecretsReady calls are gone (final fix F2). Sites against main: -registry:Host (the rt.Host+".env" argument EnsureAdminTokenBeneath took) and +whole:Route (rt to launchEnvLayer); the cmd role and a non-HA host are unchanged;rev3=census-ruling-rootfs-fleet-followups;basis=names the process for the role log listener: release.ProcessWeb when rt.Rootfs() and the role is run, else none, passed to logEmitter; reads rt.Runtime through Rootfs(); no file, path or env read added or moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty;rev3=census-ruling-region-ha-p1b3b-s;basis=Native sidecar run units use the existing nested secrets preparation and acknowledged sealed publication, but bind no app control listener. Existing run and seed reads unchanged.;rev3=census-ruling-gvisor-empty-execstart;basis=on a gVisor box (b.SandboxEffective == execsandbox.EffectiveGVisor, set by Configure at agent startup) the run role's log listener is listenLogsEach, which tees every connection of the invocation (bounded at 8) instead of only the first: the gVisor run unit's ExecStartPre=-runsc delete connects to the same StandardOutput=file: socket before ExecStart, so the one-connection listener refused the main runsc run's connection and the guest died of SIGPIPE on its first log write. Same socket path, same agent-owned listener, same emitter; no file, path or env read added or moved; the systemd family keeps listenLogs file:ReadDir@2965,registry:Host@1783,registry:Host@1995,registry:Host@612,registry:Host@6210,registry:Host@6408,whole:Route@1674,whole:Route@1885,whole:Route@2116,whole:Route@320,whole:Route@4697,whole:Route@5246,whole:Route@6244 3e03d8a191021a908b5bbbd8c65ab4d673ccd487239f9fe1700c974783a5e188
+@coverage internal/activator 42c9b9c52ad6a36fc806a2a2ff35925cf404668c9c4d33d8f6145b4452e14f00