composer: a store fetcher left out is held with its words, so its handed composition stays

Declared.Held carries the modules composeWithoutStoreFetchers leaves out
(A-452: each stays on the build it runs). The store-address comment and code
say A-461e: no address read without error holds only the fetchers, a fault
reading the inputs still refuses the node.

Builds: design 47 G-22 A-452, A-461, A-461e
This commit is contained in:
2026-11-17 16:11:59 +01:00
parent 43c812e98e
commit d57e2325f6
3 changed files with 36 additions and 9 deletions
+25 -6
View File
@@ -172,19 +172,20 @@ func ComposeIn(in Input, node string, mode Mode) (Declared, []string, error) {
return d, validate.Declaration(body), nil
}
// composeWithoutStoreFetchers is resolution.Compose where a module that fetches from the artifact store while the node reaches
// composeWithoutStoreFetchers (it answers the modules it left out, and why) is resolution.Compose where a module that fetches from the artifact store while the node reaches
// none (resolution.NoStoreError, whatever the shape: an image, a source, a tools bundle, a runtime program, a templates
// archive) is left out of the declaration with its words and the rest composes again; the node is never refused whole for it
// (design 47 G A-461, A-452). The rendering returned carries the modules so left out, for the filter and the rest to read.
func composeWithoutStoreFetchers(plan catalogue.Resolution, with catalogue.Rendering) (catalogue.Composed, catalogue.Rendering, error) {
func composeWithoutStoreFetchers(plan catalogue.Resolution, with catalogue.Rendering) (catalogue.Composed, catalogue.Rendering, map[string]string, error) {
var held map[string]string
for {
composed, err := resolution.Compose(plan, with)
var none *resolution.NoStoreError
if !errors.As(err, &none) {
return composed, with, err
return composed, with, held, err
}
if _, already := with.NotPlaced[none.Module]; already {
return catalogue.Composed{}, with, err
return catalogue.Composed{}, with, nil, err
}
left := make(map[string]string, len(with.NotPlaced)+1)
for m, why := range with.NotPlaced {
@@ -192,6 +193,10 @@ func composeWithoutStoreFetchers(plan catalogue.Resolution, with catalogue.Rende
}
left[none.Module] = none.Error()
with.NotPlaced = left
if held == nil {
held = map[string]string{}
}
held[none.Module] = none.Error()
}
}
@@ -212,7 +217,7 @@ func (c *composer) declaration(nodeName string, mode Mode) (Declared, error) {
with := rendered.Rendering
with.Generators = gens
plan := resolved.Plan
composed, with, err := composeWithoutStoreFetchers(plan, with)
composed, with, storeHeld, err := composeWithoutStoreFetchers(plan, with)
if err != nil {
return Declared{}, err
}
@@ -226,7 +231,21 @@ func (c *composer) declaration(nodeName string, mode Mode) (Declared, error) {
if err != nil {
return Declared{}, err
}
out := Declared{Held: resolved.Held, Resources: composed.Resources, Adoption: adoptionFor(plan, node, composed),
// A module that fetches from a store no node reaches is held with its words, as a module whose claim cannot be held is: it
// stays on the build it runs, its composition kept (A-452, A-461).
held := resolved.Held
if len(storeHeld) > 0 {
held = make(map[string]string, len(resolved.Held)+len(storeHeld))
for m, why := range resolved.Held {
held[m] = why
}
for m, why := range storeHeld {
if _, said := held[m]; !said {
held[m] = why
}
}
}
out := Declared{Held: held, Resources: composed.Resources, Adoption: adoptionFor(plan, node, composed),
Received: composed.Received, Mesh: with.Mesh, BusUsers: with.BusUsers,
LeftOut: sortedKeysOf(composed.LeftOut), LeftOutWhy: composed.LeftOut,
Withheld: rendered.Withheld, Unbound: rendered.Unbound,