carlos / platform Public

rootfs marker recipe: an empty replica prefix is not proof a lifetime never served (census r3 P2-1)

The operator deletes the marker only with evidence from outside the box
and the bucket (the owner confirming the instance was just created and
never used); otherwise restore, or the owner deletes and recreates the
instance (a new lifetime and marker key). Comment and note only; the
census seal stays 26a84c1f, the internal/activator envelope digest moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 7775d37e7cd43c67d7510074314802393d77080e parent 86e3e24
4 files changed, +49 −31
  • docs/superpowers/notes/census-proposal-rootfs-apps-3.md +2 −0
  • docs/superpowers/notes/rootfs-first-boot-marker.md +27 −19
  • internal/activator/rootfsmarker.go +19 −11
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-3.tsv +1 −1

CI failed — run details

diff --git a/docs/superpowers/notes/census-proposal-rootfs-apps-3.md b/docs/superpowers/notes/census-proposal-rootfs-apps-3.md
index ec894a1ab..38ef43a78 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-apps-3.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-apps-3.md
@@ -19,6 +19,8 @@ Outside the census scope: `internal/console/rootfs.go` `rootfsReadyRefusal` name
Record-write census (section "Record-write re-pins" below): `Reconcile` re-pinned again (`14f504ff` to `d49386f8`). The nonrecord marker Put moves from `ExecBackend.SettleRootfsFirstBoot` to `ExecBackend.WriteRootfsMarker` (`4cdcb1a6` to `77c23906`).
+After round 3 (census READY AFTER FIXES, one P2; whole-branch READY): the P2 fix rewrites the operator recipe in `rootfsmarker.go`'s header comment and the note. An empty replica prefix no longer counts as proof the lifetime never served; the marker is deleted only with evidence from outside the box and bucket, otherwise the owner recreates the instance. Comment only: no unit's reads change, the seal stays `26a84c1f`, and only the `internal/activator` envelope digest moves.
+
Class counts: now 150 (31 body, 41 sites, 60 new, 17 reads, 1 quiet). The same 17 envelopes are re-pinned.
## Changes in round 2 (fix wave 1)
diff --git a/docs/superpowers/notes/rootfs-first-boot-marker.md b/docs/superpowers/notes/rootfs-first-boot-marker.md
index 64974ca34..90a850f4f 100644
--- a/docs/superpowers/notes/rootfs-first-boot-marker.md
+++ b/docs/superpowers/notes/rootfs-first-boot-marker.md
@@ -25,24 +25,32 @@ A warm wake never asks the bucket.
## When an instance refuses with "no database and no replica"
The log line is `lifetime N has booted before (its first-boot marker is
-there): refusing an empty boot`. There are two causes, and the repair is
-different:
-
-- **The instance served and its replica is gone.** Restore the replica.
- Never delete the marker: that boots the instance empty over lost data.
-- **The first boot was interrupted** (the agent stopped after step 2 and
- before the first replica upload). The instance never served. This
- refusal is by design (Paul's ruling, 2026-10-27, "refuse interrupted
- init"); the platform does not guess which case it is.
-
-To repair an interrupted first boot:
-
-1. Confirm the instance never served. The bucket in
- `CARLOS_HIBERNATE_BUCKET` holds nothing under
- `<CARLOS_HIBERNATE_PREFIX>/<host>/ltx/`. If anything is there, it is
- the first case: restore, don't delete.
-2. Delete `<CARLOS_HIBERNATE_PREFIX>/<host>/rootfs-initialized/<incarnation>.json`
- from that bucket.
-3. The next request wakes the instance as a first boot.
+there): refusing an empty boot`. There are two causes:
+
+- **The instance served and its data is gone.**
+- **The first boot was interrupted** (the agent stopped after the marker
+ was confirmed). The instance may never have served. This refusal is by
+ design (Paul's ruling, 2026-10-27, "refuse interrupted init").
+
+Nothing on the box or in the bucket tells these apart. An empty replica
+prefix proves nothing: a first upload that fails only logs, and the
+instance serves anyway; and a replica that was uploaded can be lost later.
+Deleting the marker of an instance that served boots it empty, over the
+owner's data.
+
+To repair:
+
+1. If a replica or any other copy of the database exists, restore it.
+ Don't delete the marker.
+2. Otherwise treat the data as lost, unless you have evidence from outside
+ the box and the bucket that this lifetime never served: for example,
+ the instance's owner confirms they had only just created it and never
+ used it. Without that evidence, the decision is the owner's: they
+ delete the instance and create it again, which gives it a new lifetime
+ and a new marker key.
+3. With that evidence, delete
+ `<CARLOS_HIBERNATE_PREFIX>/<host>/rootfs-initialized/<incarnation>.json`
+ from the bucket in `CARLOS_HIBERNATE_BUCKET`. The next request wakes the
+ instance as a first boot.
The code is `internal/activator/rootfsmarker.go`.
diff --git a/internal/activator/rootfsmarker.go b/internal/activator/rootfsmarker.go
index 11daf09e1..78cc43ce0 100644
--- a/internal/activator/rootfsmarker.go
+++ b/internal/activator/rootfsmarker.go
@@ -21,18 +21,26 @@
//
// Interrupted init is refused, by design. The marker is confirmed before
// the database is placed, so an agent that stops after the confirmation
-// and before the first replica upload leaves a lifetime that never served
-// but reads as served: its next fresh wake, on any box, refuses with
-// errRootfsReplicaMissing. The operator's repair:
+// leaves a lifetime that reads as served whether or not it ever did: its
+// next fresh wake, on any box, refuses with errRootfsReplicaMissing.
//
-// 1. Confirm the instance never served: the hibernate bucket holds no
-// replica for the host, nothing under <hibernate prefix>/ltx/ (the
-// hibernate prefix is CARLOS_HIBERNATE_PREFIX joined with the host).
-// If a replica is there, it is not this case: restore, never delete.
-// 2. Delete the marker of the row's lifetime,
-// <hibernate prefix>/rootfs-initialized/<incarnation>.json, from the
-// bucket in CARLOS_HIBERNATE_BUCKET.
-// 3. The next request wakes it as a first boot.
+// Nothing the box or the bucket holds can tell that case from lost data.
+// An empty replica prefix proves nothing: a first upload that fails only
+// logs and the instance still serves (syncRootfsPlaceholder), and a replica
+// that was uploaded can be lost later. So the operator's repair:
+//
+// 1. If a replica or any copy of the database exists, restore it. Never
+// delete the marker.
+// 2. Otherwise treat the data as lost unless there is evidence from
+// outside the box and the bucket that the lifetime never served, such
+// as the instance's owner confirming it was just created and never
+// used. Without it, the way forward is the owner's: delete the
+// instance and create it again (a new lifetime, a new marker key).
+// 3. With that evidence, delete the marker of the row's lifetime,
+// <hibernate prefix>/rootfs-initialized/<incarnation>.json (the
+// hibernate prefix is CARLOS_HIBERNATE_PREFIX joined with the host),
+// from the bucket in CARLOS_HIBERNATE_BUCKET. The next request wakes it
+// as a first boot.
//
// docs/superpowers/notes/rootfs-first-boot-marker.md has the same recipe.
package activator
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-apps-3.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-apps-3.tsv
index 3859ca49f..e165e5934 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-apps-3.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-apps-3.tsv
@@ -278,7 +278,7 @@ internal/rollout/policy.go Managed legacy accepted-legacy accepted-legacy;rev3=J
@remove internal/host/schedule_wiring.go activatorDeliverer.managedByGenerations
@removed internal/host/schedule_wiring.go activatorDeliverer.managedByGenerations H3 census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: Kind and Hibernate inline become Route.ActivatorOwned, a method call the census does not count as a site; same fields plus Runtime
@coverage . 96d08337a2c4776fa713eb4b3f79785a37b0d4a08617b978b7dd0db082b9bab4
-@coverage internal/activator b94534751fad3c8928cfae3446a587c354bd96113276eeaaf4468ae41bf39453
+@coverage internal/activator f7e9dd6a648bcc922f1cd918282d0d4a133dd069fc6e948bf2b3452d4e40055c
@coverage internal/appconfig d265db3d58bf5b223018cae52d7dced43a0a5f508fec84500fc2957f845ae81e
@coverage internal/caps 43407c22a68cc404036c23b395d87c7dc772816bcc8aa74c4a2f4e3b1a1439d6
@coverage internal/edge 38c3f4d20377cfec57c4e59158c30c740f743c4c679488e375ecc02c0388b881