From d632071317cd1b92f46657b5d37d5d0f2f7b34be Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 23:09:59 +0100 Subject: [PATCH] =?UTF-8?q?nats=20provides=20bus-state,=20so=20a=20module?= =?UTF-8?q?=20that=20keeps=20bus=20state=20has=20a=20provider=20to=20wait?= =?UTF-8?q?=20for=20(ADR=200614=20=C2=A75,=20issue=20774)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn --- modules/nats/cmd/nats-tools/manifest_test.go | 17 +++++++++++++++++ modules/nats/module.json | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/modules/nats/cmd/nats-tools/manifest_test.go b/modules/nats/cmd/nats-tools/manifest_test.go index 57b4a3fc..93e0a8b3 100644 --- a/modules/nats/cmd/nats-tools/manifest_test.go +++ b/modules/nats/cmd/nats-tools/manifest_test.go @@ -32,6 +32,13 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) { } `json:"backup"` } `json:"own"` } `json:"data"` + Provides []struct { + Name string `json:"name"` + Scope string `json:"scope"` + Credential struct { + Form string `json:"form"` + } `json:"credential"` + } `json:"provides"` Tools []string `json:"tools"` Emits []string `json:"emits"` Resources []map[string]any `json:"resources"` @@ -43,6 +50,16 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) { if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) } + // The bus provides "bus-state" beside "mesh-bus" (ADR 0614 ยง5): a module whose manifest keeps bus state requires it. + provided := map[string]string{} + for _, p := range m.Provides { + provided[p.Name] = p.Scope + "/" + p.Credential.Form + } + for _, name := range []string{"mesh-bus", "bus-state"} { + if provided[name] != "mesh/none" { + t.Errorf("provision %q is %q: the bus provides it mesh-wide with no credential", name, provided[name]) + } + } if m.Build.On != nil { t.Error("build.on is declared: nothing is built on a base image any more") } diff --git a/modules/nats/module.json b/modules/nats/module.json index 93f518d7..3e58475c 100644 --- a/modules/nats/module.json +++ b/modules/nats/module.json @@ -12,6 +12,13 @@ "credential": { "form": "none" } + }, + { + "name": "bus-state", + "scope": "mesh", + "credential": { + "form": "none" + } } ], "claims": [