Node-engine: a setting's word is never a running bundle's own (H-A-477)

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
This commit is contained in:
2026-11-22 15:33:38 +01:00
parent 058ff297ae
commit d5b2123180
2 changed files with 18 additions and 5 deletions
+10 -5
View File
@@ -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{}
+8
View File
@@ -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"}}`},