carlos / platform Public

census: rootfs-fleet-followups proposal

Root-read overlay and card for the process-named app lines (four changed
activator units and the new appLineEmitter; envelopes internal/activator
and internal/applog re-pinned), and a record-write re-pin of
Server.handleAPIInstanceList for fleetHealth, layered on
fleetSecretsKeyWriteCensusInventory. Card:
docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md.
Awaiting the independent reviewer's verdict on #280.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev b0d928c060a1caec016c6e92e68d23a759b7deab parent 7545ef9
5 files changed, +83 −1
  • docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md +29 −0
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/rootfs_fleet_followups_census_test.go +37 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-rootfs-fleet-followups.tsv +15 −0
diff --git a/docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md b/docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md
new file mode 100644
index 000000000..5890c8d0b
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md
@@ -0,0 +1,29 @@
+# Census approval: rootfs-fleet-followups
+
+Ruling `census-ruling-rootfs-fleet-followups`. The independent reviewer approves or rejects every change below, 1 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) | 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 |
+| `internal/activator/prepare.go` `ExecBackend.prepareWorker` | body | unchanged (6) | passes the worker name (already checked by release.ValidWorkerName at the top) to logEmitter as the process; no read added or moved |
+| `internal/activator/prepare.go` `ExecBackend.logEmitter` | sites | -registry:App, -registry:Host | takes a process name and returns appLineEmitter(b.Logs, rt, process); the route account, app and host reads moved into appLineEmitter; no file read |
+| `internal/activator/rootfsrelease.go` `Service.releaseAppLog` | sites | -registry:App, -registry:Host | returns lineEmitter(appLineEmitter(a.Logs, rt, release.ProcessRelease)); the route reads moved into appLineEmitter; no file read |
+
+Envelopes re-pinned: `internal/activator`, `internal/applog`.
+
+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
+- `internal/activator/prepare.go` `ExecBackend.prepareWorker`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: prepare for a worker: the instance's two directories and the worker log socket's, the worker's stale exit records cleared by its name prefix (another worker's and every generation's kept), its log listener bound where root's worker drop-in points StandardOutput=; reads no environment file; binds no control listener; asks no replica gate
+- `internal/activator/prepare.go` `ExecBackend.logEmitter`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route
+- `internal/activator/rootfsrelease.go` `Service.releaseAppLog`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.5]: new; the writer a release's output goes through: each line to the instance's own app log (a.Logs.App(account, app, host, line)); reads the route's account, app and host for the log's key; no file read
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/activator/logsink.go:appLineEmitter`: reads +registry:App, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
+
+Seal: `94b8ccf921f64be24a4773f72d55a8e24ceba3acfb40eefe3b56af6f5b008138` → `bcc6783abc193015e76a0fedfd7ff10a8f2ff16612d19cd2e253c439c8855e0c`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-fleet-followups.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 4527593f2..0098f6133 100644
--- a/internal/provision/plan9_b8_census_test.go
+++ b/internal/provision/plan9_b8_census_test.go
@@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) {
if len(got) < 100 {
t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root)
}
- inventory := fleetSecretsKeyWriteCensusInventory()
+ inventory := rootfsFleetFollowupsWriteCensusInventory()
problems := append(censusDiff(inventory, got), censusPolicy(inventory)...)
if len(problems) > 0 {
t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n "))
diff --git a/internal/provision/rootfs_fleet_followups_census_test.go b/internal/provision/rootfs_fleet_followups_census_test.go
new file mode 100644
index 000000000..a9811f177
--- /dev/null
+++ b/internal/provision/rootfs_fleet_followups_census_test.go
@@ -0,0 +1,37 @@
+package provision
+
+// Record-write census entries for the rootfs fleet follow-ups (#366,
+// branch rootfs-fleet-followups), layered on
+// fleetSecretsKeyWriteCensusInventory (main's newest at the branch's base
+// 1fa2a99b). Reviewed by the branch author against the source; the census
+// approval is recorded on #280 with the root-read card
+// (docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md).
+//
+// One re-pin, no new unit:
+// - internal/console/apiinstances.go Server.handleAPIInstanceList
+// (key-site): after instanceHealth, fleetHealth fills the health word of
+// a fleet-placed record still unknown from the rollout join the handler
+// already loads (join.rollout, its tenant rule kept). The record listing
+// and its literal are unchanged; it writes no record.
+func rootfsFleetFollowupsWriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), fleetSecretsKeyWriteCensusInventory()...)
+ repins := []censusEntry{
+ // rootfs-fleet-followups: fleetHealth after instanceHealth; the same listing and literal.
+ {"internal/console/apiinstances.go", "Server.handleAPIInstanceList", "key-site", "lit:instances", "fc3da89d5a32eeed50e4a5c4811d2f90e0a2bce9a49bd2d71694844d5b1009d3"},
+ }
+ for _, r := range repins {
+ found := false
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ if e.Class != r.Class || e.Kinds != r.Kinds {
+ panic("rootfs-fleet-followups re-pin changes the class or kinds of " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("rootfs-fleet-followups re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return entries
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8d944141b..af36c0f49 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -34,3 +34,4 @@ plan14-root-reads-static-dir-slash.tsv fb7cd756f7c3eb2dc019c8fd55fea5475e2df7ee3
plan14-root-reads-named-unit-delivery-114.tsv d92c9d40eb2a9e66c859e2fe6df3af10a1b9d3a83b1d717ec928cb432eebb1aa
plan14-root-reads-fleet-secrets-key.tsv 9df7f5aca9a502966c9643b7062829c1c25bfbd86fa20e92d764d66f676d2cd6
plan14-root-reads-static-headers.tsv 94b8ccf921f64be24a4773f72d55a8e24ceba3acfb40eefe3b56af6f5b008138
+plan14-root-reads-rootfs-fleet-followups.tsv bcc6783abc193015e76a0fedfd7ff10a8f2ff16612d19cd2e253c439c8855e0c
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-fleet-followups.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-fleet-followups.tsv
new file mode 100644
index 000000000..7fbb80339
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-fleet-followups.tsv
@@ -0,0 +1,15 @@
+# Census overlay rootfs-fleet-followups, written by census-propose (#369). census-ruling-rootfs-fleet-followups, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-rootfs-fleet-followups.md.
+# 2 body, 2 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy d82ca4f88546b2b29b8e9619c60118f3b3f1c492c071d39f7ae63f334d9ed6cb 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 file:ReadDir@2929,registry:Host@1770,registry:Host@1982,registry:Host@5787,registry:Host@5985,registry:Host@612,whole:Route@1661,whole:Route@1872,whole:Route@2103,whole:Route@320,whole:Route@4642,whole:Route@5170,whole:Route@5821 0c049e8ff1256f466b0f6e770d65c9e0ba6943f03c377924481e0210c723da30
+@legacy 2467c84503328707bba08f52e54cc3498f611783447a44511b49a4df0b1ea58d internal/activator/prepare.go ExecBackend.prepareWorker legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: prepare for a worker: the instance's two directories and the worker log socket's, the worker's stale exit records cleared by its name prefix (another worker's and every generation's kept), its log listener bound where root's worker drop-in points StandardOutput=; reads no environment file; binds no control listener; asks no replica gate;rev3=census-ruling-rootfs-fleet-followups;basis=passes the worker name (already checked by release.ValidWorkerName at the top) to logEmitter as the process; no read added or moved file:ReadDir@563,registry:Host@224,registry:Host@440,registry:Host@902,whole:Route@124,whole:Route@809 a22180a3d5c23b92e9c227a45e90e482fc5789baec5345f1151e37773b5941f8
+@legacy 5e26653fcccbee1e5f20286530b4789cd53e32d7984fabcbff14824667457077 internal/activator/logsink.go appLineEmitter legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-fleet-followups;basis=new: the app-line emit function for rt: nil for a nil sink; reads the route account (release.RouteAccount), app and host; a sink holding AppProcess (applog.Sink) gets the process name, otherwise App as before; in-memory log sink only, no file, path or env read registry:App@166,registry:Host@174,whole:Route@161 d3af8b263f021bcba5926116366bf4a4e853a21ef7c14bcaced53dbd75247324
+@legacy d765f7a7dd9ac5f10ac545c84454e8ae9046dc36142c9a3b88e6634613b5fa6b internal/activator/prepare.go ExecBackend.logEmitter legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-fleet-followups;basis=takes a process name and returns appLineEmitter(b.Logs, rt, process); the route account, app and host reads moved into appLineEmitter; no file read whole:Route@114 171f5bc4eca79f08dc335fccac8cd11385b72ce27bded922a71e639b8a8a6ce0
+@legacy 4ed1b4930a5a677b33ea8194fba90f4b9e9c56702129a055be0fb584e008e16d internal/activator/rootfsrelease.go Service.releaseAppLog legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.5]: new; the writer a release's output goes through: each line to the instance's own app log (a.Logs.App(account, app, host, line)); reads the route's account, app and host for the log's key; no file read;rev3=census-ruling-rootfs-fleet-followups;basis=returns lineEmitter(appLineEmitter(a.Logs, rt, release.ProcessRelease)); the route reads moved into appLineEmitter; no file read whole:Route@106 20871e7bd6d22cf8a1bf733fe8b8f34e9702b2b2f6d661d1ef8140963518ed70
+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 file:ReadDir@2929,registry:Host@1770,registry:Host@1982,registry:Host@5787,registry:Host@5985,registry:Host@612,whole:Route@1661,whole:Route@1872,whole:Route@2103,whole:Route@320,whole:Route@4642,whole:Route@5170,whole:Route@5821 0c049e8ff1256f466b0f6e770d65c9e0ba6943f03c377924481e0210c723da30
+internal/activator/prepare.go ExecBackend.prepareWorker legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: prepare for a worker: the instance's two directories and the worker log socket's, the worker's stale exit records cleared by its name prefix (another worker's and every generation's kept), its log listener bound where root's worker drop-in points StandardOutput=; reads no environment file; binds no control listener; asks no replica gate;rev3=census-ruling-rootfs-fleet-followups;basis=passes the worker name (already checked by release.ValidWorkerName at the top) to logEmitter as the process; no read added or moved file:ReadDir@563,registry:Host@224,registry:Host@440,registry:Host@902,whole:Route@124,whole:Route@809 a22180a3d5c23b92e9c227a45e90e482fc5789baec5345f1151e37773b5941f8
+internal/activator/logsink.go appLineEmitter legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-fleet-followups;basis=new: the app-line emit function for rt: nil for a nil sink; reads the route account (release.RouteAccount), app and host; a sink holding AppProcess (applog.Sink) gets the process name, otherwise App as before; in-memory log sink only, no file, path or env read registry:App@166,registry:Host@174,whole:Route@161 d3af8b263f021bcba5926116366bf4a4e853a21ef7c14bcaced53dbd75247324
+internal/activator/prepare.go ExecBackend.logEmitter legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-fleet-followups;basis=takes a process name and returns appLineEmitter(b.Logs, rt, process); the route account, app and host reads moved into appLineEmitter; no file read whole:Route@114 171f5bc4eca79f08dc335fccac8cd11385b72ce27bded922a71e639b8a8a6ce0
+internal/activator/rootfsrelease.go Service.releaseAppLog legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.5]: new; the writer a release's output goes through: each line to the instance's own app log (a.Logs.App(account, app, host, line)); reads the route's account, app and host for the log's key; no file read;rev3=census-ruling-rootfs-fleet-followups;basis=returns lineEmitter(appLineEmitter(a.Logs, rt, release.ProcessRelease)); the route reads moved into appLineEmitter; no file read whole:Route@106 20871e7bd6d22cf8a1bf733fe8b8f34e9702b2b2f6d661d1ef8140963518ed70
+@coverage internal/activator 0debca01a10c2e37b744daed7b60c23788e9dca7d50086cb33eb0bf25e57ad75
+@coverage internal/applog 0f5d06983a3e8b949179ce74443aba0747cdc0a3d730e6189c9cfee4c808f59b