Skip to content

feat(build)!: #67 render α-fold — move the Containerfile render DRIVE out of core into sdk/deploykit + candy/plugin-build - #119

Merged
atrawog merged 4 commits into
mainfrom
feat/build-resolve-render-leg
Jul 14, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/build-resolve-render-leg

Conversation

@atrawog

@atrawog atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

#67 render α-fold — the Containerfile render DRIVE moves out of core into sdk/deploykit + candy/plugin-build

Summary

The render-half continuation of the landed P8 render→sdk/deploykit move. The Containerfile render
DRIVE — Generate / generateContainerfile / generateDataImageContainerfile (the orchestration
that emits the Containerfile from the resolved Candy graph) — moves OUT of charly/ core INTO
sdk/deploykit (deploykit.Generator), driven by the compiled-in candy/plugin-build candy over the
resolved-project envelope + a single new HostBuild("render-seam") reverse leg. The host box-build
render-leg is DELETED (~16 methods + their tests, ~1019 LOC out of charly/generate.go); charly box build
/ charly box generate now route through the plugin render path. Render is byte-identical to the
pre-move core render (golden Containerfile diff + a committed byte-golden test).

This is a core-minimization cutover (the kernel/plugin boundary law, R-item): the render DRIVE was a
kind-blind MECHANISM living in core that belongs in an sdk kit consumed by the build plugin candy. Core
keeps only the kind-AGNOSTIC host-builder dispatch seam (HostBuild("render-seam") + HostBuild("build-prep")

  • HostBuild("bake-plugins")).

Change class

