diff --git a/checks/health/go.mod b/checks/health/go.mod index f9aedc80..937ab2e3 100644 --- a/checks/health/go.mod +++ b/checks/health/go.mod @@ -2,4 +2,4 @@ module checks/health go 1.26.0 -require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 +require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f diff --git a/checks/health/go.sum b/checks/health/go.sum index 3725c41e..df962ed0 100644 --- a/checks/health/go.sum +++ b/checks/health/go.sum @@ -1,2 +1,2 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 h1:ImOyj4WqH9lwxOr95aH9Wq2iJkUwdtnEyPrASm9TrYA= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f h1:TbL5EGs7WCioK610IKPsEOn0mFx8mEjnvTbycaR1Alc= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= diff --git a/modules/mesh-config/cmd/mesh-config/manifest_test.go b/modules/mesh-config/cmd/mesh-config/manifest_test.go index 23f06ef3..c68914e4 100644 --- a/modules/mesh-config/cmd/mesh-config/manifest_test.go +++ b/modules/mesh-config/cmd/mesh-config/manifest_test.go @@ -16,10 +16,14 @@ func TestEveryStateAndActHasItsTool(t *testing.T) { t.Fatal(err) } var m struct { - State []string `json:"state"` - Logs []string `json:"logs"` - Reads []string `json:"reads"` - Tools []string `json:"tools"` + State []string `json:"state"` + Logs []string `json:"logs"` + Reads []string `json:"reads"` + Tools []string `json:"tools"` + Claims []struct { + Name string `json:"name"` + Serves []string `json:"serves"` + } `json:"claims"` } if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) @@ -37,6 +41,14 @@ func TestEveryStateAndActHasItsTool(t *testing.T) { for _, tool := range Tools(&Config{}) { served[tool.Name] = true } + if len(m.Claims) != 1 || m.Claims[0].Name != Seat || strings.Join(m.Claims[0].Serves, ",") != strings.Join(SeatVerbs, ",") { + t.Errorf("claims %+v, want %s serving %v", m.Claims, Seat, SeatVerbs) + } + for _, verb := range SeatVerbs { + if !served[Seat+"."+verb] { + t.Errorf("the seat's verb %s is not served", verb) + } + } for _, name := range m.Tools { if !served[name] { t.Errorf("the manifest lists the tool %s, which is not served", name) diff --git a/modules/mesh-config/cmd/mesh-config/switch_tools.go b/modules/mesh-config/cmd/mesh-config/switch_tools.go index 80983e4f..7fbc2ffc 100644 --- a/modules/mesh-config/cmd/mesh-config/switch_tools.go +++ b/modules/mesh-config/cmd/mesh-config/switch_tools.go @@ -1,7 +1,7 @@ package main -// The tools of the switch (novox/hq ADR 0565 §4, §15): compare, take-over and hand-back, the read of `declared` and -// resync. Module tools until mesh-sdk's seat mesh-config names them as its verbs. +// The tools of the switch (novox/hq ADR 0565 §4, §15): compare, take-over and hand-back, served as the seat's verbs +// and as the module's own tools beside them, the read of `declared` and resync. import ( "strings" @@ -18,7 +18,24 @@ const ( ResyncTool = "config_resync" ) +// SeatVerbs are the seat's verbs, as the manifest claims them. +var SeatVerbs = []string{Verb, CompareVerb, TakeOverVerb, HandBackVerb} + func switchTools(c *Config) []stdio.Tool { + own := ownSwitchTools(c) + byName := map[string]stdio.Tool{} + for _, t := range own { + byName[t.Name] = t + } + for verb, tool := range map[string]string{CompareVerb: CompareTool, TakeOverVerb: TakeOverTool, HandBackVerb: HandBackTool} { + t := byName[tool] + t.Name = Seat + "." + verb + own = append(own, t) + } + return own +} + +func ownSwitchTools(c *Config) []stdio.Tool { why := map[string]any{"type": "object", "properties": map[string]any{ "why": map[string]any{"type": "string", "description": "why, in a sentence"}}, "required": []string{"why"}} whyOf := func(a map[string]any) string { s, _ := a["why"].(string); return strings.TrimSpace(s) } diff --git a/modules/mesh-config/go.mod b/modules/mesh-config/go.mod index a473279f..596188af 100644 --- a/modules/mesh-config/go.mod +++ b/modules/mesh-config/go.mod @@ -2,7 +2,7 @@ module mesh-config go 1.26.0 -require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 +require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f require ( github.com/klauspost/compress v1.20.0 // indirect diff --git a/modules/mesh-config/go.sum b/modules/mesh-config/go.sum index fe45f51a..a2e6f9cc 100644 --- a/modules/mesh-config/go.sum +++ b/modules/mesh-config/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 h1:ImOyj4WqH9lwxOr95aH9Wq2iJkUwdtnEyPrASm9TrYA= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f h1:TbL5EGs7WCioK610IKPsEOn0mFx8mEjnvTbycaR1Alc= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI= github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= diff --git a/modules/mesh-config/module.json b/modules/mesh-config/module.json index 66641a25..9554db29 100644 --- a/modules/mesh-config/module.json +++ b/modules/mesh-config/module.json @@ -7,7 +7,10 @@ "name": "mesh-config", "scope": "mesh", "serves": [ - "config" + "config", + "compare", + "take-over", + "hand-back" ] } ], diff --git a/modules/mesh-hand-acts/go.mod b/modules/mesh-hand-acts/go.mod index ae12ac5a..7de813c4 100644 --- a/modules/mesh-hand-acts/go.mod +++ b/modules/mesh-hand-acts/go.mod @@ -3,7 +3,7 @@ module mesh-hand-acts go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-hand-acts/go.sum b/modules/mesh-hand-acts/go.sum index f53fc84a..89be360c 100644 --- a/modules/mesh-hand-acts/go.sum +++ b/modules/mesh-hand-acts/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 h1:ImOyj4WqH9lwxOr95aH9Wq2iJkUwdtnEyPrASm9TrYA= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f h1:TbL5EGs7WCioK610IKPsEOn0mFx8mEjnvTbycaR1Alc= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI= github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= diff --git a/modules/mesh-healers/go.mod b/modules/mesh-healers/go.mod index 84e2b59c..3986b5ca 100644 --- a/modules/mesh-healers/go.mod +++ b/modules/mesh-healers/go.mod @@ -3,7 +3,7 @@ module mesh-healers go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-healers/go.sum b/modules/mesh-healers/go.sum index f53fc84a..89be360c 100644 --- a/modules/mesh-healers/go.sum +++ b/modules/mesh-healers/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 h1:ImOyj4WqH9lwxOr95aH9Wq2iJkUwdtnEyPrASm9TrYA= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f h1:TbL5EGs7WCioK610IKPsEOn0mFx8mEjnvTbycaR1Alc= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI= github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= diff --git a/modules/mesh-self-check/go.mod b/modules/mesh-self-check/go.mod index 4f9316ba..aebf0142 100644 --- a/modules/mesh-self-check/go.mod +++ b/modules/mesh-self-check/go.mod @@ -3,7 +3,7 @@ module mesh-self-check go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-self-check/go.sum b/modules/mesh-self-check/go.sum index f53fc84a..89be360c 100644 --- a/modules/mesh-self-check/go.sum +++ b/modules/mesh-self-check/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635 h1:ImOyj4WqH9lwxOr95aH9Wq2iJkUwdtnEyPrASm9TrYA= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029211750-2e5cc4f16635/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f h1:TbL5EGs7WCioK610IKPsEOn0mFx8mEjnvTbycaR1Alc= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029212845-4204afd2400f/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI= github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=