diff --git a/go.mod b/go.mod index 3cb48cc..410da9b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/novox/mesh-host go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103131008-e7ce86ff62b5 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103152334-65b7adc8bdd9 github.com/nats-io/nats-server/v2 v2.11.17 github.com/nats-io/nats.go v1.54.0 golang.org/x/crypto v0.57.0 diff --git a/go.sum b/go.sum index 310e531..c1f0628 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103131008-e7ce86ff62b5 h1:snMd7KsMT+tKlWYtrXSXrHF4u60DElvHmbe/aq58DqU= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103131008-e7ce86ff62b5/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103152334-65b7adc8bdd9 h1:XJ7L9ZZ26URj0WxT467I9xZXijKDlQ5ZfE9NK/SnV0Y= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261103152334-65b7adc8bdd9/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/internal/compose/resolution/seats.go b/internal/compose/resolution/seats.go index 85b5015..5e1beb8 100644 --- a/internal/compose/resolution/seats.go +++ b/internal/compose/resolution/seats.go @@ -193,7 +193,8 @@ var defaultSeats = append([]mcat.Seat{ // images and archives, by digest — which is why the provision is the artifact store and not an // image registry. {Name: "mesh-artifact-store", Scope: mcat.ScopeMesh, Delivers: "artifact-store", Decision: "novox/hq ADR 0075"}, - {Name: "mesh-catalog", Scope: mcat.ScopeMesh, Decision: "novox/hq ADR 0121"}, + // The catalog (novox/hq ADR 0604): the SDK's entry with its four verbs, so the copies of the table agree. + sdkSeat(mcat.CatalogSeat), // The delivery's owner (novox/hq ADR 0239): one commit's journey from its pull request's head to every // machine, and a group of them, recorded and ordered by its holder, which asks the controller for each act. // What it says it says as its module (`mesh-delivery.transition`), through the runtime that launches it. @@ -649,3 +650,12 @@ func vaultIntake(first map[string]string) map[string]string { } return out } + +// sdkSeat is the SDK's entry for a seat, taken whole, so this copy of the table cannot disagree with it. +func sdkSeat(name string) mcat.Seat { + seat, ok := mcat.SeatNamed(name) + if !ok { + panic("the SDK's seat table holds no seat " + name) + } + return seat +} diff --git a/internal/compose/resolution/seats_test.go b/internal/compose/resolution/seats_test.go index 8c3cdd5..bcbac2c 100644 --- a/internal/compose/resolution/seats_test.go +++ b/internal/compose/resolution/seats_test.go @@ -1,6 +1,7 @@ package resolution import ( + "reflect" "strings" "testing" @@ -69,4 +70,23 @@ func TestTheHolderIsTheModuleNotTheMachine(t *testing.T) { if !held || holder.Module != "gitea" { t.Fatalf("the holder was not told apart from a neighbour: %+v", holder) } + + // ADR 0604 section 1, F3: the seat table written here answers as the SDK's does for the catalog seat, its four + // verbs included, so no two copies of the table disagree. + want, ok := mcat.SeatNamed(mcat.CatalogSeat) + if !ok { + t.Fatal("the SDK holds no catalog seat") + } + var have *mcat.Seat + for i := range defaultSeats { + if defaultSeats[i].Name == mcat.CatalogSeat { + have = &defaultSeats[i] + } + } + if have == nil { + t.Fatal("the table here holds no catalog seat") + } + if !reflect.DeepEqual(*have, want) { + t.Errorf("the table here has %+v, the SDK's is %+v", *have, want) + } }