From 07ebeae74d61646cd94d7c6a17441f9c9c9d92c2 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 21 Nov 2026 23:17:58 +0100 Subject: [PATCH] mesh_wait knows every seat of the seat list by the events it declares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A wait by seat and event name was refused for a seat the catalog half's own definitions do not name (the runner's mesh-pipeline-runner.pipeline-ended, defined in the delivery repository's contracts module), though the seat list declares the event under the seat's events family. Every seat of the seat list is now an emitter by its declared events. Builds: design 47 H2 §821, H-A-343 --- node-tools/internal/console/wait.go | 6 +++++- node-tools/internal/console/wait_test.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/node-tools/internal/console/wait.go b/node-tools/internal/console/wait.go index ad08d72..664bf95 100644 --- a/node-tools/internal/console/wait.go +++ b/node-tools/internal/console/wait.go @@ -202,10 +202,14 @@ func (s *Surface) emitters() (known knownEmitters, unchecked string) { return known, "the catalog half is not yet read (" + err.Error() + "); its first view is in mesh_first_views" } seatEvents := map[string][]string{} // a seat's events, as its definition in the seat list declares them + known.seats, known.modules = map[string][]string{}, map[string][]string{} + // Every seat of the seat list is an emitter, by the events its definition declares under its events family, whichever + // repository defines it (design 47 H2 §821, H-A-343): a seat the catalog half's own definitions do not name, such as one the + // delivery repository's contracts module defines, is waited on by its seat and event name. for _, st := range catalogue.Seats() { seatEvents[st.Name] = st.Emits + known.seats[st.Name] = st.Emits } - known.seats, known.modules = map[string][]string{}, map[string][]string{} branches := make([]string, 0, len(halves)) for b := range halves { branches = append(branches, b) diff --git a/node-tools/internal/console/wait_test.go b/node-tools/internal/console/wait_test.go index 1fe7562..22a3d87 100644 --- a/node-tools/internal/console/wait_test.go +++ b/node-tools/internal/console/wait_test.go @@ -246,6 +246,8 @@ func TestMeshWaitRefusesLoudlyAndNeverLoops(t *testing.T) { {"mesh-delivry-view.delivered", "mesh-delivry-view is neither a seat nor a module of the catalog half (mesh-catalog.revision, revision 7 of main)", true}, {"mesh-delivery-view.planned", "no declaration names mesh-delivery-view.planned", false}, {"mesh-catalog.catalog-revision", "", false}, + // a seat of the seat list the half's definitions do not name is waited on by its declared event (design 47 H2 §821) + {"mesh-wants.wanted", "", false}, } { text, isErr := callWait(half, map[string]any{"subjects": []any{c.name}, "timeout": 1}) if isErr != c.refused || c.says != "" && !strings.Contains(text, c.says) ||