Skip to content

feat(deploykit,buildkit)!: W3 producer leg — localpkg + intermediates engine → sdk - #70

Merged
atrawog merged 2 commits into
mainfrom
feat/w3-buildkit-engine
Jul 17, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/w3-buildkit-engine

Conversation

@atrawog

@atrawog atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

sdk producer leg of the W3 build-engine wave (consumer: the held charly branch feat/w3-build-engine-plugin @8ec29a0 — opens after this merges). 11 files, +3073/−61:

  • deploykit/localpkg.go (new): the whole LocalPkg subsystem from charly/localpkg.go (559 LOC) + RenderBuilderScript/hostBuilderContext (carved from charly/deploy_host_helpers.go) — PURE functions over CandyModel/buildkit.ResolvedBox/EmitOpts. The one genuine core dependency (builder-image resolve/auto-build, which may recurse into charly box build) is INJECTED as two closures supplied by the core caller.
  • The LocalPkg render-seam HostBuild round-trip is ELIMINATED — traced (candy_steps.go:100) that the plugin-side render already holds the fully-populated step from the envelope (dg.Candies/dg.Boxes); the host-side "rebuild from the live *Candy graph" was redundancy, not need. RenderLocalPkgImageInstall is now a bare function reference; the stale ":248 still host-side" comment family member dies with the callback it described (R1/R5 in-wave sweep, incl. 2 more stale claims found by the sweep in render_generator.go + steps.go).
  • deploykit/intermediates_compute.go (new, 540 LOC): ComputeIntermediates + helpers from charly/intermediates.go (454 LOC), *Config param replaced by the new IntermediateDefaults struct. RDD-spiked on real data (box/cachyos, 25 resolved boxes, 8 distro-tag sequences, zero mismatches) BEFORE the port.
  • buildkit/distro_builder_map.go (new): PickDistroBuilder — a REAL R3 fix found mid-move: charly/config.go's pre-resolve path needed the same priority-ordered first-tag-match algorithm; both callers now share ONE lookup, each adapting its own data source.
  • deploykit/intermediates_move_test.go (new): the full 1534-line / 22-function test suite migrated from charly/intermediates{,_determinism}_test.go onto CandyModel/NewSpecCandyModel fixtures — zero coverage regression.
  • CHANGELOG/2026.198.0900.md (placeholder CalVer).

Change class

cross-repo (charly-or-sdk Go): this sdk producer merges+tags FIRST; the charly consumer repoints its gitlink and opens after (together with the consolidated plugins docs-batch leg).

