sdk1: the node-engine alone composes and answers compose-candidate (ADR 0593) #198

Merged
mesh-tools merged 14 commits from feat/sdk1 into main 2026-11-02 20:42:48 +00:00
3 changed files with 17 additions and 1 deletions
Showing only changes of commit 4b8b5c7329 - Show all commits
+13
View File
@@ -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")
+2 -1
View File
@@ -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
+2
View File
@@ -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",