carlos / platform Public

root bounds a stop request's roster numeral by its own fresh roster read (roster binding fix round 1, finding 3)

Root accepted any non-zero RosterRevision, persisted it in the fence and
signed it into receipts. A future numeral (math.MaxUint64) produced
evidence both unchanged console verifiers reject, and B2 then kept it on
every retry and through crash recovery.

ClaimStopCoordinator gains VerifiedRosterRevision. FenceAndStop (before a
fence is begun or resumed) and witnessNoProcess (before its target or
receipt) refuse n outside 0 < n <= its value; nil refuses. In
instance-control, rootStopCoordinator binds it to
claimCleanupEnrollment.rosterRevision: root's own Directory.Read of the
signed roster at that moment, the box's row still naming its enrollment,
quarantined or not, never the startup read. An assembly without a cleanup
enrollment bounds by the fresh Identity.Verify instead. Retries keep the
fence's original numeral.

TestStopBoundsRosterNumeralByRootsRosterRead runs through the real
assembly: MaxUint64 and revision+1 are refused for an operation stop and the
no-process witness with no fence, drain or publication; the roster's
revision passes; a retry after hold churn returns the original receipt;
while quarantined the bound still admits historical cleanup at the current
revision and refuses beyond it. Fixtures that build coordinators by hand
supply their roster's revision. Census re-pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev ca73afa90a2d35e277ccc8c0c5ebafa737bac52c parent a9e6755
10 files changed, +249 −25
  • internal/host/claim_binding_handover_linux_test.go +11 −5
  • internal/host/claim_binding_numeral_linux_test.go +131 −0
  • internal/host/claim_binding_receipt_test.go +1 −1
  • internal/host/claimassembly.go +16 −1
  • internal/host/claimcleanup_identity.go +21 −0
  • internal/host/claimfilesseed_cli_rootrunner_linux_test.go +1 −0
  • internal/host/claimretryrecovery_test.go +10 −1
  • internal/host/claimstop.go +44 −12
  • internal/host/claimstop_test.go +7 −1
  • internal/provision/testdata/plan14-root-reads-roster-binding.tsv +7 −4
