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
This commit is contained in:
@@ -19,6 +19,10 @@ import (
|
|||||||
"route-proxy/contract"
|
"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
|
// 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.
|
// proxy writes, readable by others, and the bound entries the provider helper writes.
|
||||||
func keptStates() []announce.State {
|
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.
|
// 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 {
|
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", meshmoduleassignerclient.PlacementRead, err)
|
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 {
|
if err := followPlans(conn.Read(meshprovisionerclient.PlansRead), newPlanned(account.Node, say), held, say); err != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user