MH-3: the apply order by rank, the revert, the backup holder and the bus module first, the engine's own module last

settle applies the changed wants in the order of design 47 H 771: the node's own composition,
a reverted module, the holder of node-backup and the bus module (by the claims of the manifests
the composer holds), each pipeline's wants by rank (older source first), the rest by name, the
engine's own module last. A want of a higher rank waits on this machine alone for the lower
ranks of its pipeline, held in its have as a wait of step placing and judged again at the next
settle. The want's pipeline and rank are the mesh-delivery contract's stand-in until its commit.

Builds: design 47 H §771; H-A-46, H-A-59, H-A-67, H-A-68

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 02:37:59 +01:00
parent d2b6ecdf0e
commit 949b782a1e
7 changed files with 449 additions and 37 deletions
+13
View File
@@ -1473,6 +1473,19 @@ func (c *Composer) HoldsData(_ context.Context, module string) (data, known bool
return len(a.Manifest.DataItems()) > 0, true
}
// Claims says whether the manifest of the build the node's want of module names claims the seat, and whether that manifest is
// read: the holder of the seat node-backup and the bus module are applied first (design 47 H §771).
func (c *Composer) Claims(_ context.Context, module, seat string) (claims, known bool) {
c.mu.Lock()
fp := c.wants[module].Fp
c.mu.Unlock()
a := c.runningManifest(c.env.Node, module, fp)
if !a.Known {
return false, false
}
return a.Manifest.ClaimsSeat(seat), true
}
// taken is a module's manifest as this engine reads it (novox/hq ADR 0578 §3): decoded leniently, judging nothing, with
// the indexer's verdict from the module's value (a missing one is accepted). held is why the module is held, "" when it is
// not: a manifest the indexer refused, or one not read past a field this engine does not know. A field set aside is said
+19
View File
@@ -118,3 +118,22 @@ func aWantNamingItsVersionIsResolvedThroughTheRegistrySeats(t *testing.T) {
}
}
}
// Design 47 H §771: the order applies the holder of a seat first, found by the claim of the manifest of the build the want names.
func TestAModulesClaimsAreReadFromTheEntryOfItsWantsBuild(t *testing.T) {
fp := meshcatalogclient.SourcePrefix2 + strings.Repeat("a", 64)
c := New(Env{})
c.keptEnt = map[string]keptEntry{}
c.wants["bus"] = meshwants.WantsByWantNodeModuleValue{Fp: fp}
c.keptEnt[fp] = keptEntry{entry: meshcatalog.CatalogEntry{Module: "bus", Fp: fp,
Manifest: map[string]any{"module": "bus", "version": "1", "claims": []any{map[string]any{"name": "mesh-broker"}}}}}
if claims, known := c.Claims(context.Background(), "bus", "mesh-broker"); !claims || !known {
t.Errorf("the bus claims mesh-broker: claims %v, known %v", claims, known)
}
if claims, known := c.Claims(context.Background(), "bus", "node-backup"); claims || !known {
t.Errorf("the bus claims no node-backup: claims %v, known %v", claims, known)
}
if claims, known := c.Claims(context.Background(), "ghost", "mesh-broker"); claims || known {
t.Errorf("a module with no want has no manifest read: claims %v, known %v", claims, known)
}
}