carlos / platform Public

settled obsolete installations stay inspectable for startup's migration census (roster binding fix round 1, finding 1)

Startup settlement used AbandonRootInventory, which quarantines; with
migration participation required, verifyRootMigrationStartup's
MigrationInstallations then refused the record with ErrFenced and the
assembly aborted before the stop service existed.

hostguard gains a settled mark (persisted, only valid with the quarantine)
and SettleObsoleteRootInventory, which root's startup settlement now uses.
Every execution and admission read still refuses a quarantined record; only
the refusal-only migration census (readView with census) lists a settled
one, marked FenceView.Settled. An interrupted commit that already landed its
inventory write is recorded as that commit would have recorded it, so guard
and inventory revisions agree; a settled first install whose journal never
committed (no inventory, revision 0) is skipped by the census. The
superseded-claim abandonment, unsafe-lock quarantine, commits and rebinds
clear the mark.

N3's startup path now keeps migration participation required through the
real OpenProductionClaimAssembly (only the installed floor binaries' check
is stood in, through var rootMigrationStartupFloors) and covers a landed
update, a landed first install, an unlanded first install and a rebind.
Census overlay and 9B8 re-pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev dc1b2bbab78c1af273abe79993c73ee54c487262 parent 22d6404
12 files changed, +375 −79
  • internal/host/claim_binding_startup_linux_test.go +111 −50
  • internal/host/rootinventory.go +38 −9
  • internal/host/rootmigration_startup.go +11 −1
  • internal/hostguard/guard.go +1 −1
  • internal/hostguard/record.go +7 −2
  • internal/hostguard/root.go +52 −4
  • internal/hostguard/rootinventory_obsolete_unix_test.go +114 −0
  • internal/hostguard/rootmigration_inventory.go +3 −1
  • internal/hostguard/rootrebind.go +1 −1
  • internal/hostguard/rootview.go +14 −2
  • internal/provision/claim_empty_cohort_fix1_census_test.go +5 −3
  • internal/provision/testdata/plan14-root-reads-roster-binding.tsv +18 −5
diff --git a/internal/host/claim_binding_startup_linux_test.go b/internal/host/claim_binding_startup_linux_test.go
index 5c564d7be..0a7fafd5d 100644
--- a/internal/host/claim_binding_startup_linux_test.go
+++ b/internal/host/claim_binding_startup_linux_test.go
@@ -81,10 +81,14 @@ func (w *assemblyWorld) interruptedRebind(rec provision.Record, stamp string) re
return q
}
-// migrationRequired gives root a completed Plan 14 migration for actor, seen
-// while startupRecovery runs, so the startup inventory recovery does its work
-// rather than returning early. The participation ledger and the migration
-// record are root-owned directories on a box; here they are test directories.
+// migrationRequired gives root a completed Plan 14 migration for actor,
+// seen while w.migrating is set, so OpenProductionClaimAssembly runs its
+// startup inventory recovery and its migration census
+// (verifyRootMigrationStartup) with participation required. The
+// participation ledger and the migration record are root-owned directories
+// on a box; here they are test directories. The census's last step, the
+// installed floor binaries' check, needs root-owned binaries this host does
+// not have and is the one step stood in for.
func (w *assemblyWorld) migrationRequired(actor hostbox.Actor) {
w.t.Helper()
census := rootparticipation.Census{Schema: 1, Box: actor.Box, Enrollment: actor.Enrollment, Migration: 1, Revision: 1, LaunchRevision: 1, Complete: true}
@@ -101,8 +105,10 @@ func (w *assemblyWorld) migrationRequired(actor hostbox.Actor) {
if err := state.Write("migration.json", raw); err != nil {
w.t.Fatal(err)
}
- original, originalState := openRootMigrationParticipation, openRootMigrationState
- w.t.Cleanup(func() { openRootMigrationParticipation, openRootMigrationState = original, originalState })
+ original, originalState, originalFloors := openRootMigrationParticipation, openRootMigrationState, rootMigrationStartupFloors
+ w.t.Cleanup(func() {
+ openRootMigrationParticipation, openRootMigrationState, rootMigrationStartupFloors = original, originalState, originalFloors
+ })
openRootMigrationParticipation = func() (rootparticipation.Ledger, bool, error) {
if !w.migrating {
return rootparticipation.Ledger{}, false, nil
@@ -110,54 +116,57 @@ func (w *assemblyWorld) migrationRequired(actor hostbox.Actor) {
return rootparticipation.Ledger{State: participation}, true, nil
}
openRootMigrationState = func() (rootstate.Store, error) { return state, nil }
+ rootMigrationStartupFloors = func(string, rootFloorIdentity) error { return nil }
}
-// startupRecovery is OpenProductionClaimAssembly's startup inventory
-// recovery (rootinventory_startup.go) as a restarted root runs it: its startup
-// actor is actorForConstruction's (the cleanup identity's read). The
-// assembly's root migration floor verification that follows it needs the
-// box's installed floor binaries and is not run here.
-func (w *assemblyWorld) startupRecovery() error {
+// plantedFirstInstall leaves a first inventory write for rec pending at
+// root, stamped stamp, as a root that died after persisting the intent and
+// before its journal commit leaves it: the guard's real
+// CommitRootInventoryArtifacts persists the intent, and the commit fails
+// before any inventory is written.
+func (w *assemblyWorld) plantedFirstInstall(rec provision.Record, stamp string) {
w.t.Helper()
ctx := w.t.Context()
- owners, err := w.owners.OpenClaimOwners(ctx, w.store, w.r)
+ o := w.claim(rec.Host)
+ h := o.Claim.Holder
+ _, recordETag, err := w.store.Get(ctx, h.Key)
if err != nil {
w.t.Fatal(err)
}
- actor, err := owners.actorForConstruction(ctx, w.r.Mode)
+ enrollment := w.roster.row().Enrollment
+ q := hostbox.JournalRequest{V: 3, ID: "planted-" + rec.Host, Op: "inventory-write", RecordKey: h.Key, RecordETag: recordETag,
+ Target: hostguard.FenceTarget{Host: rec.Host, Incarnation: h.Incarnation, Stamp: h.Stamp, Session: h.Session, Box: "box-1", Enrollment: enrollment, ClaimETag: o.ETag},
+ Inventory: hostbox.StopInventory{Complete: true, Host: rec.Host, Incarnation: h.Incarnation, InstallationStamp: h.Stamp, Box: "box-1", Enrollment: enrollment, DirectoryRevision: stamp}}
+ raw, err := json.Marshal(q)
if err != nil {
w.t.Fatal(err)
}
- if err := w.assembly.Close(ctx); err != nil {
- w.t.Fatal(err)
- }
- launches, err := openClaimRootJournal()
- if err != nil {
- w.t.Fatal(err)
- }
- defer launches.Close()
- journals, err := hostbox.NewJournalService(launches)
- if err != nil {
- w.t.Fatal(err)
+ installation := hostguard.RootInstallation{Empty: true, Host: rec.Host, Incarnation: h.Incarnation, Stamp: h.Stamp, Account: h.Account, App: h.App, Record: h.Key, Box: "box-1", Enrollment: enrollment, Migration: 1, InventoryRevision: 1}
+ before := w.pending()
+ err = w.assembly.Guard.CommitRootInventoryArtifacts(ctx, installation, raw, func(*hostclaim.Claim) error { return nil }, nil, func(hostguard.RootInstallation) error { return errRootInterrupted }, nil)
+ if !errors.Is(err, errRootInterrupted) || w.pending() != before+1 {
+ w.t.Fatalf("planted first install: %v, pending %d", err, w.pending())
}
- w.migrating = true
- defer func() { w.migrating = false }()
- return recoverRootInventoryStartup(ctx, w.store, w.r, owners, actor, journals, launches)
}
-// N3 (roster binding task 5b): an interrupted inventory write and an
-// interrupted recovery rebind are left pending at B0; the box is quarantined
-// and root restarts. Each intent is settled as abandoned and logged, root
-// comes up (never errRootMigrationBusy), and its stop service answers a stop
-// of the B0 installation. After readmission and another restart root is still
-// up and the B0 installation is refused at wake. The control: an interrupted
-// intent whose binding did not change replays and completes.
+// N3 (roster binding task 5b, fix round 1 finding 1): interrupted intents
+// are left pending at B0 (an inventory write whose commit landed before the
+// record write was lost, a first install likewise, a first install whose
+// journal never committed, and a recovery rebind); the box is quarantined
+// and root restarts. Each intent is settled and logged, root comes up (never
+// errRootMigrationBusy), and its stop service answers a stop of the B0
+// installation. After readmission and another restart root is still up and
+// the B0 installation is refused at wake. The control: an interrupted intent
+// whose binding did not change replays and completes.
//
// Two restarts settle pending intents in production: the startup inventory
-// recovery inside OpenProductionClaimAssembly, whose errRootMigrationBusy
-// aborts the assembly, and the service's RecoverPending. "startup" settles
-// through the first and then builds the assembly; "service" restarts the
-// assembly and settles through the root handler's RecoverPending.
+// recovery inside OpenProductionClaimAssembly, followed there by the
+// migration census (verifyRootMigrationStartup), either of which aborts the
+// assembly; and the service's RecoverPending. "startup" restarts the real
+// assembly with migration participation required through the whole
+// construction, so the census inspects every settled installation;
+// "service" restarts without participation and settles through the root
+// handler's RecoverPending.
func TestRootStartupSettlesObsoleteIntents(t *testing.T) {
for _, path := range []string{"startup", "service"} {
t.Run(path, func(t *testing.T) {
@@ -180,12 +189,10 @@ func TestRootStartupSettlesObsoleteIntents(t *testing.T) {
t.Fatal(err)
}
}
- recover := func(startup bool) error {
- if startup {
- if err := w.startupRecovery(); err != nil {
- return err
- }
- return w.start()
+ recover := func() error {
+ if path == "startup" {
+ w.migrating = true
+ return w.restart()
}
if err := w.restart(); err != nil {
return err
@@ -194,25 +201,42 @@ func TestRootStartupSettlesObsoleteIntents(t *testing.T) {
}
// Control: same binding, interrupted, replays and completes. (The
- // startup function replays through root's creation history, a
- // root-owned directory; the control runs through the service.)
+ // startup inventory recovery replays through root's creation
+ // history, a root-owned directory; the control runs through the
+ // service, before participation is required.)
w.roster.holdChurn()
_, before := w.inventory(recE.Host)
w.interruptedRegistration(agent, recE, routeE, w.fresh())
- if err := recover(false); err != nil {
+ if err := w.restart(); err != nil {
t.Fatal("restart with a same-binding intent:", err)
}
+ if err := w.root.RecoverPending(ctx); err != nil {
+ t.Fatal("recovery of a same-binding intent:", err)
+ }
if _, after := w.inventory(recE.Host); w.pending() != 0 || after != before+1 {
t.Fatalf("same-binding intent: pending %d, inventory revision %d -> %d", w.pending(), before, after)
}
// Obsolete intents at B0, then quarantine and restart.
agent = w.agent(b0)
+ _, beforeA := w.inventory(recA.Host)
w.interruptedRegistration(agent, recA, routeA, w.fresh())
+ if _, after := w.inventory(recA.Host); after != beforeA+1 {
+ t.Fatalf("interrupted registration did not land in the inventory: %d -> %d", beforeA, after)
+ }
+ recF, routeF := w.newHost("f")
+ *w.interrupt = 1
+ err := agent.install(recF, routeF)
+ *w.interrupt = -1
+ if err == nil || w.pending() != 2 {
+ t.Fatalf("first install was not interrupted after its intent: %v, pending %d", err, w.pending())
+ }
+ recG, _ := w.newHost("g")
+ w.plantedFirstInstall(recG, b0.Binding)
w.interruptedRebind(recD, b0.Binding)
w.roster.quarantine("loss_1")
logs := captureLog(t)
- if err := recover(path == "startup"); err != nil {
+ if err := recover(); err != nil {
t.Fatal("quarantined restart with obsolete intents:", err)
}
if w.pending() != 0 {
@@ -223,6 +247,43 @@ func TestRootStartupSettlesObsoleteIntents(t *testing.T) {
t.Fatalf("no settlement log for the %s intent: %s", kind, logs())
}
}
+ if strings.Contains(logs(), "not settled") {
+ t.Fatalf("a settlement failed: %s", logs())
+ }
+ // Guard and inventory agree for every settled installation, and
+ // each still refuses execution.
+ views, err := w.assembly.Guard.Root.MigrationInstallations(ctx)
+ if err != nil {
+ t.Fatal("migration census after settlement:", err)
+ }
+ settled := map[string]hostguard.FenceView{}
+ for _, v := range views {
+ if v.Settled {
+ settled[v.Host] = v
+ }
+ }
+ for _, rec := range []provision.Record{recA, recD, recF, recG} {
+ v, ok := settled[rec.Host]
+ if !ok {
+ t.Fatalf("%s not settled: %+v", rec.Host, views)
+ }
+ _, revision, err := w.assembly.Journals.Inventory.Snapshot(ctx, rec.Host, v.Captured)
+ if err != nil || revision != v.Installation.InventoryRevision {
+ t.Fatalf("%s: guard revision %d, inventory %d %v", rec.Host, v.Installation.InventoryRevision, revision, err)
+ }
+ if _, err := w.assembly.Guard.Root.View(ctx, rec.Host, v.Captured); !errors.Is(err, hostguard.ErrFenced) {
+ t.Fatalf("%s: settled installation's execution view: %v", rec.Host, err)
+ }
+ }
+ if v := settled[recA.Host]; v.Installation.InventoryRevision != beforeA+1 {
+ t.Fatalf("landed registration not recorded: %d", v.Installation.InventoryRevision)
+ }
+ if v := settled[recF.Host]; v.Installation.InventoryRevision != 1 {
+ t.Fatalf("landed first install not recorded: %d", v.Installation.InventoryRevision)
+ }
+ if v := settled[recG.Host]; v.Installation.InventoryRevision != 0 {
+ t.Fatalf("unlanded first install: %d", v.Installation.InventoryRevision)
+ }
if _, err := w.root.InventoryActor(ctx); err == nil {
t.Fatal("quarantined root admitted new work")
}
@@ -232,7 +293,7 @@ func TestRootStartupSettlesObsoleteIntents(t *testing.T) {
// Readmission and another restart: up, the B0 installation refused.
w.roster.readmit()
- if err := recover(path == "startup"); err != nil {
+ if err := recover(); err != nil {
t.Fatal("readmitted restart:", err)
}
b1 := w.fresh()
diff --git a/internal/host/rootinventory.go b/internal/host/rootinventory.go
index 9966a1d3f..6e1a56900 100644
--- a/internal/host/rootinventory.go
+++ b/internal/host/rootinventory.go
@@ -378,11 +378,16 @@ func (h ClaimRootHTTP) obsoleteIntent(stamp string, more ...string) bool {
return false
}
-// settleObsoleteIntent abandons an obsolete pending intent through the
-// guard's existing abandonment (same host lock, exact intent bytes, the
-// installation marked quarantined), whatever the claim says now: the binding
-// difference alone supersedes it. Its installation stays refused for new
-// work, because every fresh comparison needs the new binding. A settlement
+// settleObsoleteIntent settles an obsolete pending intent through the
+// guard's SettleObsoleteRootInventory (same host lock, exact intent bytes),
+// whatever the claim says now: the binding difference alone supersedes it.
+// The installation is quarantined and marked settled: it stays refused for
+// execution and new work, because every fresh comparison needs the new
+// binding, and the migration census at root's next start still inspects it,
+// so cleanup and migration startup are not blocked (fix round 1, finding 1).
+// applied says whether root's interrupted commit had already landed the
+// intent in the inventory; the guard then records the installation that
+// commit would have recorded, so guard and inventory agree. A settlement
// failure is logged and leaves the intent pending, as any recovery failure
// does. It never consults InventoryActor, so a quarantined box settles its
// own leftovers.
@@ -391,14 +396,38 @@ func (h ClaimRootHTTP) obsoleteIntent(stamp string, more ...string) bool {
// and are not settled here: RecoverPending's cold handover recovery settles
// them (hostbox ColdHandover.Obsolete, hostguard
// SettleObsoleteColdHandover) with the same startup binding.
-func (h ClaimRootHTTP) settleObsoleteIntent(ctx context.Context, host string, raw []byte, kind, stamped string) {
- err := h.Stop.Coordinator.Guard.AbandonRootInventory(ctx, host, raw, func(*hostclaim.Claim) bool { return true })
+func (h ClaimRootHTTP) settleObsoleteIntent(ctx context.Context, host string, raw []byte, kind, stamped string, applied func(context.Context, hostguard.RootInstallation) (bool, error)) {
+ err := h.Stop.Coordinator.Guard.SettleObsoleteRootInventory(ctx, host, raw, applied)
log.Printf("instance-control: %s: obsolete pending %s intent: stamped %s current %s", host, kind, stamped, h.startupBinding)
if err != nil {
log.Printf("instance-control: %s: obsolete pending %s intent not settled: %v", host, kind, err)
}
}
+// inventoryIntentApplied reports whether q, an interrupted inventory write,
+// already landed in the inventory: the pending installation's inventory is
+// at q's revision and names q as its last request, the test the pending
+// replay makes (commitRootInventoryPending's applied).
+func (h ClaimRootHTTP) inventoryIntentApplied(q hostbox.JournalRequest) func(context.Context, hostguard.RootInstallation) (bool, error) {
+ return func(ctx context.Context, pending hostguard.RootInstallation) (bool, error) {
+ if h.Journals == nil || h.Journals.Inventory == nil {
+ return false, hostbox.ErrUnsupported
+ }
+ saved, err := h.Journals.Inventory.SnapshotRequest(ctx, hostguard.FenceTarget{Host: pending.Host, Incarnation: pending.Incarnation, Stamp: pending.Stamp})
+ if err != nil {
+ return false, err
+ }
+ return saved.Revision == q.Revision+1 && saved.LastRequest == q.ID && saved.Revision == pending.InventoryRevision, nil
+ }
+}
+
+// rebindIntentUnapplied: a recovery rebind's commit writes only the
+// successor's inventory, so the predecessor the record keeps still agrees
+// with its own inventory; the record keeps it.
+func rebindIntentUnapplied(context.Context, hostguard.RootInstallation) (bool, error) {
+ return false, nil
+}
+
func (h ClaimRootHTTP) recoverRootInventory(ctx context.Context) error {
authority := h.Stop.Coordinator.Guard.Root
if authority == nil {
@@ -415,7 +444,7 @@ func (h ClaimRootHTTP) recoverRootInventory(ctx context.Context) error {
}
if recovery.Recovery != nil {
if next := recovery.Recovery.Next; h.obsoleteIntent(next.DirectoryRevision) {
- h.settleObsoleteIntent(ctx, next.Host, raw, "rebind", next.DirectoryRevision)
+ h.settleObsoleteIntent(ctx, next.Host, raw, "rebind", next.DirectoryRevision, rebindIntentUnapplied)
continue
}
if err = h.rebindRecoveryInventory(ctx, *recovery.Recovery); err != nil {
@@ -440,7 +469,7 @@ func (h ClaimRootHTTP) recoverRootInventory(ctx context.Context) error {
return settleErr
}
if h.obsoleteIntent(q.Inventory.DirectoryRevision, q.Target.DirectoryRevision) {
- h.settleObsoleteIntent(ctx, q.Target.Host, raw, "inventory", q.Inventory.DirectoryRevision)
+ h.settleObsoleteIntent(ctx, q.Target.Host, raw, "inventory", q.Inventory.DirectoryRevision, h.inventoryIntentApplied(q))
continue
}
if _, err = h.withRootInventoryHistory(ctx, q, true); err != nil {
diff --git a/internal/host/rootmigration_startup.go b/internal/host/rootmigration_startup.go
index 16ddbb0c5..2dd17b545 100644
--- a/internal/host/rootmigration_startup.go
+++ b/internal/host/rootmigration_startup.go
@@ -112,13 +112,23 @@ func verifyRootMigrationStartup(ctx context.Context, id rootFloorIdentity, inven
return errRootMigrationBusy
}
in, revision, err := inventory.Snapshot(ctx, v.Host, hostguard.Captured{Incarnation: v.Installation.Incarnation, Stamp: v.Installation.Stamp})
+ // A settled installation whose first inventory write never landed
+ // has no inventory, and root's record says so: nothing to clean.
+ if err == nil && v.Settled && revision == 0 && v.Installation.InventoryRevision == 0 && v.Installation.Box == id.Box && v.Installation.Enrollment == id.Enrollment {
+ continue
+ }
if err != nil || !in.Complete || revision == 0 || revision != v.Installation.InventoryRevision || v.Installation.Box != id.Box || v.Installation.Enrollment != id.Enrollment {
return errRootMigrationBusy
}
}
- return verifyRootMigrationFloors(release.OptDir(), id)
+ return rootMigrationStartupFloors(release.OptDir(), id)
}
+// rootMigrationStartupFloors is the startup's installed-binary floor check.
+// A variable so tests without root-owned floor binaries can stand in for it;
+// the census before it runs unchanged.
+var rootMigrationStartupFloors = verifyRootMigrationFloors
+
func verifyRootMigrationFloors(opt string, id rootFloorIdentity) error {
bound, err := readRootProtocolBound(rootFloorDir(opt), id)
if err != nil {
diff --git a/internal/hostguard/guard.go b/internal/hostguard/guard.go
index 6e82db90f..2c9d55257 100644
--- a/internal/hostguard/guard.go
+++ b/internal/hostguard/guard.go
@@ -82,7 +82,7 @@ func (g Guard) locked(ctx context.Context, host string, fn func(*recordDir) erro
if g.Root != nil && errors.Is(err, ErrUnsafeFile) {
r, readErr := g.Root.read(host)
if readErr == nil {
- r.quarantined = true
+ r.quarantined, r.settled = true, false
return errors.Join(err, g.Root.write(r))
}
if !errors.Is(readErr, ErrNoRecord) {
diff --git a/internal/hostguard/record.go b/internal/hostguard/record.go
index 12cb446ec..cc3978f6a 100644
--- a/internal/hostguard/record.go
+++ b/internal/hostguard/record.go
@@ -26,8 +26,13 @@ type Captured struct {
}
type record struct {
- migrationDenies []MigrationDeny
- quarantined bool
+ migrationDenies []MigrationDeny
+ quarantined bool
+ // settled marks a quarantine whose only cause is root's settlement of
+ // an obsolete pending intent (roster binding N3). It never lifts the
+ // quarantine's execution refusal; the refusal-only migration census
+ // alone may inspect such an installation.
+ settled bool
root bool
installation RootInstallation
rootRetired []Captured
diff --git a/internal/hostguard/root.go b/internal/hostguard/root.go
index ac080d6a4..77e75f55e 100644
--- a/internal/hostguard/root.go
+++ b/internal/hostguard/root.go
@@ -41,6 +41,7 @@ func NewRootAuthority(store rootstate.Store) *RootAuthority { return &RootAuthor
type rootRecord struct {
MigrationDenies []MigrationDeny `json:",omitempty"`
Quarantined bool `json:",omitempty"`
+ Settled bool `json:",omitempty"`
RebindCommit []byte `json:",omitempty"`
Schema int
Installation RootInstallation
@@ -91,7 +92,10 @@ func (a *RootAuthority) read(host string) (record, error) {
return record{}, ErrMalformedRecord
}
}
- r.quarantined = saved.Quarantined
+ if saved.Settled && !saved.Quarantined {
+ return record{}, ErrMalformedRecord
+ }
+ r.quarantined, r.settled = saved.Quarantined, saved.Settled
r.root = true
r.installation = saved.Installation
r.rootRetired = saved.Retired
@@ -115,7 +119,7 @@ func (a *RootAuthority) write(r record) error {
if r.ActiveStamp != 0 {
r.installation.Stamp = r.ActiveStamp
}
- b, err := json.Marshal(rootRecord{MigrationDenies: r.migrationDenies, Quarantined: r.quarantined, RebindCommit: r.rebindCommit, Schema: 1, Installation: r.installation, Retired: r.rootRetired, Barrier: r.barrier, PendingInventory: r.pendingInventory, PendingInstallation: r.pendingInstallation, State: r})
+ b, err := json.Marshal(rootRecord{MigrationDenies: r.migrationDenies, Quarantined: r.quarantined, Settled: r.settled, RebindCommit: r.rebindCommit, Schema: 1, Installation: r.installation, Retired: r.rootRetired, Barrier: r.barrier, PendingInventory: r.pendingInventory, PendingInstallation: r.pendingInstallation, State: r})
if err != nil {
return err
}
@@ -240,7 +244,7 @@ func (g Guard) CommitRootInventoryArtifacts(ctx context.Context, in RootInstalla
}
r.pendingInventory, r.pendingInstallation = nil, nil
r.Incarnation, r.ActiveStamp, r.installation = in.Incarnation, in.Stamp, in
- r.quarantined = false
+ r.quarantined, r.settled = false, false
return d.write(r)
})
}
@@ -318,7 +322,51 @@ func (g Guard) AbandonRootInventory(ctx context.Context, host string, intent []b
return ErrFenced
}
r.pendingInventory, r.pendingInstallation = nil, nil
- r.quarantined = true
+ r.quarantined, r.settled = true, false
+ return d.write(r)
+ })
+}
+
+// SettleObsoleteRootInventory settles a pending root inventory intent that
+// root's startup found obsolete: stamped under a roster binding other than
+// the startup binding (roster binding N3). The binding difference alone
+// supersedes it, so no claim is consulted. Under the host lock, with the
+// exact intent bytes, the intent is cleared and the installation is
+// quarantined and marked settled: every execution and admission path still
+// refuses it, and only the refusal-only migration census may inspect it.
+//
+// applied reports whether the pending installation's inventory already
+// holds this intent: root's commit landed and only the final record write
+// was lost. The record then takes the installation that commit would have
+// recorded, exactly as CommitRootInventoryArtifacts records it, so the
+// guard and the inventory agree on the revision. Otherwise the record keeps
+// the installation it had.
+func (g Guard) SettleObsoleteRootInventory(ctx context.Context, host string, intent []byte, applied func(context.Context, RootInstallation) (bool, error)) error {
+ if g.Root == nil || applied == nil || len(intent) == 0 {
+ return ErrInvalidInput
+ }
+ return g.readLocked(ctx, host, func(d *recordDir) error {
+ r, err := d.read(host)
+ if err != nil {
+ return err
+ }
+ if !bytes.Equal(r.pendingInventory, intent) || r.pendingInstallation == nil {
+ return ErrInvalidInput
+ }
+ pending := *r.pendingInstallation
+ landed, err := applied(ctx, pending)
+ if err != nil {
+ return err
+ }
+ if landed {
+ if r.Incarnation != pending.Incarnation || r.ActiveStamp != pending.Stamp {
+ r.retire()
+ r.RetiredStamps = nil
+ }
+ r.Incarnation, r.ActiveStamp, r.installation = pending.Incarnation, pending.Stamp, pending
+ }
+ r.pendingInventory, r.pendingInstallation = nil, nil
+ r.quarantined, r.settled = true, true
return d.write(r)
})
}
diff --git a/internal/hostguard/rootinventory_obsolete_unix_test.go b/internal/hostguard/rootinventory_obsolete_unix_test.go
new file mode 100644
index 000000000..7341512fb
--- /dev/null
+++ b/internal/hostguard/rootinventory_obsolete_unix_test.go
@@ -0,0 +1,114 @@
+//go:build unix
+
+package hostguard
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+
+ "github.com/carlosframework/platform/internal/hostclaim"
+ "testing"
+)
+
+// Fix round 1, finding 1: an obsolete pending intent is settled into a
+// quarantine the migration census may inspect, while every execution read
+// still refuses it. A landed commit is recorded as the commit would have
+// recorded it; an unlanded one leaves the record's installation.
+func TestSettleObsoleteRootInventory(t *testing.T) {
+ for _, landed := range []bool{true, false} {
+ name := "unlanded"
+ if landed {
+ name = "landed"
+ }
+ t.Run(name, func(t *testing.T) {
+ ctx := t.Context()
+ f, target, captured := fenceFixture(t)
+ f.obs.Claim.Holder.Account, f.obs.Claim.Holder.App = "bab", "console"
+ f.g.Root = NewRootAuthority(&rootTestStore{dir: t.TempDir()})
+ in := RootInstallation{Host: target.Host, Incarnation: captured.Incarnation, Stamp: captured.Stamp, Account: "bab", App: "console", Record: "record", Box: target.Box, Enrollment: target.Enrollment, Migration: 1, InventoryRevision: 1}
+ if err := f.g.EstablishRoot(ctx, in, allow); err != nil {
+ t.Fatal(err)
+ }
+ before := in
+ in.InventoryRevision++
+ fault := errors.New("interrupted")
+ if err := f.g.CommitRootInventory(ctx, in, []byte("exact"), allow, nil, func(RootInstallation) error { return fault }); !errors.Is(err, fault) {
+ t.Fatal(err)
+ }
+ if err := f.g.SettleObsoleteRootInventory(ctx, target.Host, []byte("forged"), func(context.Context, RootInstallation) (bool, error) { return landed, nil }); !errors.Is(err, ErrInvalidInput) {
+ t.Fatal("forged intent settled:", err)
+ }
+ var got RootInstallation
+ if err := f.g.SettleObsoleteRootInventory(ctx, target.Host, []byte("exact"), func(_ context.Context, p RootInstallation) (bool, error) { got = p; return landed, nil }); err != nil {
+ t.Fatal(err)
+ }
+ if got != in {
+ t.Fatalf("applied asked about %+v, want the pending %+v", got, in)
+ }
+ r, err := f.g.Root.read(target.Host)
+ if err != nil || !r.quarantined || !r.settled || r.pendingInstallation != nil {
+ t.Fatalf("after settlement: %+v %v", r, err)
+ }
+ want := before
+ if landed {
+ want = in
+ }
+ if r.installation != want {
+ t.Fatalf("installation %+v, want %+v", r.installation, want)
+ }
+ // Execution reads refuse; the census lists it, marked Settled.
+ if _, err := f.g.Root.View(ctx, target.Host, captured); !errors.Is(err, ErrFenced) {
+ t.Fatal("execution view of a settled installation:", err)
+ }
+ if err := r.admits(f.obs.Claim, captured); !errors.Is(err, ErrFenced) {
+ t.Fatal("admission of a settled installation:", err)
+ }
+ views, err := f.g.Root.MigrationInstallations(ctx)
+ if err != nil || len(views) != 1 || !views[0].Settled || views[0].Installation != want {
+ t.Fatalf("census: %+v %v", views, err)
+ }
+ // Settled without the quarantine is malformed.
+ raw, err := f.g.Root.store.Read(target.Host + ".json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var saved map[string]any
+ if err := json.Unmarshal(raw, &saved); err != nil {
+ t.Fatal(err)
+ }
+ delete(saved, "Quarantined")
+ forged, _ := json.Marshal(saved)
+ if err := f.g.Root.store.Write(target.Host+".json", forged); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := f.g.Root.read(target.Host); !errors.Is(err, ErrMalformedRecord) {
+ t.Fatal("settled without quarantine:", err)
+ }
+ })
+ }
+
+ // The superseded-claim abandonment is not a settlement: the census
+ // still refuses it.
+ t.Run("abandoned", func(t *testing.T) {
+ ctx := t.Context()
+ f, target, captured := fenceFixture(t)
+ f.obs.Claim.Holder.Account, f.obs.Claim.Holder.App = "bab", "console"
+ f.g.Root = NewRootAuthority(&rootTestStore{dir: t.TempDir()})
+ in := RootInstallation{Host: target.Host, Incarnation: captured.Incarnation, Stamp: captured.Stamp, Account: "bab", App: "console", Record: "record", Box: target.Box, Enrollment: target.Enrollment, Migration: 1, InventoryRevision: 1}
+ if err := f.g.EstablishRoot(ctx, in, allow); err != nil {
+ t.Fatal(err)
+ }
+ in.InventoryRevision++
+ fault := errors.New("interrupted")
+ if err := f.g.CommitRootInventory(ctx, in, []byte("exact"), allow, nil, func(RootInstallation) error { return fault }); !errors.Is(err, fault) {
+ t.Fatal(err)
+ }
+ if err := f.g.AbandonRootInventory(ctx, target.Host, []byte("exact"), func(*hostclaim.Claim) bool { return true }); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := f.g.Root.MigrationInstallations(ctx); !errors.Is(err, ErrFenced) {
+ t.Fatal("census accepted an abandoned installation:", err)
+ }
+ })
+}
diff --git a/internal/hostguard/rootmigration_inventory.go b/internal/hostguard/rootmigration_inventory.go
index 9048dbc40..deab66e99 100644
--- a/internal/hostguard/rootmigration_inventory.go
+++ b/internal/hostguard/rootmigration_inventory.go
@@ -8,6 +8,8 @@ import (
// MigrationInstallations is a refusal-only census, including incomplete
// inventory. It makes no repair writes before the active-move preflight.
+// A settled installation (SettleObsoleteRootInventory) is listed, marked
+// Settled; any other quarantined or pending one refuses the census.
func (a *RootAuthority) MigrationInstallations(ctx context.Context) ([]FenceView, error) {
names, err := a.store.Names()
if err != nil {
@@ -30,7 +32,7 @@ func (a *RootAuthority) MigrationInstallations(ctx context.Context) ([]FenceView
if err != nil {
return nil, err
}
- view, err := a.viewLocked(host, Captured{Incarnation: r.Incarnation, Stamp: r.installation.Stamp})
+ view, err := a.readView(host, Captured{Incarnation: r.Incarnation, Stamp: r.installation.Stamp}, true)
if err != nil {
return nil, err
}
diff --git a/internal/hostguard/rootrebind.go b/internal/hostguard/rootrebind.go
index a94e49693..3ff6d7881 100644
--- a/internal/hostguard/rootrebind.go
+++ b/internal/hostguard/rootrebind.go
@@ -71,7 +71,7 @@ func (g Guard) RebindRootInventory(ctx context.Context, prior Captured, revision
r.retire()
r.Incarnation, r.ActiveStamp, r.installation = next.Incarnation, next.Stamp, next
r.pendingInventory, r.pendingInstallation = nil, nil
- r.quarantined = false
+ r.quarantined, r.settled = false, false
r.rebindCommit = append([]byte(nil), intent...)
return d.write(r)
})
diff --git a/internal/hostguard/rootview.go b/internal/hostguard/rootview.go
index 862daed6b..b0c5987c2 100644
--- a/internal/hostguard/rootview.go
+++ b/internal/hostguard/rootview.go
@@ -12,6 +12,9 @@ type FenceView struct {
Pending *FenceTarget
Receipts []FenceReceipt
Barrier *FenceTarget
+ // Settled is set only in the migration census's views: the
+ // installation is quarantined by an obsolete-intent settlement.
+ Settled bool `json:",omitempty"`
}
type FenceViewProvider func(context.Context, string, Captured) (FenceView, error)
@@ -42,11 +45,20 @@ func (a *RootAuthority) View(ctx context.Context, host string, captured Captured
}
func (a *RootAuthority) viewLocked(host string, captured Captured) (FenceView, error) {
+ return a.readView(host, captured, false)
+}
+
+// readView is viewLocked's read. A quarantined record is refused, except
+// that the refusal-only migration census (census) inspects a settled one
+// (SettleObsoleteRootInventory): it still names its installation and
+// inventory revision for cleanup and migration startup, and its view says
+// Settled. A pending intent is refused either way.
+func (a *RootAuthority) readView(host string, captured Captured, census bool) (FenceView, error) {
r, err := a.read(host)
if err != nil {
return FenceView{}, err
}
- if r.quarantined || r.pendingInstallation != nil {
+ if r.pendingInstallation != nil || (r.quarantined && !(census && r.settled)) {
return FenceView{}, ErrFenced
}
known := r.Incarnation == captured.Incarnation && r.ActiveStamp == captured.Stamp && captured.Stamp != 0
@@ -58,7 +70,7 @@ func (a *RootAuthority) viewLocked(host string, captured Captured) (FenceView, e
if !known {
return FenceView{}, ErrStampMismatch
}
- return FenceView{MigrationDenies: r.migrationDenies, Schema: 1, Host: host, Captured: captured, Installation: r.installation, Retired: r.rootRetired, Pending: r.ActiveFence, Receipts: r.FenceJournal, Barrier: r.barrier}, nil
+ return FenceView{MigrationDenies: r.migrationDenies, Schema: 1, Host: host, Captured: captured, Installation: r.installation, Retired: r.rootRetired, Pending: r.ActiveFence, Receipts: r.FenceJournal, Barrier: r.barrier, Settled: r.quarantined && r.settled}, nil
}
func (v FenceView) validate(host string, c Captured) error {
if v.Schema != 1 || v.Host != host || v.Installation.Host != host || v.Installation.Migration == 0 || v.Captured != c {
diff --git a/internal/provision/claim_empty_cohort_fix1_census_test.go b/internal/provision/claim_empty_cohort_fix1_census_test.go
index 32fd54b2a..f38dd42c3 100644
--- a/internal/provision/claim_empty_cohort_fix1_census_test.go
+++ b/internal/provision/claim_empty_cohort_fix1_census_test.go
@@ -63,8 +63,10 @@ func plan14ClaimMergeMovesOfflineWriteCensusInventory() []censusEntry {
// - commitRootInventoryPending: the inventory's stamp must equal the fresh
// InventoryActor's binding.
// - recoverRootInventory: a pending intent stamped under another binding
-// than the startup binding is settled through the guard's existing
-// AbandonRootInventory (host-local guard state), never replayed.
+// than the startup binding is settled through the guard's
+// SettleObsoleteRootInventory (host-local guard state: the intent
+// cleared, the record quarantined and marked settled), never replayed
+// (fix round 1, finding 1). It reads the inventory version only.
// - rebindRecoveryInventory: the successor and the predecessor inventory
// must both carry the fresh actor's binding.
//
@@ -85,7 +87,7 @@ func plan14ClaimRosterBindingWriteCensusInventory() []censusEntry {
{"internal/host/claimservingparksource_linux.go", "servingParkStateDirectory", "key-site", "lit:instances", "3596d8a75440c454d0acfa8033a8bf67cbae0625911925a0bb45140975d55baa"},
{"internal/host/rootexecution_authority.go", "ClaimRootHTTP.executionAuthority", "key-site", "key:RecordKey,lit:instances", "00818a660276f82be32f4753aae26edc547ef55654c51c6dec81fdd2e9404cdd"},
{"internal/host/rootinventory.go", "ClaimRootHTTP.commitRootInventoryPending", "key-site", "key:RecordKey", "95491a926852d6354b12179401138d2bc907806a915e13534485768bd6e1c1fb"},
- {"internal/host/rootinventory.go", "ClaimRootHTTP.recoverRootInventory", "key-site", "key:RecordKey", "fe5db29d67c2011839b91dff70e1661560dce74d5a077a131766a6ca69e4e084"},
+ {"internal/host/rootinventory.go", "ClaimRootHTTP.recoverRootInventory", "key-site", "key:RecordKey", "5456fde9349eefa927247b58035f256cccb5ca1d271299baa08b9bab6d5f088b"},
{"internal/host/rootrecovery_rebind.go", "ClaimRootHTTP.rebindRecoveryInventory", "key-site", "key:RecordKey", "0e9f3ee60e6077c46c5a951be7abe6878ec79f76a71f78872ac9e54d519a66f4"},
}
entries := plan14ClaimMergeMovesOfflineWriteCensusInventory()
diff --git a/internal/provision/testdata/plan14-root-reads-roster-binding.tsv b/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
index e6be3034b..aa2bd8d5e 100644
--- a/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
+++ b/internal/provision/testdata/plan14-root-reads-roster-binding.tsv
@@ -1,8 +1,8 @@
# 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 c3cd56042b2b998498efce4dc3e28902195b96db81cf202fcd54fb031abe0b24
+@coverage internal/host 029d77f62565cb727abe4772283703a60e56de5d76d6d54f6b96be0a5a5722af
@coverage internal/hostactors 1af14a5c45dacffe3d5b1878fde611b6887b1f3fdf2604adad427c819818813b
@coverage internal/hostbox 6a698fe2c67cf9096d341b558e3f151481221f4134f578fcd2b8dbfcb07f3b50
-@coverage internal/hostguard c15e0c64cd46fac2cbe0c4b0c7d7a50e12d2f49553a36ff4856cb95d344ff311
+@coverage internal/hostguard 6579d40d41a929bfcb71a09a97efb19c85e9fd2059bf3b8760a4970ebeb561fb
internal/host/claimassembly.go ClaimAssembly.Build authority C,G rev3=PROPOSED-roster-binding;identity=agent uid carlos; root instance-control uid 0;basis=as before; the agent's install pin (Reconcile.DirectoryRevision) and its census pin are the startup actor's binding, not the roster write counter; reads unchanged file:Prepare@3791,file:Prepare@3824,file:Prepare@3840,file:Prepare@3857,file:Prepare@4606,file:Read@4536,whole:Timer@2044 cc979699a6390a04b76b1c02b8d53ff1f72b11a40191ad7e6951aed9cf21f9ba
internal/host/claimcleanup_identity.go verifyClaimCleanupEnrollment authority C,G,J4 root-input;kept=C,G;scope=protected-decision-only;rev3=PROPOSED-roster-binding;basis=the same read; the cleanup actor also carries hostactors.BoxBinding of its row in that startup read, which stamps only what the cleanup identity itself constructs; fresh authority is never this actor file:Read@173 dafa2d78591fccac8a3bd7d6b6faa5088e2f3fda665a9906e8b9ae128ade1908
internal/host/claimconstruction.go OpenProductionClaimAssembly authority C,E3,J4 rev3=PROPOSED-roster-binding;identity=root controller and service UID using authenticated root projection;basis=as before; the launch owner's fence target is stamped with the actor's binding and carries the roster write counter as RosterRevision, the stop receipt's numeral; reads unchanged file:Read@10611,file:Read@4684,file:ReadFile@4228,registry:Host@10638,whole:Route@10726,whole:Route@11475 171e91d7bb19f31def2d0077694b0cc7fd4b4917d62b4b852c0a74b2d0d786b0
@@ -24,7 +24,7 @@ internal/host/claimstop_writers.go ClaimStopCoordinator.WritersStopped authority
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
internal/host/rootinventory.go ClaimRootHTTP.commitRootInventoryPending authority E2 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=as before; the inventory's stamp must equal the binding of a fresh InventoryActor (root's inventory actor is Identity.Verify on every call, R2); same reads file:Read@1429,file:Read@3469,registry:Account@4833,registry:Account@4848,registry:App@4869,registry:App@4880,registry:ClaimIncarnation@4339,registry:ClaimOwner@4389,registry:ClaimOwner@5519,registry:ClaimOwnership@4931,registry:ClaimOwnership@4953,registry:ClaimOwnership@5835,registry:ClaimOwnership@8038,registry:ClaimRowID@4553,registry:ClaimRowID@4630,registry:ClaimStamp@4367,registry:DBPath@4897,registry:DBPath@4911,registry:Host@4803,registry:Host@4815,registry:Host@8502,registry:Name@8525,whole:ClaimOwnership@4935,whole:ClaimOwnership@4963,whole:ClaimOwnership@5845,whole:ClaimOwnership@8049,whole:Route@10292,whole:Route@3661,whole:Route@4044,whole:Route@4060,whole:Route@4115,whole:Route@4766,whole:Route@4779,whole:Route@4788,whole:Route@5026,whole:Route@5258,whole:Route@6092,whole:Route@6228,whole:Route@6452,whole:Route@7894,whole:Route@9557,whole:Route@9618,whole:Timer@8510,whole:Timer@8533 95491a926852d6354b12179401138d2bc907806a915e13534485768bd6e1c1fb
-internal/host/rootinventory.go ClaimRootHTTP.recoverRootInventory authority C,E1 rev3=PROPOSED-roster-binding;basis=as before (E16, E46); a pending inventory or rebind intent stamped under a binding other than root's startup binding is obsolete: it is settled, one intent at a time, through the guard's existing AbandonRootInventory (settleObsoleteIntent), logged, never replayed and never an assembly abort (N3); same reads. Executing identity: root instance-control or root participation/update file:Read@1887,file:Read@888 fe5db29d67c2011839b91dff70e1661560dce74d5a077a131766a6ca69e4e084
+internal/host/rootinventory.go ClaimRootHTTP.recoverRootInventory authority C,E1 rev3=PROPOSED-roster-binding;basis=as before (E16, E46); a pending inventory or rebind intent stamped under a binding other than root's startup binding is obsolete: it is settled, one intent at a time, through the guard's existing AbandonRootInventory (settleObsoleteIntent), logged, never replayed and never an assembly abort (N3); same reads. Executing identity: root instance-control or root participation/update; fix round 1 (finding 1): an obsolete intent is settled through SettleObsoleteRootInventory, told whether an interrupted inventory write already landed (inventoryIntentApplied) or, for a rebind, that its predecessor is kept (rebindIntentUnapplied); same reads file:Read@1939,file:Read@911 5456fde9349eefa927247b58035f256cccb5ca1d271299baa08b9bab6d5f088b
internal/host/rootmigration_evidence.go readMigrationStop authority G,J4 rev3=PROPOSED-roster-binding;identity=carlos system journal-migrate offline operator uid 0;basis=as before; the wanted receipt is matched on its binding field; a receipt whose directory_revision is not a canonical non-zero numeral is skipped, and the numeral is carried into the target's RosterRevision; same read file:Read@592 e16256c1a4c6807b32e55a0617bbc6e17d12ff708a7fcaa765af9b35226c61b7
internal/host/rootrecovery_rebind.go ClaimRootHTTP.rebindRecoveryInventory authority C rev3=PROPOSED-roster-binding;basis=retain fresh claim and inventory checks and refuse a box listed Lost; the successor must be stamped with the fresh actor's non-empty binding, and the predecessor inventory must carry that binding too (R3) before any reuse; same reads file:Exec@2625,file:Read@1519,file:Read@2129,registry:Account@3346,registry:App@3383,registry:ClaimIncarnation@3446,registry:ClaimOwner@3626,registry:ClaimRowID@3648,registry:ClaimStamp@3474,registry:Host@3318,whole:Route@3767 0e9f3ee60e6077c46c5a951be7abe6878ec79f76a71f78872ac9e54d519a66f4
internal/hostbox/coldhandover.go ColdHandover.Run authority C,J2,J4 rev3=PROPOSED-roster-binding;identity=root claim, migration or adoption controller uid 0;basis=as before; when Admit is set (root's handler and startup recovery), it runs first, before any successor state, for a new handover and for every replay (N5, B1); same reads file:Exec@1114,file:Lstat@10883,file:OpenRoot@10805,file:Read@1466,registry:Addr@3741,registry:Addrs@3759,registry:Backing@3778,registry:Canary@3835,registry:ClaimIncarnation@3619,registry:ClaimIncarnation@4121,registry:ClaimOwner@11633,registry:ClaimOwner@4203,registry:ClaimOwner@4223,registry:ClaimOwner@6098,registry:ClaimOwner@7190,registry:ClaimOwner@8444,registry:ClaimOwnership@11225,registry:ClaimOwnership@3589,registry:ClaimOwnership@4567,registry:ClaimOwnership@4785,registry:ClaimOwnership@4818,registry:ClaimRowID@11523,registry:ClaimRowID@11604,registry:ClaimRowID@4241,registry:ClaimRowID@4849,registry:ClaimRowID@7149,registry:ClaimRowID@8469,registry:ClaimStamp@3664,registry:ClaimStamp@4168,registry:Host@7026,registry:Host@8406,registry:Kind@3697,registry:Name@4903,registry:Name@7041,registry:Name@8425,registry:Platform@3819,registry:Registration@4267,registry:Registration@7106,registry:Registration@8494,registry:Replica@3849,registry:Route@11225,registry:Route@4567,registry:Route@4818,registry:Route@5349,registry:Route@6098,registry:Timers@4766,registry:Timers@4785,registry:Timers@4849,registry:Timers@4903,registry:Timers@6978,registry:Timers@8281,registry:Tunnel@3799,registry:Unit@3723,whole:ClaimOwnership@11239,whole:ClaimOwnership@3593,whole:ClaimOwnership@4579,whole:ClaimOwnership@4801,whole:ClaimOwnership@4830,whole:ColdRows@11227,whole:ColdRows@12339,whole:ColdRows@12349,whole:ColdRows@5064,whole:ColdRows@5072,whole:ColdRows@5080,whole:ColdRows@5087,whole:ColdRows@5351,whole:ColdRows@6100,whole:ColdRows@6980,whole:ColdRows@8283,whole:Route@11233,whole:Route@3574,whole:Route@3934,whole:Route@4366,whole:Route@4374,whole:Route@4425,whole:Route@4433,whole:Route@4573,whole:Route@4824,whole:Route@5358,whole:Route@6107,whole:Timer@4105,whole:Timer@4379,whole:Timer@4387,whole:Timer@4438,whole:Timer@4476,whole:Timer@4772,whole:Timer@4791,whole:Timer@4855,whole:Timer@4909,whole:Timer@6987,whole:Timer@8290 14778af6e9553d5d386ad88c48c5331e7312e0bc94d48e8ad8e72a8d3e8b06fa
@@ -41,7 +41,7 @@ internal/host/claimservingreboot_prepare_linux.go servingParkLedger.observeReboo
internal/host/claimservingreboot_prepare_linux.go type servingParkRebootAuthority authority C,J4 rev3=PROPOSED-roster-binding;basis=comment only: Actor is the bound actor (Actor.Bound), so a preparation survives unrelated roster writes and still moves with the binding ba0cc635a2fd0c1dd4a753736137a6284a44e73127f17299227b870436cae6c2
internal/host/claimstop_recovery.go ClaimStopCoordinator.RecoverStopped authority C,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=as before; the fence target must carry a roster numeral, refused before any kill; the recovered receipt's directory_revision is that numeral and its binding field the target's stamp 804edb1c8f315facf1685993a48c1ffe514e23dbe04f8e66e92deae13a709e05
internal/host/rootinventory_startup.go recoverRootInventoryStartup authority C,G rev3=PROPOSED-roster-binding;identity=root control startup and system recovery uid 0;basis=as before; its one read, rootstate.Open of the migration directory, moved unchanged into var openRootMigrationState; the census pin is the startup actor's binding; the recovery handler's InventoryActor is the fresh Identity.Verify and its startupBinding the startup actor's binding (N3) 2e6647bbc6121ce3333e129e89304f1a6494abb9ccc11b17aeb3439c936de83a
-internal/host/rootmigration_startup.go verifyRootMigrationStartup authority G,F,J4 rev3=PROPOSED-roster-binding;identity=root instance-control startup and recovery uid 0;basis=as before; its one read, rootstate.Open of the migration directory, moved unchanged into var openRootMigrationState 774782a59be9b9b22efd7a1be61ebad17c88a808ed2a9ef95a515f023605ad2e
+internal/host/rootmigration_startup.go verifyRootMigrationStartup authority G,F,J4 rev3=PROPOSED-roster-binding;identity=root instance-control startup and recovery uid 0;basis=as before; its one read, rootstate.Open of the migration directory, moved unchanged into var openRootMigrationState; fix round 1 (finding 1): a census view marked Settled with no inventory and root revision 0 (a settled first install whose journal never committed) is skipped; the installed-binary floor check goes through var rootMigrationStartupFloors; reads unchanged 35f815830a3b4dcac325e0651eb047a6571c5b39a6bd0f63d76a24f3ca2b3858
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
@@ -52,8 +52,21 @@ internal/host/claimhandover_transport.go ClaimRootHTTP.admitColdSuccessor author
internal/hostbox/coldhandover.go ColdHandover.settleObsolete authority C rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: settles a journaled handover in phase prepared, parked or complete through the guard's SettleObsoleteColdHandover, whose record step rewrites the journal as settled (B3); ColdHandover.Recover is its only caller, and its class ecdbb6d7e71426e782a2007e730d3e06c46d3a7113290768286a78f64a1aaa70
internal/hostguard/coldhandover.go Guard.SettleObsoleteColdHandover authority C rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: under the host lock, on the guard record it already reads, requires the prior's completed fence receipt, active stamp and the matching barrier, retires the successor stamp, clears the barrier, restores the prior's completed fence to the deny slot, writes the record, then records; an already settled record only records; ColdHandover.settleObsolete is its only caller, and its class a342cd17b58ec7d4afdee1d5666b675ced000e4a3ef68bf938651e4229fa7f78
internal/host/rootinventory.go ClaimRootHTTP.obsoleteIntent authority C,E1,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: reports a stamp other than startupBinding (empty startupBinding never); no read; the class of its callers recoverRootInventory (C,E1) and RecoverPending (C,J4) 0e47d85d007b8f56b5a9f7ec87abc7b5085f0ebebb9da5310a34304dd207730e
-internal/host/rootinventory.go ClaimRootHTTP.settleObsoleteIntent authority C,E1 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: abandons an obsolete pending intent through the guard's existing AbandonRootInventory (same host lock, exact intent bytes), logged; never consults InventoryActor; recoverRootInventory is its only caller, and its class af90c834619a1ff0be4decad2498de6a2a4be0f69b55c41adefaee7dca510d03
+internal/host/rootinventory.go ClaimRootHTTP.settleObsoleteIntent authority C,E1 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: abandons an obsolete pending intent through the guard's existing AbandonRootInventory (same host lock, exact intent bytes), logged; never consults InventoryActor; recoverRootInventory is its only caller, and its class; fix round 1 (finding 1): settles through the guard's SettleObsoleteRootInventory instead of AbandonRootInventory, so the installation is quarantined and marked settled, inspectable by the migration census and still refused for execution; no read afe2fea20a0b5368d8762664bd812908f6ae16536acefc735a7c340e2fc4c5c4
internal/host/claimstop.go stopReceiptNumeral authority C,G,J4 rev3=PROPOSED-roster-binding;identity=root instance-control uid 0;basis=new: the receipt numeral from the fence target's persisted RosterRevision, zero refused; no read; the class of its callers FenceAndStop, witnessNoProcess and RecoverStopped b1776ff85789af138c7215cd3fc4beb758823fdbcd4a98d802b3de29b8490439
internal/host/claimstop.go receiptRosterRevision authority G,J4 rev3=PROPOSED-roster-binding;identity=carlos system journal-migrate offline operator uid 0;basis=new: parses a receipt's directory_revision as a canonical non-zero decimal; no read; its root caller is readMigrationStop, and its class (the agent's validateTransportStop also uses it) 40f6c90cdfdf0d03bc3f2e30d7739d9ec5001ad1c412ab2ceb8a27c9d4583009
internal/host/claimservinghandover.go servingPriorBinding authority C,J4 rev3=PROPOSED-roster-binding;basis=new name for servingPriorRevision (removed below), now equality: the recorded stamp is the actor's non-empty binding, where it was a numeral no newer than the write counter; the removed row's class dfbda3bd8e6095f76488e3f6926e8579de9c023b6f4935a81b6c8a554c961007
@remove internal/host/claimservinghandover.go servingPriorRevision
+internal/host/rootinventory.go ClaimRootHTTP.inventoryIntentApplied authority C,E1 rev3=PROPOSED-roster-binding;identity=root instance-control or root participation/update uid 0;basis=new (fix round 1, finding 1): reads the pending installation's inventory version through the root journal service's inventory (SnapshotRequest) and reports whether the interrupted write already landed (revision q.Revision+1, last request q.ID, the pending revision); no file read of its own; the class of its caller recoverRootInventory 0a7d0da576245d9ab8657ae5611c71b97a0786cb8fa9a86f0681ef2033f610d7
+internal/host/rootinventory.go rebindIntentUnapplied authority C,E1 rev3=PROPOSED-roster-binding;identity=root instance-control or root participation/update uid 0;basis=new (fix round 1, finding 1): constant false, a rebind's commit writes only the successor's inventory so the kept predecessor agrees with its own; no read; the class of its caller recoverRootInventory 19399a184c63b259c3150b6e86c7cdbcab21e2b0f2da64eff07700d0b98930c4
+internal/host/rootmigration_startup.go var rootMigrationStartupFloors authority G,F,J4 rev3=PROPOSED-roster-binding;identity=root instance-control startup and recovery uid 0;basis=new (fix round 1, finding 1): the startup's installed-binary floor check, verifyRootMigrationFloors unchanged, behind a variable so tests without root-owned floor binaries can stand in for it; its only caller is verifyRootMigrationStartup, and its class 250545174d349672c1c5f8d3a4ff8ea46a0fc73d38fd15e8b81d8b3cbdb61f1e
+internal/hostguard/guard.go Guard.locked authority C rev3=PROPOSED-roster-binding;basis=fix round 1 (finding 1): an unsafe-lock quarantine also clears the settled mark, so hostile evidence is never inspectable as a settlement; reads unchanged fdebfbd4bff4d2064d830ce26c539d99ce140f383e39ce88ac9ce2a8a191c536
+internal/hostguard/root.go Guard.AbandonRootInventory authority C rev3=PROPOSED-roster-binding;basis=fix round 1 (finding 1): the superseded-claim abandonment also clears the settled mark; it stays a refusing quarantine for the migration census; no read change a0f7b41ad7d42cd845b2a563c8b126b80878eec0caecd5b1ab1bebf66f22284f
+internal/hostguard/root.go Guard.CommitRootInventoryArtifacts authority G,J4 rev3=PROPOSED-roster-binding;identity=root claim controller construction uid 0;basis=fix round 1 (finding 1): a successful commit clears the settled mark with the quarantine; reads unchanged 1f640a3d6411ee23f6d23db4b7a5b276bb43e02c5945d537e765ddab093193ab
+internal/hostguard/root.go RootAuthority.write authority C,G,J4 rev3=PROPOSED-roster-binding;identity=root control uid 0;basis=fix round 1 (finding 1): persists the settled mark (Settled, omitempty); no read d9da59ba4d96884af78bb953fe7789e0cf737b7c7eff576c28d459f4152bd0f6
+internal/hostguard/root.go RootAuthority.read authority C,G,J4 rev3=PROPOSED-roster-binding;identity=root control/startup/generation uid 0;basis=fix round 1 (finding 1): reads the settled mark; a record Settled but not Quarantined is malformed; same read file:Read@175 acd752ed113ea01908ae1dc42dd6742ce7ff00078ac21e67b454e1c38df07f6e
+internal/hostguard/rootrebind.go Guard.RebindRootInventory authority E2 rev3=PROPOSED-roster-binding;basis=fix round 1 (finding 1): a completed rebind clears the settled mark with the quarantine; reads unchanged 2798adb3e11e8f251d47546c13d7c9ba040ba5bd97dae63017ca08f1a23eb206
+internal/hostguard/rootview.go RootAuthority.viewLocked authority C,G,J4 rev3=PROPOSED-roster-binding;identity=carlos instance-control, root control service uid 0;basis=fix round 1 (finding 1): now readView with census false, unchanged behaviour: quarantined (settled or not) and pending records refuse 2bc13f3341e273be24c275db459e3e9bbaa2f79354562dfad792ab88f628e45c
+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