carlos / platform Public

activator: a failed worker start is no exit to the member (platform-39)

Ruling platform-39: a launch that never ran did not "exit", so RFS-3-C35
is for a worker that ended with no status to tell, not for a failed
start. A failed start keeps its behaviour from before C35: the operator
line alone, or C10 when it enters the crash loop, and it does not pace
the exit line.

The census proposal is re-run with the same NAME and claims file:
noteWorkerExitLocked's digest moved and its claim now says so; the same
units, classes and sites, seal e5918092 -> 19fd02dd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 18e556185763e5d8ce8dd42e89bd08120207bcab parent 3319eff
5 files changed, +48 −8
  • docs/superpowers/notes/census-proposal-rootfs-worker-exit.md +2 −2
  • internal/activator/rootfsworkers.go +7 −2
  • internal/activator/rootfsworkers_test.go +35 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv +3 −3
diff --git a/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md b/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md
index 9d63c6733..c725ade0f 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md
@@ -5,7 +5,7 @@ Ruling `census-ruling-rootfs-worker-exit`. The independent reviewer approves or
| unit | change | read sites | what changed |
|---|---|---|---|
| `internal/activator/unitproc.go` `ExecBackend.observe` | body | unchanged (22) | an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added |
-| `internal/activator/rootfsworkers.go` `Service.noteWorkerExitLocked` | sites | +whole:Route | an exit with no status to tell now also emits the member event RFS-3-C35 at warn (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent |
+| `internal/activator/rootfsworkers.go` `Service.noteWorkerExitLocked` | sites | +whole:Route | a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent |
Envelopes re-pinned: `.`, `internal/activator`, `internal/rolloutwords`.
@@ -21,6 +21,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/control.go:systemctlUnitMainExit`: reads +file:CommandContext; written legacy, accepted-legacy, frozen
- new `internal/activator/unitproc.go:ExecBackend.unitMainExitOf`: reads +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
-Seal: `78b7e7e30ad3ada44388a4ee16f3950ef888ae03e552477dcbfbb07c51ffb83e` → `e59180920ac4b3840a5ee520a27d6c4c2b90d61044e4b73dbca77e61ae56063c`.
+Seal: `78b7e7e30ad3ada44388a4ee16f3950ef888ae03e552477dcbfbb07c51ffb83e` → `19fd02ddce24e25bac069e2e33441d6c62869ef3f6d7bb5142a3e93e58bcfbf0`.
Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/rootfsworkers.go b/internal/activator/rootfsworkers.go
index 4f3e510c8..26172e682 100644
--- a/internal/activator/rootfsworkers.go
+++ b/internal/activator/rootfsworkers.go
@@ -615,8 +615,10 @@ type workerReleaser interface {
// run of sidecarHealthyRun), the restart count, and the member's event:
// RFS-3-C10 once on entering the crash loop, RFS-3-C09 with the delay
// otherwise (at most once a minute in the loop). An exit with no status to
-// tell [pf W1.16] gives an operator line, and RFS-3-C35 in C09's place,
-// paced the same way (Task 11 end-to-end, #366). The caller holds a.mu.
+// tell [pf W1.16] gives an operator line, and for a worker that ended
+// RFS-3-C35 in C09's place, paced the same way (Task 11 end-to-end, #366);
+// a failed start never ran, so it gets the operator line alone
+// (platform-39). The caller holds a.mu.
func (a *Service) noteWorkerExitLocked(e *actEntry, wk *rootfsWorker, now time.Time) {
if !wk.started.IsZero() && now.Sub(wk.started) >= sidecarHealthyRun {
wk.backoff, wk.crashLoop = 0, false
@@ -643,6 +645,9 @@ func (a *Service) noteWorkerExitLocked(e *actEntry, wk *rootfsWorker, now time.T
switch {
case entered:
emitEvent(a.Logs, e.route, "error", fmt.Sprintf(rolloutwords.EventWorkerCrashLoop, wk.name))
+ case wk.startFailed:
+ // A launch that never ran did not exit (platform-39): the
+ // operator line alone, as before RFS-3-C35.
case wk.crashLoop && !wk.lastExitEvent.IsZero() && now.Sub(wk.lastExitEvent) < time.Minute:
case !ok:
wk.lastExitEvent = now
diff --git a/internal/activator/rootfsworkers_test.go b/internal/activator/rootfsworkers_test.go
index dd7fb0f37..4116ebf49 100644
--- a/internal/activator/rootfsworkers_test.go
+++ b/internal/activator/rootfsworkers_test.go
@@ -697,6 +697,41 @@ func TestWorkerExitWithNoStatusIsPacedInTheLoop(t *testing.T) {
}
}
+// A launch that never ran did not exit (platform-39): a failed start tells
+// the member nothing outside the crash loop's C10, as before RFS-3-C35,
+// while an ended worker with no status gets C35.
+func TestAFailedWorkerStartIsNoExitToTheMember(t *testing.T) {
+ sink := &rootfsSink{}
+ a := &Service{Logs: sink}
+ e := &actEntry{host: "shop.example.com", route: rootfsGateRoute("shop.example.com")}
+ now := time.Date(2026, 10, 30, 12, 0, 0, 0, time.UTC)
+ note := func(wk *rootfsWorker) []string {
+ n := len(sink.msgs())
+ a.mu.Lock()
+ a.noteWorkerExitLocked(e, wk, now)
+ a.mu.Unlock()
+ return sink.msgs()[n:]
+ }
+ failed := &rootfsWorker{name: "jobs", startFailed: true}
+ if got := note(failed); len(got) != 0 {
+ t.Errorf("a failed start told the member %q, want nothing", got)
+ }
+ if !failed.lastExitEvent.IsZero() {
+ t.Error("a failed start paced the exit line")
+ }
+ // Into the crash loop, a failed start still tells C10 once.
+ looping := &rootfsWorker{name: "jobs", startFailed: true, backoff: sidecarRestartMax / 2}
+ if got := note(looping); !slices.Equal(got, []string{fmt.Sprintf(rolloutwords.EventWorkerCrashLoop, "jobs")}) {
+ t.Errorf("a failed start entering the loop told %q, want C10", got)
+ }
+ p := &fakeWorkerProc{}
+ p.exit("", "")
+ ended := &rootfsWorker{name: "jobs", proc: p}
+ if got := note(ended); !slices.Equal(got, []string{fmt.Sprintf(rolloutwords.EventWorkerExitedUnknown, "jobs", "2s")}) {
+ t.Errorf("an ended worker with no record told %q, want C35", got)
+ }
+}
+
// [pf W1.16] C09's status: an exit code, 128 plus a known signal's number;
// no record or an unknown signal tells none.
func TestRootfsWorkerExitStatus(t *testing.T) {
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 22bda0d04..c27c4bab6 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -36,4 +36,4 @@ plan14-root-reads-fleet-secrets-key.tsv 9df7f5aca9a502966c9643b7062829c1c25bfbd8
plan14-root-reads-static-headers.tsv 94b8ccf921f64be24a4773f72d55a8e24ceba3acfb40eefe3b56af6f5b008138
plan14-root-reads-rootfs-check-volumes.tsv 042684bf5af6f61ce8b87f10b68a42b08d131ba4cb5bcab16320c7b032a724e6
plan14-root-reads-rootfs-fleet-followups.tsv 78b7e7e30ad3ada44388a4ee16f3950ef888ae03e552477dcbfbb07c51ffb83e
-plan14-root-reads-rootfs-worker-exit.tsv e59180920ac4b3840a5ee520a27d6c4c2b90d61044e4b73dbca77e61ae56063c
+plan14-root-reads-rootfs-worker-exit.tsv 19fd02ddce24e25bac069e2e33441d6c62869ef3f6d7bb5142a3e93e58bcfbf0
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv
index 67cc3b2a7..e198f6712 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv
@@ -4,11 +4,11 @@
@legacy 654efde59dfa1b0581fdcd671633bccd26e950637a979e31e7b51dd6d7beccec internal/activator/unitproc.go ExecBackend.observe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=final fix I3: the process observer's termination proof for a rootfs handle (Runtime, the new kind, one site) goes through unitEvents (two more Route sites): the host slice's cgroup.events and, for a rootfs unit, the group systemd reports when that is elsewhere, so a foreign invocation root placed outside the slice and could not stop is never read as gone from the absent expected path; a failed stop of a foreign invocation leaves it unstopped, asked again next poll, completion pending; a binary handle's proof is unchanged (cgroup.events under the host slice); the agent decides only whether it keeps a handle and a launch file; no root decision; re-digested at the merge of origin/main 3c33f2eb: main's own change to the observer is in the body, this branch's rootfs-aware evidence and the rootfs-only failed-stop retry (merge prep N1: a binary handle behaves exactly as main) on top; the kinds are the union;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: for a worker handle (p.worker != "") the observer keeps the exit record it read (workerExit, workerExitOK) for the supervisor instead of wording a member event, and says nothing for a replaced-after-stop or restarted-outside end; the termination evidence (cgroup.events via unitEvents, the foreign-invocation rule) and the record's single-use removal are unchanged and apply to a worker as to a generation; a binary or generation handle behaves exactly as before; the same 22 read sites, no read added;rev3=census-ruling-rootfs-worker-exit;basis=an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added registry:Host@1222,registry:Host@3062,registry:Host@3252,registry:Host@3599,registry:Host@3825,registry:Host@4529,registry:Host@5927,registry:Runtime@2414,registry:Runtime@806,whole:Route@1224,whole:Route@2222,whole:Route@2416,whole:Route@3064,whole:Route@3254,whole:Route@3601,whole:Route@3827,whole:Route@4531,whole:Route@5001,whole:Route@5479,whole:Route@5929,whole:Route@808,whole:Route@972 0e53c43116af56ded14aa9d786eb9ba4b7b2183422b8d2bf094636c0844f8b6d
@legacy 26519d5badff16976140677555950a75d4ef1000ff71a93fdfe3016f38e17798 internal/activator/control.go systemctlUnitMainExit legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: runs `systemctl show -p InvocationID,ExecMainCode,ExecMainStatus <unit>` as the agent (no privilege), the same shape as systemctlUnitState and systemctlControlGroup; the unit name is the handle's own (unitNameFor/rootfsUnitFor), not tenant input; output parsed as three key=value strings file:CommandContext@108 74e7b49ce1a61d1602988fed295101fbc84212e7bfab1cca4d91048ee926855f
@legacy 152429a6381484da89988583d7f2017af3962ba2706dcb17625caa391cabca55 internal/activator/unitproc.go ExecBackend.unitMainExitOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: reads the handle's unit main exit through UnitMainExit (Route.Host only for its log line), used only when the invocation systemd reports equals the handle's own; withMainExit accepts only systemd's numeric code (1, 2, 3) and a non-negative numeric status, signal names from the fixed workerSignals table; it changes only the advisory record's code, status and result, which decide event wording and a worker's restart line, never termination, a lease or any root decision registry:Host@381,whole:Route@383 4bf2ea75dc18730c6d147a628e32c84697da8e3af263cef7d19c4378ec5918c5
-@legacy ccd423d2c0d73e4fb6aaa1f06aaaa24da95c8b51b4129443203ffc4ab52cc3aa internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=an exit with no status to tell now also emits the member event RFS-3-C35 at warn (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1126,whole:Route@1274,whole:Route@902 94e0513e841f9434dd33e10c51b6c50e440d569c1b6f520efc21c2b598a26ae2
+@legacy 6d9992edc5189954dac625f3b626db8ffaa87fee4ed86342367f06e63e0a7a30 internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1256,whole:Route@1404,whole:Route@902 3c35a45e892785405bd961f29168ae230e8fea4d7202ccca499d2d4f8a4d07df
internal/activator/unitproc.go ExecBackend.observe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=final fix I3: the process observer's termination proof for a rootfs handle (Runtime, the new kind, one site) goes through unitEvents (two more Route sites): the host slice's cgroup.events and, for a rootfs unit, the group systemd reports when that is elsewhere, so a foreign invocation root placed outside the slice and could not stop is never read as gone from the absent expected path; a failed stop of a foreign invocation leaves it unstopped, asked again next poll, completion pending; a binary handle's proof is unchanged (cgroup.events under the host slice); the agent decides only whether it keeps a handle and a launch file; no root decision; re-digested at the merge of origin/main 3c33f2eb: main's own change to the observer is in the body, this branch's rootfs-aware evidence and the rootfs-only failed-stop retry (merge prep N1: a binary handle behaves exactly as main) on top; the kinds are the union;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: for a worker handle (p.worker != "") the observer keeps the exit record it read (workerExit, workerExitOK) for the supervisor instead of wording a member event, and says nothing for a replaced-after-stop or restarted-outside end; the termination evidence (cgroup.events via unitEvents, the foreign-invocation rule) and the record's single-use removal are unchanged and apply to a worker as to a generation; a binary or generation handle behaves exactly as before; the same 22 read sites, no read added;rev3=census-ruling-rootfs-worker-exit;basis=an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added registry:Host@1222,registry:Host@3062,registry:Host@3252,registry:Host@3599,registry:Host@3825,registry:Host@4529,registry:Host@5927,registry:Runtime@2414,registry:Runtime@806,whole:Route@1224,whole:Route@2222,whole:Route@2416,whole:Route@3064,whole:Route@3254,whole:Route@3601,whole:Route@3827,whole:Route@4531,whole:Route@5001,whole:Route@5479,whole:Route@5929,whole:Route@808,whole:Route@972 0e53c43116af56ded14aa9d786eb9ba4b7b2183422b8d2bf094636c0844f8b6d
internal/activator/control.go systemctlUnitMainExit legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: runs `systemctl show -p InvocationID,ExecMainCode,ExecMainStatus <unit>` as the agent (no privilege), the same shape as systemctlUnitState and systemctlControlGroup; the unit name is the handle's own (unitNameFor/rootfsUnitFor), not tenant input; output parsed as three key=value strings file:CommandContext@108 74e7b49ce1a61d1602988fed295101fbc84212e7bfab1cca4d91048ee926855f
internal/activator/unitproc.go ExecBackend.unitMainExitOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: reads the handle's unit main exit through UnitMainExit (Route.Host only for its log line), used only when the invocation systemd reports equals the handle's own; withMainExit accepts only systemd's numeric code (1, 2, 3) and a non-negative numeric status, signal names from the fixed workerSignals table; it changes only the advisory record's code, status and result, which decide event wording and a worker's restart line, never termination, a lease or any root decision registry:Host@381,whole:Route@383 4bf2ea75dc18730c6d147a628e32c84697da8e3af263cef7d19c4378ec5918c5
-internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=an exit with no status to tell now also emits the member event RFS-3-C35 at warn (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1126,whole:Route@1274,whole:Route@902 94e0513e841f9434dd33e10c51b6c50e440d569c1b6f520efc21c2b598a26ae2
+internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1256,whole:Route@1404,whole:Route@902 3c35a45e892785405bd961f29168ae230e8fea4d7202ccca499d2d4f8a4d07df
@coverage . 7068c680e02abdbbabc3ed4f2b166399134f4da933148b538f136bbc8a72885a
-@coverage internal/activator 7abdf8241f39566adfc7d7d5dd332b2e54d9f4817a59c561bbf978242a9004f1
+@coverage internal/activator d8ab85c6704d01dfbe179028497150619de0c666d0ccb4bb91b794c88d0f18d5
@coverage internal/rolloutwords 8e5a5e657c86fa4113803bbd6c46966ae9bd7e835c2f0fae552657a82998f32e