From 5a3510b115da08f9507a882de3ede6254920ef4a Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 16 Nov 2026 01:01:01 +0100 Subject: [PATCH] =?UTF-8?q?node-engine:=20a=20runtime=20of=20its=20own=20r?= =?UTF-8?q?uns=20the=20tool=20runner's=20program,=20which=20the=20module's?= =?UTF-8?q?=20parts=20check=20leaves=20out=20(design=2047=20G=20=C2=A7524,?= =?UTF-8?q?=20A-432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/agent/agent_test.go | 5 +++++ internal/agent/parts.go | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/agent/agent_test.go b/internal/agent/agent_test.go index 0c0c8b5a..9e118334 100644 --- a/internal/agent/agent_test.go +++ b/internal/agent/agent_test.go @@ -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 diff --git a/internal/agent/parts.go b/internal/agent/parts.go index b324b9a7..850935b4 100644 --- a/internal/agent/parts.go +++ b/internal/agent/parts.go @@ -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: