Repository navigation
feat(deploykit)!: the build-mode render engine lands in sdk/deploykit (P8 sdk half) - #24
Conversation
… (P8 sdk half) The build-mode Containerfile RENDER ENGINE moves from charly core into sdk/deploykit as an importable library — the render mechanism is no longer core-only, so any plugin importing the sdk can render a Containerfile. It lands in deploykit (not buildkit) because the render calls the build-compile helpers (ResolveCascadePackages/CompileLocalPkgStep/CompileShellSnippetSteps) and reads deploykit.CandyModel; the import DAG is one-way deploykit->buildkit, so a buildkit-hosted render would cycle. New: render_generator.go (Generator + the 7 host-coupled function-value seams + the ExternalizedBuilders field), tasks_render/tasks_emit/tasks_stage.go (EmitTasks + the per-verb line emitters + inline-content staging), candy_steps.go (WriteCandySteps), init.go (EmitInitAssembly/EmitInitFragmentStages/ GenerateInitFragments + InitRender* + MapToKeyValueSlice), candy_stage/bootstrap/ candy_env/routes.go, graph/candy_collect/effective_version/order/builder_support.go. CandyModel grows the render/init/writeCandySteps accessors. kit/atomic_write.go + kit/calver_compare.go (AtomicWriteFile + CompareCalVer). Behaviour-neutral: the consuming charly box generate is byte-identical across every image (main + box/fedora set, incl. builder/localpkg/supervisord paths). go test ./... green; golangci-lint 0 issues; go vet clean. Assisted-by: Claude (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: charly/sdk Go — SDK library relocation (the build-mode render engine moves into I re-derived compliance independently and re-ran the Go gates live. The relocation is architecturally sound and its evidence is coherent — but it does not pass the formatter gate, so it cannot merge as-is. Blocking finding — item 17 (Go code-quality gate)
Confirmed by both gates CLAUDE.md item 17 requires:
Secondary — item 6 / anti-cheat (R2)The byte-parity set excludes Checklist
Decision: CHANGES REQUESTED. One mechanical blocker: Assisted-by: Claude (analysed on a live system) |
…nt alignment Review-round fix for #24 (pr-validator item-17 blocking finding). The P8 CandyModel accessor block hand-aligned its trailing comments with an extra space; gofmt normalizes trailing-comment alignment to single-space-after-longest-field. gofmt -w + the repo golangci-lint fmt now report clean. No semantic change (comment whitespace only) — byte-parity across the image set is unaffected. The CHANGELOG evidence line now records the gofmt/vet gates. Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: charly/sdk Go — build-mode render-engine relocation into Independent live re-run (
Checklist (every rule):
Decision: Independent re-derivation confirms full CLAUDE.md compliance. The relocation is behaviour-neutral by construction — the render engine is a kind-blind Mechanism reaching every host dependency through function-value seams over the Assisted-by: Claude (analysed on a live system) |
…ngine relocation Merge-time version stamp (pr-validator): rename the CHANGELOG placeholder to the finalized CalVer and align its H1 heading. Assisted-by: Claude (fully tested and validated)
) The #24 P8 version-stamp renamed the CHANGELOG placeholder to CHANGELOG/2026.192.1709.md but left its H1 at the placeholder date (# 2026.192.1815) — git mv renames the file without touching its heading. This aligns the H1 to the finalized CalVer so the filename, H1, and the release tag v0.2026192.1709 all agree. Docs-only correction to already-released history: no new CHANGELOG entry and no new tag (v0.2026192.1709 already points at the correct code). Assisted-by: Claude (documentation reviewed)
…eps the host-side ENGINE (P8 consumer) (#62) The superproject (consumer) half of P8: the build-mode Containerfile RENDER MECHANISM relocates from charly/ into sdk/deploykit (producer: opencharly/sdk#24, tagged v0.2026192.1709). charly's render methods become thin delegating shims over a cached Generator.toDeploykit(); the host-side build ENGINE stays core as the Mechanism reached via HostBuild("image"). charly/graph.go moves to deploykit; graph_shim.go keeps the delegating wrappers + CycleError alias. The sdk submodule pointer + charly/go.mod require bump to the merged sdk main. Behaviour-neutral: charly box generate is byte-identical across all 9 tested images (main + box/fedora, covering builder/localpkg/supervisord-assembly render paths), independently re-verified by pr-validator. Live disposable bed check-sidecar-pod 11/11 (fresh charly update rebuild gate included). Assisted-by: Claude (fully tested and validated)
…o sdk (P8b-followup) (#32) The sdk half of #24 (P8b-followup). With the box-build DRIVE in candy/plugin-build and RESOLVE/RENDER host-side, the remaining PURE-COMPUTE build helpers relocate from charly core into the sdk libraries — zero host-coupling (no loader, no `*Config`, no podman, no provider registry). - `kit/install_dir.go` → `kit.InstallDirAtomic` (pure renameat2(RENAME_EXCHANGE) atomic dir-swap); kit imports golang.org/x/sys/unix directly (go.mod indirect→direct). - `buildkit/phase_template.go` → `FormatPhaseTemplate`/`BuilderPhaseTemplate` (pure (phase,venue)→template resolvers over spec types). - `buildkit/system_packages.go` → `RenderSystemPackagesFragment` (pure fragment render; takes decoded scalars so buildkit need not import deploykit — no cycle). - `deploykit/intermediates.go` → the intermediate-image DAG pure funcs, re-typed over the CandyModel interface + buildkit.ResolvedBox; +`HasInstallFiles()` on the CandyModel interface (plain method, no wire type — SDD-clean). The `*Config`-reading orchestration (the RESOLVE half) STAYS in charly. Verification (re-run independently by the pr-validator on the sdk module in isolation): `go build ./...`, `go vet ./...`, `gofmt -l` clean; `go mod tidy` a no-op (x/sys direct genuine); `go test ./kit/... ./buildkit/... ./deploykit/...` + `go test ./...` green; `golangci-lint run` 0 issues. Adversarial checks pass: intermediates.go Config-free (mode-purity), buildkit does not import deploykit (no cycle), HasInstallFiles is an interface method (SDD-clean). Behaviour equivalence = the superproject byte-parity (46 Containerfiles, `charly box generate` byte-identical, hash 25852f20 both legs), independently reproduced. Assisted-by: Claude (fully tested and validated)
…om charly core K1 keystone (task #24), sdk producer leg (B2 producer-first — lands + tags before the charly consumer leg). Relocates the TOP-LEVEL loader orchestration — LoadUnified itself and the standalone ApplyDiscover walk — out of charly core into sdk/loaderkit, extending the seam-injection pattern spec.WalkSeams/spec.MaterializeSeams already established by the prior K1-unit-1 Materializer seam. Purely additive: 3 files, 0 deletions. - loaderkit/unified_file.go — UnifiedFile/InlineCandy relocated from charly/unified.go (K1 unit 1). Zero behavior change. - loaderkit/load_unified.go (new) — LoadUnified(dir, seams LoadSeams): the kind-blind orchestration ported verbatim from charly's former inline body. LoadSeams is an 11-field callback struct threading every registry-coupled step back to the host. - loaderkit/discover.go — adds RunDiscover(rootDir, specs, seams), reusing the existing walker.runDiscover/parseDiscoveredManifest mechanism instead of duplicating it. Byte-equivalence proof (paired with the charly consumer-leg proof) confirms the merged loader path is behavior-identical to origin/main's pre-keystone loader across two real project fixtures. Independently re-verified by a fresh pr-validator: build/vet/gofmt/mod-tidy/mod-verify/cue:gen reproducibility/golangci-lint (0 issues)/go test all clean; placement CORRECT per the plugin skill's K1-proper migration ledger. CHANGELOG: CHANGELOG/2026.206.1046.md Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
The spec PR #24 merged + tagged: the ExtractStep IR is now in the released github.com/opencharly/spec module at v0.2026224.1942, so the dev-aid local replace (=> ../spec) is removed and the require bumps from v0.2026224.403. Verified standalone (GOWORK=off): go build + go test green, gofmt/vet clean. Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)
Summary
The sdk half of P8 (plugin-build becomes the REAL engine). The build-mode Containerfile RENDER ENGINE relocates from charly core into
sdk/deploykitas an importable library — the render mechanism is no longer core-only, so any plugin importing the sdk can render a Containerfile.It lands in deploykit (not buildkit) because the render calls the build-compile helpers (
ResolveCascadePackages/CompileLocalPkgStep/CompileShellSnippetSteps) and readsdeploykit.CandyModel; the import DAG is one-waydeploykit→buildkit, so a buildkit-hosted render would cycle.buildkitstays the low keystone layer (ResolvedBox,RenderTemplate,NewInstallContext).The host-coupled dependencies the render needs are threaded as function-value seams the core resolve half wires (so no render-specific per-kind code stays in charly):
EmitPluginOp,CollectBoxPorts,ValidateEgress,RenderService,RewriteHeaderCopyForRemote,RenderLocalPkgImageInstall,ResolveInlineBuilder(+ theExternalizedBuildersmap).Files
render_generator.go—Generator+ the 7 seams +NewRenderGenerator.tasks_render.go/tasks_emit.go/tasks_stage.go—Generator.EmitTasks+ the per-verb line emitters + inline-content staging.candy_steps.go—Generator.WriteCandySteps(the per-candy render call-graph).init.go—EmitInitAssembly/EmitInitFragmentStages/GenerateInitFragments+InitRender*+MapToKeyValueSlice.candy_stage.go/bootstrap.go/candy_env.go/routes.go— scratch/extract stages, bootstrap, per-candy ENV/EXPOSE, traefik routes.graph.go/candy_collect.go/effective_version.go/order.go/builder_support.go— build graph, candy collection, effective versions, order/base-image resolution, builder detection.candy_model.go—CandyModelgrows the render/init/writeCandySteps accessors.kit/atomic_write.go+kit/calver_compare.go—AtomicWriteFile+CompareCalVer.Change class
SDK library relocation (Go). Behaviour-neutral by construction — the consuming
charly box generateoutput is asserted byte-identical.R10 evidence
charly box generate(tag-pinned) produces byte-identical Containerfiles across all 9 tested images —main/check-k8s-deploy-app+ the 8box/fedoraimages (fedora,fedora-charly,fedora-builder,fedora-nonfree,fedora-nonfree-ssh-client,check-pod,composition-app,composition-source) — covering the builder, localpkg, and supervisord-assembly render paths.check-sidecar-pod— PASS (11/11 steps, exit 0, 203s):check-k8s-deploy-appwith the in-development toolchain (--dev-local-pkg) through the relocated render engine, deploys it as a live disposable pod with themypausesidecar member, passes its check plan on first deploy AND after a freshcharly update, tears down cleanly. No scope-shrinking flags.go test ./...green (sdk);golangci-lint run0 issues;go vetclean.CLAUDE.md rule compliance
box/fedorafedora-coderimage cannot becharly box generate-d in this environment — but the abort is a pre-existing charly remote-plugin-FETCH limitation, not P8, and P8's behaviour-neutrality claim holds without it. RCA:fedora-codercomposes its npm/pixi builder plugins as REMOTE plugins from@github.com/opencharly/charly; charly fetches that repo to~/.cache/charly/repos/…@main/as a non-git flat copy (git -C … rev-parse→ "not a git repository"), so the repo'ssdksubmodule dir is empty and the plugin'sreplace github.com/opencharly/sdk => ../../sdkcannot resolve →go buildfails. This lives entirely in the fetch/plugin-build path (refs/loader), which P8 does not touch (P8 relocates the RENDER engine). Separability by the objective test: P8's byte-parity claim is PROVEN by the other 8 images (main + 7 fedora) covering every render pathfedora-coderwould use (packages/localpkg/tasks/inline-builder/init-assembly/env/routes), and the pre-P8 baseline capture hit the identical wall (fedora-coderis absent from the baseline set too). The remote-plugin-submodule fetch gap is a candidate follow-up cutover, opened once P8 lands.git grepon moved identifiers returns only their new deploykit home.Assisted-by: Claude (fully tested and validated)