Repository navigation
feat(deploykit): relocate the build-time BUILDER render engine to sdk/deploykit (K3-A) - #39
Conversation
…/deploykit (K3-A) The multi-stage BUILDER render (detection pixi/npm/aur + external_builder + the pre-main-FROM stage assembly + the artifact COPY emitters) moves from charly core into deploykit/builders_render.go over CandyModel + buildkit.ResolvedBox. The only host coupling — the provider registry (on-demand connect + ResolveBuilder + OpResolve Invoke) — stays 3 seam function-value fields on the render Generator (EnsureBuildersConnected / ResolveDetectionBuilderStage / ResolveExternalBuilderStage), wired host-side by charly's toDeploykit(); the host closures preserve every builder error string byte-exact. CandyModel gains GetExternalBuilder (the external_builder: word). BuilderResolveInputFrom is exported (R3 — shared with charly's inline-builder seam + the step-emit host builder). DetectExternalizedBuilders is ONE shared pkg func for both the render AND the deploy build pre-pass (R3). Byte-identical `charly box generate` output across box/fedora (46 images) + box/arch (12); go test (deploykit) green; golangci-lint 0; no CUE touched (TestGenReproducible green). First K3 build-engine relocation unit. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01QKhd4bTfDKi4epvFJDWyLV
pr-validator — APPROVED ✅Change class: code (sdk Validated by a fresh, superproject-rooted evaluator (V-K3A) that trusted none of the author's pasted output and re-derived every checkable gate. Independently re-run (isolated worktree at the PR head 568abc0):
Relocation fidelity: side-by-side vs super-main R10 bed cross-check (no benefit of the doubt) — reconciled on disk:
Checklist: 0 security/anti-tampering ✓ · 1 description ✓ · 2 change-class gate (correct beds, no fraud) ✓ · 3 tier placement: CORRECT — a kind-blind build-render MECHANISM (sdk-only deps) belongs in an sdk kit per the K3 boundary law; the render BODY leaves the kernel while the registry coupling stays host-side via function-value seams (not a per-concern wire seam). Advances the plugin-host end-state; eventual home is plugin-build (tracked K3 continuation), so sdk/deploykit is the correct intermediate. No regression. Decision: All 18 items PASS. The only limitation — the assembled byte-parity cannot be re-run at leg 1 (the consumer is leg 2, not yet on main) — is inherent to producer-first cross-repo landing (B6); maximal verification was done (on-disk summaries reconciled exactly + relocated code confirmed running), and byte-parity is re-derived at leg-2 validation. Finalizing the merge-time CalVer, merging (squash), and tagging. Cross-repo obligation: leg 2 must be the ATOMIC K3-A cutover (gitlink → this merged SHA, Assisted-by: Claude (analysed on a live system) |
Evaluator version stamp for #39 — the K3-A build-time BUILDER render engine relocation (producer half). CHANGELOG renamed from the author's placeholder to the merge-time CalVer. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01BpWheWfgtQNkjxVDW12zFg
…seams peer-dispatch) (#65) * feat(spec): move DoMode/ExecContext/StepDoMode to spec (K3 #39) DoMode (+DoAct/DoAssert/DoInstruct) lived in kit/planrun.go; ExecContext (+CtxBuild/CtxDeploy/CtxRuntime) lived in deploykit/compiler_deps.go; StepDoMode (pure over spec.Step) lived in kit/planspec.go. All three are plain shared vocabulary types every consumer that classifies an Op/Step needs (the plan walk in sdk/kit, the deploy-plan compiler in sdk/deploykit, charly core's registry-coupled semantics, candy/plugin-box's independent validate-engine re-derivation) — moved to sdk/spec so none of them need a mechanism-kit import just for these types. kit and deploykit now reference spec.DoMode/spec.ExecContext directly; their own internal call sites (kit/runner.go, kit/planrun.go, deploykit/install_build.go) repointed. Assisted-by: Claude Sonnet 5 (analysed on a live system) * feat(kit): promote InspectImageLabels — reentry-class dissolution (K3) Promotes charly/labels.go's defaultInspectLabels (a pure podman/docker inspect + label-JSON parse, zero charly-core coupling) to sdk/kit as InspectImageLabels, alongside the already-kit-owned ResolveRuntime/ ResolveLocalImageRef/LocalImageExists/EngineBinary/ErrImageNotLocal. This lets candy/plugin-box's `labels` command call the whole local-image-label probe directly, eliminating the charly/box_labels_cmd.go `__box-labels` reentry (charly-side commit follows on the superproject branch). Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif * feat(deploykit): K3 render-seam production move — 5 seams go peer-dispatch RenderService, the detection/external builder resolves, ValidateEgress, and RewriteHeaderCopyForRemote were pure providerRegistry.resolve+Invoke dispatch (or pure data + host-fs I/O over the CandyModel envelope) with zero live-loader dependency — RDD-spiked live on the external-builder leg in a prior commit. candy/plugin-build's render now calls them directly via renderSeamCaller.invoke/resolveBuilderStage (InvokeProvider, no HostBuild round-trip) instead of HostBuild("render-seam"). BuildServiceRenderContext is promoted from charly/service_render.go so both the plugin's render and charly's own (deploy-mode) RenderService share one source (R3). rewriteHeaderCopyForRemote is promoted from charly/generate.go, operating on the CandyModel interface (GetRemote/GetSourceDir/GetSubPathPrefix/GetName — all already exposed) instead of the live *Candy map. The 4 remaining seams (EmitPluginOp, localpkg, inline-builder, ensure-builders) keep the HostBuild callback: EnsureBuilders/InlineBuilder need the live loader's scan+connect machinery (rides K1); EmitPluginOp needs a Go-level type-assertion (ProvisionActor/BuildEmitter) against a BUILTIN provider's concrete type that only charly core holds (a builtin's generic Invoke() is an intentional error-stub for the placement-invisible perf invariant, so InvokeProvider can't substitute). Assisted-by: Claude Code Claude Sonnet 5 (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif * feat(spec): FeatureEntity carries RAW plan, not the host-transformed form (K3) Drops FeatureEntity's Summary/Steps(FeatureStep)/ValidationErrors — all computed HOST-side from data that is itself sdk-portable (kit.KeywordOf, kit.ValidatePlanSteps, deploykit.DescriptionInfo) — in favor of a raw Plan []Step field. candy/plugin-feature (which already owns the list/ pending/validate grammar) now runs the summarize/validate transform itself; charly/host_build_feature.go's enumerateFeatures needs no kit/deploykit import as a result (charly-side commit follows). Assisted-by: Claude Code Claude Sonnet 5 (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif * test(deploykit): port GenerateInitFragments/CandyCopySource tests from charly The charly-core wrappers these tests exercised (Generator.generateInitFragments, Generator.candyCopySource) were dead code (zero non-test callers) and are being deleted as part of the K3 build-engine core-minimization cutover. Neither GenerateInitFragments nor CandyCopySource had any test coverage of their own in this package — the wrapper tests were the only coverage that existed for this real production logic (fragment-assembly/port-relay naming, local-vs-remote copy-source resolution). Port them here verbatim, calling deploykit.Generator directly, so the coverage moves with the logic instead of being silently dropped. Assisted-by: Claude Sonnet 5 (analysed on a live system)
Summary
K3-A (first K3 build-engine relocation unit). The build-time BUILDER render engine — the multi-stage detection builders (pixi/npm/aur), the
external_builder:out-of-tree builders, the pre-main-FROM stage assembly, and the artifact COPY emitters — relocates OUT of charly core intosdk/deploykit/builders_render.go, overCandyModel+buildkit.ResolvedBox. The only host coupling (the provider registry) stays 3 seam function-value fields on the renderGenerator, wired host-side by charly'stoDeploykit(); the host closures preserve every builder error string byte-exact.This is the producer half of the K3-A cutover — the consumer (charly core
generate.go−343, seam wiring) lands as the superproject PR that bumps this sdk to the merged tag.Change class
Code (sdk library) — runtime class. Gate = the consuming superproject's build + byte-parity + live beds (below).
What changed (sdk/deploykit)
builders_render.go(328 lines):EmitPreMainCandyStages,EmitBuilderStages,EmitExternalBuilderStages,EmitExternalBuilderArtifacts,EmitBuilderArtifacts; exportedBuilderResolveInputFrom(R3 — also consumed by charly's inline-builder seam + step-emit host builder); the sharedDetectExternalizedBuilderspkg func (ONE detection impl for the render AND the deploy build pre-pass, R3);expandBuilderPath.render_generator.go: 3 registry seam fields (EnsureBuildersConnected/ResolveDetectionBuilderStage/ResolveExternalBuilderStage), extending the existingResolveInlineBuilderseam pattern.candy_model.go:CandyModel.GetExternalBuilder()(plain snapshot-safe field read).R10 evidence (runtime class — fully tested and validated)
Live build-class gate on the frozen tree + stamped binary
v2026.194.1658:Coverage: the goldens byte-covered all 3 builder paths (detection pixi/aur, external_builder via check-pod→plugin-example-builder, inline cargo); error strings audited byte-exact on the failure paths. After merging origin/main (07dbdbc, K5U0's #ResolvedProject envelope — disjoint from these files), re-verified: sdk build +
go test ./deploykit/... ./spec/...green (TestGenReproducible = no drift), charly rebuilt against the merged sdk → byte-parity still BYTE-IDENTICAL.Checklist
Assisted-by: Claude (fully tested and validated)