Repository navigation
refactor(core)!: pod-overlay build off charly-core NewGenerator (#55 step 3-II) - #196
Conversation
…te resolved-project host wrapper's overlay caller (#55 step3-II) Relocates the pod-overlay build's resolved-project envelope construction off charly-core's NewGenerator onto candy/plugin-build's render-prepped resolve pipeline, reused via a new resolve-only Op on build:generate (word=="generate" && Op==OpResolve, plugin.go/resolve.go), completing the seam-death 3b/3-I started: - spec: ExtraCandyRefs threaded into #BuildRequest (spec leg, already landed by team-lead at spec main 1fdb481). - candy/plugin-deploy-pod: podPrepareVenue fetches its own render-prepped envelope via InvokeProvider("build","generate",OpResolve,...) before calling the shrunk HostBuild("overlay") seam; overlay.go computes per-candy security in-plugin via candyByName(dg.Candies,name).Security() (spec.CandyModel.Security is wire-carried — no host-only dependency). - charly/build_overlay.go: hostBuildOverlay shrinks to BaseUser/BaseSecurity/ BaseRegistry (live podman inspect) + ParentVolumes + live-plans re-attach; the render-prepped envelope, per-candy security, and init-system resolution no longer come from this seam. - charly/generate.go: NewGenerator deleted (proven fully dead — its last production caller, the overlay seam, now reaches the same recipe plugin-side); loadRenderGen's cache-miss fallback switches to the cheap newCandyScanGenerator. Two tests that depended on NewGenerator as a comparison/parity baseline (render_seam_cache_test.go, plugin_installstep_envelope_parity_test.go) are rewritten with a test-only reproduction of its former recipe, matching the pattern resolved_project_namespace_test.go already uses for a prior deleted wrapper. - charly/resolved_project_host.go: kept (not deleted in full) — RDD finding during implementation: host_build_buildengine.go's hostBuildNamespaced still calls fillNamespacedBoxes directly for plugin-build's own namespaced-box resolution, a separate, still-live production concern unrelated to the overlay envelope. Only the now production-dead projectResolvedProjectWithBoxes wrapper (zero callers outside two tests) is flagged; the file's header documents the corrected full-deletion story for a future cutover. - charly/bundle_add_cmd.go: named #66 exit comment on the deploy-only residue (deriveChildExecutorForPath/deployDelCmd/resolveDelNode/ podDeploymentArtifactExists), confirmed build-shared trio unchanged. - Confirm-not-moved comments added to builder_preresolve.go, host_build_box_ref_resolve.go, host_build_render_seam.go (out of this cutover's scope). - kernel_manifest_floor_test.go: floor-justification strings for generate.go and build_overlay.go updated to match their shrunk contents (R1 doc fix). - candy/plugin-deploy-pod: 2 pre-existing golangci-lint findings in the touched module fixed (config_setup.go conditional-assignment merge, sidecar_resolve.go extraneous-space directive comment) — required by the commit hook's per-module lint gate; the remaining findings in other candy/plugin-* modules stay in task #14's thematic batch. Gates run: go build/vet clean (charly + candy/plugin-build + candy/plugin-deploy-pod, including all 85 candy modules standalone GOWORK=off), gofmt -l clean, go test ./charly/... 0-fail (194.9s), TestPluginsGenReproducible + TestNoSinglePluginAPISurface pass, box validate exit 0 (root + box/fedora), fresh task build:binary clean, golangci-lint 0 issues (candy/plugin-deploy-pod). R10 disposable-bed verification (check-pod-overlay + check-builder-vm) routes to team-lead per the dispatch plan. Assisted-by: Claude Code Sonnet 4.5 (analysed on a live system)
…, not the operator host (#55 step3-II) BLOCKING R1 regression caught by team-lead's code reading before landing: my 3-II shrink of hostBuildOverlay sourced the pod-overlay's per-step DistroCfg from detectHostContext() (the operator host's own distro) instead of the base image's resolved distro tag. This host is Arch/CachyOS while check-pod-overlay's base is Fedora — a live cross-distro bug, not merely latent, confirmed empirically: temporarily reverting to the buggy code and running the new regression test reproduces exactly the wrong format set ([aur pac] instead of [rpm]). Fix: resolveOverlayBaseDistroDef (charly/build_overlay.go) does a cheap, standalone buildkit.ResolveBox for JUST the base box name (no candy scan, no ExtraCandyRefs — a box's own distro: list is independent of which candies later get overlaid onto it), mirroring exactly what the deleted NewGenerator's gen.Boxes[base].Distro gave the OLD code. detectHostContext() is now ONLY a last-resort fallback if that lightweight resolve fails. Traced (and documented in the file header) that build.DistroCfg itself has no confirmed reader on the current step-emit path — the step-emit words that care about distro/format read it off their OWN candy-side envelope's box.DistroDef (derived from the box's wire-carried .Distro tag), not from this host struct — but the podDistroDef VALUE it carries must still be correct regardless, both to match team-lead's "pure relocation, byte- identical to old behavior" bar and to remove a landmine for any future reader. New regression test: TestResolveOverlayBaseDistroDef_UsesBaseImageDistroNotHost (charly/deploy_target_pod_test.go) — resolves box/fedora's "fedora" base and asserts the def carries the "rpm" format while NOT carrying "pac"/"aur" (this host's own format), which fails on the buggy code and passes on the fix (verified both ways). Also fixed a stale doc comment on TestCreateRemoteCandyCopies_StagesRemoteCandySource (hostBuildOverlay no longer calls createRemoteCandyCopies itself — R1 doc divergence). Also deletes applySelfSuperprojectOverride (charly/refs.go), a dead wrapper with zero callers (its env-mutation pattern is duplicated/inlined at its real call site, host_build_check_bed.go) — surfaced by golangci-lint's per-module gate on this same commit and unrelated to but blocking it. Gates re-run: go build/vet clean, gofmt -l clean, go test ./charly/... 0-fail (200.9s), all 85 candy modules vet clean standalone (GOWORK=off), workspace vet clean, box validate exit 0 (root + box/fedora), fresh task build:binary clean. NOTE: 86 candy+charly go.mod files' github.com/opencharly/spec require pin also drifted (v0.2026210.1533 -> v0.2026210.1634, Go's own module-consistency mechanism reconciling to the ALREADY-LANDED spec commit 1fdb481) while re-running the all-85 GOWORK=off vet gate, but are LEFT UNCOMMITTED here: golangci-lint on the charly module specifically cannot resolve its ~85 compiled-in candy imports under GOWORK=off (no local replace directives for them, unlike sdk/spec — a structural, pre-existing limitation, not a real finding), so including charly/go.mod trips the commit hook on an unrelated, unfixable-in-scope environmental failure. Flagged to team-lead to decide whether/how to land that reconciliation separately. Assisted-by: Claude Code Sonnet 4.5 (analysed on a live system)
…all modules (#55 step3-II) 86 go.mod files (charly + all 85 candy/plugin-* modules) had their github.com/opencharly/spec require-version pin bumped from v0.2026210.1533 to v0.2026210.1634, reconciling to the ALREADY-LANDED spec leg (commit 1fdb481, "ExtraCandyRefs on #BuildRequest") this cutover's gitlink bump already reflects. Surfaced mechanically by Go's own module-consistency check while re-running the mandatory all-85 GOWORK=off vet gate; every one of the 86 diffs is this exact single-line version bump, nothing else (verified via diff inspection before staging). No source-code change. Assisted-by: Claude Code Sonnet 4.5 (analysed on a live system)
…R1 fix + R10 (check-pod-overlay 13/13) Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: charly Go + plugins + build engine + spec-field consumer (runtime class) This is a well-executed cutover — the architecture is right, the R1 DistroDef fix is real and correctly tested, and the full runtime gate re-verifies. It is blocked by one issue: an incomplete R5 sweep of the deleted Checklist
placement: CORRECT — the pod-overlay render-prep moves outward (core → plugin) via the class-generic Gitlinks / gates I re-ran independently
❌ BLOCKING — R5 incomplete sweep of the deleted
|
| File:line | Text | Touched by PR? |
|---|---|---|
charly/generate.go:42 |
"…is still computed in NewGenerator regardless — only the per-box emission loop is scoped." | yes |
charly/generate.go:73 |
"…Candies/Boxes are stable post-NewGenerator." | yes |
charly/generate.go:199 |
"Skips the build-time plugin connect + pre-build validate NewGenerator also runs…" | yes |
charly/resolved_project_host.go:183 |
"…mirroring NewGenerator+RenderPrepAll's two-phase shape…" | yes |
charly/validate_project_host.go:287 |
"…so charly box build/generate (NewGenerator) no longer calls Validate()" |
no (sibling) |
charly/tasks.go:174 |
"…seam in NewGenerator), with NO package-main concrete-type assert." | no (sibling) |
charly/plugin_loader.go:781 |
"…NewGenerator's build-time connect seam)." | no (sibling) |
Two of the affected files (generate.go, resolved_project_host.go) are actively edited here — the "touching a surface obligates curing it" standing directive applies directly. The correct form is the one the author already used elsewhere in this very diff (build_overlay.go, host_build_render_seam.go, host_build_buildengine.go all say "the deleted NewGenerator" / "…is DELETED") — those are accurate and fine.
Fix: sweep the ~7 comments above to past-tense/deleted-marked, or re-point them at the current locus (newCandyScanGenerator for the cheap path; plugin-side resolveBuildEngine / test-side testFullResolveGenerator for the full-resolve recipe). Append a fix commit, push fast-forward (status resets), and this re-runs — everything else is green, so it should pass immediately.
Comments considered: none (PR carried no comments).
Cross-PR interactions considered: only #196 open in opencharly/charly (no file overlap risk). opencharly/plugins #110 (docs) + #113 (attribution policy) open — neither touches this PR's files; none-found blocking.
Decision: CHANGES REQUESTED — one blocking R5/R1 doc-divergence (deleted NewGenerator unswept across 5 files). Not merged. Fix in place and re-push.
Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system)
…ctResolvedProjectWithBoxes wrapper (#55 step3-II) Validator CHANGES-REQUESTED on PR #196 (head 2786ceb): the R5 self-test for the deleted NewGenerator only covered the resolved-project identifiers, not NewGenerator itself. Fixes both blocking findings in one commit: 1. Whole-tree grep sweep of stale present-tense "NewGenerator is/does X" claims across every file touched by the deletion AND untouched siblings that named it (claim-keyed, not file-keyed, per R5): - charly/generate.go (comments on RequestedBoxes/dkGen/ newCandyScanGenerator's doc) - charly/resolved_project_host.go, charly/validate_project_host.go, charly/tasks.go, charly/plugin_loader.go (untouched siblings the validator named) - charly/host_build_render_seam.go, charly/build_emit_test.go, charly/deploy_target_pod_test.go (further hits the sweep caught) - candy/plugin-build/charly.yml + resolve.go (from the K3 cutover, #49 — predates this cutover but carried the same "NewGenerator stays host" claim, now false) - candy/plugin-example-builder/plugin.go, candy/plugin-example-step/ plugin.go (named a since-deleted generate.go connect seam + emitExternalBuilderStages/emitExternalBuilderArtifacts) Self-test: `git grep -n 'NewGenerator' -- charly/ candy/ ':!CHANGELOG/'` now returns ONLY historical/deleted-marked mentions — verified. 2. Deleted projectResolvedProjectWithBoxes (charly/resolved_project_host.go): production-dead once 3-II's own commit (6bc7b38) relocated its last production caller (the pod-overlay seam) plugin-side — the validator correctly flagged this as radical-dead-code-removal territory rather than an acceptable "R3 test harness". fillNamespacedBoxes stays (a genuinely live production capability via host_build_buildengine.go's hostBuildNamespaced). The two former test callers are repointed: - resolved_project_namespace_test.go's namespaced-box test now drives the LIVE hostBuildNamespaced directly (a better test target than the dead wrapper — it's the actual production function). - resolved_project_host_test.go's + plugin_installstep_envelope_parity_ test.go's generic-envelope-projection use (no live production equivalent left in charly core — the real replacement, candy/plugin- build's resolveBuildEngine, is a different Go module) now share ONE test-local reproduction, testProjectResolvedProjectWithBoxes (resolved_project_host_test.go), matching the established test-only-reproduction pattern this cutover already uses elsewhere (R3 — one helper, not two duplicated copies). Also caught + fixed two more stale references to the deleted wrapper surfaced by the same grep: candy/plugin-bundle/candy_select.go (repointed to the wrapper's real underlying mechanism, sdk/loaderkit's ProjectResolvedProject) and charly/validate_project_host.go (repointed the "overlay seam calls this fail-fast" claim to the actual current fail-fast caller, hostBuildNamespaced). Gates re-run: go build/vet clean (charly + candy/plugin-build + candy/plugin-bundle), all 85 candy modules build+vet clean standalone (GOWORK=off), gofmt -l clean tree-wide, go test ./charly/... 0-fail (194.4s) including the repointed namespace/parity/projection tests, TestPluginsGenReproducible PASS, box validate exit 0 (root + box/fedora), fresh task build:binary clean. No runtime behavior change (comments + test-only code), so no bed re-run required per the R10 gate-by-change-class matrix. Assisted-by: Claude Code Sonnet 4.5 (analysed on a live system)
pr-validator — APPROVED ✅Change class: charly Go + plugins + build engine + spec-field consumer (runtime class) Checklist
placement: CORRECT — the pod-overlay render-prep moves outward (core → plugin) via the class-generic Gates / facts I re-ran independently
Comments considered: 1 — the round-1 pr-validator CHANGES-REQUESTED (incomplete Decision: APPROVED — every rule verified from scratch; the round-1 R5 blocker is fixed. Proceeding to finalize the merge-time CalVer, merge (squash), and tag. Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system) |
Evaluator version-stamp: rename CHANGELOG placeholder 2026.210.1750 -> 2026.210.1858 and rewrite its H1 to the merge-time CalVer. No schema bump (no .cue change). Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system) Claude-Session: https://claude.ai/code/session_01WU7Ew3dq4d1MJzseLuxt3r
pr-validator — landed ✅
Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system) |
#55 step 3-II — pod-overlay build off charly-core NewGenerator
The overlay-relocation cutover: the pod
add_candy:overlay build stops reconstructing a host-side*buildkit.Generatorin charly core and reuses the plugin-side build-resolve pipeline; core's fullNewGeneratoris DELETED. Consumes merged spec1fdb481(v0.2026210.1634 — theExtraCandyRefsfield, spec#5). Full narrative:CHANGELOG/2026.210.1750.md. 4 commits (squash folds them).What lands
build:generategains a no-writeOpResolvevariant (plugin-build): runsresolveBuildEngineverbatim (full render-prep) + returnsspec.BuildResolveReplywithout Containerfile write. Threads the newspec.BuildRequest.ExtraCandyRefs(replacing hardcoded nil).InvokeProvider("build","generate",OpResolve,{Boxes:[baseName],ExtraCandyRefs,Dir}); per-candy security in-plugin from wire-carriedspec.CandyModel.Security.NewGeneratorDELETED from charly/generate.go (zero production callers);loadRenderGenfallback → cheapnewCandyScanGenerator.hostBuildOverlayshrunk to host-only bits (BaseUser/BaseSecurity/BaseRegistry via live-executor podman inspect + ParentVolumes + live-plans re-attach).R1 fix (caught in R10 code review, empirically confirmed)
hostBuildOverlayinitially sourced overlayDistroDeffromdetectHostContext().Distro(the operator HOST's distro) not the base image's — a live cross-distro bug (host is Arch/CachyOS, base is Fedora → arch[aur pac]formats leaking into a fedora-base overlay). Fixed viaresolveOverlayBaseDistroDef(base box's wire-cleanDistrotag, mirroring the deleted NewGenerator);detectHostContext()is fallback-only. Regression testTestResolveOverlayBaseDistroDef_UsesBaseImageDistroNotHost+ reproduced empirically (reverting the fix → the test fails with arch formats). The functional bed PASSED on the buggy binary — only code-reading caught it.Deferred (named exits)
resolved_project_host.goslims but doesn't fully delete —fillNamespacedBoxesstill live viahostBuildNamespaced(loader-cone-tied) → step 5; overlay's caller of the wrapper IS gone. buildkit TYPES → spec → step 3-III (#72); builder_venue → step 4 (#66). All named in file headers.R10 — fresh ./bin/charly 2026.210.1749
dnf install(Fedora/rpm — base image's distro, NOT the arch host), live-proving the DistroDef fix..check/check-pod-overlay/2026.210.1750/summary.yml.go build ./...0-fail;go test ./charly/...0-fail; all-85GOWORK=off go vet; gofmt empty;TestPluginsGenReproducible+TestNoSinglePluginAPISurface+TestKernelManifest; box validate exit 0. R5 both grep directions clean.Producer-first B2: spec#5 (merged+tagged) → this super leg.
Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated)