The broker credential resolves the mesh-broker seat, not the hub (issue 059)
An adversarial review of the 055 fix found it encoded the wrong invariants, latent while every mesh keeps its broker on the hub. Now: the address is the overlay name of the node ASSIGNED a module claiming the mesh-broker seat (the hub stands in only while nothing holds the seat — genesis); "on the overlay" is what whereEveryoneIs answers (resolved the networking module), not "has an address"; a portless genesis address defaults to 5671 instead of silently disabling the path; a second `overlay place --hub` is refused rather than last-write-wins; and `overlay place` says that earlier credentials keep their old address. A test now binds the controller's own module.json to its seat, so deleting the claim fails the suite. https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
This commit is contained in:
@@ -2,6 +2,8 @@ package catalogue
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -484,3 +486,24 @@ func TestSomethingOrdinaryAnsweredHereNeedsNothing(t *testing.T) {
|
||||
t.Fatalf("a shell answered on this machine produced %d need(s)", len(got.Needs))
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheControllersOwnManifestClaimsItsSeat(t *testing.T) {
|
||||
// The seat test above fabricates manifests, so deleting the claim from the real module.json
|
||||
// would fail nothing (novox/hq issue 059's review). This binds the one manifest this
|
||||
// repository owns: the controller claims the mesh-scoped seat named after its server
|
||||
// (ADR 0079), or the one-controller property is convention again.
|
||||
raw, err := os.ReadFile(filepath.Join("..", "..", "module.json"))
|
||||
if err != nil {
|
||||
t.Fatalf("the controller's own manifest is unreadable: %v", err)
|
||||
}
|
||||
m, err := ParseManifest(raw)
|
||||
if err != nil {
|
||||
t.Fatalf("the controller's own manifest does not parse: %v", err)
|
||||
}
|
||||
for _, c := range m.Claims {
|
||||
if c.Name == "mesh-controller" && c.At() == ScopeMesh {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatalf("module.json no longer claims the mesh-scoped mesh-controller seat: %+v", m.Claims)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user