Land feature 57's controller work on its release branch

The controller plans config, templates and moved providers' provisions,
hands bus accounts to the vault and judges the new manifest words, on the
feature's SDK and node-engine validator (feature 57, config and provisioning).
This commit is contained in:
2026-10-15 21:27:33 +00:00
parent fcdecb4361
commit 97a2d841c7
349 changed files with 42440 additions and 786 deletions
+12 -11
View File
@@ -14,14 +14,15 @@ import (
"github.com/novox/mesh-controller/internal/catalogue"
)
// withTemplateTexts is what was built with each template's text, for a module whose files name templates
// (novox/hq ADR 0349 §2): its templates archive gains the text of every file in it, read back from the packed
// bytes, by its path inside the archive. Resolve reads them into the files' content.
// withTemplateTexts is what was built with each template's text, for a module whose files name templates (novox/hq ADR
// 0349 §2): its templates archive — the one built from its templates directory, files/ unless its manifest names
// another (issue 731) — gains the text of every file in it, read back from the packed bytes, by its path inside the
// archive. Resolve reads them into the files' content.
//
// **Read from the archive, proven by its digest.** The module's files/ is packed again, as the build packs it,
// and the bytes are read only when they hash to the digest the build made or took: a fresh build's own archive,
// or a check's build a walk copied by digest without building (novox/hq ADR 0350 §2). Packing is deterministic,
// so one source packs to one digest; a tree that packs to another is not the archive, and its text is refused.
// **Read from the archive, proven by its digest.** The module's templates directory is packed again, as the build packs
// it, and the bytes are read only when they hash to the digest the build made or took: a fresh build's own archive, or
// a check's build a walk copied by digest without building (novox/hq ADR 0350 §2). Packing is deterministic, so one
// source packs to one digest; a tree that packs to another is not the archive, and its text is refused.
func withTemplateTexts(manifest catalogue.Manifest, within string, built []catalogue.Built) ([]catalogue.Built, error) {
if !manifest.Templated() {
return built, nil
@@ -35,18 +36,18 @@ func withTemplateTexts(manifest catalogue.Manifest, within string, built []catal
}
if name == "" || at < 0 {
return nil, fmt.Errorf("%s names templates and built no archive of %s/ to read them from",
manifest.Module, catalogue.TemplatesDir)
manifest.Module, manifest.TemplatesDir())
}
body, err := pack(filepath.Join(within, catalogue.TemplatesDir))
body, err := pack(filepath.Join(within, filepath.FromSlash(manifest.TemplatesDir())))
if err != nil {
return nil, fmt.Errorf("%s: packing %s/ to read its templates back failed: %w", manifest.Module,
catalogue.TemplatesDir, err)
manifest.TemplatesDir(), err)
}
sum := sha256.Sum256(body)
digest := "sha256:" + hex.EncodeToString(sum[:])
if built[at].Digest != digest {
return nil, fmt.Errorf("%s: %s/ packs to the digest %s, and the archive %q built or taken is %s: the "+
"templates are read only from the archive the mesh records", manifest.Module, catalogue.TemplatesDir,
"templates are read only from the archive the mesh records", manifest.Module, manifest.TemplatesDir(),
digest, name, orNone(built[at].Digest))
}
texts, err := unpackTexts(body)