minio reads who holds a seat through the placement client and the seat's state name, not go/delivery (B5e; ADR 0634 §1, §4; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 15:23:30 +01:00
parent c39c3fdddd
commit 45f4edbb36
4 changed files with 14 additions and 7 deletions
+8 -4
View File
@@ -12,11 +12,11 @@ package main
import (
"context"
"fmt"
mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner"
"os"
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
"git.novox.be/novox/mesh-sdk/go/views"
@@ -31,9 +31,9 @@ const (
func main() {
seats := &views.Reader{Module: "minio", Findings: meshconditionsclient.FindingWriter{State: stdio.State("findings")}, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}, Logf: func(f string, a ...any) { fmt.Fprintf(os.Stderr, "[object-store] "+f+"\n", a...) }}
seats.Follow(delivery.AssignerModule, delivery.SeatHoldersState, SeatHoldersTool)
seats.Follow(assignerModule, mesh.StateSeatHolders, SeatHoldersTool)
s, err := newServer(os.Getenv(ConfigWord), os.Getenv(LinksWord), os.Getenv(ReceivesWord),
func() (map[string][]byte, error) { return seats.Values(delivery.SeatHoldersRead) })
func() (map[string][]byte, error) { return seats.Values(assignerModule + "." + mesh.StateSeatHolders) })
if err != nil {
fmt.Fprintf(os.Stderr, "[object-store] %v\n", err)
os.Exit(1)
@@ -46,7 +46,11 @@ func main() {
}
// SeatHoldersTool is the assigner's read tool of who holds which seat, which the manifest invokes (ADR 0615).
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"
func tools(s *server) []stdio.Tool {
return []stdio.Tool{{
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
mesh "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner"
"os"
"strings"
"testing"
@@ -40,7 +41,7 @@ func TestManifestClaimsTheSeat(t *testing.T) {
}
invokes, _ := m["invokes"].([]any)
consumes, _ := m["consumes"].([]any)
if _, reads := m["reads"]; reads || len(invokes) != 2 || invokes[0] != SeatHoldersTool || invokes[1] != "seat:mesh-hand-acts.hand-act" || len(consumes) != 1 || consumes[0] != "mesh-delivery-assigner.views.seat-holders" {
if _, reads := m["reads"]; reads || len(invokes) != 2 || invokes[0] != SeatHoldersTool || invokes[1] != "seat:mesh-hand-acts.hand-act" || len(consumes) != 1 || consumes[0] != assignerModule+".views."+mesh.StateSeatHolders {
t.Fatalf("reads %v, invokes %v, consumes %v: it asks the assigner's seat-holders once and follows its events (ADR 0615)", m["reads"], invokes, consumes)
}
var goBundle map[string]any
+2 -2
View File
@@ -6,13 +6,13 @@ import (
"encoding/json"
"errors"
"fmt"
assignerclient "git.novox.be/novox/mesh-contracts/placement/go/clients/meshmoduleassignerclient"
"os"
"path/filepath"
"strings"
"time"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-sdk/go/objectlink"
)
@@ -247,7 +247,7 @@ func (s *server) holds(seat, node, module string) (bool, error) {
if err != nil {
return false, err
}
holders, err := delivery.HoldersOf(keys, seat, node)
holders, err := assignerclient.HoldersOf(keys, seat, node)
if err != nil {
return false, err
}