Merge branch 'b9j/registry' into feat/registry-milestone

This commit is contained in:
2026-11-05 19:26:06 +01:00
11 changed files with 1006 additions and 35 deletions
@@ -1,24 +1,6 @@
package meshmoduleassignerclient
import (
"sort"
seat "git.novox.be/novox/mesh-contracts/placement/go/seats/meshmoduleassigner"
)
// The holder of the seat and the names a reader of its states declares in its `reads` (`<module>.<state>`) and binds
// to (`<module>_<state>`): named here once, by the seat's state, so no reader builds them from a module's name
// (ADR 0634 §4; the lead's ruling of 2026-11-05).
const (
// Module is the module that holds the seat mesh-module-assigner.
Module = "mesh-delivery-assigner"
// PlacementRead and SeatHoldersRead are the states `placement` and `seat-holders`, as a manifest's `reads` names them.
PlacementRead = Module + "." + seat.StatePlacement
SeatHoldersRead = Module + "." + seat.StateSeatHolders
// PlacementBucket and SeatHoldersBucket are the states' buckets.
PlacementBucket = Module + "_" + seat.StatePlacement
SeatHoldersBucket = Module + "_" + seat.StateSeatHolders
)
import "sort"
// MachineNames is every machine the seat places modules on, sorted, from its state `placement` as a reader holds its
// keys: each with a node key `<node>.node` or, in the form before, `placement.<node>`. Module keys and keys of the
@@ -5,15 +5,6 @@ import (
"testing"
)
func TestTheStatesAreNamedBySeatAndState(t *testing.T) {
for got, want := range map[string]string{PlacementRead: "mesh-delivery-assigner.placement", SeatHoldersRead: "mesh-delivery-assigner.seat-holders",
PlacementBucket: "mesh-delivery-assigner_placement", SeatHoldersBucket: "mesh-delivery-assigner_seat-holders"} {
if got != want {
t.Errorf("got %q, want %q", got, want)
}
}
}
func TestMachineNamesAreTheNodesAKeyNames(t *testing.T) {
keys := map[string][]byte{"g14.node": nil, "g14.app": nil, "ace.node": nil, "placement.novox": nil, "want.x.y": nil, "bad": nil}
if got, want := MachineNames(keys), []string{"ace", "g14", "novox"}; !reflect.DeepEqual(got, want) {