Let the build agent run on the genesis document until its registry binds (hq issue 121, ADR 0336)
mesh/delivery-group group fix/121-genesis-package-registry delivering: 2 of 4 delivered
mesh/merge-gate head a641ed7d15c7 merged into trunk b12c4b82e820 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head a641ed7d15c7 merged into trunk b12c4b82e820 — pass: its merge-check.sh passed
mesh/delivery delivered

With npm-package-registry optional, the binding file the agent's environment
names may be absent, and mesh-builder failed every build on reading it. It now
reads the genesis document the installer seals at genesis's packages step when
no binding is present, prefers the binding when both are, and each build's log
says which it resolved from (§4). A build that needs the registry - a package,
an image naming .npmrc, TypeScript with an @novox/ dependency - on an agent with
neither is refused before anything is built or published, naming the machine,
the unbound requirement and gitea (§6); it never falls back to the public
registry. The captured catalogue moves to the mesh-catalog change it is judged
with.
This commit is contained in:
jochen
2026-10-13 02:53:41 +02:00
parent eb7ee921b5
commit a641ed7d15
25 changed files with 1291 additions and 97 deletions
+23 -1
View File
@@ -251,6 +251,20 @@ func build(ctx context.Context, run Runner, publish Publisher,
// never resolve a mesh package — making their image non-deterministic (a needless rollout every
// build) and leaking the credential into a build stage. Absent entirely with no registry, which
// is the bootstrap case (novox/hq ADR 0076).
// **A build that needs the registry and has none is refused before anything is built or
// published** (novox/hq ADR 0336 §6) — before a base is copied into the store, and never built
// without the credential or against the public registry.
if !npmrc.Enabled() {
why, err := needsRegistry(manifest, within)
if err != nil {
return Result{}, err
}
if why != "" {
err := npmrc.unbound(manifest.Module, why)
say("packages", "REFUSED: %v", err)
return Result{}, err
}
}
var npmrcPath string
if npmrc.Enabled() && manifest.Build != nil && wantsPackages(manifest, within) {
content, err := npmrc.File()
@@ -263,7 +277,7 @@ func build(ctx context.Context, run Runner, publish Publisher,
}
// Only for as long as the build: a later check's container mounts this workspace (novox/hq issue 462).
defer os.Remove(npmrcPath)
say("packages", "resolving %s from the mesh's package registry", npmrc.Scope)
say("packages", "resolving %s from the mesh's package registry, from %s", npmrc.Scope, fromOr(npmrc.From))
src.notPinned("it resolves packages from the mesh's registry at build time")
}
@@ -701,6 +715,14 @@ func against(within string, manifest catalogue.Manifest, resolved []string) []st
return out
}
// fromOr is where a registry was resolved from, as a build's log says it.
func fromOr(from string) string {
if from == "" {
return "what this build was handed"
}
return from
}
// ManifestName is the one file a module repository must have.
//
// At the root, and named the same in every repository. A convention somebody can look for beats a