diff --git a/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go b/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go index dd8db4984..396c469ec 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go @@ -195,6 +195,16 @@ func TestTheModuleInvokesTheArtifactSeatsVerbsAndWritesNoStore(t *testing.T) { if !slices.Contains(m.Consumes, "mesh-conditions.findings-asked") { t.Errorf("consumes %v lack mesh-conditions.findings-asked", m.Consumes) } + // Design 47 G A-488a, A-488b: its runtime follows the seat list, so the module consumes the seat's two events (which makes its + // durable consumer) and invokes the verb that reads the list. + for _, ev := range []string{"mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed"} { + if !slices.Contains(m.Consumes, ev) { + t.Errorf("consumes %v lack %s", m.Consumes, ev) + } + } + if !slices.Contains(m.Invokes, "seat:mesh-catalog.seat-definitions") { + t.Errorf("invokes %v lack seat:mesh-catalog.seat-definitions", m.Invokes) + } // Not a foundation part, it asks its finding stream in requires, by the template events (design 47 G §529, A-30), and // declares no stream of that name. for _, st := range m.Streams { diff --git a/modules/mesh-build-go/module.json b/modules/mesh-build-go/module.json index acc49284d..e73f26bb6 100644 --- a/modules/mesh-build-go/module.json +++ b/modules/mesh-build-go/module.json @@ -33,7 +33,9 @@ } ], "consumes": [ - "mesh-conditions.findings-asked" + "mesh-conditions.findings-asked", + "mesh-catalog.seat-definition-changed", + "mesh-catalog.seat-definition-removed" ], "invokes": [ "seat:mesh-hand-acts.hand-act", @@ -46,6 +48,7 @@ "seat:mesh-wants.input", "seat:mesh-module-assigner.assignments", "seat:mesh-catalog.module", + "seat:mesh-catalog.seat-definitions", "seat:mesh-catalog.entry" ], "config": { diff --git a/modules/mesh-build-image/cmd/mesh-build-image/compose_test.go b/modules/mesh-build-image/cmd/mesh-build-image/compose_test.go index 827f5c85f..e06d84c2d 100644 --- a/modules/mesh-build-image/cmd/mesh-build-image/compose_test.go +++ b/modules/mesh-build-image/cmd/mesh-build-image/compose_test.go @@ -24,7 +24,7 @@ func TestTheModuleInvokesTheImageSeatAndHoldsNoRegistry(t *testing.T) { t.Fatal(err) } if want := []string{"seat:mesh-hand-acts.hand-act", "seat:container-image-registry.publish", "seat:container-image-registry.publish-part", - "seat:container-image-registry.mirror", "seat:mesh-module-assigner.assignments", "seat:mesh-catalog.module"}; !slices.Equal(m.Invokes, want) { + "seat:container-image-registry.mirror", "seat:mesh-module-assigner.assignments", "seat:mesh-catalog.module", "seat:mesh-catalog.seat-definitions"}; !slices.Equal(m.Invokes, want) { t.Errorf("invokes = %v, want %v", m.Invokes, want) } // The seat's outcomes a copy waits on; the version comes in the ask, so version.numbered is not heard (design 47 G §413). @@ -32,6 +32,7 @@ func TestTheModuleInvokesTheImageSeatAndHoldsNoRegistry(t *testing.T) { for _, e := range OutcomeEvents { consumes = append(consumes, "container-image-registry."+e) } + consumes = append(consumes, "mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed") // the seat list, A-488a if !slices.Equal(m.Consumes, consumes) { t.Errorf("consumes = %v, want %v", m.Consumes, consumes) } diff --git a/modules/mesh-build-image/cmd/mesh-build-image/manifest_test.go b/modules/mesh-build-image/cmd/mesh-build-image/manifest_test.go index 5a8fd6111..a2f8be6c7 100644 --- a/modules/mesh-build-image/cmd/mesh-build-image/manifest_test.go +++ b/modules/mesh-build-image/cmd/mesh-build-image/manifest_test.go @@ -113,6 +113,16 @@ func TestWorkAndStoreDirectoriesLieOutsideTheHome(t *testing.T) { // and the registry's address is bound into a file of the home that the program reads. func TestManifestKeepsItsStatesClaimsItsBuildSeatAndDeclaresItsHealthTool(t *testing.T) { m := readManifest(t) + // Design 47 G A-488a, A-488b: its runtime follows the seat list, so the module consumes the seat's two events (which makes its + // durable consumer) and invokes the verb that reads the list. + for _, ev := range []string{"mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed"} { + if !slices.Contains(m.Consumes, ev) { + t.Errorf("consumes %v lack %s", m.Consumes, ev) + } + } + if !slices.Contains(m.Invokes, "seat:mesh-catalog.seat-definitions") { + t.Errorf("invokes %v lack seat:mesh-catalog.seat-definitions", m.Invokes) + } states := []string{} for _, s := range m.State { states = append(states, s.Name) diff --git a/modules/mesh-build-image/module.json b/modules/mesh-build-image/module.json index 3da2c35c5..9493c8927 100644 --- a/modules/mesh-build-image/module.json +++ b/modules/mesh-build-image/module.json @@ -68,11 +68,14 @@ "seat:container-image-registry.publish-part", "seat:container-image-registry.mirror", "seat:mesh-module-assigner.assignments", - "seat:mesh-catalog.module" + "seat:mesh-catalog.module", + "seat:mesh-catalog.seat-definitions" ], "consumes": [ "container-image-registry.published", - "container-image-registry.refused" + "container-image-registry.refused", + "mesh-catalog.seat-definition-changed", + "mesh-catalog.seat-definition-removed" ], "own-secrets": { "broker": "${dir:state}/broker" diff --git a/modules/mesh-build-node/cmd/mesh-build-node/manifest_test.go b/modules/mesh-build-node/cmd/mesh-build-node/manifest_test.go index 03d182e38..6640f55a9 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/manifest_test.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/manifest_test.go @@ -277,6 +277,17 @@ func TestTheModuleRequiresNodeToolsItPullsThrough(t *testing.T) { if !slices.Contains(m.Requires, "node-tools") { t.Errorf("requires %v lack node-tools", m.Requires) } + // Design 47 G A-488a: its runtime follows the seat list (seatlist.Start subscribes to the seat mesh-catalog's events), so the + // module consumes both, which makes its durable consumer _mesh-build-node_tools: with none, the seat list is never + // read and the asks of a named asker are given back for ever. + for _, ev := range []string{"mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed"} { + if !slices.Contains(m.Consumes, ev) { + t.Errorf("consumes %v lack %s", m.Consumes, ev) + } + } + if !slices.Contains(m.Invokes, "seat:mesh-catalog.seat-definitions") { + t.Errorf("invokes %v lack seat:mesh-catalog.seat-definitions (A-488b)", m.Invokes) + } } // Design 47 G A-254, A-313, A-314: the module keeps a run's answer over what step-ended carries inline in the steps state's own diff --git a/modules/mesh-build-node/module.json b/modules/mesh-build-node/module.json index 1f141d375..4f6a44a3f 100644 --- a/modules/mesh-build-node/module.json +++ b/modules/mesh-build-node/module.json @@ -24,6 +24,10 @@ "serves": ["current", "drop", "pause", "resume", "steps", "kept-artifact", "output"] } ], + "consumes": [ + "mesh-catalog.seat-definition-changed", + "mesh-catalog.seat-definition-removed" + ], "config": { "capacity": { "type": "number", @@ -76,7 +80,8 @@ "seat:npm-package-registry.publish", "seat:npm-package-registry.publish-part", "seat:mesh-module-assigner.assignments", - "seat:mesh-catalog.module" + "seat:mesh-catalog.module", + "seat:mesh-catalog.seat-definitions" ], "own-secrets": { "broker": "${dir:state}/broker"