MH-2: a want is read by its version alone; the parts check and parts-differ go
The node-engine no longer reads a want's parts: the parts check (G 524) and its hold parts-differ are removed, the digests of a build are resolved through the registry seats from the want's version, and a candidate's added module is resolved from its version alone. Builds: design 47 H §750, §764; H-A-37, H-A-38 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -19,15 +19,17 @@ func TestTheKeepingNodeIsTheWantsKeptOn(t *testing.T) {
|
||||
node string
|
||||
kept bool
|
||||
}{
|
||||
{"kept, by its bare digest", kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Parts: map[string]string{"db:p": "sha256:" + kd}}, "n3", true},
|
||||
{"kept, by the declared digest", "sha256:" + kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Parts: map[string]string{"db:p": "sha256:" + kd}}, "n3", true},
|
||||
{"a digest the parts do not name", "sha256:" + strings.Repeat("7", 64), &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Parts: map[string]string{"db:p": "sha256:" + kd}}, "", false},
|
||||
{"a want naming no keeping node", kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", Parts: map[string]string{"db:p": "sha256:" + kd}}, "", false},
|
||||
{"kept, by its bare digest", kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Version: "1"}, "n3", true},
|
||||
{"kept, by the declared digest", "sha256:" + kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Version: "1"}, "n3", true},
|
||||
{"a digest the resolved version does not name", "sha256:" + strings.Repeat("7", 64), &meshwants.WantsByWantNodeModuleValue{Fp: "f1", KeptOn: "n3", Version: "1"}, "", false},
|
||||
{"a want naming no keeping node", kd, &meshwants.WantsByWantNodeModuleValue{Fp: "f1", Version: "1"}, "", false},
|
||||
{"no want of the module", kd, nil, "", false},
|
||||
} {
|
||||
c := &Composer{wants: map[string]meshwants.WantsByWantNodeModuleValue{}}
|
||||
if row.want != nil {
|
||||
c.wants["db"] = *row.want
|
||||
// The digests the want's version resolves to through the registry seats (design 47 H §750).
|
||||
c.resolved = map[resolvedKey]versionParts{{"db", "f1", "1"}: {parts: map[string]string{"db:p": "sha256:" + kd}}}
|
||||
}
|
||||
node, fp, kept, err := c.KeptBuildOf(context.Background(), "db", row.digest)
|
||||
if err != nil || node != row.node || kept != row.kept || (kept && fp != "f1") {
|
||||
|
||||
Reference in New Issue
Block a user