diff --git a/internal/agent/agent_test.go b/internal/agent/agent_test.go index e6c128a..2ce56b1 100644 --- a/internal/agent/agent_test.go +++ b/internal/agent/agent_test.go @@ -1560,6 +1560,19 @@ func TestTheNodesOwnCompositionIsAppliedWhenItDiffersAndARecordMoveWaitsForAYes( if _, err := b.ag.Composition(context.Background(), "db", "sha256:"+strings.Repeat("0", 64), false); err == nil { t.Error("a digest no revision has was answered") } + // novox/hq ADR 0593 §6: the engine publishes each composition with its plan in its composition state; the verb reads + // that revision by the digest its have and want name, its resources' (the plan left out of the digest). + planned, _ := delivery.DecodeComposed(draw) + planned.Plan = &catalogue.Plan{} + praw, err := delivery.EncodeComposed(planned) + if err != nil { + t.Fatal(err) + } + keep(dk, praw) + if view, err := b.ag.Composition(context.Background(), "db", ddig, false); err != nil || view.Composition.Digest != ddig || + len(view.Revisions) != 3 || view.Revisions[2].Digest != ddig { + t.Errorf("db's published revision with its plan, asked by its digest, reads %+v (%v)", view, err) + } b.comps.put(dk, draw) eventually(t, "db's have stays waiting-yes after its composition went back to what runs", func() bool { h := b.haves.last("db") diff --git a/internal/nodegrant/nodegrant.go b/internal/nodegrant/nodegrant.go index eb7c088..5553804 100644 --- a/internal/nodegrant/nodegrant.go +++ b/internal/nodegrant/nodegrant.go @@ -2,7 +2,8 @@ // file the node-engine's tests run under (novox/hq ADR 0593 §1): the composer of the bus's user list is the grants // part's own, so this repository holds what it composes for a node rather than calling it. testdata/node.json is that // grant for the node NODE, captured from mesh-sdk's buscompose.PermissionsFor at 3d87ddc, with what this release adds -// to it (ADR 0593 §6, §7): the node's writes of its own composition state, and its reads of the indexer's candidates. +// to it (ADR 0593 §6, §7): the node's writes of its own composition state, and its reads of the indexer's candidates +// and of its verdicts on their manifests. // When the grants part changes a node's grant, this file changes with it in the same group. package nodegrant diff --git a/internal/nodegrant/testdata/node.json b/internal/nodegrant/testdata/node.json index 445ea31..92e72e8 100644 --- a/internal/nodegrant/testdata/node.json +++ b/internal/nodegrant/testdata/node.json @@ -42,6 +42,7 @@ "$JS.API.DIRECT.GET.KV_mesh-delivery-indexer_candidates.>", "$JS.API.DIRECT.GET.KV_mesh-delivery-indexer_manifests.>", "$JS.API.DIRECT.GET.KV_mesh-delivery-indexer_modules.>", + "$JS.API.DIRECT.GET.KV_mesh-delivery-indexer_verdicts.>", "$JS.API.DIRECT.GET.KV_mesh-host_acts.$KV.mesh-host_acts.NODE.>", "$JS.API.DIRECT.GET.KV_mesh-host_data.$KV.mesh-host_data.NODE.>", "$JS.API.DIRECT.GET.KV_mesh-host_health.$KV.mesh-host_health.NODE", @@ -59,6 +60,7 @@ "$JS.API.STREAM.INFO.KV_mesh-delivery-indexer_candidates", "$JS.API.STREAM.INFO.KV_mesh-delivery-indexer_manifests", "$JS.API.STREAM.INFO.KV_mesh-delivery-indexer_modules", + "$JS.API.STREAM.INFO.KV_mesh-delivery-indexer_verdicts", "$JS.API.STREAM.INFO.KV_mesh-host_acts", "$JS.API.STREAM.INFO.KV_mesh-host_data", "$JS.API.STREAM.INFO.KV_mesh-host_health",