Files
mesh-host/internal/selfcompose/kept_test.go
T
jschoubben dd2b3a16df MH-2b: the node-engine reads the want by the real contract: composed, kept-on and newest go
A want carries no composed digest, no keeping node and no newest build (design 47 H 750,
H-A-37): the agent takes the digest from the composition the node made for the want's
build, the shadow's resolution around a missing entry (A-405) and KeptBuildOf's keeping node
go, and the artifact is fetched from the store. Tests of the removed behaviour go.

Builds: design 47 H §750; H-A-37

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 03:09:22 +01:00

27 lines
1.1 KiB
Go

package selfcompose
import (
"context"
"slices"
"testing"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
)
// Design 47 G §558, A-275: a manifest's `invokes` in its long form {verb, fields} is read for its seat, and one of a form that
// cannot be read is refused, never read as no seats.
func TestSeatsOfReadsALongFormInvokeAndRefusesAnUnreadableOne(t *testing.T) {
c := New(Env{Node: "n1"})
c.modules["m"] = meshcatalog.ModulesByModuleValue{Manifest: "d1"}
c.modules["bad"] = meshcatalog.ModulesByModuleValue{Manifest: "d2"}
c.manifests["d1"] = []byte(`{"module":"m","invokes":["seat:a.b",{"verb":"seat:mesh-catalog.revision","fields":["x"]}]}`)
c.manifests["d2"] = []byte(`{"module":"bad","invokes":[3]}`)
seats, err := c.seatsOf(context.Background(), reader{c: c}, "m")
if err != nil || !slices.Equal(seats, []string{"a", "mesh-catalog"}) {
t.Fatalf("seats %v, %v", seats, err)
}
if seats, err := c.seatsOf(context.Background(), reader{c: c}, "bad"); err == nil {
t.Fatalf("an unreadable invokes gave seats %v", seats)
}
}