diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/catalogue_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/catalogue_test.go index 3f46a2fd4..917e77ac8 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/catalogue_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/catalogue_test.go @@ -7,6 +7,8 @@ import ( "slices" "strings" "testing" + + seat "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshdelivery" ) // **The gate is the only claimant of the seat `mesh-delivery` in the catalogue** (novox/hq ADR 0437 §1, ADR 0449 §4, ADR 0454, @@ -50,6 +52,20 @@ func TestTheCatalogueHoldsTheGateAsTheOnlyClaimantOfTheSeat(t *testing.T) { } var generic any _ = json.Unmarshal(raw, &generic) + // A `consumes` entry `mesh-delivery.` is the seat's event (design 47 G A-30, §507): a manifest names a + // seat's events by the seat, so an entry naming one of the seat's own events is no module's name. + if top, ok := generic.(map[string]any); ok { + if entries, ok := top["consumes"].([]any); ok { + kept := []any{} + for _, e := range entries { + name, _ := e.(string) + if !slices.ContainsFunc(seat.Events(), func(ev string) bool { return name == "mesh-delivery."+ev }) { + kept = append(kept, e) + } + } + top["consumes"] = kept + } + } var walk func(v any) walk = func(v any) { switch x := v.(type) {