From 7ed668fa53d525027b21b2ddd0b2a1e6f77becd6 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 01:32:06 +0100 Subject: [PATCH] I7: a catalog entry carries its manifest's class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gate reads a mover's class from its catalog entry when it opens the delivery record, so the indexer writes the manifest's class there. Builds: design 47 H2 §810; H-A-394 (1), H-A-431 (1) --- .../mesh-delivery-indexer/internal/index/catalog_graph.go | 5 +++-- .../internal/index/catalog_graph_test.go | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go index 906f2263f..93ff2d057 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go @@ -27,13 +27,14 @@ const CatalogEntryLayout = 1 // CatalogEntryOf is the catalog graph entry of one module: the module graph's node of it as a recompute computed it // (its build, provision and verb edges, the verb edges left out on a cycle, ADR 0614), with where the trunk holds it, // its manifest's digest and verdict, the main package its process runs (MainOf), the package versions it builds against -// and what the indexer computes its next revision from (Inputs: the lead's ruling on milestone 47/G finding 1), so that +// and what the indexer computes its next revision from (Inputs: the lead's ruling on milestone 47/G finding 1), and its +// manifest's class, core or leaf, absent for none (design 47 H2 §810, H-A-394 (1): the gate reads it), so that // ModuleValueOf gives the module's value back from the entry alone. The acting rules are the revision's to add. func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catalogue.Manifest, raw string, n graph.Node) meshcatalog.CatalogEntry { e := meshcatalog.CatalogEntry{V: CatalogEntryLayout, Module: module, Repository: cur.Repository, Path: cur.Path, Commit: cur.Commit, Manifest: manifestWhole(raw), ManifestDigest: meshcatalogclient.EntryManifestDigest(cur.Manifest), Verdict: cur.Verdict, Fp: n.FP, None: n.None, Bases: n.Bases, Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes, - Serves: n.Serves, LeftOut: n.LeftOut, Main: MainOf(m), Contributes: contributesOf(m)} + Serves: n.Serves, LeftOut: n.LeftOut, Main: MainOf(m), Contributes: contributesOf(m), Class: m.Class} // requires names every requirement as catalogue.Manifest.Wants lists them, optional ones and those only contributes names // included, since contributing to a requirement is requiring it (design 47 G §709, A-229). for _, r := range m.Wants() { diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go index 36cb65242..69dca5113 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go @@ -106,7 +106,11 @@ func TestAnEntryNamesWhatItContributesToAndEveryRequirement(t *testing.T) { if n := graph.NodeOf(e); !reflect.DeepEqual(n.Requires, []string{"database", graph.BusState, "route"}) { t.Errorf("the node's requires = %v, want the optional cache left out", n.Requires) } - if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{}, "", graph.Node{}); e.Contributes != nil { - t.Errorf("an entry of a manifest contributing nothing carries contributes %v", e.Contributes) + if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{}, "", graph.Node{}); e.Contributes != nil || e.Class != "" { + t.Errorf("an entry of a manifest contributing nothing and naming no class carries contributes %v, class %q", e.Contributes, e.Class) + } + // Design 47 H2 §810, H-A-394 (1): the entry carries its manifest's class, which the gate reads. + if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{Class: catalogue.ClassCore}, "", graph.Node{}); e.Class != catalogue.ClassCore { + t.Errorf("the entry of a core manifest carries the class %q, want core", e.Class) } }