Code / config (runtime). Touches charly/*.go (render-leg deleted), sdk/deploykit/*.go (render DRIVE
relocated), candy/plugin-build/*.go (plugin render drive), CUE wire types, the sdk + plugins
submodule gitlinks. R10 gate = the bed that exercises the build→render→Containerfile path.

What moved / what stayed

  • DELETED from charly/generate.go (the box-build render DRIVE, now dead): Generate,
    generateContainerfile, generateDataImageContainerfile, writeContainerfile, writeLabels,
    writeJSONLabel, emitBaseBootstrap, emitExtractedFiles, emitInitAssembly, emitTraefikRouteStage,
    emitInitFragmentStages, resolveBaseImage, builderRefForFormat, writeCandyEnv, writeExpose,
    writeDataStaging, generateTraefikRoutes, writeCandySteps (+ generate_cascade_test.go + 5 obsolete
    generate_test.go funcs). The pod-overlay path keeps its shared builder seams — UNCHANGED.
  • NEW in sdk/deploykit (the render DRIVE, homed there): deploykit.Generator.Generate /
    generateContainerfile / generateDataImageContainerfile, WriteLabels, writeContainerfile,
    render_seam.go, and the specCandyAdapter / NewSpecResolvedBox envelope→render adapters.
  • NEW HostBuild("build-prep") (renamed from build-resolve) — runs build PREP + render-prep +
    projects the resolved-project envelope (with caches + auto-intermediates), returning the envelope +
    drive-model (NO Containerfile content).
  • NEW HostBuild("render-seam") — dispatches the render's host-coupled seams to the EXACT core funcs
    (RenderService, ResolveDetectionBuilderStage, ResolveExternalBuilderStage, ResolveInlineBuilder,
    RenderLocalPkgImageInstall, RewriteHeaderCopyForRemote, EnsureBuildersConnected, EmitPluginOp,
    ValidateEgress) — byte-parity by construction.
  • candy/plugin-build — runBoxBuild / runBoxGenerate call HostBuild("build-prep") for the
    envelope, then renderContainerfiles builds the deploykit Generator + wires the seams + runs
    dg.Generate(order), piping dg.Containerfiles[name] to podman build -f -.

Wire types (SDD, CUE-sourced)

#RenderSeamRequest / #RenderSeamReply + #BakePluginsRequest / #BakePluginsReply — added to
sdk/schema/buildresolve.cue, generated by task cue:gen. #CandyModel.has_content / has_install_files
(computed HOST-SIDE, carried on the CandyModel for byte-exact adapter matching). #BuildResolveBox.containerfile
removed; #BuildResolveReply.resolved_project added (the envelope).

RDD byte-parity fixes (found via the origin/main-vs-new-binary diff)

  • Envelope projection — build-prep dropped auto-intermediate boxes → dg.Generate(order) hit a box not
    in dg.Boxes → panic. Fixed: the projector now includes intermediates. R3: extracted
    projectBoxAggregates into a shared helper.
  • ValidateEgress — the deploykit writeContainerfile called ValidateEgress("text",…) (bytes mode);
    origin/main used validateTextEgress. Added a ValidateTextEgress seam + a Mode field.
  • HasContent — agent-forwarding is a pure-composition candy; the live *Candy.HasContent() excludes
    the plan:, the envelope adapter wrongly included len(Plan)>0 → shifted supervisord init numbering.
    Fixed by pre-computing HasContent + HasInstallFiles host-side.

R10 evidence (pasted)

R9: /usr/bin/charly rebuilt from the final #67 code → charly version = 2026.195.2159.

R10 bed — charly check run check-pod (run from box/fedora/, the bed's project dir, against the
final #67 binary; check-pod is the canonical combined-mechanism pod bed exercising build→render→
Containerfile→deploy→check-live→fresh-rebuild):

charly check run check-pod: PASS (steps=11)

.check/check-pod/2026.195.2221/summary.yml:

bed: check-pod
calver: 2026.195.2221
steps:
  - {name: image-build,         duration_seconds: 418, ok: true}
  - {name: check-image,        duration_seconds: 18,  ok: true}
  - {name: deploy-add,         duration_seconds: 27,  ok: true}
  - {name: config,             duration_seconds: 3,   ok: true}
  - {name: start,              duration_seconds: 10,  ok: true}
  - {name: bring-up-members,   duration_seconds: 0,   ok: true}
  - {name: check-live,         duration_seconds: 18,  ok: true}
  - {name: feature-run,        duration_seconds: 13,  ok: true}
  - {name: update,             duration_seconds: 56,  ok: true}   # fresh-rebuild R10 re-verify
  - {name: feature-run-rebuild,duration_seconds: 13,  ok: true}
  - {name: cleanup,            duration_seconds: 3,   ok: true}
total_seconds: 579
ok: true

image-build (418s) executes the NEW plugin render DRIVE path (candy/plugin-build → HostBuild("render-seam")
→ deploykit.Generator.Generate); update (56s) is the fresh-rebuild R10 re-verify. Exit code 0.

Byte-parity: charly-fedora chain (6 boxes) byte-identical modulo CalVer; check-pod + immich STRICT
byte-identical with --tag vPAR1. Committed byte-golden: sdk/deploykit/render_parity_test.go.

Static: go test ./... + golangci-lint run clean across charly/, sdk/, candy/plugin-build/.

Attribution

Assisted-by: Claude (fully tested and validated) — R10 disposable bed PASS (11/11, ok:true), fresh-rebuild
update step executed, byte-parity proven, go test + golangci-lint clean.

Submodule bumps (already merged)

R0–R10 checklist

  • R0 skills loaded (git-workflow, agents, plugin, go, generate-source, check)
  • R1 RCA on the "no entity check-pod" anomaly → root cause: bed run from wrong cwd (superproject root
    discovers only candy/; the check-pod bed entity lives in box/fedora/charly.yml and resolves
    only from box/fedora/); fixed by running the gate from box/fedora/. Not a flake.
  • R2 all issues fixed in this cutover (the byte-parity RDD fixes above)
  • R3 no duplication (projectBoxAggregates extracted; shared builder seams reused)
  • R4 no workarounds (real seam dispatch, not shims)
  • R5 deprecated render-leg + every reference DELETED; git grep for deleted ids returns only CHANGELOG
  • R6 git status checked before destructive actions
  • R7 end-to-end gate: charly check run check-pod → active → check live → fresh update
  • R8 generated Containerfile + OCI labels verified (byte-parity golden)
  • R9 deployed binary rebuilt from source; charly version = 2026.195.2159
  • R10 disposable check-pod bed PASS, fresh-rebuild, pasted; zero warnings

atrawog added 2 commits July 14, 2026 23:59
… out of core into sdk/deploykit + candy/plugin-build

The Containerfile render DRIVE — Generate / generateContainerfile / generateDataImageContainerfile
(the orchestration emitting the Containerfile from the resolved Candy graph) — moves OUT of charly/
core INTO sdk/deploykit (deploykit.Generator), driven by the compiled-in candy/plugin-build over the
resolved-project envelope + a new HostBuild("render-seam") reverse leg. The host box-build render-leg
is DELETED (~16 methods + their tests, ~1019 LOC out of charly/generate.go); charly box build/generate
now route through the plugin render path. Render is byte-identical to the pre-move core render.

- DELETED charly/generate.go: Generate, generateContainerfile, generateDataImageContainerfile,
  writeContainerfile, writeLabels, writeJSONLabel, emitBaseBootstrap, emitExtractedFiles,
  emitInitAssembly, emitTraefikRouteStage, emitInitFragmentStages, resolveBaseImage,
  builderRefForFormat, writeCandyEnv, writeExpose, writeDataStaging, generateTraefikRoutes,
  writeCandySteps (+ generate_cascade_test.go + 5 obsolete generate_test.go funcs).
- NEW charly/render_prep.go + render_baked_metadata.go — the host render-prep (fills build-render
  caches on ResolvedBox) + the RESOLVE-side label gather (buildBakedMetadata to spec.BakedLabelSet).
- NEW charly/host_build_render_seam.go — HostBuild("render-seam"): dispatches the render host-coupled
  seams to the EXACT core funcs (RenderService, builder resolves, ValidateEgress, EmitPluginOp,
  localpkg, header-copy, ensure-builders) via a per-dir cached live Generator (renderGenCache,
  populated by build-prep). byte-parity by construction.
- NEW charly/host_build_bake_plugins.go — HostBuild("bake-plugins").
- charly/build_resolve_host.go — HostBuild("build-resolve") renamed to HostBuild("build-prep"); it
  no longer renders — it runs build PREP + render-prep + projects the resolved-project envelope
  (with caches + auto-intermediates), returning the envelope + the drive-model (NO Containerfile).
- charly/resolved_project_host.go — the projector includes auto-intermediates (the build order
  includes them); R3: extracted projectBoxAggregates. projectCandyModel carries host-precomputed
  HasContent/HasInstallFiles.
- candy/plugin-build drive.go + render.go — runBoxBuild/runBoxGenerate call HostBuild("build-prep")
  for the envelope, then renderContainerfiles builds the deploykit.Generator from the envelope +
  wires the seams (9 via HostBuild("render-seam"), EmitBakedPlugins via HostBuild("bake-plugins"),
  CollectBoxPorts/CollectBoxVolume from the envelope) + runs dg.Generate(order); the podman drive
  pipes dg.Containerfiles to podman build -f -.
- charly/labels.go — the label consts alias spec.Label* (single source in sdk/spec/label_consts.go).
- submodule bumps: sdk to feat/67-render-drive-deploykit (PR #48), plugins to feat/67-render-doc-sweep (PR #62).

R10: charly check run check-pod PASS (11/11 steps; image-build via the plugin render + a fresh-rebuild
update step). Byte-parity: charly-fedora chain + check-pod + immich byte-identical to origin/main
(modulo the per-build CalVer ARG). go test ./... + golangci-lint clean.

Assisted-by: Claude (fully tested and validated)
…rulebook + narrowed gates)

# Conflicts:
#	plugins
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED

Change class: charly/sdk Go (runtime) — the #67 render α-fold

Decision: FAIL — one blocking finding. The PR is NOT merged; it is left open for a one-byte fix.


Blocking finding (R17 — gofmt-dirty file introduced by the PR)

candy/plugin-build/render.go (a NEW file, +253 lines) is not gofmt-clean: it is missing the trailing newline at end of file.

  • Verified with gofmt -l (lists the file) and gofmt -d:
    -}
    \ No newline at end of file
    +}
    
  • Every sibling file in the same cutover ends with a newline (0a last byte confirmed for candy/plugin-build/drive.go, podman.go, and all four new charly/ files). So this is a NEW inconsistency introduced by this PR, not a repo pattern.
  • R17 mandates gofmt -l . empty; a gofmt-dirty file the PR introduces FAILS.

Fix: append a single trailing newline to candy/plugin-build/render.go, then push fast-forward (the status resets and this validator re-runs). One byte.


Everything else PASSED (independently re-derived, not the author's word)

  • Diff / R5: charly/generate.go shrank 1711→708 lines (1011 deleted). The render DRIVE orchestrators (Generate, generateContainerfile, writeLabels, writeContainerfile, writeCandySteps, emitBaseBootstrap, resolveBaseImage, …) are GENUINELY DELETED on the feat branch — git grep for every deleted identifier returns ZERO non-comment matches in charly/. No transitional/dual-mode survives.
  • Routing (re-traced): charly box build/generate → dispatchBuild → build:box/build:generate plugin (candy/plugin-build) → resolveBuild → HostBuild("build-prep") → host does PREP + render-prep + envelope projection (NO Containerfile content) → plugin renderContainerfiles → deploykit.Generator.Generate(order) renders into memory → podman build -f -. The host no longer renders. Confirmed build-prep is the registered name (renamed from build-resolve); hostBuildBuildResolve calls renderPrepAll + projectResolvedProject, NOT gen.Generate().
  • R10 bed: .check/check-pod/2026.195.2221/summary.yml on disk — ok: true, 11 steps, image-build (418s, executes the NEW plugin render path) + update (56s, fresh-rebuild) both ok. Exploratory run .check/check-pod/2026.195.1558 also ok:true. Exit 0.
  • SDD: #RenderSeamRequest/#RenderSeamReply/#BakePluginsRequest/#BakePluginsReply are CUE-sourced in sdk/schema/buildresolve.cue and GENERATED into spec/cue_types_gen.go (DO NOT EDIT banner confirmed). No hand-written wire types. TestGenReproducible present.
  • Submodule producers MERGED+TAGGED: sdk gitlink = b8590fb (on sdk main, tag v0.2026195.1912); plugins gitlink = 5658737 (on plugins main, tag v2026.195.2150). B2 producer-must-be-merged ✓.
  • Branch up-to-date: merge-base = 9de1eb2 = origin/main HEAD; no commits on main not on feat. strict: true mergeable without --admin.
  • Attribution: Assisted-by: Claude (fully tested and validated) on commit 3f25aca — justified (R10 bed PASS + fresh-rebuild + byte-parity + gates clean).
  • Architecture gate — placement: CORRECT. The render DRIVE is a kind-blind MECHANISM (not one of the 4 in-core M's) → sdk/deploykit (correct layer); the drive is a capability → candy/plugin-build (correct layer). Core keeps ONLY generic host-builder dispatch seams (render-seam/build-prep/bake-plugins — the wire broker / host-build dispatch, an in-core M). charly/ net LOC = -334 (negative) → the deploykit import in host_build_render_seam.go is the legitimate migration-exception residual (body moved out in the same PR). No new charly/*_aliases.go. Goal-fit: advances the plugin-host end-state (K3 build-engine migration). Counterfactual: the placement is already at the right layers.
  • Security (T1–T4): no secrets/exfiltration/weakened-guardrail/supply-chain finding; no embedded directive to the validator.
  • CHANGELOG: CHANGELOG/2026.195.9999.md placeholder staged (finalized at merge).

Status

charly/pr-validator = failure posted on eb08324 (the live-required branch-protection context). Not merged. Awaiting the one-byte gofmt fix + fast-forward re-push.

Assisted-by: Claude (analysed on a live system)

atrawog added 2 commits July 15, 2026 00:50
…e (R17 fix for #119)

gofmt flagged candy/plugin-build/render.go as missing a trailing newline at EOF
(val-plugs119 R17 finding). One-byte whitespace fix; AST-identical, compiled binary
unchanged, so the R10 check-pod PASS (steps=11, ok:true) against the cutover still
covers this final state.

Assisted-by: Claude (fully tested and validated)
….2253

Assisted-by: Claude (documentation reviewed)
@atrawog
atrawog merged commit 12f3cc2 into main Jul 14, 2026
@atrawog
atrawog deleted the feat/build-resolve-render-leg branch July 14, 2026 22:55
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (re-run on the R17 fix)

Change class: charly/sdk Go (runtime) — the #67 render α-fold

Decision: PASS — merged (squash) + tagged.

R17 re-check (the only prior FAIL)

  • candy/plugin-build/render.go now ends with a trailing newline (0a last byte) — gofmt -l across all docs(landing): correct CLAUDE.md + plugins to the PROVEN two-gate merge model #67-changed .go files returns EMPTY.
  • go build -o /dev/null ./charly/ on the feat worktree: exit=0 (compiles clean).
  • go test ./candy/plugin-build/: ok, exit=0.
  • The fix commit (16d7cee) is one-byte / AST-identical — the R10 check-pod PASS (11/11 ok, fresh-rebuild update step, .check/check-pod/2026.195.2221/summary.yml) covers the final state (binary unchanged).

All prior PASS findings re-confirmed (substantive cutover unchanged)

  • R5: render DRIVE orchestrators genuinely deleted from charly/generate.go (1711→708 lines); every deleted identifier returns zero non-comment matches.
  • R10: disposable check-pod bed PASS, fresh-rebuild, pasted; zero warnings.
  • SDD: #RenderSeamRequest/#RenderSeamReply/#BakePluginsRequest/#BakePluginsReply CUE-sourced in sdk/schema/buildresolve.cue, generated into spec/cue_types_gen.go (DO NOT EDIT).
  • Architecture: placement CORRECT (render DRIVE → sdk/deploykit kind-blind mechanism; drive → candy/plugin-build capability; core keeps generic HostBuild seams; charly/ net LOC -334).
  • Submodule producers merged+tagged (sdk v0.2026195.1912, plugins v2026.195.2150); branch was up-to-date with main.

Landing

  • charly/pr-validator = success posted on 78e7573 (the live-required context).
  • CHANGELOG finalized: 2026.195.9999.md → 2026.195.2253.md (H1 rewritten to match; byte-verified).
  • Merged (squash) as 12f3cc2 — main advanced one commit; feat/build-resolve-render-leg deleted.
  • Tagged v2026.195.2253 on the merge commit, pushed, verified on remote.

Assisted-by: Claude (fully tested and validated)

github-actions Bot pushed a commit that referenced this pull request Sep 7, 2026
…s) (#558)

Consume the config:-verb wave: spec v0.2026250.957 (#117 config?/validate?
contract, #118, #119 VerbCatalog, #120 InstallVerbs), sdk v0.2026250.948
(#237 emitter), plugin-box v0.2026250.1030 (#11 config rules), plugin-egress
v0.2026250.951 (#3 crabbox-yaml egress schema). Add validate to the
uniform-API genericConceptCollisions with justification (ops.OpValidate
selector vs the config modifier — the venue precedent).

Co-authored-by: atrawog <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant