R6: the controller writes signed per-node compositions and their digests; plans, pushes and their verbs go (issue 1945) #457

Merged
mesh-tools merged 67 commits from feat/r6 into main 2026-10-24 23:00:31 +00:00
Showing only changes of commit ca25e4ab45 - Show all commits
@@ -28,6 +28,7 @@ import (
"github.com/novox/mesh-controller/internal/chain"
"github.com/novox/mesh-controller/internal/identity"
"github.com/novox/mesh-controller/internal/inventory"
"github.com/novox/mesh-controller/internal/link"
)
// The compositions through the controller whole (novox/hq ADR 0539; the review's G1): the real store, the controller's
@@ -220,6 +221,7 @@ func aServedMesh(t *testing.T) *servedMesh {
}
}
keepWhatServeSets(t)
serving, stop := context.WithCancel(context.Background())
done := make(chan error, 1)
go func() { done <- serve(serving) }()
@@ -587,3 +589,18 @@ func capturedOutput(act func() error) (string, error) {
w.Close()
return <-done, actErr
}
// keepWhatServeSets gives back, once the served controller stopped, what serve sets for the rest of its process, which
// a controller's process exits after and the test process does not (issue 1945): the served mark in the environment, the
// hand-act log's connection, the keeper, the status and the event publishers. Registered before the controller starts, so
// it runs after the cleanup that stops it.
func keepWhatServeSets(t *testing.T) {
t.Helper()
t.Setenv(servedVar, "")
unheld, status, given, check, follow, keeper, hand := logUnheldChanges, statusFrom, givenEvents, checkEvents,
link.Calls.Follow, conditionsFrom, handActConn
t.Cleanup(func() {
logUnheldChanges, statusFrom, givenEvents, checkEvents, link.Calls.Follow, conditionsFrom, handActConn =
unheld, status, given, check, follow, keeper, hand
})
}