From d5b2123180719a57d26e2f7c86a66758cee84608 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 15:33:38 +0100 Subject: [PATCH] Node-engine: a setting's word is never a running bundle's own (H-A-477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuilding a stubbed module's bundles from the tool runner's running MESH_TOOL_ENV kept the setting words the engine itself composed before (MESH_CONFIG_PUBLISH_TRIES "8" from the builder's old default), so §781's check refused them against the setting's composed value ("5") and every composition on shanks failed. Leave them out like the other mesh-said words; they are composed again from the setting. Builds: design 47 H2 §781, H-A-477 --- internal/compose/composed.go | 15 ++++++++++----- internal/compose/composed_test.go | 8 ++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/internal/compose/composed.go b/internal/compose/composed.go index b7a56b79..ae48a961 100644 --- a/internal/compose/composed.go +++ b/internal/compose/composed.go @@ -13,6 +13,7 @@ import ( engcomp "github.com/novox/mesh-host/internal/compositions" "git.novox.be/novox/mesh-networking/modules/mesh-wireguard/go/overlay" + stdio "git.novox.be/novox/mesh-sdk/go" "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/declaration" "github.com/novox/mesh-host/internal/compose/resolution" @@ -399,9 +400,10 @@ func FilterRunning(running []engcomp.Composed) *string { // ToolsRunning is, by module, the tools bundles that run on the node (Node.RunsTools): each bundle archive a module's // resource unpacks at its BundlePath, with what the runtime's own process loads of it and the words it hands it -// (catalogue.RuntimeToolModules, catalogue.RuntimeToolEnv, the mesh's own words left out). A bundle the runtime loads -// nothing of has no Loads: the runtime dropped it, and the composition reads its loads again from the module's build -// (issue 1126, review: shanks had already applied the drop of systemd-resolved). Nil when running holds no runtime process. +// (catalogue.RuntimeToolModules, catalogue.RuntimeToolEnv, the mesh's own words left out, its setting words among them). +// A bundle the runtime loads nothing of has no Loads: the runtime dropped it, and the composition reads its loads again +// from the module's build (issue 1126, review: shanks had already applied the drop of systemd-resolved). Nil when +// running holds no runtime process. func ToolsRunning(running []engcomp.Composed) map[string][]catalogue.Bundle { type resource struct { ID string `json:"id"` @@ -454,8 +456,11 @@ func ToolsRunning(running []engcomp.Composed) map[string][]catalogue.Bundle { } var own map[string]string for w, v := range words[module] { - if w == catalogue.FilesOwnedPaths || w == catalogue.ReadsSecretPlaces || w == engcomp.FingerprintVar { - continue // the mesh's to say, composed again (the fingerprint is the want's, §519) + if w == catalogue.FilesOwnedPaths || w == catalogue.ReadsSecretPlaces || w == engcomp.FingerprintVar || + strings.HasPrefix(w, stdio.SettingWord("")) { + // The mesh's to say, composed again: the fingerprint is the want's (§519), a setting's word its setting's + // (design 47 H2 §781, H-A-477), never a value the engine composed before. + continue } if own == nil { own = map[string]string{} diff --git a/internal/compose/composed_test.go b/internal/compose/composed_test.go index 2179aa48..73931eeb 100644 --- a/internal/compose/composed_test.go +++ b/internal/compose/composed_test.go @@ -179,6 +179,14 @@ func TestCompositionsAreTheDeclarationSplitByModule(t *testing.T) { n.RunsOwn = &engcomp.Composed{Node: "anchor", Resources: []json.RawMessage{json.RawMessage(lampRuns)}} return *n.RunsOwn }, map[string]string{}, true, "", "", ""}, + // H-A-477: a setting's word the runtime runs with is the mesh's, composed again, never the bundle's own word. + {"folded, a setting's word it runs with is not its own", func(n *Node) engcomp.Composed { + n.InOwn = map[string]bool{"lamp": true} + n.RunsOwn = &engcomp.Composed{Node: "anchor", Resources: []json.RawMessage{json.RawMessage(lampRuns)}} + return *n.RunsOwn + }, map[string]string{}, false, + `"MESH_TOOL_MODULES":"` + served + `","MESH_TOOL_ENV":` + strconv.Quote(`{"lamp":{"LAMP_CONF":"/var/lib/lamp/conf","MESH_CONFIG_PUBLISH_TRIES":"8"}}`), + "", ""}, // H-A-306: a held module's slice is what runs of it, verbatim: no fingerprint of its want where none runs. {"held, its new build not delivered", held, map[string]string{"lamp": fpFor('1')}, false, "", served, `{"lamp":{"LAMP_CONF":"/var/lib/lamp/conf"}}`}, -- 2.54.0