H-20: a tools bundle's words hold its module's want fingerprint

Builds: design 47 G §519, §618
This commit is contained in:
2026-11-12 04:55:33 +01:00
parent 94f6c3dba4
commit 4d656fe4e1
4 changed files with 92 additions and 3 deletions
+21
View File
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
seat "git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"slices"
"strings"
"testing"
@@ -203,6 +204,26 @@ func TestComparingCompositions(t *testing.T) {
t.Errorf("the node's own carries %s: %s", FingerprintVar, raw)
}
}
// §519, §618: the tool runner's process hands each bundle's module its own want's fingerprint in the words of its
// bundles, a module with bundles and no words included, and the runner's own fingerprint reaches no other module's.
fpLamp, fpBare := "src2:"+strings.Repeat("1", 64), "src2:"+strings.Repeat("2", 64)
runner, err := Split("novox", []json.RawMessage{json.RawMessage(`{"id":"r","type":"process","module":"nats","run":["x"],"env":{` +
`"` + catalogue.RuntimeToolModules + `":"bare=/b/x,lamp=/l/y","` + catalogue.RuntimeToolEnv + `":"{\"lamp\":{\"LAMP_CONF\":\"/c\"}}"}}`)},
map[string]string{"nats": fp, "lamp": fpLamp, "bare": fpBare}, nil, NodeOwn{})
if err != nil {
t.Fatal(err)
}
var proc struct{ Env map[string]string }
_ = json.Unmarshal(runner[mustKey(t, "novox", "nats", fp)].Resources[0], &proc)
var given map[string]map[string]string
if err := json.Unmarshal([]byte(proc.Env[catalogue.RuntimeToolEnv]), &given); err != nil {
t.Fatal(err)
}
if given["lamp"][FingerprintVar] != fpLamp || given["lamp"]["LAMP_CONF"] != "/c" || given["bare"][FingerprintVar] != fpBare ||
len(given["nats"]) != 0 || proc.Env[FingerprintVar] != fp {
t.Errorf("the bundles' words are %v and the runner's env %v", given, proc.Env)
}
}
func mustKey(t *testing.T, node, module, fp string) string {