composer: a module that fetches from an artifact store no node reaches waits alone, never the node

Typed resolution.NoStoreError from artifactsInto (image, source, tools bundle,
runtime program, templates archive), laid on its module by
composeWithoutStoreFetchers with A-452's "nothing provides" words and composed
again, instead of a whole-node refusal. Replaces storeHeld and
modulesNeedingTheStore, whose shape list missed bundles and held stand-ins.

Builds: design 47 G-22 A-452, A-461, A-461b, A-459b
This commit is contained in:
2026-11-17 16:03:18 +01:00
parent eb89cb7da3
commit e3d994fde1
5 changed files with 68 additions and 48 deletions
+13 -2
View File
@@ -8,6 +8,17 @@ import (
"github.com/novox/mesh-host/internal/registryforms"
)
// NoStoreError is a module that fetches from the artifact store while this node reaches none: it costs that module, never the
// node. The caller leaves the module out of the declaration, with these words (design 47 G A-461, A-452; ADR 0163 rule 6).
type NoStoreError struct {
Module string
said string
}
func (e *NoStoreError) Error() string {
return fmt.Sprintf("nothing provides %q, wanted by %s: %s", "the artifact store's address", e.Module, e.said)
}
// artifactsInto composes the artifact store's address into a resource's `image` and `source`.
//
// **Composed here, at the last moment before a machine, and stored nowhere.** A kept reference is
@@ -35,11 +46,11 @@ func artifactsInto(resource map[string]any, module string, with mcat.Rendering)
}
if _, kept := registryforms.Forms.InArtifactStore(written); kept {
if with.ArtifactStore == "" {
return fmt.Errorf(
return &NoStoreError{Module: module, said: fmt.Sprintf(
"%s's %v names %s, which is in the mesh's artifact store, and this mesh has no "+
"artifact store on its network to fetch it from — nothing assigned holds the seat "+
"container-image-registry, or the machine holding it is not on the private network",
module, resource["id"], written)
module, resource["id"], written)}
}
resource[key] = registryforms.Forms.Routed(written, with.ArtifactStore)
imageSeatInto(resource, key, written, with)