diff --git a/internal/host/claim_binding_handover_linux_test.go b/internal/host/claim_binding_handover_linux_test.go
index 317358989..b5a3f1ccb 100644
--- a/internal/host/claim_binding_handover_linux_test.go
+++ b/internal/host/claim_binding_handover_linux_test.go
@@ -26,8 +26,17 @@ import (
// receipt, stamped with stamp.
func (w *assemblyWorld) operationStop(host, stamp string) hostclaim.Observed {
w.t.Helper()
- ctx := w.t.Context()
- o, err := hostclaim.Update(ctx, w.store, w.claim(host), func(c *hostclaim.Claim) error {
+ o := w.operationSession(host)
+ if _, err := w.root.Stop.Coordinator.FenceAndStop(w.t.Context(), w.priorStop(o, stamp)); err != nil {
+ w.t.Fatal("operation stop of the prior:", err)
+ }
+ return o
+}
+
+// operationSession is operationStop's TEST-ONLY claim transition alone.
+func (w *assemblyWorld) operationSession(host string) hostclaim.Observed {
+ w.t.Helper()
+ o, err := hostclaim.Update(w.t.Context(), w.store, w.claim(host), func(c *hostclaim.Claim) error {
h := c.Holder
h.Session, h.WriterBox, h.Generation = c.Gen+1, "box-1", "g5"
h.Admissions = []hostclaim.AdmissionRecord{{Region: "ie", Session: h.Session, Box: "box-1", Generation: "g5", Mode: "fresh"}}
@@ -37,9 +46,6 @@ func (w *assemblyWorld) operationStop(host, stamp string) hostclaim.Observed {
if err != nil {
w.t.Fatal(err)
}
- if _, err := w.root.Stop.Coordinator.FenceAndStop(ctx, w.priorStop(o, stamp)); err != nil {
- w.t.Fatal("operation stop of the prior:", err)
- }
return o
}
diff --git a/internal/host/claim_binding_numeral_linux_test.go b/internal/host/claim_binding_numeral_linux_test.go
new file mode 100644
index 000000000..2c8671a79
--- /dev/null
+++ b/internal/host/claim_binding_numeral_linux_test.go
@@ -0,0 +1,131 @@
+//go:build linux
+
+package host
+
+import (
+ "context"
+ "errors"
+ "math"
+ "strconv"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/hostguard"
+)
+
+// Fix round 1, finding 3: root bounds an agent-sent RosterRevision by
+// 0 < n <= the revision of the roster it reads and verifies itself at that
+// moment, before any durable fence, drain or receipt. Through the real
+// instance-control assembly: rootStopCoordinator's bound is the cleanup
+// enrollment's fresh read of the signed roster. A future numeral
+// (math.MaxUint64, or the roster's revision + 1) is refused for an
+// operation stop and for the no-process witness, with no fence, no drain
+// and nothing published; the roster's own revision passes, and a retry
+// after roster writes keeps the original numeral (B2). While quarantined
+// the fresh read still bounds historical cleanup.
+func TestStopBoundsRosterNumeralByRootsRosterRead(t *testing.T) {
+ ctx := t.Context()
+ w := newAssemblyWorld(t)
+ w.mustStart()
+ b0 := w.fresh()
+ recA, routeA := w.newHost("a")
+ recB, routeB := w.newHost("b")
+ for _, rec := range []struct {
+ host string
+ agent func() error
+ }{{recA.Host, func() error { return w.agent(b0).install(recA, routeA) }}, {recB.Host, func() error { return w.agent(b0).install(recB, routeB) }}} {
+ if err := rec.agent(); err != nil {
+ t.Fatal(rec.host, err)
+ }
+ }
+ drains := 0
+ inner := w.root.Stop.Coordinator.Drainer
+ w.root.Stop.Coordinator.Drainer = stopDrainFunc(func(ctx context.Context, req StopRequest, fence string) (DrainAcknowledgement, error) {
+ drains++
+ return inner.DrainClaim(ctx, req, fence)
+ })
+ published := func(host string) int {
+ t.Helper()
+ keys, err := w.store.List(ctx, "control/hosts/"+host+"/")
+ if err != nil {
+ t.Fatal(err)
+ }
+ n := 0
+ for _, k := range keys {
+ if strings.HasPrefix(k, "control/hosts/"+host+"/evidence/") || strings.HasPrefix(k, "control/hosts/"+host+"/serving-evidence/") {
+ n++
+ }
+ }
+ return n
+ }
+ current := w.roster.read().Roster.Revision
+
+ // Operation stop of A's writer session.
+ o := w.operationSession(recA.Host)
+ captured := hostguard.Captured{Incarnation: o.Claim.Holder.Incarnation, Stamp: o.Claim.Holder.Stamp}
+ for _, n := range []uint64{math.MaxUint64, current + 1} {
+ req := w.priorStop(o, b0.Binding)
+ req.RosterRevision = n
+ if _, err := w.root.Stop.Coordinator.FenceAndStop(ctx, req); !errors.Is(err, ErrClaimStopIdentity) {
+ t.Fatalf("operation stop with numeral %d: %v", n, err)
+ }
+ if v := w.view(recA.Host, captured); v.Pending != nil || len(v.Receipts) != 0 || drains != 0 || published(recA.Host) != 0 {
+ t.Fatalf("numeral %d left effects: pending %v receipts %d drains %d published %d", n, v.Pending, len(v.Receipts), drains, published(recA.Host))
+ }
+ }
+ req := w.priorStop(o, b0.Binding)
+ req.RosterRevision = current
+ stopped, err := w.root.Stop.Coordinator.FenceAndStop(ctx, req)
+ if err != nil {
+ t.Fatal("operation stop with the roster's revision:", err)
+ }
+ if r := decodeStopReceipt(t, stopped.Bytes); r.DirectoryRevision != strconv.FormatUint(current, 10) {
+ t.Fatalf("receipt numeral %q, want %d", r.DirectoryRevision, current)
+ }
+ // Roster writes, then a retry with the newer numeral: the original
+ // numeral and receipt (B2).
+ w.roster.holdChurn()
+ newer := w.roster.read().Roster.Revision
+ if newer <= current {
+ t.Fatalf("hold churn did not move the roster: %d -> %d", current, newer)
+ }
+ req.RosterRevision = newer
+ again, err := w.root.Stop.Coordinator.FenceAndStop(ctx, req)
+ if err != nil || string(again.Bytes) != string(stopped.Bytes) {
+ t.Fatalf("retry after roster writes: %v (same receipt %v)", err, string(again.Bytes) == string(stopped.Bytes))
+ }
+
+ // No-process witness for B (session zero).
+ before := published(recB.Host)
+ for _, n := range []uint64{math.MaxUint64, newer + 1} {
+ if _, err := w.noProcessStop(recB.Host, b0.Binding, n); !errors.Is(err, ErrClaimStopIdentity) {
+ t.Fatalf("no-process witness with numeral %d: %v", n, err)
+ }
+ if published(recB.Host) != before {
+ t.Fatalf("numeral %d published a no-process receipt", n)
+ }
+ }
+
+ // Quarantined: the fresh read still bounds historical cleanup.
+ w.roster.quarantine("loss_1")
+ quarantined := w.roster.read().Roster.Revision
+ if _, err := w.noProcessStop(recB.Host, b0.Binding, quarantined+1); !errors.Is(err, ErrClaimStopIdentity) {
+ t.Fatal("quarantined no-process witness with a future numeral:", err)
+ }
+ witnessed, err := w.noProcessStop(recB.Host, b0.Binding, quarantined)
+ if err != nil {
+ t.Fatal("quarantined no-process witness with the roster's revision:", err)
+ }
+ if r := decodeStopReceipt(t, witnessed.Bytes); r.DirectoryRevision != strconv.FormatUint(quarantined, 10) {
+ t.Fatalf("quarantined receipt numeral %q, want %d", r.DirectoryRevision, quarantined)
+ }
+ cleanup := w.priorStop(o, b0.Binding)
+ cleanup.Cleanup, cleanup.RosterRevision = true, quarantined
+ if again, err := w.root.Stop.Coordinator.FenceAndStop(ctx, cleanup); err != nil || string(again.Bytes) != string(stopped.Bytes) {
+ t.Fatalf("quarantined cleanup stop: %v", err)
+ }
+ cleanup.RosterRevision = math.MaxUint64
+ if _, err := w.root.Stop.Coordinator.FenceAndStop(ctx, cleanup); !errors.Is(err, ErrClaimStopIdentity) {
+ t.Fatal("quarantined cleanup stop with a future numeral:", err)
+ }
+}
diff --git a/internal/host/claim_binding_receipt_test.go b/internal/host/claim_binding_receipt_test.go
index 43fc2dab5..4fd1b6733 100644
--- a/internal/host/claim_binding_receipt_test.go
+++ b/internal/host/claim_binding_receipt_test.go
@@ -140,7 +140,7 @@ func (w *receiptWorld) coordinator() ClaimStopCoordinator {
h := w.claim().Claim.Holder
return StopInventory{Host: host, Incarnation: h.Incarnation, InstallationStamp: h.Stamp, Box: "box-1", Enrollment: w.installed.Enrollment, DirectoryRevision: w.installed.Binding, Complete: true, Entries: []StopInventoryEntry{{Kind: "path", ArtifactID: "artifact-1", ManagedRoot: "data", RelativePath: "instances/" + host}}}, nil
}
- return ClaimStopCoordinator{EvidenceSigner: w.key, RequestLimit: hostbox.RequestLimit, Guard: w.guard(), Claims: hostguard.StoreReader{Store: w.roster.store}, CarlosUID: 1001, Evidence: w.roster.store,
+ return ClaimStopCoordinator{VerifiedRosterRevision: (&claimCleanupEnrollment{actor: w.installed, directory: w.roster.dir}).rosterRevision, EvidenceSigner: w.key, RequestLimit: hostbox.RequestLimit, Guard: w.guard(), Claims: hostguard.StoreReader{Store: w.roster.store}, CarlosUID: 1001, Evidence: w.roster.store,
Peers: stopPeerFunc(func(context.Context) (StopPeer, error) {
return StopPeer{UID: 1001, PID: 42, ProcessStart: "start-42", BootID: "boot-1", ControllerID: "controller-1"}, nil
}),
diff --git a/internal/host/claimassembly.go b/internal/host/claimassembly.go
index f0f4b20d1..4de0210b6 100644
--- a/internal/host/claimassembly.go
+++ b/internal/host/claimassembly.go
@@ -385,7 +385,8 @@ func NewProductionRootClaimStop(ctx context.Context) (http.Handler, error) {
// rootStopCoordinator is root's stop coordinator over the assembly and the
// deployment store, before NewProductionClaimStopHandler binds its peer
-// authentication, kernel and identities.
+// authentication, kernel and identities. Its numeral bound is the cleanup
+// enrollment's fresh roster read.
func (assembly *ClaimAssembly) rootStopCoordinator(store release.Store) ClaimStopCoordinator {
coordinator := *assembly.Stop
coordinator.Guard = assembly.Guard
@@ -393,6 +394,20 @@ func (assembly *ClaimAssembly) rootStopCoordinator(store release.Store) ClaimSto
coordinator.Claims = hostguard.StoreReader{Store: store}
coordinator.Inventory = assembly.Reconcile.Inventory
coordinator.Evidence = store
+ // The numeral bound is root's own fresh verified roster read (fix
+ // round 1, finding 3): the cleanup enrollment's, which still reads a
+ // quarantined box's roster. An assembly without one (not instance-control
+ // as production builds it) bounds by the fresh identity instead, which
+ // refuses while quarantined.
+ if assembly.cleanupEnrollment != nil {
+ coordinator.VerifiedRosterRevision = assembly.cleanupEnrollment.rosterRevision
+ } else {
+ identity := assembly.Identity
+ coordinator.VerifiedRosterRevision = func(ctx context.Context) (uint64, error) {
+ actor, err := identity.Verify(ctx)
+ return actor.Revision, err
+ }
+ }
return coordinator
}
diff --git a/internal/host/claimcleanup_identity.go b/internal/host/claimcleanup_identity.go
index 9c8adb32f..7b8865af2 100644
--- a/internal/host/claimcleanup_identity.go
+++ b/internal/host/claimcleanup_identity.go
@@ -64,6 +64,27 @@ func (p *claimCleanupEnrollment) configureSigner(ctx context.Context, c *ClaimSt
return nil
}
+// rosterRevision is root's own verified roster read at the moment of the
+// call (directory.Read checks the deployment's signature): the write
+// counter of a roster that still names this box under its enrollment. It
+// holds while the box is quarantined, so historical cleanup keeps working;
+// only the bound it gives a stop request's numeral matters (fix round 1,
+// finding 3). It is never the startup read.
+func (p *claimCleanupEnrollment) rosterRevision(ctx context.Context) (uint64, error) {
+ if p == nil {
+ return 0, ErrClaimStopUnavailable
+ }
+ roster, err := p.directory.Read(ctx)
+ if err != nil {
+ return 0, err
+ }
+ row, ok := roster.Roster.Boxes[p.actor.Box]
+ if !ok || row.Enrollment != p.actor.Enrollment || roster.Roster.Revision == 0 {
+ return 0, ErrClaimStopIdentity
+ }
+ return roster.Roster.Revision, nil
+}
+
func (o ClaimOwnerBindings) actorForConstruction(ctx context.Context, mode string) (hostbox.Actor, error) {
if mode == "instance-control" && o.cleanupEnrollment != nil {
return o.cleanupEnrollment.actor, nil
diff --git a/internal/host/claimfilesseed_cli_rootrunner_linux_test.go b/internal/host/claimfilesseed_cli_rootrunner_linux_test.go
index 4c16d281c..0298c0562 100644
--- a/internal/host/claimfilesseed_cli_rootrunner_linux_test.go
+++ b/internal/host/claimfilesseed_cli_rootrunner_linux_test.go
@@ -302,6 +302,7 @@ func TestFilesSeedCLIStopFixture(t *testing.T) {
c.Kernel = f.f.kernel
f.p.root.Stop.Coordinator = c
c.RetainNoProcess = f.p.retainLegacyNoProcess
+ c.VerifiedRosterRevision = fixedRosterRevision(f.actor.Revision)
o := f.f.read()
h := o.Claim.Holder
req := StopRequest{Region: f.actor.Region, Host: o.Host, Incarnation: h.Incarnation, InstallationStamp: h.Stamp, Box: f.actor.Box, Enrollment: f.actor.Enrollment, BootID: f.f.peer.BootID, ControllerID: f.f.peer.ControllerID, ExpectedClaimETag: o.ETag, ExpectedDirectoryRevision: f.actor.Binding, RosterRevision: f.actor.Revision}
diff --git a/internal/host/claimretryrecovery_test.go b/internal/host/claimretryrecovery_test.go
index 5894be165..e892840a5 100644
--- a/internal/host/claimretryrecovery_test.go
+++ b/internal/host/claimretryrecovery_test.go
@@ -246,10 +246,19 @@ func recoveryTuple(o hostclaim.Observed, l claimStopLocal) hostguard.FenceTarget
return hostguard.FenceTarget{Region: l.Actor.Region, Host: o.Host, Incarnation: h.Incarnation, Stamp: h.Stamp, Session: h.Session, Box: l.Actor.Box, Enrollment: l.Actor.Enrollment, BootID: l.BootID, ControllerID: l.ControllerID, ClaimETag: o.ETag, DirectoryRevision: stamp, RosterRevision: l.Actor.Revision}
}
+// rosterRevision is root's verified roster read in this fixture: the roster
+// the controllers' actors read, at f.revision (7 when unset).
+func (f *recoveryFixture) rosterRevision(context.Context) (uint64, error) {
+ if f.revision == 0 {
+ return 7, nil
+ }
+ return f.revision, nil
+}
+
// root is instance-control's coordinator for one request. The live peer is
// whichever controller process the fixture most recently started.
func (f *recoveryFixture) root(drain StopDrainer) ClaimStopCoordinator {
- return ClaimStopCoordinator{EvidenceSigner: f.signer, RequestLimit: hostbox.RequestLimit, Guard: f.guard, Claims: hostguard.StoreReader{Store: f.claims}, CarlosUID: 1001, Evidence: f.evidence, Drainer: drain, Kernel: f.kernel, NewID: f.newID, Now: func() time.Time { return f.now },
+ return ClaimStopCoordinator{VerifiedRosterRevision: f.rosterRevision, EvidenceSigner: f.signer, RequestLimit: hostbox.RequestLimit, Guard: f.guard, Claims: hostguard.StoreReader{Store: f.claims}, CarlosUID: 1001, Evidence: f.evidence, Drainer: drain, Kernel: f.kernel, NewID: f.newID, Now: func() time.Time { return f.now },
Peers: stopPeerFunc(func(context.Context) (StopPeer, error) { return f.peer, nil }),
Inventory: stopInventoryFunc(func(ctx context.Context, host string) (StopInventory, error) {
o, err := hostclaim.Read(ctx, f.claims, host)
diff --git a/internal/host/claimstop.go b/internal/host/claimstop.go
index 22a4c5c3b..4a997a729 100644
--- a/internal/host/claimstop.go
+++ b/internal/host/claimstop.go
@@ -141,18 +141,23 @@ type StopResult struct {
type ClaimStopCoordinator struct {
RetainNoProcess func(context.Context, hostclaim.Observed, StopResult) error
- EvidenceSigner ed25519.PrivateKey
- RequestLimit time.Duration
- Guard hostguard.Guard
- Claims StopClaimReader
- Peers StopPeerProvider
- Inventory StopInventoryReader
- Drainer StopDrainer
- Kernel StopKernelVerifier
- Evidence release.Store
- CarlosUID uint32
- NewID func() string
- Now func() time.Time
+ // VerifiedRosterRevision is the write counter of the roster root reads
+ // and verifies itself at the moment of the call, quarantined or not.
+ // It bounds an agent-sent RosterRevision before any fence or receipt
+ // takes it (boundRosterRevision); nil refuses every stop.
+ VerifiedRosterRevision func(context.Context) (uint64, error)
+ EvidenceSigner ed25519.PrivateKey
+ RequestLimit time.Duration
+ Guard hostguard.Guard
+ Claims StopClaimReader
+ Peers StopPeerProvider
+ Inventory StopInventoryReader
+ Drainer StopDrainer
+ Kernel StopKernelVerifier
+ Evidence release.Store
+ CarlosUID uint32
+ NewID func() string
+ Now func() time.Time
}
func stopComponent(s string) bool {
@@ -189,6 +194,27 @@ func (c ClaimStopCoordinator) validateShape(r StopRequest) error {
return nil
}
+// boundRosterRevision refuses an agent-sent receipt numeral outside
+// 0 < n <= the revision of the roster root reads and verifies now (fix
+// round 1, finding 3), the bound the v0.28.4 console verifiers apply
+// against the roster they read. Roster revisions only grow, so a numeral
+// inside it now stays inside it for every later verifier. It runs before a
+// fence is begun or a no-process receipt is made; a retry that resumes a
+// fence still keeps the fence's original numeral (B2).
+func (c ClaimStopCoordinator) boundRosterRevision(ctx context.Context, n uint64) error {
+ if c.VerifiedRosterRevision == nil {
+ return ErrClaimStopUnavailable
+ }
+ current, err := c.VerifiedRosterRevision(ctx)
+ if err != nil {
+ return err
+ }
+ if n == 0 || n > current {
+ return ErrClaimStopIdentity
+ }
+ return nil
+}
+
// stopReceiptNumeral is a receipt's directory_revision, read from the one
// persisted source: the fence target's RosterRevision. A target without one
// (written before roster binding) cannot produce a receipt.
@@ -291,6 +317,9 @@ func (c ClaimStopCoordinator) FenceAndStop(ctx context.Context, req StopRequest)
if !stopComponent(fenceID) || !stopComponent(receiptID) {
return StopResult{}, ErrClaimStopUnavailable
}
+ if err := c.boundRosterRevision(ctx, req.RosterRevision); err != nil {
+ return StopResult{}, err
+ }
gen := uint64(0)
if observed.Claim != nil {
gen = observed.Claim.Gen
@@ -443,6 +472,9 @@ func (c ClaimStopCoordinator) witnessNoProcess(ctx context.Context, req StopRequ
} else if !hostguard.StopAuthorityMatches(claim, target) {
return StopResult{}, ErrClaimStopIdentity
}
+ if err := c.boundRosterRevision(ctx, req.RosterRevision); err != nil {
+ return StopResult{}, err
+ }
// No session ran, so there is no fence: the witness's own target is the
// receipt's one source, retained with the result.
numeral, err := stopReceiptNumeral(target)
diff --git a/internal/host/claimstop_test.go b/internal/host/claimstop_test.go
index 123f02dd7..54dc937b5 100644
--- a/internal/host/claimstop_test.go
+++ b/internal/host/claimstop_test.go
@@ -80,7 +80,7 @@ func claimStopFixture(t *testing.T) (ClaimStopCoordinator, StopRequest, *failPut
store := &failPutStore{Store: base}
ids := []string{"fence-1", "receipt-1", "fence-retry", "receipt-retry"}
now := time.Date(2026, 10, 6, 17, 0, 0, 123, time.UTC)
- c := ClaimStopCoordinator{EvidenceSigner: ed25519.NewKeyFromSeed(make([]byte, ed25519.SeedSize)), RequestLimit: 120 * time.Second, Guard: guard, Claims: stopClaimReader{obs}, CarlosUID: 1001, Evidence: store,
+ c := ClaimStopCoordinator{VerifiedRosterRevision: fixedRosterRevision(7), EvidenceSigner: ed25519.NewKeyFromSeed(make([]byte, ed25519.SeedSize)), RequestLimit: 120 * time.Second, Guard: guard, Claims: stopClaimReader{obs}, CarlosUID: 1001, Evidence: store,
Peers: stopPeerFunc(func(context.Context) (StopPeer, error) {
return StopPeer{UID: 1001, PID: 42, ProcessStart: "start-42", BootID: "boot-1", ControllerID: "controller-1"}, nil
}),
@@ -262,3 +262,9 @@ func TestClaimStopRefusesIncompleteProvidersAndEvidence(t *testing.T) {
t.Fatalf("incomplete evidence = %v", err)
}
}
+
+// fixedRosterRevision is a fixture's verified roster read: the roster it
+// stands for is at revision n.
+func fixedRosterRevision(n uint64) func(context.Context) (uint64, error) {
+ return func(context.Context) (uint64, error) { return n, nil }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-roster-binding.tsv b/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
index 2f322fe94..807188f8a 100644
--- a/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
+++ b/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
@@ -1,5 +1,5 @@
# Census overlay roster-binding (roster binding, design-roster-revision-holds.md rev 3 plus section 7, tasks 1 to 7 at 7103ee07): installed state is stamped with and compared against hostactors.BoxBinding, a digest of the box's roster row and the deployment's binding facts, instead of the roster write counter, so holds and other unrelated roster writes no longer refuse claim work while a quarantine, readmission, re-enrolment, floor, home or census-key change still does. The binding is computed from the reads the claim roster adapter and the cleanup identity already make; root's inventory actor is the fresh Identity.Verify; stop receipts take their directory_revision numeral from the fence's persisted RosterRevision and carry the binding in a new field; root startup settles obsolete inventory and rebind intents through the existing abandonment write and obsolete cold-handover barriers through the new fenced SettleObsoleteColdHandover; the cold handover admits only a fresh successor. Changed units are re-pinned at their existing class, task and identity; new units take the class of the callers that execute them; servingPriorRevision is removed (renamed servingPriorBinding). productionClaimRoster.Actor is folded from the claim-ack-refresh overlay, which stays loaded before this one. No accepted-legacy row, so the seal stands. PROPOSED, awaiting a ruling (docs/superpowers/notes/census-proposal-claim-step8-readiness.md, "Roster binding").
-@coverage internal/host 0e0c8163f603164e66ea2c06213b141b7b6db7879f1423911b11da202d1994d1
+@coverage internal/host 94a41c4d945fb3bcd2ee36f4a01ab73fbbd734b7e51046cb49affd33562172ee
@coverage internal/hostactors 1af14a5c45dacffe3d5b1878fde611b6887b1f3fdf2604adad427c819818813b
@coverage internal/hostbox 6a698fe2c67cf9096d341b558e3f151481221f4134f578fcd2b8dbfcb07f3b50
@coverage internal/hostguard 6579d40d41a929bfcb71a09a97efb19c85e9fd2059bf3b8760a4970ebeb561fb
@@ -18,8 +18,8 @@ internal/host/claimservinglegacy.go validateServingLegacyStop authority C,J4 rev
internal/host/claimservinglegacyroot_linux.go servingParkRoot.retainLegacyNoProcess authority C,J4 rev3=PROPOSED-roster-binding;basis=as before; the result target's stamp must equal the fresh actor's binding (servingPriorBinding) where it had to equal the write counter's decimal; same read file:Read@1197 1a3238ca4ea458af0e26481441465cd9ad346da190cf3edb7c03f4ca4a48d017
internal/host/claimservingparkroot_linux.go servingParkRoot.withRootInstallation authority C,J4 rev3=PROPOSED-roster-binding;basis=as before; the fresh actor must also carry a binding; same read file:Read@2136 d32aea9959a65a8a5ff13259ce82b21c945f00daa9bf2064854b957f993aed3d
internal/host/claimservingreboot_prepare_linux.go servingParkRoot.prepareOrCommitServingReboot authority C,J4 rev3=PROPOSED-roster-binding;basis=as before; the preparation and the commit persist the bound actor (Actor.Bound, write counter cleared) and the reread compares with SameBinding, so holds and other unrelated roster writes no longer refuse it while a quarantine, readmission or re-enrolment still does; same read file:Read@1513 ffccacf59482b5c25c95de1887009504bbdce4be8352a628efd74557f30147d3
-internal/host/claimstop.go ClaimStopCoordinator.FenceAndStop authority C,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=as before; the request must carry RosterRevision, persisted in the fence target; the receipt's directory_revision is the persisted target's numeral (stopReceiptNumeral, never the request's) and its binding field the target's stamp; a fence without a numeral is refused before any drain or kill; same read file:Read@1646 1e9ff3896cf20bca5845d459bc5d9808441964c261dda3cfef791a5dfb1e0e6d
-internal/host/claimstop.go ClaimStopCoordinator.witnessNoProcess authority C,G,J4 rev3=PROPOSED-roster-binding;basis=as before; the witness target carries the request's RosterRevision, the receipt's numeral, and the receipt's binding field is the target's stamp; refused without a numeral before the inventory read; same reads file:Exec@1881,file:Read@2794,file:Read@668 aaba48f3e1f4933385caff7944b7dd739be68c1ab6bacce25b1411cc3a66ef18
+internal/host/claimstop.go ClaimStopCoordinator.FenceAndStop authority C,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=as before; the request must carry RosterRevision, persisted in the fence target; the receipt's directory_revision is the persisted target's numeral (stopReceiptNumeral, never the request's) and its binding field the target's stamp; a fence without a numeral is refused before any drain or kill; same read; fix round 1 (finding 3): before the fence is begun or resumed, the request's RosterRevision is bounded by 0 < n <= root's own fresh verified roster read (boundRosterRevision); a retry still keeps the fence's original numeral (B2); same read file:Read@1646 1eeab1f435123642edd6baefa63e9cc0eaddf51922d943223573d9298e5ab446
+internal/host/claimstop.go ClaimStopCoordinator.witnessNoProcess authority C,G,J4 rev3=PROPOSED-roster-binding;basis=as before; the witness target carries the request's RosterRevision, the receipt's numeral, and the receipt's binding field is the target's stamp; refused without a numeral before the inventory read; same reads; fix round 1 (finding 3): the request's RosterRevision is bounded by root's fresh verified roster read before the witness target or receipt takes it; same reads file:Exec@1881,file:Read@2896,file:Read@668 a534246f305bd4a9a29a436760ea02c8f9e17a29b54080a852aa8eb0cf0ab47b
internal/host/claimstop_writers.go ClaimStopCoordinator.WritersStopped authority C,G,J4 root-input;kept=C,G;scope=protected-decision-only;rev3=PROPOSED-roster-binding;basis=the same reads; the request must carry roster_revision, copied into the observation's fence target; no receipt comes from it file:Read@1078,file:Read@2771 cb0fbe24c32dc361c4d3661a1f99dbcdedb26b5cc771263d424407f23304dc56
internal/host/claimwakestop.go ClaimAssembly.collectCapturedStop authority C,G,J4 rev3=PROPOSED-roster-binding;basis=as before; with no launch record the expected stamp is the actor's binding; the request carries the launch record's roster numeral, or the actor's write counter when the record names none; same reads file:Exec@3264,file:Read@605 45c827a643468eeac5413de43546f0135d28e7d18b99aee31dcd290fd5fbad78
internal/host/rootexecution_authority.go ClaimRootHTTP.executionAuthority authority C,E2,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=as before; the execution authority carries the fresh actor's binding as its DirectoryRevision; same reads file:Exec@1657,file:Read@553 00818a660276f82be32f4753aae26edc547ef55654c51c6dec81fdd2e9404cdd
@@ -45,7 +45,7 @@ internal/host/rootmigration_startup.go verifyRootMigrationStartup authority G,F,
internal/hostbox/coldhandover.go ColdHandover.Recover authority C rev3=PROPOSED-roster-binding;basis=a provably superseded cold admission can abandon its barrier without discarding its receipt; a settled journal is skipped, and a journaled successor that Obsolete reports is settled through settleObsolete instead of resumed; a failed settlement does not stop the other journals d28f0ac7dee5f858be05175e24338818069deb902f26e38b81170966b710d9b9
internal/hostbox/coldhandover.go type ColdHandover authority C,J4 rev3=PROPOSED-roster-binding;basis=as before, plus Admit (root's fresh successor admission) and Obsolete (root's startup obsolescence test); with both nil, Run and Recover are as before ae1abb4422718e4b72401a43ff2a239f060274397e6c904e696cfacb67ba55a6
internal/host/rootmigration_startup.go var openRootMigrationState authority C,F,G,J4 rev3=PROPOSED-roster-binding;identity=root instance-control startup and recovery uid 0;basis=new: rootstate.Open of rootMigrationDir, read-only, moved unchanged out of recoverRootInventoryStartup (C,G) and verifyRootMigrationStartup (G,F,J4) into a variable so tests can stand in for the root-owned directory; its only callers are those two, and it takes both their tasks file:Open@71 4564c16cd8ec2d403e99191a94f67ba1655abe8642eaa3660234c104c3f5ac6d
-internal/host/claimassembly.go ClaimAssembly.rootStopCoordinator authority C,E2 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: NewProductionRootClaimStop's stop coordinator assembly, moved unchanged; NewProductionRootClaimStop is its only caller, and its class 8665b7c841f45df5e1a2bc57f3bf377a0d90c2b9888176eb69354633fc782101
+internal/host/claimassembly.go ClaimAssembly.rootStopCoordinator authority C,E2 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: NewProductionRootClaimStop's stop coordinator assembly, moved unchanged; NewProductionRootClaimStop is its only caller, and its class; fix round 1 (finding 3): sets the coordinator's VerifiedRosterRevision to the cleanup enrollment's fresh roster read (claimCleanupEnrollment.rosterRevision); an assembly without a cleanup enrollment bounds by the fresh Identity.Verify's Revision instead, which refuses while quarantined; no read 9e2539c2d720065bdd96bf90cf847c20f09ed3dcca61ceaf9e418a9548d49274
internal/host/claimassembly.go ClaimAssembly.claimRootHTTP authority C,E2 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: NewProductionRootClaimStop's root handler assembly; InventoryActor is the fresh Identity.Verify (R2), startupBinding and the census pin are the startup actor's binding; NewProductionRootClaimStop is its only caller, and its class b231e1b9bb854a667fdab64d21e011d644d8cba26bcb3730c1bb433986ba28c0
internal/host/claimhandover_transport.go ClaimRootHTTP.coldHandover authority C,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: the operation cold handover that serveColdHandover and RecoverPending both build, as before plus Admit = admitColdSuccessor; the class of those two callers 067248e06d68c2e4f3ceeb449ce37ce99b2cc4d0b66f9c5d31266d59c086d6da
internal/host/claimhandover_transport.go ClaimRootHTTP.admitColdSuccessor authority C,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: RequireNewWork, then the successor's box, enrollment and stamp against a fresh InventoryActor (non-empty binding); refuses without InventoryActor; runs before any successor state (N5, B1); executed by ColdHandover.Run for coldHandover's callers, their class 72681b40f684ac60e937c8c40984fe97951af92770de9a5d73c1ac5bbbab34eb
@@ -70,3 +70,6 @@ internal/hostguard/rootview.go RootAuthority.viewLocked authority C,G,J4 rev3=PR
internal/hostguard/rootmigration_inventory.go RootAuthority.MigrationInstallations authority C,G,J4 rev3=PROPOSED-roster-binding;identity=root migration/startup uid 0;basis=fix round 1 (finding 1): reads each record through readView with census true, so a settled installation is listed, marked Settled; any other quarantined or pending record still refuses the census; reads unchanged 11170afcb762367188400d9472f81c87d6eaf74a6d36b2582001ee8cf99766e6
internal/hostguard/rootview.go RootAuthority.readView authority C,G,J4 rev3=PROPOSED-roster-binding;identity=carlos instance-control, root control service uid 0;basis=new (fix round 1, finding 1): viewLocked's read moved unchanged, plus the census exception for a settled record; reads through RootAuthority.read; the class of its callers viewLocked and MigrationInstallations cd67585f565aa68f6f73a2ad3540ef79c2ce4c5303b99c80317c77b0be9d5667
internal/hostguard/root.go Guard.SettleObsoleteRootInventory authority C,E1 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new (fix round 1, finding 1): under the host lock and with the exact intent bytes, clears an obsolete pending intent, records the installation the interrupted commit would have recorded when applied says it landed, and marks the record quarantined and settled; no claim read; reads through the guard's record directory; the class of its caller settleObsoleteIntent dcb5caf851fc00e089b1aedc4ef83f2f75c02837ce02ed689057fbd387e6f6e9
+internal/host/claimstop.go type ClaimStopCoordinator authority C,G,J4 rev3=PROPOSED-roster-binding;basis=fix round 1 (finding 3): gains VerifiedRosterRevision, root's fresh verified roster read that bounds an agent-sent receipt numeral; nil refuses every stop and no-process witness d492a16fa6b3d75c90a72b34c6a30f025e8e8baf085ee49ebf18955f10602cfe
+internal/host/claimstop.go ClaimStopCoordinator.boundRosterRevision authority C,G,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new (fix round 1, finding 3): refuses an agent-sent RosterRevision outside 0 < n <= VerifiedRosterRevision's value, nil refusing; no read of its own; the class of its callers FenceAndStop (C,J4) and witnessNoProcess (C,G,J4) ddd535a321268d90f9058388304a417d81320d64b468a2ce5a9d65d3789902d3
+internal/host/claimcleanup_identity.go claimCleanupEnrollment.rosterRevision authority C,G,J4 root-input;kept=C,G;scope=protected-decision-only;rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new (fix round 1, finding 3): root's own read of the signed roster (hostactors Directory.Read verifies the deployment signature) at the moment of a stop, never the startup read; the box's row must still name this enrollment; returns the roster's write counter whether or not the box is quarantined, so historical cleanup keeps working; the same read configureSigner makes; reached only through rootStopCoordinator's VerifiedRosterRevision, so the class of boundRosterRevision's callers file:Read@157 42b607901a37ef0dcd3e3dad7f0c053beab426c3f2acec0457a65800a0fd7f22