From e1eb98fcbcce4ac3f1782b5b9aaf2c2a6a458b68 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 18:37:28 +0100 Subject: [PATCH] No client names a holder: each reader keeps its own constant, held to its manifest (ADR 0625 section 4, issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- modules/route-proxy/cmd/route-proxy/bus.go | 8 ++++-- .../route-proxy/cmd/route-proxy/names_test.go | 25 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 modules/route-proxy/cmd/route-proxy/names_test.go diff --git a/modules/route-proxy/cmd/route-proxy/bus.go b/modules/route-proxy/cmd/route-proxy/bus.go index a7724a0..8c622c7 100644 --- a/modules/route-proxy/cmd/route-proxy/bus.go +++ b/modules/route-proxy/cmd/route-proxy/bus.go @@ -19,6 +19,10 @@ import ( "route-proxy/contract" ) +// placementRead is the seat mesh-module-assigner's state placement as this module's manifest reads it (`reads`); no seat's +// client names a holder (novox/hq ADR 0625 ยง4), so the name is kept here and held to the manifest by TestTheReadIsTheManifests. +const placementRead = "mesh-delivery-assigner.placement" + // keptStates is every state route-proxy keeps, as both its halves write them: the routes and the refusals this // proxy writes, readable by others, and the bound entries the provider helper writes. func keptStates() []announce.State { @@ -74,8 +78,8 @@ func followOnce(path string, held *table) error { } } // Who is inside first, so the first table is served to the machines it is meant for. - if err := followInside(conn.Read(meshmoduleassignerclient.PlacementRead), held); err != nil { - log.Printf("cannot follow %s, so an internal name is served to this machine alone: %v", meshmoduleassignerclient.PlacementRead, err) + if err := followInside(conn.Read(placementRead), held); err != nil { + log.Printf("cannot follow %s, so an internal name is served to this machine alone: %v", placementRead, err) } if err := followPlans(conn.Read(meshprovisionerclient.PlansRead), newPlanned(account.Node, say), held, say); err != nil { conn.Close() diff --git a/modules/route-proxy/cmd/route-proxy/names_test.go b/modules/route-proxy/cmd/route-proxy/names_test.go new file mode 100644 index 0000000..2a2464c --- /dev/null +++ b/modules/route-proxy/cmd/route-proxy/names_test.go @@ -0,0 +1,25 @@ +package main + +import ( + "encoding/json" + "os" + "slices" + "testing" +) + +// The state the proxy follows to know who is inside is one its manifest reads. +func TestTheReadIsTheManifests(t *testing.T) { + raw, err := os.ReadFile("../../module.json") + if err != nil { + t.Fatal(err) + } + var m struct { + Reads []string `json:"reads"` + } + if err := json.Unmarshal(raw, &m); err != nil { + t.Fatal(err) + } + if !slices.Contains(m.Reads, placementRead) { + t.Errorf("the proxy follows %s, its manifest reads %v", placementRead, m.Reads) + } +}