carlos / platform Public

gvisor demos: final review round 2 fixes

Keep native Ready and stop behavior aligned with main while retaining gVisor termination proofs for handles and retained instance files. Apply the approved exit suffix, add the rollback draft, and refresh the census.
Co-Authored-By: Astra (gpt-6-astra) via codex
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f19f91d0513781ef0b5edf0c8d3b41ff35f14f52 parent 35211f5
11 files changed, +329 −28
  • docs/superpowers/notes/census-proposal-gvisor-demos.md +11 −3
  • docs/superpowers/runbooks/gvisor-demos.md +2 −0
  • internal/activator/execsandboxstatus_test.go +1 −1
  • internal/activator/sandbox_test.go +57 −0
  • internal/activator/unitproc.go +9 −6
  • internal/instancectl/gvisor_r2_test.go +172 −0
  • internal/instancectl/sandboxstop.go +24 −0
  • internal/instancectl/sandboxstop_test.go +5 −1
  • internal/instancectl/server.go +40 −11
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv +7 −5

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-gvisor-demos.md b/docs/superpowers/notes/census-proposal-gvisor-demos.md
index ca952861d..63e0e2607 100644
--- a/docs/superpowers/notes/census-proposal-gvisor-demos.md
+++ b/docs/superpowers/notes/census-proposal-gvisor-demos.md
@@ -1,6 +1,6 @@
# Census approval: gvisor-demos
-Ruling `census-ruling-gvisor-demos`. The independent reviewer approves or rejects every change below, 61 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-gvisor-demos`. The independent reviewer approves or rejects every change below, 62 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -8,7 +8,7 @@ Ruling `census-ruling-gvisor-demos`. The independent reviewer approves or reject
| `internal/activator/sidecar_ha.go` `ExecBackend.startHAWorker` | body | unchanged (13) | Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. |
| `internal/activator/size.go` `Service.SizeState` | body | unchanged (2) | Task 8: copy actual Unit and parsed execsandbox.Family from the retained process handle under the existing Service lock. No box-mode inference or added external read; logical Want unchanged. |
| `internal/activator/unitproc.go` `ExecBackend.newUnitProc` | body | unchanged (1) | Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. |
-| `internal/activator/unitproc.go` `unitProc.Stop` | body | unchanged (2) | Task 5 fix round 2: keep original-run owner stop proof failure latched until a successful plain fenced stop, in the owner Stop path. The foreign-invocation observer again completes from main's existing cgroup evidence after its plain stop attempt. Same control channel and retained unit kind; no new read. |
+| `internal/activator/unitproc.go` `unitProc.Stop` | body | unchanged (2) | Final R2 N2a: restrict exited gen-0 re-stop and stopUnproven/ErrStillRunning failure latch to retained gVisor mode or gVisor backend mode. Native handles use main 9622c65a behavior: no re-stop after observed exit, log failed stop and wait for done. Existing control channel; no new read. |
| `internal/demobuild/purge.go` `Worker.PurgeDemo` | body | unchanged (3) | Task 7: derive the selected build family for existing authenticated job retirement; cleanup proves both named families before any shared mount or bundle removal. Existing marker and scratch reads unchanged. |
| `internal/demobuild/runner.go` `Run` | body | unchanged (1) | Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained. |
| `internal/demobuild/security_linux.go` `verifyWorkMount` | body | unchanged (1) | Task 9: Add observed filesystem type/capacity and expected cap to root diagnostic; same checks and reads. |
@@ -215,6 +215,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/instancectl/sandbox.go:Server.sandboxHTTP`: reads +file:Query; written legacy, accepted-legacy, frozen
- new `internal/instancectl/sandbox.go:Server.unitFamily`: reads +registry:Runtime, +whole:Route ×3; written legacy, accepted-legacy, frozen
- new `internal/instancectl/sandboxstop.go:Server.proveRunGone`: reads +file:ReadFile; written legacy, accepted-legacy, frozen
+- new `internal/instancectl/sandboxstop.go:Server.sandboxRunFilesPresent`: reads +file:Lstat; written legacy, accepted-legacy, frozen
- new `internal/instanceexec/probe_gvisor.go:checkGVisorFacts`: reads +file:Openat2; written legacy, accepted-legacy, frozen
- new `internal/instanceexec/probe_gvisor.go:type gvisorProbeFacts`: reads +file:Openat2; written legacy, accepted-legacy, frozen
- new `internal/instanceexec/probe_gvisor_linux.go:runGVisorProbeChecks`: reads +data-literal, +file:Lstat, +file:Openat2, +file:ReadFile ×3; written legacy, accepted-legacy, frozen
@@ -224,7 +225,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/activator/cmdunit.go:cmdUnit.StopAndSettle`: +registry:Runtime ×2, +whole:Route ×2; keeps legacy, task accepted-legacy
- reads `internal/activator/unitproc.go:unitProc.stopUnit`: +registry:Runtime ×2, +whole:Route; keeps legacy, task accepted-legacy
-Seal: `ba2d479f7176757f8c8a4e251c498854a2ae092509ff77d9786f79d10c503c19` → `e2b56aa6a54b7e83d181b54e95aa13285e588a3785c43034762259f5d3736515`.
+Seal: `ba2d479f7176757f8c8a4e251c498854a2ae092509ff77d9786f79d10c503c19` → `705ec95359b3386a9f204a0546b71d3d8fa9b04ac8573e48443399413260c2fb`.
Overlay: `internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
@@ -265,6 +266,13 @@ read-census change. Reproduce this section after regenerating the card.
- `internal/host/execsandboxfloor.go:sandboxEnvironmentProblem`, wired by `wireSandboxReadiness` through `SandboxSettings.Environment`, calls the existing no-follow bounded host.env reader inside root Ready. The agent cannot read the 0600 file and only projects root's returned reason. No update/recovery check is relaxed and runtime selection is unchanged.
- The root status heading, missing instance observation and activator exit suffix use the delegated Luna text verbatim. No exit status or observed unit-family semantics change.
+Final review R2 fixes (no new whole-branch review round):
+
+- `Server.Ready` keeps a host.env problem in the exec-sandbox status, including `Blocked` and sandbox `Ready=false`, but preserves the overall native readiness verdict. Effective gVisor still refuses. The mode remains the one captured from the process environment; the update/recovery floor is unchanged.
+- `unitProc.Stop` re-stops an exited original run and latches proof failure only for a retained gVisor handle or gVisor backend. Native handles again skip stop after observed exit and wait for observer completion after a failed control request, as on main 9622c65a. No new control call or file read.
+- `Server.handleStop` checks only this validated host's fixed bundle/skeleton leaves under its existing start fence. Effective systemd with neither leaf takes main's single-stop path, including join failure and stop error handling; retained state keeps the existing both-family proof and removal. The new `Server.sandboxRunFilesPresent` Lstat reads are listed in the generated card. Unexpected leaf types retain the proof requirement; lookup errors refuse.
+- `unitProc.exitLine` appends exactly ` (exit status via gVisor)` with one leading space; the exact equality test covers both known and unknown exit records. The stale DRAFT comment is removed.
+
## Merge integration
Main's native `ExecStop=-+/opt/carlos/carlos instance-stop $MAINPID` and `TimeoutStopFailureMode=kill` are retained byte for byte; all gVisor templates are unchanged from d60dd8ac. The record-write inventory composes on main's consoleSecretsWriteCensusInventory and re-pins main.main with both the instance-stop dispatch and the existing gVisor marker. The gVisor overlay follows all four new main overlays.
diff --git a/docs/superpowers/runbooks/gvisor-demos.md b/docs/superpowers/runbooks/gvisor-demos.md
index b28066f35..467a42467 100644
--- a/docs/superpowers/runbooks/gvisor-demos.md
+++ b/docs/superpowers/runbooks/gvisor-demos.md
@@ -99,6 +99,8 @@ replace a missing member-facing command with an unrecorded box operation.
## Roll back
+On a systemd box, leftover gVisor files for an instance make the readiness sweep stop that instance's native unit, so clear them after switching a box back to systemd.
+
Set `CARLOS_EXEC_SANDBOX=systemd` in root-owned `/etc/carlos/host.env`, then restart control and the agent. Drain the gVisor run family and prove its processes are gone. Verify that the box and instance status report Ready and systemd before rolling back below the minimum release that supports exec-sandbox, if an older release is needed. Do not roll an
unaware binary onto a box that still has gvisor configured.
diff --git a/internal/activator/execsandboxstatus_test.go b/internal/activator/execsandboxstatus_test.go
index 765ea7d13..a0dd74b18 100644
--- a/internal/activator/execsandboxstatus_test.go
+++ b/internal/activator/execsandboxstatus_test.go
@@ -40,7 +40,7 @@ func TestGVisorExitAttribution(t *testing.T) {
}
for _, ok := range []bool{true, false} {
line := p.exitLine(rec, ok)
- if !strings.HasSuffix(line, " (gVisor reported the exit; source not identified)") || strings.Contains(line, "app exited") || strings.Contains(line, "runtime exited") {
+ if line != exitLine(rec, ok)+" (exit status via gVisor)" || strings.Contains(line, "app exited") || strings.Contains(line, "runtime exited") {
t.Fatalf("exit attribution: %q", line)
}
}
diff --git a/internal/activator/sandbox_test.go b/internal/activator/sandbox_test.go
index 47ba4c4ed..acef25425 100644
--- a/internal/activator/sandbox_test.go
+++ b/internal/activator/sandbox_test.go
@@ -343,3 +343,60 @@ func TestGVisorSwapUsesOriginalRun(t *testing.T) {
t.Fatal(err)
}
}
+
+type unreachableStopControl struct {
+ *fakeControl
+ onFailure func()
+}
+
+func (c *unreachableStopControl) Stop(ctx context.Context, host string, role instancectl.Role) error {
+ err := c.fakeControl.Stop(ctx, host, role)
+ if c.onFailure != nil {
+ c.onFailure()
+ }
+ return err
+}
+
+func TestUnitProcStopUnreachableControlByFamily(t *testing.T) {
+ for _, family := range []string{"native", "handle-gvisor", "backend-gvisor"} {
+ for _, exited := range []bool{false, true} {
+ t.Run(fmt.Sprintf("%s/exited=%v", family, exited), func(t *testing.T) {
+ ctl := &unreachableStopControl{fakeControl: &fakeControl{stopErr: errors.New("control unreachable")}}
+ b := &ExecBackend{Control: ctl}
+ p := &unitProc{b: b, rt: registry.Route{Host: "demo.example"}, role: instancectl.RoleRun, done: make(chan struct{})}
+ if family == "handle-gvisor" {
+ p.sandbox = execsandbox.EffectiveGVisor
+ }
+ if family == "backend-gvisor" {
+ b.SandboxEffective = execsandbox.EffectiveGVisor
+ }
+ p.exited.Store(exited)
+ if exited {
+ close(p.done)
+ } else {
+ // The observer sees exit while control is unreachable. Native
+ // Stop must still wait for done after its failed request.
+ ctl.onFailure = func() { p.exited.Store(true); close(p.done) }
+ }
+ err := p.Stop(context.Background())
+ if family == "native" {
+ if err != nil || p.stopUnproven.Load() {
+ t.Fatalf("native Stop=%v unproven=%v", err, p.stopUnproven.Load())
+ }
+ want := 1
+ if exited {
+ want = 0
+ }
+ if len(ctl.calls) != want {
+ t.Fatalf("calls=%v want %d", ctl.calls, want)
+ }
+ if !p.Exited() {
+ t.Fatal("native observed exit changed")
+ }
+ } else if !errors.Is(err, ErrStillRunning) || p.Exited() || len(ctl.calls) != 1 {
+ t.Fatalf("gvisor Stop=%v exited=%v calls=%v", err, p.Exited(), ctl.calls)
+ }
+ })
+ }
+ }
+}
diff --git a/internal/activator/unitproc.go b/internal/activator/unitproc.go
index 91fd64667..a07b00ff1 100644
--- a/internal/activator/unitproc.go
+++ b/internal/activator/unitproc.go
@@ -260,23 +260,27 @@ func (p *unitProc) Exited() bool { return p.exited.Load() && !p.stopUnproven.Loa
// after that, preserving childProc's ordering (signal first, close the
// listener after the process is gone).
func (p *unitProc) Stop(ctx context.Context) error {
- if !p.Exited() || p.role == instancectl.RoleRun && p.gen == 0 {
+ // Only gVisor handles need root's both-family proof after the observer
+ // has seen exit. Native handles keep main's wait-after-stop-error path.
+ gvisorRun := p.role == instancectl.RoleRun && p.gen == 0 &&
+ (p.sandbox == execsandbox.EffectiveGVisor || p.b != nil && p.b.SandboxEffective == execsandbox.EffectiveGVisor)
+ if !p.Exited() || gvisorRun {
// Set before the Control.Stop call, not after: observe polls
// concurrently, and a stop it cannot yet see as "requested" would
// still fire its own foreign-invocation stop for the same unit.
- if p.role == instancectl.RoleRun && p.gen == 0 {
+ if gvisorRun {
p.stopUnproven.Store(true)
}
p.stopRequested.Store(true)
sctx, cancel := context.WithTimeout(ctx, instancectl.DeadlineControl)
err := p.stopUnit(sctx)
cancel()
- if err == nil && p.role == instancectl.RoleRun && p.gen == 0 {
+ if err == nil && gvisorRun {
p.stopUnproven.Store(false)
}
if err != nil {
log.Printf("activator: stop %s %s: %v", p.rt.Host, p.role, err)
- if p.role == instancectl.RoleRun && p.gen == 0 {
+ if gvisorRun {
return fmt.Errorf("%w: %v", ErrStillRunning, err)
}
}
@@ -540,8 +544,7 @@ func (b *ExecBackend) observe(p *unitProc) {
func (p *unitProc) exitLine(rec instancectl.ExitRecord, ok bool) string {
line := exitLine(rec, ok)
if _, family := p.UnitIdentity(); family == execsandbox.FamilyGVisor {
- // DRAFT: Paul reviews this wording before merge.
- line += " (gVisor reported the exit; source not identified)"
+ line += " (exit status via gVisor)"
}
return line
}
diff --git a/internal/instancectl/gvisor_r2_test.go b/internal/instancectl/gvisor_r2_test.go
new file mode 100644
index 000000000..1544630cc
--- /dev/null
+++ b/internal/instancectl/gvisor_r2_test.go
@@ -0,0 +1,172 @@
+package instancectl
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/execsandbox"
+)
+
+func TestReadyHostEnvironmentProblemByMode(t *testing.T) {
+ for _, mode := range []execsandbox.Effective{execsandbox.EffectiveSystemd, execsandbox.EffectiveGVisor} {
+ t.Run(string(mode), func(t *testing.T) {
+ s, _ := gvisorStartFixture(t)
+ s.SandboxEffective = mode
+ s.SandboxEnvironment = func() error { return errors.New("EXEC-SANDBOX-CONFIG: /etc/carlos/host.env: unreadable") }
+ calls := 0
+ s.Systemctl = func(context.Context, ...string) (string, error) {
+ calls++
+ return "", errors.New("must not query systemd")
+ }
+ for _, probeReady := range []bool{true, false} {
+ s.report.Ready = probeReady
+ rep, ready := s.Ready()
+ want := mode == execsandbox.EffectiveSystemd && probeReady
+ if ready != want || rep.Ready != want {
+ t.Fatalf("ready=%v report=%+v want=%v", ready, rep, want)
+ }
+ if rep.ExecSandbox == nil || rep.ExecSandbox.Ready || !strings.Contains(rep.ExecSandbox.Blocked, "/etc/carlos/host.env") {
+ t.Fatalf("missing environment diagnostic: %+v", rep.ExecSandbox)
+ }
+ status := http.StatusServiceUnavailable
+ if ready {
+ status = http.StatusOK
+ }
+ client := sandboxReportClient(t, status, rep, mode)
+ if err := client.Ready(t.Context()); (err == nil) != want {
+ t.Fatalf("agent Ready=%v want=%v", err, want)
+ }
+ state, _ := client.SandboxStatus(t.Context())
+ if state.Blocked != rep.ExecSandbox.Blocked || state.Ready {
+ t.Fatalf("agent lost diagnostic: %+v", state)
+ }
+ }
+ if calls != 0 {
+ t.Fatalf("systemctl calls=%d", calls)
+ }
+ })
+ }
+}
+
+func TestNativeStopGVisorFilesGate(t *testing.T) {
+ for _, state := range []string{"absent", "empty parents", "other host", "bundle", "skeleton", "symlink", "unreadable"} {
+ for _, failProof := range []bool{false, true} {
+ t.Run(state+map[bool]string{false: "/clean", true: "/proof-fails"}[failProof], func(t *testing.T) {
+ s, calls := sandboxStopServer(t)
+ root := t.TempDir()
+ s.sandboxBundleRoot, s.sandboxRootfsRoot = filepath.Join(root, "bundles"), filepath.Join(root, "skeletons")
+ for _, dir := range []string{s.sandboxBundleRoot, s.sandboxRootfsRoot} {
+ if state != "absent" {
+ if err := os.Mkdir(dir, 0700); err != nil {
+ t.Fatal(err)
+ }
+ }
+ }
+ switch state {
+ case "bundle", "skeleton", "other host":
+ dir, id := s.sandboxBundleRoot, "run-demo.example"
+ if state == "skeleton" {
+ dir = s.sandboxRootfsRoot
+ }
+ if state == "other host" {
+ id = "run-other.example"
+ }
+ if err := os.Mkdir(filepath.Join(dir, id), 0700); err != nil {
+ t.Fatal(err)
+ }
+ case "symlink":
+ if err := os.Symlink("missing", filepath.Join(s.sandboxBundleRoot, "run-demo.example")); err != nil {
+ t.Fatal(err)
+ }
+ case "unreadable":
+ s.sandboxBundleRoot = filepath.Join(root, "file")
+ if err := os.WriteFile(s.sandboxBundleRoot, nil, 0600); err != nil {
+ t.Fatal(err)
+ }
+ }
+ removed := false
+ s.removeSandbox = func(string) error {
+ if s.legacyStopping["demo.example"] == 0 {
+ t.Error("cleanup outside fence")
+ }
+ removed = true
+ return nil
+ }
+ base := s.Systemctl
+ s.Systemctl = func(ctx context.Context, args ...string) (string, error) {
+ if s.legacyStopping["demo.example"] == 0 {
+ t.Error("stop outside fence")
+ }
+ out, err := base(ctx, args...)
+ if args[0] == "show" && failProof {
+ return "", errors.New("proof unavailable")
+ }
+ return out, err
+ }
+ w := httptest.NewRecorder()
+ s.handleStop(w, httptest.NewRequest("POST", "/stop?host=demo.example&role=run", nil))
+ full := state == "bundle" || state == "skeleton" || state == "symlink"
+ want := http.StatusNoContent
+ if state == "unreadable" || full && failProof {
+ want = http.StatusBadGateway
+ }
+ if w.Code != want {
+ t.Fatalf("stop=%d %s want=%d calls=%v", w.Code, w.Body, want, *calls)
+ }
+ if full {
+ joined := strings.Join(*calls, "\n")
+ for _, unit := range []string{UnitName(RoleRun, "demo.example"), GVisorUnitName("demo.example")} {
+ if !strings.Contains(joined, "show -p "+runProofProperties+" "+unit) {
+ t.Fatalf("missing proof: %v", *calls)
+ }
+ }
+ if removed == failProof {
+ t.Fatalf("removed=%v proof failed=%v", removed, failProof)
+ }
+ } else if state != "unreadable" {
+ if len(*calls) != 1 || (*calls)[0] != "stop "+UnitName(RoleRun, "demo.example") || removed {
+ t.Fatalf("native stop diverged from main: %v removed=%v", *calls, removed)
+ }
+ }
+ })
+ }
+ }
+}
+
+func TestNativeStopFailureAndJoinTimeoutKeepMainPath(t *testing.T) {
+ for _, joinTimeout := range []bool{false, true} {
+ t.Run(map[bool]string{false: "stop failure", true: "join timeout"}[joinTimeout], func(t *testing.T) {
+ s := &Server{legacyJoin: time.Millisecond}
+ if joinTimeout {
+ _, finish, err := s.beginLegacyStart(t.Context(), "demo.example", s.nextConnSeq())
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer finish()
+ }
+ calls := 0
+ s.Systemctl = func(_ context.Context, args ...string) (string, error) {
+ calls++
+ if len(args) != 2 || args[0] != "stop" || args[1] != UnitName(RoleRun, "demo.example") {
+ t.Fatalf("extra proof: %v", args)
+ }
+ return "control unavailable", errors.New("exit status 1")
+ }
+ w := httptest.NewRecorder()
+ s.handleStop(w, httptest.NewRequest("POST", "/stop?host=demo.example&role=run", nil))
+ if w.Code != http.StatusBadGateway || calls != 1 {
+ t.Fatalf("stop=%d %s calls=%d", w.Code, w.Body, calls)
+ }
+ if !joinTimeout && w.Body.String() != "stop: control unavailable exit status 1\n" {
+ t.Fatalf("main error changed: %q", w.Body.String())
+ }
+ })
+ }
+}
diff --git a/internal/instancectl/sandboxstop.go b/internal/instancectl/sandboxstop.go
index 2d07420d1..643b6493f 100644
--- a/internal/instancectl/sandboxstop.go
+++ b/internal/instancectl/sandboxstop.go
@@ -124,3 +124,27 @@ func (s *Server) proveRunGone(ctx context.Context, host, unit string) error {
}
return nil
}
+
+// Files precede every gVisor start and are removed only after proof. Under
+// the start fence, their absence lets native /stop keep main's single stop;
+// another host's files do not require proofs for this host (R2 N2b).
+func (s *Server) sandboxRunFilesPresent(host string) (bool, error) {
+ id, err := GVisorID(host, RoleRun, 0)
+ if err != nil {
+ return false, err
+ }
+ for _, root := range []string{s.sandboxBundleRoot, s.sandboxRootfsRoot} {
+ if root == "" {
+ continue
+ }
+ if _, err := os.Lstat(filepath.Join(root, id)); errors.Is(err, os.ErrNotExist) {
+ continue
+ } else if err != nil {
+ return false, fmt.Errorf("%w: %v", errSandboxDrain, err)
+ }
+ // An unexpected leaf (including a dangling symlink) is retained state;
+ // it cannot bypass the proof and the checked removal path.
+ return true, nil
+ }
+ return false, nil
+}
diff --git a/internal/instancectl/sandboxstop_test.go b/internal/instancectl/sandboxstop_test.go
index a27ba5ed4..721459480 100644
--- a/internal/instancectl/sandboxstop_test.go
+++ b/internal/instancectl/sandboxstop_test.go
@@ -36,7 +36,11 @@ func systemd257Stopped(unit string) string {
func sandboxStopServer(t *testing.T) (*Server, *[]string) {
t.Helper()
calls := []string{}
- s := &Server{CgroupRoot: t.TempDir()}
+ s := &Server{CgroupRoot: t.TempDir(), sandboxBundleRoot: t.TempDir()}
+ // The mode-switch cases retain the run bundle created before start.
+ if err := os.Mkdir(filepath.Join(s.sandboxBundleRoot, "run-demo.example"), 0700); err != nil {
+ t.Fatal(err)
+ }
s.Systemctl = func(_ context.Context, args ...string) (string, error) {
calls = append(calls, strings.Join(args, " "))
return systemd257Stopped(args[len(args)-1]), nil
diff --git a/internal/instancectl/server.go b/internal/instancectl/server.go
index d615d3a05..d14a83b29 100644
--- a/internal/instancectl/server.go
+++ b/internal/instancectl/server.go
@@ -1183,28 +1183,49 @@ func (s *Server) handleStop(w http.ResponseWriter, r *http.Request) {
// replaces any job a joined start had submitted.
release, err := s.fenceLegacyStarts(r.Context(), req.host)
defer release()
+ bothFamilies := s.effectiveSandbox() != execsandbox.EffectiveSystemd
+ if !bothFamilies {
+ var stateErr error
+ bothFamilies, stateErr = s.sandboxRunFilesPresent(req.host)
+ if stateErr != nil {
+ http.Error(w, "stop: "+stateErr.Error(), http.StatusBadGateway)
+ return
+ }
+ }
if err != nil {
// Stopped anyway, but not proven final: a start may follow.
- s.stopRunFamiliesBestEffort(r.Context(), req.host)
- http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
- return
- }
- if err := s.stopRunFamilies(r.Context(), req.host); err != nil {
+ if bothFamilies {
+ s.stopRunFamiliesBestEffort(r.Context(), req.host)
+ } else {
+ _, _ = s.Systemctl(r.Context(), "stop", unit)
+ }
http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
return
}
- if err := s.clearLegacyClaimLaunch(r.Context(), req.host); err != nil {
- http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
+ if bothFamilies {
+ if err := s.stopRunFamilies(r.Context(), req.host); err != nil {
+ http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
+ return
+ }
+ if err := s.clearLegacyClaimLaunch(r.Context(), req.host); err != nil {
+ http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
+ return
+ }
+ w.WriteHeader(http.StatusNoContent)
return
}
- w.WriteHeader(http.StatusNoContent)
- return
}
if out, err := s.Systemctl(r.Context(), "stop", unit); err != nil {
http.Error(w, "stop: "+strings.TrimSpace(out+" "+err.Error()), http.StatusBadGateway)
return
}
+ if req.role == RoleRun {
+ if err := s.clearLegacyClaimLaunch(r.Context(), req.host); err != nil {
+ http.Error(w, "stop: "+err.Error(), http.StatusBadGateway)
+ return
+ }
+ }
if OneShot(req.role) {
_ = s.cleanCmdExe(r.Context(), req.role, req.host, false)
}
@@ -1404,10 +1425,18 @@ func (s *Server) handleReady(w http.ResponseWriter, r *http.Request) {
// rather than answering with an empty Lines (final review, plan 2, item
// 6): a caller reading /ready during startup should see why, not a report
// that looks like every check silently passed.
-func (s *Server) Ready() (ProbeReport, bool) {
+func (s *Server) Ready() (rep ProbeReport, ready bool) {
if s.SandboxEnvironment != nil {
if err := s.SandboxEnvironment(); err != nil {
- return s.withSandboxState(sandboxReport(err)), false
+ if s.effectiveSandbox() != execsandbox.EffectiveSystemd {
+ return s.withSandboxState(sandboxReport(err)), false
+ }
+ // systemd already loaded this process's environment. An on-disk
+ // problem blocks updates, but must not block native wakes (R2 N1).
+ defer func() {
+ rep.ExecSandbox.Blocked = err.Error()
+ rep.ExecSandbox.Ready = false
+ }()
}
}
ctx, cancel := context.WithTimeout(context.Background(), DeadlineReady)
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index f44689b24..8b80b1fb0 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -132,4 +132,4 @@ plan14-root-reads-instance-stop-execstop-528.tsv 75fb3eb24d0bf3a8405b929675d919e
plan14-root-reads-region-ha-shutting-down-retry.tsv 75fb3eb24d0bf3a8405b929675d919ec88f15386d43e9ff687ce138a7ed968a4
plan14-root-reads-managed-fleets-2b1.tsv d467adec3d86ae220afe98269aa226e87adba1b83e31eda214ceea0f02720a98
plan14-root-reads-design-console-secrets.tsv ba2d479f7176757f8c8a4e251c498854a2ae092509ff77d9786f79d10c503c19
-plan14-root-reads-gvisor-demos.tsv e2b56aa6a54b7e83d181b54e95aa13285e588a3785c43034762259f5d3736515
+plan14-root-reads-gvisor-demos.tsv 705ec95359b3386a9f204a0546b71d3d8fa9b04ac8573e48443399413260c2fb
diff --git a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
index 7dad1115f..57b036654 100644
--- a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
+++ b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv
@@ -1,11 +1,11 @@
# Census overlay gvisor-demos, written by census-propose (#369). census-ruling-gvisor-demos, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-gvisor-demos.md.
# 41 body, 33 sites, 11 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 61 new dispositions: 4 reads re-frozen at their disposition with the claim, 56 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
+# 62 new dispositions: 4 reads re-frozen at their disposition with the claim, 57 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
@legacy c704be8adc98ef362ac25f0ee4916e4bd6b7d636fbf3e62a068643790aadc9eb internal/activator/backend_unit.go UnitBackend.systemctl legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. file:CommandContext@332 fc3481b0f6f5410479d649b20bed2f0870bf574e67d5b00e6e47bd6262036c1b
@legacy bba784d6c5913e5483457620b8c6b0cea30cef7eaa19954b148cea75d1a944ae internal/activator/sidecar_ha.go ExecBackend.startHAWorker legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-s;basis=Require nested HA sidecar shape and closed worker identity environment; prepare and acknowledge sealed secrets before writing the existing run launch file. Start the previously verified staged executable through existing root StartExe, mark uncertain starts for stop proof, and observe the same run unit. No health dial or new root verb.;rev3=census-ruling-gvisor-demos;basis=Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. registry:Host@1355,registry:Host@1391,registry:Host@2005,registry:Host@270,registry:Host@320,whole:Route@1049,whole:Route@1433,whole:Route@1504,whole:Route@1637,whole:Route@1692,whole:Route@184,whole:Route@2048,whole:Route@853 f90fb0c55c16840a832498cd96ffdbf8bbc3bc8adca210372a731679afb36edd
@legacy 9c86cfa6cbd773a060dfd4ede0b114ad4562af31e3c8d2e47f0b4eadc41b4d45 internal/activator/size.go Service.SizeState legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=root-route (J1, as ExecBackend.GenTier): new (#329 plan 3 Task 6, pending column from the final review): the agent's status (internal/host sizestatus) asks for an awake non-worker entry's generation unit (genUnitOf), whether a swap holds the parent, and the size it should run at, EffectiveSize over sizedRouteLocked's route. Its two sites are the entry's in-memory route and the sized copy; it reads no registry, file or root state of its own; no root decision;rev3=census-ruling-gvisor-demos;basis=Task 8: copy actual Unit and parsed execsandbox.Family from the retained process handle under the existing Service lock. No box-mode inference or added external read; logical Want unchanged. whole:Route@227,whole:Route@502 f6d1d22080a447e7ef654f84f9713a68396312e51aa3efef2de1f6069dc6ca65
@legacy 6becaa7d7d3b47c82db5f5edc9a18c080948feeaebc835f8455a5130cadb9d5d internal/activator/unitproc.go ExecBackend.newUnitProc legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=returns newUnitProcFor's error alongside the handle; the same one site, no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. whole:Route@220 2c4479b8182bd8f0fc235dd213776e6c59b22b341e6a470c0f690bee428f42ad
-@legacy 8a1d54c72d48200fb3774f636caf471bc15122405399e598ffae6bd1caf25d38 internal/activator/unitproc.go unitProc.Stop legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Task 5 fix round 2: keep original-run owner stop proof failure latched until a successful plain fenced stop, in the owner Stop path. The foreign-invocation observer again completes from main's existing cgroup evidence after its plain stop attempt. Same control channel and retained unit kind; no new read. registry:Host@703,whole:Route@705 246d7bf501f06517b73496be89d55c2618ce5968fe06a259f6d6d7b0c3ebea0a
+@legacy a269a1c4dafbed718b4452e997179d17c01a737d42bfca7022c568651ab4f57c internal/activator/unitproc.go unitProc.Stop legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Final R2 N2a: restrict exited gen-0 re-stop and stopUnproven/ErrStillRunning failure latch to retained gVisor mode or gVisor backend mode. Native handles use main 9622c65a behavior: no re-stop after observed exit, log failed stop and wait for done. Existing control channel; no new read. registry:Host@923,whole:Route@925 2a30bd51c50466df6ba69ba5176ee32ef1f2273d69ad28e7539c2abc6f198eec
@legacy 53927e0d3ea245b498cb2a72f3574b3de4d0328169afbcdc0302d64b7f057639 internal/demobuild/purge.go Worker.PurgeDemo legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads root-owned seen/job-ID marker and scratch existence; checks demo/box/job binding before existing stop/cgroup/unmount cleanup. Fix round 1: also requires the job marker host to match the purge host; no new file reads.;rev3=census-ruling-gvisor-demos;basis=Task 7: derive the selected build family for existing authenticated job retirement; cleanup proves both named families before any shared mount or bundle removal. Existing marker and scratch reads unchanged. file:Lstat@423,file:Lstat@906,file:ReadAll@581 2ec4d6cbaeece4e687ef8923a84afe6bb717ea83688266007bacf072b95675fb
@legacy 238e4dce1ff7166c4ab212c1db33462561af34db097cd1b45622fd51451ff873 internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained. file:ReadAll@584 b5600faa9b1873448735a77731da5902ee80d94424932c68891b6467a5527554
@legacy 86870fb7e9299eb5d6eacb69f73a3f646919441874146242bc77584867e1c476 internal/demobuild/security_linux.go verifyWorkMount legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads filesystem type/capacity and mount presence for a root-derived work path.;rev3=census-ruling-gvisor-demos;basis=Task 9: Add observed filesystem type/capacity and expected cap to root diagnostic; same checks and reads. file:Statfs@83 209e90de81869b243c38ca4ac098bf3c3969c5956416c2f17d3ca94b447793b3
@@ -81,6 +81,7 @@
@legacy 6e7c31ca1ec29af939e5f6bf6590be0310df30cfb1ad96a0c8463f0e3498ef60 internal/instancectl/sandbox.go Server.sandboxHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final batch: read the existing launch request host query and refuse a retained cleanup error only for that validated instance ID, before global sandbox admission. No filesystem read or new launch authority; stop/reset are outside this middleware gate. file:Query@106 e8add208fd314a12397747774e6b66f8ca282e5e801301675154988da8529c5d
@legacy 43a54aebd894c7b4852e9fbcf3e1dc75d71ceffebe4c51ee7003dffce4d22cb7 internal/instancectl/sandbox.go Server.unitFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Classify only retained mode, claims/demo flags, role and route runtime/demo shape; gVisor public starts require a route and only private probe/build may omit it. No I/O or readiness-driven fallback. registry:Runtime@630,whole:Route@614,whole:Route@794,whole:Route@852 bed900b96d6b79417c25954e25144ec00c6388a0951ffd405b9788f103851d06
@legacy 5492a4dd126f921302135f7c7a0b7ae6f5b24518ce0f37b745f955d47312d5ea internal/instancectl/sandboxstop.go Server.proveRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 5: read only the validated host-derived systemd cgroup.events path under the configured root. Require complete inactive/dead state, zero jobs/MainPID/ControlPID, expected ControlGroup and exact populated 0 or absent cgroup; unreadable or malformed proof refuses cleanup. Fix round 1 C1/I1: accept the captured systemd 257 empty Job field as no queued job, also zero. Do not infer running state from LoadState; keep required-property presence, inactive/failed plus dead/failed, zero MainPID/ControlPID, expected ControlGroup and empty/absent cgroup proof. Native cleanup runs before sibling ID derivation. No new read path. Task 9: Treat omitted empty Job, InvocationID and ControlGroup as their captured systemd 257 unset defaults. Require explicit LoadState, ActiveState, SubState, MainPID and ControlPID; retain no-job, zero-PID, terminal-state, expected-group and empty/absent-cgroup checks. Same fixed derived path and read. file:ReadFile@853 867b1af5b3f9ded72bd023fd0d7d02a589a131db76046b76156e581738fc90b8
+@legacy 78a7bf004a5f9c279a5e6d48462effcdb869934b189b2346151863def2055324 internal/instancectl/sandboxstop.go Server.sandboxRunFilesPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final R2 N2b: new Lstat of run-<validated instance ID> below the two fixed root-owned bundle/skeleton parents. Any leaf, including symlink, means retained state; missing leaves mean no gVisor stop proof required on systemd. Unexpected lookup errors refuse. No caller-controlled path, no file content opened, no executable or authority record read. file:Lstat@272 f9cd6bdb8f32f399bc8013b0eed43be17e6774bda38c0adcdf27e4783b0d86be
@legacy cec824c9807e579085fc5e14741c1b3fd97bcf58210f8861cd4f9c282d39aa1e internal/instanceexec/probe_gvisor.go checkGVisorFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Evaluate guest probe facts only. Census labels the boolean Openat2 field as a file read, but this pure evaluator performs no I/O or root action. file:Openat2@845 0fbb701794c0c747fb23628a1e3ed9f791d3024e2001df8040809b8f7544bae1
@legacy 41d8f6f4a50ddf86247cc886cfee2c1dad66937a57f9af7b0be82a8fef3283b5 internal/instanceexec/probe_gvisor.go type gvisorProbeFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Guest evidence fields only; Openat2 is a boolean fact, not a syscall or filesystem read. file:Openat2@325 5b30f52a1aca92bfa18331e3a88ac84fbaa4b15765197f822446c1aff7884046
@legacy 1f9c923ed04f164bbf66e677c957e3df583122c5ffdb081fe9c1bde32b8b6e29 internal/instanceexec/probe_gvisor_linux.go runGVisorProbeChecks legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Unprivileged guest reads fixed /proc/self/status and /proc/version; checks root-supplied numeric identity, capabilities/NNP, pinned measured kernel signature, io_uring ENOSYS, loopback/public TCP refusal, absent nonce-derived host fixture and unreachable root abstract socket. Checks existing safe-open behavior at its own fixed data directory and serves a nonce socket in its own host-visible run mount until root acknowledges process/limit proof. No host root authority or tenant-selected path. CI fix: replace net.Interfaces (AF_NETLINK) with guest-only fixed /proc/net/dev ReadFile; require exactly the lo interface and a complete counters row. Existing public TCP refusal and guest isolation assertions remain. No host-selected or tenant-selected read path. data-literal@2195,file:Lstat@2093,file:Openat2@2162,file:ReadFile@1287,file:ReadFile@1465,file:ReadFile@607 9070fe8dfa3997812f4d2e370314fe667d54560a189a466caad1ae0a2d88af42
@@ -120,7 +121,7 @@ internal/activator/backend_unit.go UnitBackend.systemctl legacy accepted-legacy
internal/activator/sidecar_ha.go ExecBackend.startHAWorker legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-s;basis=Require nested HA sidecar shape and closed worker identity environment; prepare and acknowledge sealed secrets before writing the existing run launch file. Start the previously verified staged executable through existing root StartExe, mark uncertain starts for stop proof, and observe the same run unit. No health dial or new root verb.;rev3=census-ruling-gvisor-demos;basis=Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. registry:Host@1355,registry:Host@1391,registry:Host@2005,registry:Host@270,registry:Host@320,whole:Route@1049,whole:Route@1433,whole:Route@1504,whole:Route@1637,whole:Route@1692,whole:Route@184,whole:Route@2048,whole:Route@853 f90fb0c55c16840a832498cd96ffdbf8bbc3bc8adca210372a731679afb36edd
internal/activator/size.go Service.SizeState legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=root-route (J1, as ExecBackend.GenTier): new (#329 plan 3 Task 6, pending column from the final review): the agent's status (internal/host sizestatus) asks for an awake non-worker entry's generation unit (genUnitOf), whether a swap holds the parent, and the size it should run at, EffectiveSize over sizedRouteLocked's route. Its two sites are the entry's in-memory route and the sized copy; it reads no registry, file or root state of its own; no root decision;rev3=census-ruling-gvisor-demos;basis=Task 8: copy actual Unit and parsed execsandbox.Family from the retained process handle under the existing Service lock. No box-mode inference or added external read; logical Want unchanged. whole:Route@227,whole:Route@502 f6d1d22080a447e7ef654f84f9713a68396312e51aa3efef2de1f6069dc6ca65
internal/activator/unitproc.go ExecBackend.newUnitProc legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=returns newUnitProcFor's error alongside the handle; the same one site, no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: migrate structured root start identity, validate binding, retain actual unit for observation/exit/stop. Unknown worker response retains only a cleanup request and listener, never a guessed observed identity. Existing route/control/cgroup inputs; no new root read. whole:Route@220 2c4479b8182bd8f0fc235dd213776e6c59b22b341e6a470c0f690bee428f42ad
-internal/activator/unitproc.go unitProc.Stop legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Task 5 fix round 2: keep original-run owner stop proof failure latched until a successful plain fenced stop, in the owner Stop path. The foreign-invocation observer again completes from main's existing cgroup evidence after its plain stop attempt. Same control channel and retained unit kind; no new read. registry:Host@703,whole:Route@705 246d7bf501f06517b73496be89d55c2618ce5968fe06a259f6d6d7b0c3ebea0a
+internal/activator/unitproc.go unitProc.Stop legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-gvisor-demos;basis=Final R2 N2a: restrict exited gen-0 re-stop and stopUnproven/ErrStillRunning failure latch to retained gVisor mode or gVisor backend mode. Native handles use main 9622c65a behavior: no re-stop after observed exit, log failed stop and wait for done. Existing control channel; no new read. registry:Host@923,whole:Route@925 2a30bd51c50466df6ba69ba5176ee32ef1f2273d69ad28e7539c2abc6f198eec
internal/demobuild/purge.go Worker.PurgeDemo legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads root-owned seen/job-ID marker and scratch existence; checks demo/box/job binding before existing stop/cgroup/unmount cleanup. Fix round 1: also requires the job marker host to match the purge host; no new file reads.;rev3=census-ruling-gvisor-demos;basis=Task 7: derive the selected build family for existing authenticated job retirement; cleanup proves both named families before any shared mount or bundle removal. Existing marker and scratch reads unchanged. file:Lstat@423,file:Lstat@906,file:ReadAll@581 2ec4d6cbaeece4e687ef8923a84afe6bb717ea83688266007bacf072b95675fb
internal/demobuild/runner.go Run legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job.;rev3=census-ruling-gvisor-demos;basis=Task 7: retain bounded no-follow diagnostics/output reads after termination proof; filter gVisor runtime timestamp lines before returning compiler diagnostics. No new read. Task 9: Log failing steps through root logger before returning exactly ErrBuild. Existing bounded no-follow reads and termination-before-output retained. file:ReadAll@584 b5600faa9b1873448735a77731da5902ee80d94424932c68891b6467a5527554
internal/demobuild/security_linux.go verifyWorkMount legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads filesystem type/capacity and mount presence for a root-derived work path.;rev3=census-ruling-gvisor-demos;basis=Task 9: Add observed filesystem type/capacity and expected cap to root diagnostic; same checks and reads. file:Statfs@83 209e90de81869b243c38ca4ac098bf3c3969c5956416c2f17d3ca94b447793b3
@@ -210,6 +211,7 @@ internal/instancectl/sandbox.go Server.requestFamily legacy accepted-legacy acce
internal/instancectl/sandbox.go Server.sandboxHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final batch: read the existing launch request host query and refuse a retained cleanup error only for that validated instance ID, before global sandbox admission. No filesystem read or new launch authority; stop/reset are outside this middleware gate. file:Query@106 e8add208fd314a12397747774e6b66f8ca282e5e801301675154988da8529c5d
internal/instancectl/sandbox.go Server.unitFamily legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Classify only retained mode, claims/demo flags, role and route runtime/demo shape; gVisor public starts require a route and only private probe/build may omit it. No I/O or readiness-driven fallback. registry:Runtime@630,whole:Route@614,whole:Route@794,whole:Route@852 bed900b96d6b79417c25954e25144ec00c6388a0951ffd405b9788f103851d06
internal/instancectl/sandboxstop.go Server.proveRunGone legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Task 5: read only the validated host-derived systemd cgroup.events path under the configured root. Require complete inactive/dead state, zero jobs/MainPID/ControlPID, expected ControlGroup and exact populated 0 or absent cgroup; unreadable or malformed proof refuses cleanup. Fix round 1 C1/I1: accept the captured systemd 257 empty Job field as no queued job, also zero. Do not infer running state from LoadState; keep required-property presence, inactive/failed plus dead/failed, zero MainPID/ControlPID, expected ControlGroup and empty/absent cgroup proof. Native cleanup runs before sibling ID derivation. No new read path. Task 9: Treat omitted empty Job, InvocationID and ControlGroup as their captured systemd 257 unset defaults. Require explicit LoadState, ActiveState, SubState, MainPID and ControlPID; retain no-job, zero-PID, terminal-state, expected-group and empty/absent-cgroup checks. Same fixed derived path and read. file:ReadFile@853 867b1af5b3f9ded72bd023fd0d7d02a589a131db76046b76156e581738fc90b8
+internal/instancectl/sandboxstop.go Server.sandboxRunFilesPresent legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Final R2 N2b: new Lstat of run-<validated instance ID> below the two fixed root-owned bundle/skeleton parents. Any leaf, including symlink, means retained state; missing leaves mean no gVisor stop proof required on systemd. Unexpected lookup errors refuse. No caller-controlled path, no file content opened, no executable or authority record read. file:Lstat@272 f9cd6bdb8f32f399bc8013b0eed43be17e6774bda38c0adcdf27e4783b0d86be
internal/instanceexec/probe_gvisor.go checkGVisorFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Evaluate guest probe facts only. Census labels the boolean Openat2 field as a file read, but this pure evaluator performs no I/O or root action. file:Openat2@845 0fbb701794c0c747fb23628a1e3ed9f791d3024e2001df8040809b8f7544bae1
internal/instanceexec/probe_gvisor.go type gvisorProbeFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Guest evidence fields only; Openat2 is a boolean fact, not a syscall or filesystem read. file:Openat2@325 5b30f52a1aca92bfa18331e3a88ac84fbaa4b15765197f822446c1aff7884046
internal/instanceexec/probe_gvisor_linux.go runGVisorProbeChecks legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Unprivileged guest reads fixed /proc/self/status and /proc/version; checks root-supplied numeric identity, capabilities/NNP, pinned measured kernel signature, io_uring ENOSYS, loopback/public TCP refusal, absent nonce-derived host fixture and unreachable root abstract socket. Checks existing safe-open behavior at its own fixed data directory and serves a nonce socket in its own host-visible run mount until root acknowledges process/limit proof. No host root authority or tenant-selected path. CI fix: replace net.Interfaces (AF_NETLINK) with guest-only fixed /proc/net/dev ReadFile; require exactly the lo interface and a complete counters row. Existing public TCP refusal and guest isolation assertions remain. No host-selected or tenant-selected read path. data-literal@2195,file:Lstat@2093,file:Openat2@2162,file:ReadFile@1287,file:ReadFile@1465,file:ReadFile@607 9070fe8dfa3997812f4d2e370314fe667d54560a189a466caad1ae0a2d88af42
@@ -253,12 +255,12 @@ internal/host/systemapply.go systemApplier.stageCandidate legacy accepted-legacy
@remove internal/instancectl/demo_policy.go Server.demoCgroup
@removed internal/instancectl/demo_policy.go Server.demoCgroup H3 census-ruling-gvisor-demos;basis=Delegate the existing readback to demoCgroupReadback; wrapper has no direct read and retains its callers.
@coverage . 6a7231c0623c2833e48e1926ad096d073a256ccd13d2e171a739712d370c2e3a
-@coverage internal/activator 895a96344b160b142fdb98092a54cb1d672a3bdc9b63996d77734540ae872098
+@coverage internal/activator 68ec80ae408160b4f77e738a7e77a7725e973623c1718b3990dd14f7ef67e862
@coverage internal/demobuild 60f5e9d6c2acb85d8943d848f013349157bf985bba71e69e99d4ed6e831c1dd7
@coverage internal/execsandbox 8f4069cb40c57bc0f01a934f44c49c9fdb549879c509b374d97474b859538569
@coverage internal/host 80a3329e6f69214885661efa9b433b6edf39380e2cd8927188a0465e0d0ea9a7
@coverage internal/host/units 4b442cd9c1706ec2f5b9de8159ff3502f9f32f97d1b82a38d2c42acca214e1c0
-@coverage internal/instancectl e451c10091363bae0ae1975fc8947d3ea674f04a9e1857fb3917c188d3080f29
+@coverage internal/instancectl f5413266639c3899a728bf84cf06b0d20faee22c86a87940be04c0bd8b4e7abb
@coverage internal/instanceexec 10a3ef8ede2d43df1eb3e41f3b050197cea2aeb90911d99cca2957e1c4b04b57
@coverage internal/publicrelease 4b98543d38d648c60009592dac6c1e8a012ecca42e52d95d12404c0f9506457c
@coverage internal/status ce96e1680960d510b9abc9f8cb9746e32fef1c69b494f9d0ad05dd31e5781d5b