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) ||