node-engine: a runtime of its own runs the tool runner's program, which the module's parts check leaves out (design 47 G §524, A-432)

This commit is contained in:
2026-11-16 01:01:01 +01:00
parent 7f892a757c
commit 5a3510b115
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -366,6 +366,11 @@ func TestAWantAndItsCompositionApplyTheModuleAndTheHaveNamesBoth(t *testing.T) {
if got := partsDifference(map[string]string{"web:c": d3}, []json.RawMessage{container}); got != "" {
t.Fatalf("a container whose digest is in the parts differs: %q", got)
}
// A-432: a runtime of its own runs the tool runner's program, which the module's parts do not name.
ownRuntime := json.RawMessage(`{"id":"web.own-runtime","type":"process","name":"web-runtime","source":"store/node-tools","digest":"` + d1 + `","run":["./node-tools"],"module":"web"}`)
if got := partsDifference(map[string]string{"web:c": d3}, []json.RawMessage{container, ownRuntime}); got != "" {
t.Fatalf("a runtime of its own differs from the module's parts: %q", got)
}
}
// R6-A AC2: given a kept declaration and wants and compositions equal to it, when the agent starts, nothing is applied
+3 -1
View File
@@ -6,6 +6,7 @@ import (
"sort"
"strings"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/declaration"
)
@@ -47,7 +48,8 @@ func partsDifference(parts map[string]string, resources []json.RawMessage) strin
fetched[res.Digest] = true
}
case *declaration.Process:
if res.Source != "" {
// A runtime of its own runs the tool runner's program, which the tool runner's want checks (A-432).
if res.Source != "" && !strings.HasSuffix(res.ID, "."+catalogue.OwnRuntimeID()) {
fetched[res.Digest] = true
}
case *declaration.Container: