From 0acad94ba504b896292a5f8fe31f65f534a396c6 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 01:00:25 +0100 Subject: [PATCH] Fix 9.2: the gate's catalogue test reads a consumes entry naming the seat's own event as the seat, not the module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 G A-30, §507 (consumes names a seat's events by the seat) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- .../cmd/mesh-delivery-gate/catalogue_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) {