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
27 lines
1.1 KiB
Go
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)
|
|
}
|
|
}
|