From 4923e44cf79481ec9c3bd48d4dddb661a3c84e26 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 15:23:30 +0100 Subject: [PATCH] =?UTF-8?q?mesh-watcher=20reads=20who=20holds=20a=20seat?= =?UTF-8?q?=20through=20the=20placement=20client=20and=20the=20seat's=20st?= =?UTF-8?q?ate=20name,=20not=20go/delivery=20(B5e;=20ADR=200634=20=C2=A71,?= =?UTF-8?q?=20=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/mesh-watcher/cmd/mesh-watcher/main.go | 15 ++++++++++----- .../cmd/mesh-watcher/manifest_test.go | 3 ++- modules/mesh-watcher/go.mod | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/mesh-watcher/cmd/mesh-watcher/main.go b/modules/mesh-watcher/cmd/mesh-watcher/main.go index 41e57b7c6..c25e47d04 100644 --- a/modules/mesh-watcher/cmd/mesh-watcher/main.go +++ b/modules/mesh-watcher/cmd/mesh-watcher/main.go @@ -10,6 +10,8 @@ import ( "context" "encoding/json" "fmt" + assignerclient "git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient" + mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner" "os" "strings" "sync" @@ -19,7 +21,6 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" meshselfcheck "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshselfcheck" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/delivery" "git.novox.be/novox/mesh-sdk/go/views" ) @@ -76,7 +77,7 @@ func main() { w := NewWatcher(tg, time.Now, logf, node) l := &listening{now: "not yet: starting"} placement := &views.Reader{Module: "mesh-watcher", Logf: logf, Findings: meshconditionsclient.FindingWriter{State: stdio.State("findings")}, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}} - placement.Follow(delivery.AssignerModule, delivery.SeatHoldersState, SeatHoldersTool) + placement.Follow(assignerModule, mesh.StateSeatHolders, SeatHoldersTool) go run(w, l, node, placement) if err := stdio.Serve("", append(tools(w, l), placement.Tools("watcher")...)); err != nil { logf("%v", err) @@ -155,12 +156,16 @@ func roundTrip(node string) error { // SeatHoldersTool is the assigner's read tool of the state of who holds which seat, which the manifest invokes; the // state is followed as a view (ADR 0615), named as the manifest named it before: SeatHoldersRead. -const SeatHoldersTool = delivery.AssignerModule + ".assigner_read_seat_holders" +// assignerModule is the holder of the seat mesh-module-assigner whose seat-holders view this module follows: the one name +// of it here, the same as its manifest's `consumes` and `invokes` carry (the manifest test holds them equal). +const assignerModule = "mesh-delivery-assigner" + +const SeatHoldersTool = assignerModule + ".assigner_read_seat_holders" // controlNodes reads which machines hold the bus, from the placement seat's state of who holds which seat (novox/hq // ADR 0571 clause 4). The controller is not placed (ADR 0590), so the bus's machines are the control node. func controlNodes(seats *views.Reader) ([]string, error) { - keys, err := seats.Values(delivery.SeatHoldersRead) + keys, err := seats.Values(assignerModule + "." + mesh.StateSeatHolders) if err != nil { return nil, err } @@ -172,7 +177,7 @@ func holderNodes(keys map[string][]byte, seats ...string) ([]string, error) { var out []string seen := map[string]bool{} for _, seat := range seats { - holders, err := delivery.HoldersOf(keys, seat, "") + holders, err := assignerclient.HoldersOf(keys, seat, "") if err != nil { return nil, err } diff --git a/modules/mesh-watcher/cmd/mesh-watcher/manifest_test.go b/modules/mesh-watcher/cmd/mesh-watcher/manifest_test.go index cc004b07a..08170cefb 100644 --- a/modules/mesh-watcher/cmd/mesh-watcher/manifest_test.go +++ b/modules/mesh-watcher/cmd/mesh-watcher/manifest_test.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner" "os" "path/filepath" "reflect" @@ -38,7 +39,7 @@ func TestTheManifestSaysWhatTheCodeDoes(t *testing.T) { t.Fatal(err) } // Where the bus runs is the assigner's seat-holders, asked once and followed by its events (ADR 0615), never read. - if !reflect.DeepEqual(m.Consumes, []string{"mesh-self-check.checked", "mesh-delivery-assigner.views.seat-holders"}) { + if !reflect.DeepEqual(m.Consumes, []string{"mesh-self-check.checked", assignerModule + ".views." + mesh.StateSeatHolders}) { t.Fatalf("consumes %v", m.Consumes) } if !reflect.DeepEqual(m.Invokes, []string{SeatHoldersTool, m.Module + ".watcher_ping", "seat:mesh-hand-acts.hand-act"}) || len(m.Reads) != 0 { diff --git a/modules/mesh-watcher/go.mod b/modules/mesh-watcher/go.mod index e578d0d55..d94d9400b 100644 --- a/modules/mesh-watcher/go.mod +++ b/modules/mesh-watcher/go.mod @@ -5,6 +5,8 @@ go 1.26.0 require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261104174359-05b3e2e1b94f require ( + git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient v0.0.0-00010101000000-000000000000 + git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient 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/go v0.0.0-20261104174344-ae5266e77639 // indirect