How R10-tested — exact gate, commands, and pasted output

  • The gate: library leg — build/test/lint/gen here + byte-parity + the consumer-side full gate on the held charly PR (its validator runs charly box build + the pod-build-path bed before that PR merges).
  • Eval beds run: N/A in this repo — the composing bed runs on the charly leg's final gate.
  • Byte-parity (the wave's RDD gate, run twice — baseline and on the FINAL combined tree): 10 box/cachyos Containerfiles byte-IDENTICAL (CalVer-tag-normalized): arch.arch-builder / arch.arch / arch.cuda-arch-builder / cachyos / cachyos-pacstrap-builder / cachyos-pacstrap / cachyos-ssh-client / cachyos-ssh-client-plugin-wl / cachyos-ssh-client-plugin-wl-wl-screenshot-pixelflux / charly-selftest — FAIL=0.
  • Did the CHANGED code path execute live? The relocated compute/render paths executed via the byte-parity box generate runs against the branch binary; unit-level via the migrated suite below.
  • Concurrency: N/A — pure library relocation, no shared-state path.
sdk:    GOWORK=off go build ./...  → clean
        GOWORK=off go test ./...   → ok, all packages (incl. the 22 migrated intermediates tests)
        golangci-lint run ./...    → 0 issues
        gofmt -l .                 → clean
charly (consumer, held branch @8ec29a0 pinning this head):
        go build/vet/test ./...    → clean / clean / ok charly 90s
        golangci-lint              → 0 issues
Axes on the held consumer: kit-import files 141 → 139; non-test charly LOC 48,385 → 47,285.
R5: every deleted identifier greps to zero live hits across charly+sdk+plugins.

Attribution tier

analysed on a live system — build/test/byte-parity generate runs executed against the branch binary; the disposable-bed proof rides the charly consumer's final gate (not claimed here).

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: go/plugin/build/generate/strict-policy/git-workflow/cutover-policy loaded (author teammate + orchestrator).
  • R1 RCA + zero warnings: the render-seam redundancy was traced (caller chain) before removal; the sweep surfaced 2 MORE stale claims in untouched sdk files — fixed in this commit (claim-keyed, R1). Outputs warning-free.
  • R2 no out-of-scope: pre-existing gofmt-dirty files found on origin/main are routed to the go-quality batch (not silently fixed here, not parked).
  • R3 no duplication: PickDistroBuilder extraction — the move would otherwise have left two copies of one algorithm.
  • R4 no workaround: the core dependency is injected as explicit closures, not duck-typed or shimmed.
  • R5 hard cutover + grep: consumer deletes files whole (its leg); self-test pasted above; the ":248" stale-comment family swept in-wave.
  • R6 git safety: append-only branch; no destructive actions; no force-push.
  • R7 runtime gate: consumer-side (the charly leg's bed gate).
  • R8 artifact invariants: the byte-parity proof IS the emitted-artifact invariant for this wave.
  • R9 binary == source + deps: per-worktree branch binary used for the parity runs; no new runtime OS deps.
  • R10 disposable + coverage: 1534 lines of migrated coverage; final disposable-bed gate on the consumer PR.
  • RDD / ADE / SDD: both spikes empirical BEFORE code (caller-chain trace; real-data distro-map comparison); ADE N/A (no candy manifest change in this repo); SDD N/A (no CUE shape).
  • Hard cutover: ONE atomic squash on sdk main.
  • Kernel/plugin boundary law: relocations are mechanism-kit code — the legal sdk home; the perf-gate-protected in-proc wrappers stay core (documented per-file in the wave report).
  • Disposable-only autonomy: N/A.
  • Clean architecture + Go gates: all pasted above.
  • CHANGELOG: CHANGELOG/2026.198.0900.md staged (placeholder; validator finalizes).

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif

Relocates two host-coupled subsystems out of charly core after RDD-spike
proof their claimed host dependency was stale: both operate purely on
already-available envelope data (CandyModel/buildkit.ResolvedBox), not
*Config or the live loader graph.

- localpkg.go (from charly/localpkg.go + partially deploy_host_helpers.go):
  ResolveLocalPkgDir/BuildLocalPkgOnHost/BuildDepPkgsOnHost/
  TransferAndInstallPkgs/VenueHasPkgManager/ExecLocalPkgInstall/
  RenderLocalPkgImageInstall/RenderBuilderScript. The one genuine core
  dependency (builder-image resolve/auto-build) is injected as closures.
  Eliminates the LocalPkg render-seam host round-trip entirely — traced
  that the caller already holds the fully-populated step.
- intermediates_compute.go + buildkit/distro_builder_map.go (from
  charly/intermediates.go): ComputeIntermediates and friends, plus a new
  shared PickDistroBuilder algorithm charly's own distroBuilderMap now
  also calls (R3 dedup enabled by the move).
- Full test migration for both (localpkg_test.go, intermediates_move_test.go)
  onto CandyModel/NewSpecCandyModel fixtures.

Assisted-by: Claude Sonnet 5 (analysed on a live system)
@atrawog

atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: cross-repo (charly-or-sdk Go) — sdk producer leg, no standalone disposable bed (analogous to the B6 "new candy has no standalone R10" precedent: the real runtime gate rides the held charly consumer PR feat/w3-build-engine-plugin @8ec29a0).

I re-derived everything independently in an isolated worktree (own GOLANGCI_LINT_CACHE, -buildvcs=false) rather than trusting the pasted evidence:

  • go build / go vet / gofmt -l . / go test ./... — all clean, re-run myself.
  • golangci-lint run ./... (isolated cache) — 0 issues.
  • Counted intermediates_move_test.go: 22 func Test — matches the claimed count exactly.
  • R3 (PickDistroBuilder): verified both claimed callers — sdk's own distroBuilderMap and the held consumer's charly/config.go:611-616.
  • R5 grep self-test: zero hits for LocalPkgParams|LocalPkgResult|RenderSeamLocalPkg in both the sdk repo and the consumer repo.
  • Consumer sanity (charly-wt-w3, sdk submodule pinned to this exact head 25d73ee): go build/vet/test ./charly/... all clean; confirmed the consumer already deleted the LocalPkg render-seam host-dispatch case and that candy_steps.go:98-100 really does build the step from dg.Candies/dg.Boxes before calling RenderLocalPkgImageInstall — the caller-chain claim that motivated the seam's removal checks out.
  • Byte-parity claim independently re-derived, not trusted: regenerated all 10 claimed box/cachyos Containerfiles from the consumer worktree's own (freshly built, version-confirmed) binary and diffed (CalVer-normalized) against a pre-move baseline capture — all 10 byte-identical, FAIL=0.
  • No go.mod/go.sum changes. No *.cue touched — the new IntermediateDefaults/DistroBuilderCandidate structs are internal pure-function parameter carriers (never marshalled/gRPC-wire), matching the established EmitOpts (spec/deploy_executor.go) precedent, not wire types requiring CUE-sourcing.
  • Branch protection confirmed (charly/pr-validator sole required context, strict: true, enforce_admins: true); branch is exactly 1 commit ahead of current main — not behind.
  • No other open sdk PRs at time of validation.

placement: CORRECT — sdk/deploykit + sdk/buildkit are the legal mechanism-kit home for this relocation (kind-blind, consumed by the transitional core caller today and the target candy/plugin-build per the ongoing K-wave); the one genuine core dependency (builder-image resolve/auto-build) is correctly injected as two closures rather than threaded via *Config or duck-typed. This PR touches no charly/*.go, so the alias/kit-import mechanical sub-checks apply to the (separately validated) consumer PR.

Checklist: 0 security ✅ · 1 description ✅ · 2 change-class gate ✅ · 3 attribution (analysed on a live system, justified) ✅ · 4 R0 skills ✅ · 5 R1 (RCA + zero warnings) ✅ · 6 R2 (one genuinely-separable pre-existing gofmt item routed to the go-quality batch) ✅ · 7 R3 ✅ · 8 R4 ✅ · 9 R5 ✅ · 10 R6/R8/R9 N/A (library repo; artifact-invariant = the byte-parity proof) · 11 R10 coverage ✅ (1534-line/22-func migrated suite) · 12 RDD/ADE/SDD ✅ · 13 concurrency N/A (pure library relocation, no shared-state path) · 14 hard cutover (one atomic commit) ✅ · 15 architecture gate ✅ (placement CORRECT) · 16 disposable-only N/A · 17 clean-architecture + Go gates ✅ · 18 CHANGELOG ✅.

Decision: PASS. Proceeding to finalize the merge-time CalVer, merge (squash), and tag.

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

pr-validator finalization for PR #70 — rename the placeholder
CHANGELOG to the merge-time CalVer and match the H1 heading.

Assisted-by: Claude Sonnet 5 (analysed on a live system)
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