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"}}`},