H-A-337: a held module's owned paths are laid over the whole resolution's

Review of 94a2e6ed: composing the owned paths over the modules not held
changed which module owns a path by the rules between modules (a seat path
over a module's own tools, a seat path stepping back), so a hold's start
told /etc/resolv.conf to the uplink instead of the held resolver, and the
words changed once. The owned paths are now composed over the whole
resolution, less each entry a held module owns, with each running entry of
a held module where no entry left names its path.

Builds: design 47 H H-A-337, H-A-335, H-A-306 (3)
This commit is contained in:
2026-11-21 22:17:27 +01:00
parent 94a2e6ede0
commit b605449d47
2 changed files with 36 additions and 9 deletions
+11 -5
View File
@@ -86,15 +86,21 @@ func resolutionFilesWords(r mcat.Resolution, m mcat.Manifest, words map[string]s
}
// heldOwnedPaths is ownedPaths with a held module's entries as they run (design 47 H, H-A-335, H-A-337): while any module
// is held and the holder's words as it runs (ran) say the owned paths, the entries the modules not held compose, and each
// running entry whose owner is a held module where those name no owner of its path (a module that answered applies,
// H-A-306 (3)). Else ownedPaths.
// is held and the holder's words as it runs (ran) say the owned paths, ownedPaths over the whole resolution, so the rules
// between modules (a seat path over a module's own tools, a seat path stepping back) read every module as before, less
// each entry a held module owns, and each running entry whose owner is a held module where no entry left names its path
// (a module that answered applies, H-A-306 (3)). Else ownedPaths.
func heldOwnedPaths(r mcat.Resolution, held map[string]bool, ran map[string]string) map[string]string {
owned := resolutionOwnedPaths(r)
var running map[string]string
if body, says := ran[mcat.FilesOwnedPaths]; !says || json.Unmarshal([]byte(body), &running) != nil {
return resolutionOwnedPaths(r)
return owned
}
for p, entry := range owned {
if held[ownerOf(entry)] {
delete(owned, p)
}
}
owned := resolutionOwnedPaths(notHeld(r, held))
for p, entry := range running {
if _, composed := owned[p]; !composed && held[ownerOf(entry)] {
owned[p] = entry