H-A-335: a held module's share of a holder's words is what runs

The reads runtime on ace restarted twice in two minutes because its
MESH_SECRET_PLACES changed: the holders of node-reads and node-files were
told the node's secret places and owned paths from held modules' stubs,
which differ pass by pass while a part is withheld. While a module is held,
the resolution now takes its share from each runtime process as it runs:
the secret places are those the modules not held compose merged with every
place that runs, and the owned paths keep each running entry a held module
owns. Two passes with the same held set compose every runtime process the
same; a module that answered and changed is still composed from its build.

Builds: design 47 H H-A-335, H-A-337, H-A-306 (2), (3)
This commit is contained in:
2026-11-21 22:10:50 +01:00
parent 637cfb1fd0
commit 94a2e6ede0
13 changed files with 299 additions and 32 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ func TestTheHolderOfNodeFilesIsToldSecretPlacesAndOwnedPaths(t *testing.T) {
app := mcat.Manifest{Module: "app", Version: "1",
Resources: []map[string]any{{"id": "conf", "type": "file", "path": "/etc/app/app.conf"}}}
r := mcat.Resolution{Node: "anchor", Modules: []mcat.Manifest{files, host, app}}
words, err := resolutionFilesWords(r, files, nil, mcat.Rendering{})
words, err := resolutionFilesWords(r, files, nil, mcat.Rendering{}, Holding{}, "")
if err != nil {
t.Fatal(err)
}
@@ -51,7 +51,7 @@ func TestTheHolderOfNodeFilesIsToldSecretPlacesAndOwnedPaths(t *testing.T) {
mcat.UseSeats(reversed)
}
both := mcat.Resolution{Node: "anchor", Modules: []mcat.Manifest{files, uplink, resolver}}
w, err := resolutionFilesWords(both, files, nil, mcat.Rendering{})
w, err := resolutionFilesWords(both, files, nil, mcat.Rendering{}, Holding{}, "")
if err != nil {
t.Fatal(err)
}
@@ -65,12 +65,12 @@ func TestTheHolderOfNodeFilesIsToldSecretPlacesAndOwnedPaths(t *testing.T) {
// the controller tells them, and not the paths its running resources are at (a directory the mesh placed).
carried := mcat.Manifest{Module: "de-spiegel", Version: "1", OwnsPaths: []string{"/var/lib/de-spiegel/server.env"},
Resources: []map[string]any{{"id": "state", "type": "directory", "path": "/var/lib/de-spiegel"}}}
w, err := resolutionFilesWords(mcat.Resolution{Node: "anchor", Modules: []mcat.Manifest{files, carried}}, files, nil, mcat.Rendering{})
w, err := resolutionFilesWords(mcat.Resolution{Node: "anchor", Modules: []mcat.Manifest{files, carried}}, files, nil, mcat.Rendering{}, Holding{}, "")
if err != nil || !strings.Contains(w[mcat.FilesOwnedPaths], `"/var/lib/de-spiegel/server.env":"de-spiegel (its own tools)"`) ||
strings.Contains(w[mcat.FilesOwnedPaths], `"/var/lib/de-spiegel":`) {
t.Errorf("a carried module does not own its manifest's paths alone: %v %v", w[mcat.FilesOwnedPaths], err)
}
if w, _ := resolutionFilesWords(r, app, nil, mcat.Rendering{}); w[mcat.FilesOwnedPaths] != "" {
if w, _ := resolutionFilesWords(r, app, nil, mcat.Rendering{}, Holding{}, ""); w[mcat.FilesOwnedPaths] != "" {
t.Error("a module not holding node-files is told the owned paths")
}
}