carlos / platform Public

Merge remote-tracking branch 'origin/main' into fix/dr1-unstamped-live-row

# Conflicts:
#	internal/provision/testdata/plan14-root-reads-chain.tsv
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev a9929c9ad4f81e8ef94e7fe5941dd9fb2c98b536 parent a8c9182parent 432135a
8 files changed, +283 −3
  • docs/superpowers/notes/2026-11-07-region-ha-g3-fixes-follow-ups.md +1 −0
  • docs/superpowers/notes/census-proposal-dr1-left-link.md +1 −1
  • docs/superpowers/notes/census-proposal-region-ha-dr2.md +19 −0
  • internal/host/hadepartures_dr2_test.go +208 −0
  • internal/host/hadepartures_scan.go +46 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +2 −1
  • internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-dr2.tsv +5 −0

CI passed — run details

diff --git a/docs/superpowers/notes/2026-11-07-region-ha-g3-fixes-follow-ups.md b/docs/superpowers/notes/2026-11-07-region-ha-g3-fixes-follow-ups.md
index 085035753..2701fcc83 100644
--- a/docs/superpowers/notes/2026-11-07-region-ha-g3-fixes-follow-ups.md
+++ b/docs/superpowers/notes/2026-11-07-region-ha-g3-fixes-follow-ups.md
@@ -11,6 +11,7 @@ Branch `region-ha-g3-fixes` (2026-11-07). These are the P3s and deferred items f
6. The simulation's churn never mutates records that carry duties. (T2 review)
7. The journal `Visited` map grows with the deployment: about 40 KB per save at 300 records. (T2 review)
8. Retiring a group member leaves its `status/boxes`, `alerts/boxes` and `metrics/boxes` objects behind until they age out (24 h). This branch makes the readers that page or block ignore a proven member with no edges file. The departure itself should delete these objects on their ETags after the edges file. That is a new delete on the termination path, so it needs its own review and census row. (8a3d302 finding, inv/status-rows.md)
+ DR-2 (2026-11-07) does the `status/boxes` part: a group member's departure deletes that snapshot on its ETag after the edges file, best-effort. `alerts/boxes` stays: deleting it would clear a firing alert as gone, which wants its own decision. `metrics/boxes` stays: it is history under many keys and blocks nothing.
## Steering
9. Bisecting a refused chunk is not paced against Route 53's 5 requests per second. Known foreign latency records in the same region are not filtered out up front, and the shrink guard can refuse a whole pass after a large drop. (T1 review)
diff --git a/docs/superpowers/notes/census-proposal-dr1-left-link.md b/docs/superpowers/notes/census-proposal-dr1-left-link.md
index eda933959..4fd104e19 100644
--- a/docs/superpowers/notes/census-proposal-dr1-left-link.md
+++ b/docs/superpowers/notes/census-proposal-dr1-left-link.md
@@ -11,6 +11,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/release/adopt.go:unstampedPlannedRow`: reads +registry:Backing, +registry:Unit, +registry:Version; written legacy, accepted-legacy, frozen
- reads `internal/release/adopt.go:adoptHost`: +registry:Host ×2, +registry:PrevVersion, +whole:Route; keeps authority, task B3,E1,E2,E3,E4,J1
-Seal: `5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36` → `c733cf0182c7985b75875a16aaacadd6d9da15ba5a635120e6da8bd0093f6155`.
+Seal: `7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22` → `160744b3062d0ab9a0cb3c7be3a391ae38cf89ffe410ddd5d179e0c3cb509b66`.
Overlay: `internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-proposal-region-ha-dr2.md b/docs/superpowers/notes/census-proposal-region-ha-dr2.md
new file mode 100644
index 000000000..0ff4759ae
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-region-ha-dr2.md
@@ -0,0 +1,19 @@
+# Census approval: region-ha-dr2
+
+Ruling `census-ruling-region-ha-dr2`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/host/hadepartures_scan.go` `Controller.complete` | sites | +whole:HADeparture | DR-2: after the edges phases, calls retireStatusSnapshot, which for a deterministic account/iid group reference only does one GET of status/boxes/<ref>.json in the deployment store and a conditional delete of that exact revision (ETag). Best-effort and time-bounded (at most 5 s, always leaving 2 s of the step for the completion save; Astra R1 P2): any failure or timeout is logged and never holds completion, paging or acknowledgement. Fixed refs untouched. No filesystem, executable or new authority read; no change to the edges deletion, completion gates or ordering. |
+
+Envelopes re-pinned: `internal/host`.
+
+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/host/hadepartures_scan.go` `Controller.complete`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read the durable departure/scan and current inventory, then conditionally delete only the retained exact edges key/revision. Reread uncertain results and refuse replacement identities. Persist deletion and acknowledged index phases before complete; queue receipts stay in memory and only complete rows acknowledge. Fresh process evidence is required before authority checkpoint reuse. Fix r1/P15: ignore the old scan-level ETag override and delete only the original departure ETag. Exact-key readback retries the same tag; a changed tag is never deleted and advances only with a different verified iid under the same ref/account/scope, otherwise holds and pages. Persist permission fault episodes; route completion faults through bounded retry. No new filesystem or executable input. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read. B5: Increment completion counter only after the durable complete phase; C4 ordering stays after that commit.;rev3=census-ruling-region-ha-p3b;basis=Require registered admitted work before completing a departure or acknowledging it. Existing coverage, inventory, lease and successor reads remain; closed members defer rather than clear obligations.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: drops the per-departure nudge bookkeeping (moved to a fixed-size global limiter). Completion gates, exact-ETag deletion and reads unchanged.;rev3=census-ruling-region-ha-g3-fixes;basis=Require current inventory visit coverage and re-read group edges before conditional deletion. Verify identity and scope before rebinding a changed ETag; preserve fixed-ref retention and exact-ETag deletion. Reads scan EdgesETag and coverage state; no new object key or read source.
+
+Seal: `5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36` → `7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-dr2.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/hadepartures_dr2_test.go b/internal/host/hadepartures_dr2_test.go
new file mode 100644
index 000000000..813d13b98
--- /dev/null
+++ b/internal/host/hadepartures_dr2_test.go
@@ -0,0 +1,208 @@
+package host
+
+import (
+ "context"
+ "errors"
+ "os"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/edgesfile"
+ "github.com/carlosframework/platform/internal/hafresh"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+ "github.com/carlosframework/platform/internal/status"
+)
+
+// DR-2 (dev rehearsal 2026-11-07): a retired group member's status snapshot
+// stays fresh for 3 x status.SnapshotPeriod after its last write, while the
+// departure deletes its edges file within minutes. edgesfile.JoinLive reads a
+// fresh snapshot with no edges file as incomplete evidence (ruling (A)), so
+// every automatic non-home create was refused until the snapshot aged out.
+// The departure that deletes the edges file must take the snapshot with it.
+
+// dr2Finalize drives the departure to "complete" with the dead box's status
+// snapshot written lastWrite before the finalize, and returns the store's
+// snapshot read the console joins on, one minute after the finalize.
+func dr2Finalize(t *testing.T, x *g3Departure, lastWrite time.Duration) edgesfile.Snapshot {
+ t.Helper()
+ ctx := t.Context()
+ for _, b := range []struct {
+ ref string
+ at time.Time
+ }{{x.dead.Ref, x.now.Add(-lastWrite)}, {x.peer.Ref, x.now}} {
+ if err := status.WriteBox(ctx, x.store, status.Box{Label: b.ref, GeneratedAt: b.at}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ // The live peer publishes its own edges file: the read below must still
+ // see one fresh, published box, so a pass that deleted everything fails.
+ peer := x.dead
+ x.dead = x.peer
+ key, tag := x.edgesKey, x.edgesTag
+ x.edgesKey, x.edgesTag = edgesfile.Key(x.peer.Ref), ""
+ x.writeEdges(t)
+ x.dead, x.edgesKey, x.edgesTag = peer, key, tag
+
+ entry, _ := provision.LifetimeEntryOf(x.records[0])
+ raw, _ := hafresh.MarkerBody(5, hafresh.Marker{V: 1, Box: x.dead.Ref, IID: x.dead.InstanceID, Lifetime: entry.ID})
+ x.fx.PutLock("instances/"+x.records[0].Host, raw)
+ for i := 0; i < 6 && x.row(t).Phase != "complete"; i++ {
+ if err := x.c.step(ctx); err != nil {
+ t.Fatal(err)
+ }
+ x.now = x.now.Add(31 * time.Second)
+ }
+ if d := x.row(t); d.Phase != "complete" {
+ t.Fatalf("departure never finalized: %+v", d)
+ }
+ if _, _, err := x.store.Get(ctx, x.edgesKey); !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("edges file survived the departure: %v", err)
+ }
+ snap, err := edgesfile.ReadLiveSnapshot(ctx, x.store, x.now.Add(time.Minute))
+ if err != nil {
+ t.Fatal(err)
+ }
+ return snap
+}
+
+func TestDepartureDR2RetiredSnapshotGoesWithEdges(t *testing.T) {
+ x := newG3Departure(t, 1)
+ // The rehearsal's shape: last snapshot about four minutes before the
+ // edges delete, so it stays fresh for another eleven.
+ snap := dr2Finalize(t, x, 4*time.Minute)
+ if !snap.BoxesComplete {
+ t.Fatal("DR-2: a retired member's fresh status snapshot leaves the live read incomplete after its departure finalized")
+ }
+ if _, _, err := x.store.Get(t.Context(), "status/boxes/"+x.dead.Ref+".json"); !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("retired member's status snapshot survived: %v", err)
+ }
+ if _, _, err := x.store.Get(t.Context(), "status/boxes/"+x.peer.Ref+".json"); err != nil {
+ t.Fatalf("live peer's status snapshot was touched: %v", err)
+ }
+ fresh := 0
+ for _, f := range snap.Files {
+ if f.Fresh {
+ fresh++
+ }
+ }
+ if fresh != 1 || !snap.EvidenceComplete() {
+ t.Fatalf("live read after departure: %d fresh, complete %v", fresh, snap.EvidenceComplete())
+ }
+}
+
+// statusDeleteRefused fails every delete of a status snapshot.
+type statusDeleteRefused struct {
+ release.Store
+ tries int
+}
+
+func (s *statusDeleteRefused) refuse(key string) error {
+ if strings.HasPrefix(key, "status/boxes/") {
+ s.tries++
+ return errors.New("AccessDenied")
+ }
+ return nil
+}
+func (s *statusDeleteRefused) Delete(ctx context.Context, key string) error {
+ if err := s.refuse(key); err != nil {
+ return err
+ }
+ return s.Store.Delete(ctx, key)
+}
+func (s *statusDeleteRefused) DeleteIfMatch(ctx context.Context, key, etag string) error {
+ if err := s.refuse(key); err != nil {
+ return err
+ }
+ return release.DeleteIfMatch(ctx, s.Store, key, etag)
+}
+func (s *statusDeleteRefused) DeleteRevision(ctx context.Context, key, etag string) error {
+ if err := s.refuse(key); err != nil {
+ return err
+ }
+ return s.Store.(release.IndexedDeleter).DeleteRevision(ctx, key, etag)
+}
+func (s *statusDeleteRefused) IndexDeletion(ctx context.Context, key string) error {
+ return s.Store.(release.IndexedDeleter).IndexDeletion(ctx, key)
+}
+
+// The snapshot delete is a cleanup: refusing it must not hold the departure
+// (its duties are recovered and its edges file is gone), so the worst case is
+// the pre-fix window, never a stuck departure or a page.
+func TestDepartureDR2SnapshotDeleteFailureDoesNotBlock(t *testing.T) {
+ x := newG3Departure(t, 1)
+ refused := &statusDeleteRefused{Store: x.store}
+ x.c.cfg.OpenStore = func(context.Context) (release.Store, error) { return refused, nil }
+ snap := dr2Finalize(t, x, 4*time.Minute)
+ if refused.tries == 0 {
+ t.Fatal("the departure never tried to delete the retired snapshot")
+ }
+ if x.pages != 0 {
+ t.Fatalf("a refused snapshot delete paged %d times", x.pages)
+ }
+ if snap.BoxesComplete {
+ t.Fatal("the refused delete left no snapshot, so this test proves nothing")
+ }
+ if _, _, acks := x.queue.counts(); acks != 1 {
+ t.Fatal("departure not acknowledged", acks)
+ }
+}
+
+// A fixed reference is reused by the box that replaces it, so its departure
+// must leave the snapshot under that label alone: it may be the new box's.
+func TestDepartureDR2FixedReferenceKeepsSnapshot(t *testing.T) {
+ store := release.NewDirStore(t.TempDir())
+ if err := status.WriteBox(t.Context(), store, status.Box{Label: "fixed", GeneratedAt: time.Now()}); err != nil {
+ t.Fatal(err)
+ }
+ c := &Controller{cfg: DepartureConfig{Logf: func(string, ...any) {}}}
+ d := registry.HADeparture{}
+ d.Box.Ref, d.Box.Account, d.Box.InstanceID = "fixed", "111122223333", "i-1123456789abcdef0"
+ c.retireStatusSnapshot(t.Context(), store, d)
+ if _, _, err := store.Get(t.Context(), "status/boxes/fixed.json"); err != nil {
+ t.Fatalf("a fixed reference's departure took the snapshot under its label: %v", err)
+ }
+}
+
+// statusReadHangs answers every status snapshot read only when its context
+// ends: a store that has stopped answering.
+type statusReadHangs struct{ statusDeleteRefused }
+
+func (s *statusReadHangs) Get(ctx context.Context, key string) ([]byte, string, error) {
+ if strings.HasPrefix(key, "status/boxes/") {
+ s.tries++
+ <-ctx.Done()
+ return nil, "", ctx.Err()
+ }
+ return s.Store.Get(ctx, key)
+}
+
+// Astra R1 P2: the cleanup must not spend the time the departure needs to
+// record that it is complete. A hung status read near the end of a step's
+// budget would otherwise fail save("complete") and page for a departure
+// whose duties and edges file are already settled.
+func TestDepartureDR2HungSnapshotReadDoesNotPage(t *testing.T) {
+ x := newG3Departure(t, 1)
+ hung := &statusReadHangs{statusDeleteRefused{Store: x.store}}
+ x.c.cfg.OpenStore = func(context.Context) (release.Store, error) { return hung, nil }
+ entry, _ := provision.LifetimeEntryOf(x.records[0])
+ raw, _ := hafresh.MarkerBody(5, hafresh.Marker{V: 1, Box: x.dead.Ref, IID: x.dead.InstanceID, Lifetime: entry.ID})
+ x.fx.PutLock("instances/"+x.records[0].Host, raw)
+ for i := 0; i < 6 && x.row(t).Phase != "complete"; i++ {
+ ctx, cancel := context.WithTimeout(t.Context(), snapshotRetireReserve+time.Second)
+ _ = x.c.step(ctx)
+ cancel()
+ x.now = x.now.Add(31 * time.Second)
+ }
+ if d := x.row(t); d.Phase != "complete" {
+ t.Fatalf("a hung snapshot read held the departure: %+v", d)
+ }
+ if x.pages != 0 {
+ t.Fatalf("a hung snapshot read paged %d times", x.pages)
+ }
+ if hung.tries == 0 {
+ t.Fatal("the cleanup never ran, so this test proves nothing")
+ }
+}
diff --git a/internal/host/hadepartures_scan.go b/internal/host/hadepartures_scan.go
index 990828a87..b9302e3ab 100644
--- a/internal/host/hadepartures_scan.go
+++ b/internal/host/hadepartures_scan.go
@@ -669,6 +669,7 @@ func (c *Controller) complete(ctx context.Context, id string) (result error) {
return err
}
}
+ c.retireStatusSnapshot(ctx, store, d)
if err = save("complete"); err != nil {
return err
}
@@ -679,6 +680,51 @@ func (c *Controller) complete(ctx context.Context, id string) (result error) {
return c.ackDeparture(ctx, d)
}
+// retireStatusSnapshot deletes a departed group member's status snapshot once
+// its edges file is gone (DR-2). The snapshot stays fresh for three status
+// periods after the box's last write, and edgesfile.JoinLive reads a fresh
+// snapshot with no edges file as incomplete evidence, which refuses every
+// automatic create outside the home region until it ages out.
+//
+// Only a group reference qualifies: it names one account and instance
+// forever, and that instance is proven terminated, so nothing else writes
+// this key. A fixed reference is reused by its replacement, whose snapshot
+// this must never take. The delete is conditional on the revision read here,
+// and it is a cleanup: any failure leaves the snapshot to age out as before
+// and never holds the departure.
+// snapshotRetireReserve is the time retireStatusSnapshot leaves for the
+// durable completion save that follows it.
+const snapshotRetireReserve = 2 * time.Second
+
+func (c *Controller) retireStatusSnapshot(ctx context.Context, store release.Store, d registry.HADeparture) {
+ if d.Box.Ref != groupReferenceOf(d.Box.Account, d.Box.InstanceID) {
+ return
+ }
+ key := "status/boxes/" + d.Box.Ref + ".json"
+ // Leave the step the time it needs to record completion (Astra R1 P2):
+ // a hung read here must not fail save("complete") and page.
+ budget := 5 * time.Second
+ if deadline, ok := ctx.Deadline(); ok {
+ budget = min(budget, time.Until(deadline)-snapshotRetireReserve)
+ }
+ if budget <= 0 {
+ c.logf("Box %s left its status report %s behind (no time left in this pass). It stops counting as fresh within 15 minutes.", d.Box.Ref, key)
+ return
+ }
+ call, cancel := context.WithTimeout(ctx, budget)
+ defer cancel()
+ _, tag, err := store.Get(call, key)
+ if errors.Is(err, os.ErrNotExist) {
+ return
+ }
+ if err == nil {
+ err = release.DeleteIfMatch(call, store, key, tag)
+ }
+ if err != nil {
+ c.logf("Box %s left its status report %s behind (%v). It stops counting as fresh within 15 minutes.", d.Box.Ref, key, err)
+ }
+}
+
func (c *Controller) bindDepartureEdges(ctx context.Context, d registry.HADeparture, raw []byte, tag string) error {
if tag == "" || c.cfg.Identities == nil || d.Box.Ref != groupReferenceOf(d.Box.Account, d.Box.InstanceID) {
return errDepartureIdentity
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index e28d8bf0d..8bbf82d75 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -117,4 +117,5 @@ plan14-root-reads-signin-first-run-mobile.tsv 61027a32e31cb7ce017304f526f668c269
plan14-root-reads-claim-ux-edge.tsv 889ce9f72f93b581b29527e5c5d4410b47732424ce8ce45c080904ebb6c52195
plan14-root-reads-region-ha-g3-fixes.tsv cd001bf3a9a8871f12d1ca9cfa0a925760c1fc345dc911246ffaabc235dfabf6
plan14-root-reads-claim-countdown.tsv 5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36
-plan14-root-reads-dr1-left-link.tsv c733cf0182c7985b75875a16aaacadd6d9da15ba5a635120e6da8bd0093f6155
+plan14-root-reads-region-ha-dr2.tsv 7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22
+plan14-root-reads-dr1-left-link.tsv 160744b3062d0ab9a0cb3c7be3a391ae38cf89ffe410ddd5d179e0c3cb509b66
diff --git a/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv b/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
index 822cc9ec2..50267e7f2 100644
--- a/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
+++ b/internal/provision/testdata/plan14-root-reads-dr1-left-link.tsv
@@ -4,5 +4,5 @@
@legacy 5b6bf96a9b163865e5e064f584de49f3c5c28a115d32a2ae0b9669babb6cd859 internal/release/adopt.go unstampedPlannedRow legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new pure predicate over the route row (Version, Unit, Backing, sidecar, ActivatorOwned) and the live version already read; no file, store or process access registry:Backing@121,registry:Unit@104,registry:Version@71 e8eecc0ea0215995b49a66f3a9eb833d95d9364f152ee491ea085d03ff55eee9
internal/release/adopt.go unstampedPlannedRow legacy accepted-legacy accepted-legacy;rev3=census-ruling-dr1-left-link;basis=new pure predicate over the route row (Version, Unit, Backing, sidecar, ActivatorOwned) and the live version already read; no file, store or process access registry:Backing@121,registry:Unit@104,registry:Version@71 e8eecc0ea0215995b49a66f3a9eb833d95d9364f152ee491ea085d03ff55eee9
internal/release/adopt.go adoptHost authority B3,E1,E2,E3,E4,J1 E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed or unseed the exec mode before PointLive (R24), under the same full-row compare and no ServingVersion/GoodVersion/running build guard. Version stamps staging and is not serving evidence. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read.;rev3=census-ruling-dr1-left-link;basis=the up-to-date return is skipped for an unstamped planned row (unstampedPlannedRow), which takes the existing install path with all its gates; on that repair (cur == ver) the D2 history is not seeded from the candidate path, the stamp keeps PrevVersion, and the refusal clear keeps the up-to-date rule. No new read kind registry:App@11580,registry:App@11734,registry:App@13088,registry:App@14336,registry:App@15934,registry:App@21429,registry:App@26905,registry:App@3144,registry:App@34685,registry:App@6791,registry:App@8092,registry:App@8286,registry:Backing@21145,registry:GoodVersion@21184,registry:Hibernate@36158,registry:Host@10517,registry:Host@11460,registry:Host@11493,registry:Host@11593,registry:Host@11747,registry:Host@11843,registry:Host@11875,registry:Host@11940,registry:Host@12390,registry:Host@12730,registry:Host@12854,registry:Host@13301,registry:Host@13410,registry:Host@13612,registry:Host@14426,registry:Host@15212,registry:Host@15687,registry:Host@15920,registry:Host@16262,registry:Host@16897,registry:Host@20605,registry:Host@20713,registry:Host@2105,registry:Host@21397,registry:Host@22217,registry:Host@22375,registry:Host@22837,registry:Host@22889,registry:Host@2294,registry:Host@23036,registry:Host@23123,registry:Host@2375,registry:Host@24229,registry:Host@24473,registry:Host@25133,registry:Host@25518,registry:Host@25659,registry:Host@26873,registry:Host@27000,registry:Host@28342,registry:Host@28992,registry:Host@3157,registry:Host@32225,registry:Host@32843,registry:Host@33168,registry:Host@33242,registry:Host@33489,registry:Host@33640,registry:Host@34857,registry:Host@35142,registry:Host@35255,registry:Host@35693,registry:Host@35749,registry:Host@35853,registry:Host@36000,registry:Host@36859,registry:Host@36985,registry:Host@37073,registry:Host@4469,registry:Host@4616,registry:Host@5579,registry:Host@5684,registry:Host@6903,registry:Host@6951,registry:Host@7068,registry:Host@7100,registry:Host@7978,registry:Host@8146,registry:Host@8272,registry:Host@8391,registry:Host@8869,registry:Host@9256,registry:Host@9482,registry:Host@9578,registry:Host@9669,registry:Kind@21101,registry:Kind@554,registry:PrevVersion@35044,registry:Runtime@11244,registry:Runtime@12648,registry:ServingVersion@21208,registry:Socket@21126,registry:Stateless@21085,registry:Stateless@21336,registry:Tunnel@21165,registry:Unit@33388,registry:Unit@579,whole:Route@10106,whole:Route@10460,whole:Route@11575,whole:Route@11729,whole:Route@13078,whole:Route@14326,whole:Route@15902,whole:Route@16467,whole:Route@16873,whole:Route@18073,whole:Route@18376,whole:Route@18532,whole:Route@20862,whole:Route@21006,whole:Route@21282,whole:Route@21419,whole:Route@2206,whole:Route@23958,whole:Route@24357,whole:Route@26895,whole:Route@3139,whole:Route@31796,whole:Route@34833,whole:Route@3595,whole:Route@4347,whole:Route@4587,whole:Route@6786 b89abf1c8a4e23cbcea7c35ee2c4653b2a97dbcafb38cb33907901c34b5e19f2
-@coverage internal/host d1354d1a98de9d4b9018e6df0b65ac1f4e6c5a1d2dd922100fe316d592c7be22
+@coverage internal/host 99af3938fef7bc05f9c970ed39a37d3731a98886020150af2c5ffdffa257b493
@coverage internal/release ed09cbbff76338cf9a5fe15dd1bc2316e4540bf4d882b0736ea6a49067922b85
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-dr2.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-dr2.tsv
new file mode 100644
index 000000000..c836b8b8b
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-dr2.tsv
@@ -0,0 +1,5 @@
+# Census overlay region-ha-dr2, written by census-propose (#369). census-ruling-region-ha-dr2, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-dr2.md.
+# 0 body, 1 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 96bc6eeef386b0a0a2cbbb9fcda68a84e458f26bd385510e2425f73f869dc337 internal/host/hadepartures_scan.go Controller.complete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read the durable departure/scan and current inventory, then conditionally delete only the retained exact edges key/revision. Reread uncertain results and refuse replacement identities. Persist deletion and acknowledged index phases before complete; queue receipts stay in memory and only complete rows acknowledge. Fresh process evidence is required before authority checkpoint reuse. Fix r1/P15: ignore the old scan-level ETag override and delete only the original departure ETag. Exact-key readback retries the same tag; a changed tag is never deleted and advances only with a different verified iid under the same ref/account/scope, otherwise holds and pages. Persist permission fault episodes; route completion faults through bounded retry. No new filesystem or executable input. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read. B5: Increment completion counter only after the durable complete phase; C4 ordering stays after that commit.;rev3=census-ruling-region-ha-p3b;basis=Require registered admitted work before completing a departure or acknowledging it. Existing coverage, inventory, lease and successor reads remain; closed members defer rather than clear obligations.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: drops the per-departure nudge bookkeeping (moved to a fixed-size global limiter). Completion gates, exact-ETag deletion and reads unchanged.;rev3=census-ruling-region-ha-g3-fixes;basis=Require current inventory visit coverage and re-read group edges before conditional deletion. Verify identity and scope before rebinding a changed ETag; preserve fixed-ref retention and exact-ETag deletion. Reads scan EdgesETag and coverage state; no new object key or read source.;rev3=census-ruling-region-ha-dr2;basis=DR-2: after the edges phases, calls retireStatusSnapshot, which for a deterministic account/iid group reference only does one GET of status/boxes/<ref>.json in the deployment store and a conditional delete of that exact revision (ETag). Best-effort and time-bounded (at most 5 s, always leaving 2 s of the step for the completion save; Astra R1 P2): any failure or timeout is logged and never holds completion, paging or acknowledgement. Fixed refs untouched. No filesystem, executable or new authority read; no change to the edges deletion, completion gates or ordering. registry:DeleteUncertain@3813,registry:DeleteUncertain@4198,registry:EdgesETag@1894,registry:EdgesETag@2906,registry:Hosts@5076,registry:InventoryGeneration@1846,registry:PermissionAlerted@2426,registry:PermissionAlerted@3559,registry:PermissionAlerted@4342,registry:PermissionAlerted@4746,registry:PermissionAlerted@841,registry:PermissionAlerted@883,registry:Phase@1002,registry:Phase@1042,registry:Phase@1538,registry:Phase@262,registry:Phase@3692,registry:Phase@4460,registry:Phase@680,registry:Phase@950,registry:Phase@967,registry:Version@665,whole:HADeparture@2846,whole:HADeparture@315,whole:HADeparture@442,whole:HADeparture@4872,whole:HADeparture@5125,whole:HADepartureHostScan@5078,whole:HADepartureScan@1718,whole:HADepartureScan@643 d27948e878037f10244e753357cf0686a69bfb065e44d5584117fabb707259c3
+internal/host/hadepartures_scan.go Controller.complete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3b-t;basis=B4: Read the durable departure/scan and current inventory, then conditionally delete only the retained exact edges key/revision. Reread uncertain results and refuse replacement identities. Persist deletion and acknowledged index phases before complete; queue receipts stay in memory and only complete rows acknowledge. Fresh process evidence is required before authority checkpoint reuse. Fix r1/P15: ignore the old scan-level ETag override and delete only the original departure ETag. Exact-key readback retries the same tag; a changed tag is never deleted and advances only with a different verified iid under the same ref/account/scope, otherwise holds and pages. Persist permission fault episodes; route completion faults through bounded retry. No new filesystem or executable input. B4 fix r4/P18 supersedes fixed-ref deletion: only the deterministic account/iid group reference may delete its retained exact ETag. Every other ref performs an exact-key GET and stays pending unless absent or the existing verified newer-incarnation check succeeds; the live replacement file is left intact. Group revision changes stay pending. No new key or authority read. B5: Increment completion counter only after the durable complete phase; C4 ordering stays after that commit.;rev3=census-ruling-region-ha-p3b;basis=Require registered admitted work before completing a departure or acknowledging it. Existing coverage, inventory, lease and successor reads remain; closed members defer rather than clear obligations.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: drops the per-departure nudge bookkeeping (moved to a fixed-size global limiter). Completion gates, exact-ETag deletion and reads unchanged.;rev3=census-ruling-region-ha-g3-fixes;basis=Require current inventory visit coverage and re-read group edges before conditional deletion. Verify identity and scope before rebinding a changed ETag; preserve fixed-ref retention and exact-ETag deletion. Reads scan EdgesETag and coverage state; no new object key or read source.;rev3=census-ruling-region-ha-dr2;basis=DR-2: after the edges phases, calls retireStatusSnapshot, which for a deterministic account/iid group reference only does one GET of status/boxes/<ref>.json in the deployment store and a conditional delete of that exact revision (ETag). Best-effort and time-bounded (at most 5 s, always leaving 2 s of the step for the completion save; Astra R1 P2): any failure or timeout is logged and never holds completion, paging or acknowledgement. Fixed refs untouched. No filesystem, executable or new authority read; no change to the edges deletion, completion gates or ordering. registry:DeleteUncertain@3813,registry:DeleteUncertain@4198,registry:EdgesETag@1894,registry:EdgesETag@2906,registry:Hosts@5076,registry:InventoryGeneration@1846,registry:PermissionAlerted@2426,registry:PermissionAlerted@3559,registry:PermissionAlerted@4342,registry:PermissionAlerted@4746,registry:PermissionAlerted@841,registry:PermissionAlerted@883,registry:Phase@1002,registry:Phase@1042,registry:Phase@1538,registry:Phase@262,registry:Phase@3692,registry:Phase@4460,registry:Phase@680,registry:Phase@950,registry:Phase@967,registry:Version@665,whole:HADeparture@2846,whole:HADeparture@315,whole:HADeparture@442,whole:HADeparture@4872,whole:HADeparture@5125,whole:HADepartureHostScan@5078,whole:HADepartureScan@1718,whole:HADepartureScan@643 d27948e878037f10244e753357cf0686a69bfb065e44d5584117fabb707259c3
+@coverage internal/host 384d3a2e206f25d36cd2045f96e3311d618dc363fdc8ce633a3ccd8de7b8937c