From 1f3a2939888625b19704705b5cadaeaeb5fff892 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 17:03:28 +0100 Subject: [PATCH] =?UTF-8?q?The=20nats=20keeper=20takes=20the=20removal=20g?= =?UTF-8?q?rant=20from=20the=20grants=20part's=20published=20busgrants=20p?= =?UTF-8?q?ackage=20and=20names=20it=20in=20packages=20(ADR=200634=20?= =?UTF-8?q?=C2=A74;=20issue=201966)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- modules/nats/cmd/nats-tools/manifest_test.go | 12 +++++++++--- modules/nats/cmd/nats-tools/removal_test.go | 6 +++--- modules/nats/go.mod | 2 ++ modules/nats/module.json | 3 +++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/modules/nats/cmd/nats-tools/manifest_test.go b/modules/nats/cmd/nats-tools/manifest_test.go index 2f63445ca..f02e67307 100644 --- a/modules/nats/cmd/nats-tools/manifest_test.go +++ b/modules/nats/cmd/nats-tools/manifest_test.go @@ -41,9 +41,10 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) { Form string `json:"form"` } `json:"credential"` } `json:"provides"` - Tools []string `json:"tools"` - Emits []string `json:"emits"` - Resources []map[string]any `json:"resources"` + Packages map[string]string `json:"packages"` + Tools []string `json:"tools"` + Emits []string `json:"emits"` + Resources []map[string]any `json:"resources"` Build struct { On any `json:"on"` Artifacts []artifact `json:"artifacts"` @@ -52,6 +53,11 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) { if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) } + // The removal grant the tests compose is the grants part's published package busgrants (series 0.1), which the + // manifest names so the build resolves it (ADR 0634 §4). + if m.Packages["busgrants"] != "0.1" { + t.Errorf("packages = %v, want busgrants at 0.1", m.Packages) + } // 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 { diff --git a/modules/nats/cmd/nats-tools/removal_test.go b/modules/nats/cmd/nats-tools/removal_test.go index b11f09296..680fee08c 100644 --- a/modules/nats/cmd/nats-tools/removal_test.go +++ b/modules/nats/cmd/nats-tools/removal_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "git.novox.be/novox/mesh-sdk/go/buscompose" + "git.novox.be/novox/mesh-delivery/modules/mesh-grants/busgrants" "git.novox.be/novox/mesh-sdk/go/catalogue" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" @@ -27,9 +27,9 @@ import ( func TestTheRemovalToolsChangeOnlyWhatTheyAreAskedAndTheGrantAllows(t *testing.T) { dir := t.TempDir() conf := filepath.Join(dir, "nats.conf") - // Issue 1126 B5: the tools' grant as the mesh composes it for this module's word (mesh-sdk BusRemovalGrants), never + // Issue 1126 B5: the tools' grant as the mesh composes it for this module's word (the grants part's busgrants.BusRemovalGrants), never // a list written here, so the test proves the composed grant is enough and no wider. - grants, err := buscompose.BusRemovalGrants([]string{catalogue.RemovesControllerLeftovers, catalogue.RemovesEngineActs}, + grants, err := busgrants.BusRemovalGrants([]string{catalogue.RemovesControllerLeftovers, catalogue.RemovesEngineActs}, []string{"novox"}) if err != nil { t.Fatal(err) diff --git a/modules/nats/go.mod b/modules/nats/go.mod index 5a01c69c4..75c0cac88 100644 --- a/modules/nats/go.mod +++ b/modules/nats/go.mod @@ -3,6 +3,7 @@ module nats-tools go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/modules/mesh-grants/busgrants v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient v0.0.0-00010101000000-000000000000 @@ -15,6 +16,7 @@ require ( ) require ( + git.novox.be/novox/mesh-delivery/modules/mesh-grants/busgrants v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/go v0.0.0-20261104174344-ae5266e77639 // indirect github.com/antithesishq/antithesis-sdk-go v0.8.0-default-no-op // indirect diff --git a/modules/nats/module.json b/modules/nats/module.json index c207dc885..a3dc719f1 100644 --- a/modules/nats/module.json +++ b/modules/nats/module.json @@ -1,6 +1,9 @@ { "module": "nats", "version": "1", + "packages": { + "busgrants": "0.1" + }, "upgrade": { "policy": "record", "why": "the bus keeps the streams of the whole mesh: each move waits for a person's yes, which the operator's Approve of the release that carries its build gives, and its node backs its streams up before it applies (hq ADR 0236, ADR 0601)"