diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go index c4b576f4..7cb6ae5b 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositionrun.go @@ -378,7 +378,8 @@ func caseOf(half mcc.Half) (map[string]composer.Manifest, map[string]json.RawMes func nodeEngineEntry(entries map[string]meshcatalog.CatalogEntry) (meshcatalog.CatalogEntry, bool) { for _, name := range slices.Sorted(mapsKeys(entries)) { for _, s := range entries[name].Serves { - if strings.HasPrefix(s, ne.Seat+".") { + // The catalog writes a served seat verb as `seat:.` (as the compose words above are made). + if strings.HasPrefix(strings.TrimPrefix(s, "seat:"), ne.Seat+".") { return entries[name], true } } diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/nodeengineentry_test.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/nodeengineentry_test.go new file mode 100644 index 00000000..135d72c7 --- /dev/null +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/nodeengineentry_test.go @@ -0,0 +1,26 @@ +package main + +import ( + "testing" + + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog" +) + +// The module claiming the seat node-engine is found by its served verbs, in the catalog's form `seat:.` +// and in the bare form (live, 2026-11-16: every composition step said "holds no module claiming the seat node-engine"). +func TestTheNodeEngineEntryIsFoundByItsServedVerbs(t *testing.T) { + for _, c := range []struct { + name string + serves []string + found bool + }{ + {"the catalog's seat form", []string{"seat:node-engine.compose", "seat:node-engine.acts"}, true}, + {"the bare form", []string{"node-engine.compose"}, true}, + {"another seat", []string{"seat:node-engine-x.compose", "seat:mesh-wants.ask"}, false}, + } { + e, ok := nodeEngineEntry(map[string]meshcatalog.CatalogEntry{"other": {Serves: []string{"seat:mesh-builds.ask"}}, "engine": {Serves: c.serves}}) + if ok != c.found || (ok && e.Serves[0] != c.serves[0]) { + t.Errorf("%s: found %v (%v), want %v", c.name, ok, e.Serves, c.found) + } + } +}