Skip to content

feat(spec,kit,deploykit): K3 build-engine render-seam dissolution (5 seams peer-dispatch) - #65

Merged
atrawog merged 6 commits into
mainfrom
feat/k3-build-zero-kit
Jul 17, 2026
Merged

atrawog merged 6 commits into
mainfrom
feat/k3-build-zero-kit

Conversation

@atrawog

@atrawog atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The sdk leg of the K3 "build-engine → plugin-build" cutover. Three independent pieces, all committed on this branch:

  1. spec/verb_context.go (task feat(deploykit): relocate the build-time BUILDER render engine to sdk/deploykit (K3-A) #39): DoMode/ExecContext + StepDoMode moved from sdk/kit to sdk/spec — pure vocabulary enums with no mechanism dependency, so every consumer that only needs to classify an Op/Step no longer needs a kit/deploykit import.

  2. Render-seam production move (5 of 9 host-coupled render callbacks in the box-build render pipeline): RenderService, ResolveDetectionBuilderStage, ResolveExternalBuilderStage, ValidateEgress/ValidateTextEgress, and RewriteHeaderCopyForRemote all turned out to be pure providerRegistry.resolve+Invoke dispatch (or, for the header-copy rewrite, pure data + host-fs I/O over data the CandyModel envelope already carries) — RDD-spiked live on the external-builder leg first, then implemented for real. candy/plugin-build now calls these directly via sdk.Executor.InvokeProvider instead of a HostBuild("render-seam", ...) round-trip. New shared helpers: deploykit.BuildServiceRenderContext (promoted from charly/service_render.go so both the plugin's render and charly's own deploy-mode RenderService share one source) and deploykit.rewriteHeaderCopyForRemote (promoted from charly/generate.go, now operating on the CandyModel interface instead of the live *Candy map). The remaining 4 seams (EmitPluginOp, local-pkg, inline-builder, ensure-builders) keep the HostBuild callback — each has a genuine host-only dependency (documented in render_seam.go's header comment): the loader's scan+connect machinery (rides K1), or a Go-level type-assertion against a BUILTIN provider's concrete type that only charly core holds.

  3. spec/feature_wire.go: FeatureEntity now carries a raw Plan []Step instead of the host-precomputed Summary/Steps(FeatureStep)/ValidationErrors — the transform (kit.KeywordOf, kit.ValidatePlanSteps, deploykit.DescriptionInfo) was always sdk-portable, so it moves to candy/plugin-feature (charly-side PR).

Test plan

  • go build ./... clean
  • go vet ./... clean
  • go test ./... — all packages pass
  • golangci-lint run ./... — 0 issues
  • Live-verified against box/fedora's check-pod bed (full R10: build → check-image → deploy-add → config → start → check-live → feature-run → fresh-rebuild → feature-run-rebuild → cleanup), twice, both PASS 12/12 — confirms the render-seam move end-to-end (external-builder splice, supervisord service render, remote header-copy materialization all correct in the generated Containerfile)
  • Live-verified charly feature list/pending/validate against box/fedora (real project, 3 baked box entities) — correct output including a genuine pre-existing validation finding unrelated to this refactor

Depends on nothing; the charly super PR depends on this merging first (B2).

Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif

atrawog added 5 commits July 17, 2026 02:18
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)
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
…patch

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
…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
…m 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)
@atrawog

atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Independent PR validation — PASS

Fresh, independent re-derivation (fresh worktree, trusting no author/orchestrator claims):

  • GOWORK=off go mod tidy — no-op (already tidy), go mod verify clean.
  • GOWORK=off go build ./... clean, GOWORK=off go test ./... clean across all sdk packages (spec, kit, deploykit, enginekit, loaderkit, vmshared).
  • GOWORK=off golangci-lint run ./... — 0 issues.
  • Reviewed the diff: spec/verb_context.go (DoMode/ExecContext/StepDoMode — pure vocabulary, no mechanism dependency), the 5 render-seam production moves (RenderService/detection+external builder resolves/ValidateEgress/RewriteHeaderCopyForRemote — confirmed each is genuinely pure providerRegistry.resolve+Invoke dispatch or data+host-fs I/O over the CandyModel envelope, not a vague host-coupling claim), and spec/feature_wire.go's FeatureEntity raw-plan shape.
  • Confirmed via candy/plugin-deploy-pod/overlay.go grep that deploykit.BuildServiceRenderContext/GenerateInitFragments/CandyCopySource are genuinely load-bearing production code (not orphaned), consistent with the promoted-not-duplicated claim.
  • The test-porting commit (95c8577) was reviewed line-by-line: TestGenerateInitFragments/TestGenerateRelayInitFragments/TestCandyCopySource ported verbatim (same assertions) against deploykit.Generator directly.

Assembled build (charly super + this sdk branch) verified separately — see charly#139's validation. Merging.

@atrawog
atrawog merged commit e779c53 into main Jul 17, 2026
@atrawog
atrawog deleted the feat/k3-build-zero-kit branch July 17, 2026 02:54
atrawog added a commit that referenced this pull request Jul 29, 2026
…c aliases (#55 step 3-III sdk leg) (#110)

* refactor(buildkit)!: DistroConfig/BuilderConfig containers → thin spec aliases (#55 step 3-III sdk leg)

The value-type containers + methods + WrapDistroDef/DistroTagChain now source
from spec (merged v0.2026210.2052); buildkit keeps thin type aliases (−285 LOC in
format_config.go), matching its existing DistroDef/BuilderDef alias pattern.
InitConfig unchanged (composition policy → #65/#71). require spec bumped
v0.2026210.1533 → v0.2026210.2052.

Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated)

* chore(changelog): finalize #55 step 3-III sdk-leg stamp → 2026.210.2103

Merge-time CalVer finalization by the fresh pr-validator: rename the
placeholder CHANGELOG to the merge-time stamp and rewrite its H1. No code
change; the buildkit alias cutover is unchanged.

Assisted-by: Claude Code Claude Opus 4.8 (fully tested and validated)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_018iiqSrY7SkJhgvqDYpiHGH

---------

Co-authored-by: Claude Opus 4.8 <[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