Repository navigation
feat(build)!: box-build podman DRIVE moves into candy/plugin-build; host is a resolve/render seam (P8b) - #70
Conversation
…ost is a resolve/render seam (P8b)
P8b reverses the P8 "permanent facade": the box-build podman DRIVE (the build-order loop, the
per-image build lock, the push, and the inline merge gate) now LIVES in the compiled-in
candy/plugin-build (importing only the sdk module), and charly's host side is reduced to a pure
RESOLVE/RENDER seam provider. `charly box generate` output is BYTE-IDENTICAL (the render is
unchanged, host-side); `charly box build` is behavior-identical (verified: fedora + fedora-builder
dependency-chain build, inline layer merge 3->1 / 2->1 via the candy's HostBuild("merge") path).
INTO candy/plugin-build (the DRIVE): plugin.go (Invoke runs the drive, no longer a HostBuild("image")
echo), drive.go (runBoxBuild/runBoxGenerate/buildImages/mergeBox/driveConfig), podman.go
(buildImage/pushImage/arg-builders/retryCmd + per-image lock via kit.AcquireImageBuildLock).
Host SEAMS (charly core): build_resolve_host.go (HostBuild("build-resolve") — loader RESOLVE +
Containerfile RENDER + privileged builder-bootstrap + builder-ensure -> the serializable drive-model)
and build_merge_host.go (HostBuild("merge"), TRANSITIONAL -> deletes when P14a lands verb:oci, the
candy swapping to InvokeProvider). merge.go extracted mergeImageRef (runOne calls it too, R3).
BREAKING (internal host<->plugin build-seam): the hostBuilders "image"/"containerfiles" kinds are
removed (replaced by "build-resolve" + "merge"); charly/build.go's runBoxBuild/runBoxGenerate/
buildImages/buildImage/pushImage/arg-builders/retryCmd/imageTags/mergeAfterBuild/hostBuildImage/
hostBuildGenerate deleted; filelock.go's imageBuildLockPath/acquireImageBuildLock deleted (-> kit,
R3). BuildCmd.Run computes the tag once, holds the build-activity retention lock across the build,
dispatches to the candy, and runs the retention prune as a host post-step. R5 comment sweep of the
"permanent facade"/"engine STAYS host-side" claims (main.go/remote_image.go/host_build_vm_build.go/
validate.go/deploy_wire.go); grep self-test clean.
Boundary-law re-judgment: generate.go/build_target_oci.go/intermediates.go/layers.go STAY core PINNED
BY the loader Mechanism + the P2 runtime-Candy decision, RE-JUDGED at P15/P16 (never a silent keep).
Deferred to P8b-followup: intermediates->deploykit, format_config resolvers->buildkit,
build_stage_atomic->kit (collide with P13/P14 sdk work).
Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
….MergeRequest Merge origin/main (8264934, command:alias P14b) into feat/p8b-build-engine and re-run pluginsgen (plugin-build + plugin-alias both compiled-in; go.work + plugins_generated.go carry both). Bump the sdk submodule pointer to the P8b sdk branch (df30685) which merged sdk main (P14a #28 MergeRequest/MergeReply + P13 #29) and dropped the transitional local MergeRequest. Align consumers to P14a's shape: MergeRequest.MaxMB/MaxTotalMB are int (the candy casts box.MergeMaxMB int64 to int; build_merge_host.go drops the now-redundant int() conversions). Fresh-rebuild R10 re-run on the merged code: build + go test + lint (0 issues) + gofmt + generate byte-parity + real fedora build + merge seam (Merged 3-to-1 / 2-to-1 / 9-to-3 via the candy HostBuild merge) all green. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
P14a spec.MergeRequest.MaxMB/MaxTotalMB are int (not int64). The candy mergeBox casts box.MergeMaxMB int64 to int; build_merge_host.go drops the now-redundant int() conversions (unconvert). Belongs with the sdk-pointer bump in 59c9fbe; committed separately after the earlier git add was lost to a hook-blocked command. Worktree verified green (build + go test + golangci-lint 0 issues + gofmt + generate byte-parity + real fedora build + merge seam). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
… (P8b sdk half) (#31) The sdk contract half of P8b: the box-build podman DRIVE moves into candy/plugin-build; charly's host side becomes a resolve/render seam provider (consumer opencharly/charly#70). - schema/buildresolve.cue → generated spec.BuildResolveRequest/BuildResolveBox/BuildResolveReply (CUE-sourced per the SDD wire-type mandate; all plain/nested structs, Levels [][]string generates faithfully via gengotypes — no disjunction, no RawBody). The HostBuild("build-resolve") seam envelope. - kit/filelock.go → ImageBuildLockPath + AcquireImageBuildLock, the per-image build lock derived byte-identically across the module boundary (R3) so charly core + compiled-in candy/plugin-build share one lock. Blocking flock primitive (R4), mirrors AcquireLocalPkgBuildLock. - spec/deploy_wire.go — BuildRequest doc-comment R5-swept to the new CLI→DRIVE reality. - The transitional #MergeRequest/#MergeReply local copy was dropped; spec.MergeRequest/MergeReply now have ONE home in schema/oci.cue (P14a, sdk#28, merged) — R3. Validated by a fresh independent pr-validator at df30685/b929b85: go build/vet/test green, gofmt -l empty, golangci-lint run ./... 0 issues, task cue:gen a reproducible NO-OP, MergeRequest one-home confirmed. Runtime exercise via consumer #70's real charly box build (39-step fedora build driving kit.AcquireImageBuildLock + BuildResolve* against a fresh rebuild). Assisted-by: Claude (fully tested and validated)
…26193.1308) sdk#31 (the P8b sdk half) merged to sdk main as ccd68e0, tag v0.2026193.1308. Bump the sdk submodule gitlink from the feat-branch commit to the merged sdk main ccd68e0, and charly/go.mod require to v0.2026193.1308. The transitional local MergeRequest is gone from sdk now; build_merge_host.go + the candy import spec.MergeRequest/MergeReply from oci.cue (one home). candy/plugin-build/go.mod keeps v0.0.0 + replace => ../../sdk (in-repo convention, matching plugin-alias). Fresh-rebuild R10 re-confirmed against the merged pointer: build exit0 (v2026.193.1245) + go test green + golangci-lint 0 issues (charly+candy) + gofmt + generate byte-identical + real fedora build exit0. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
Rebase #70 onto merged main 3f6ef75 (strict:true up-to-date). Only charly/go.mod conflicted (sdk require): kept v0.2026193.1308 (ccd68e0, descendant of P13 sdk). Re-ran pluginsgen: plugin-build + plugin-bundle + plugin-alias all compiled-in (go.work + plugins_generated.go). P13 did not touch the build-engine files (no overlap). Fresh-rebuild R10 re-confirmed: build exit0 + go test green + golangci-lint 0 issues + real fedora build exit0. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
pr-validator — APPROVED ✅Change class: charly/sdk Go + candy config (runtime; concurrency-sensitive build DRIVE + shared image-build lock) Fresh, independent re-derivation in a superproject-rooted clone @
Independently re-run evidence: Concurrent full-roster R10 (persistent session, fresh p8b binary v2026.193.1333): check-exampledeploy 100s · check-sidecar-pod 294s · check-k3s-vm 266s · check-charly-vm 312s · check-group 270s — 5/5 PASS, all building through the new candy DRIVE + shared kit build-lock simultaneously; the lock serialized 5 concurrent builds correctly (contention visible, no corruption/deadlock); zero-warnings met; teardown clean ( Non-blocking nit (follow-up, not a blocker): Decision: APPROVED. The box-build podman DRIVE cleanly relocates into Assisted-by: Claude (analysed on a live system) |
Merge-time version stamp applied by the fresh pr-validator: rename the placeholder CHANGELOG entry to the merge-time CalVer 2026.193.1359 and align its H1 heading. No schema bump (P8b is build-engine only, no #SchemaVersion change). Validated independently: R0-R10 + SDD + F11 boundary + byte-parity (470 files, diff -r exit 0) + the concurrent 5/5 disposable-bed roster (fresh charly box build through the new candy DRIVE + shared kit build-lock, serialized correctly under simultaneity). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_015xCf9fyAJmooLeZr19pxrf
… hermetic (#73) TestPruneImagesByRetention / _SharedID stubbed the image inventory (ListLocalImages, listContainerImageRefs) but NOT liveBuildFloor, which reads the host-global build-activity lock dir (~/.cache/charly/locks/builds). Under a concurrent host build the correct mid-build retention protection engaged and the expected tag removal was silently skipped — non-deterministic. Root-cause fix: liveBuildFloor becomes an injectable package var (var liveBuildFloor = defaultLiveBuildFloor), mirroring the existing ListLocalImages/listContainerImageRefs seams; the engine body moves to defaultLiveBuildFloor unchanged. Production callers (pruneImagesByRetention, pruneDanglingCharlyImages, pruneBuildahStaging) are untouched and still do the real scan; the two prune tests stub it to a fixed no-live-build result → hermetic. Mid-build protection unchanged. Validated by a fresh independent pr-validator: go build/vet/gofmt clean, golangci-lint v2.12.2 0 issues, go test -race -count=20 TestPruneImagesByRetention 20/20, full charly suite green, live `charly clean --dry-run` on a fresh binary ("images: would remove 24 tag(s)"). Delta re-gated after P8b (#70) merged to main (build.go/filelock.go overlap) — full retention gate re-run green. Assisted-by: Claude (analysed on a live system)
opencharly/docs#70 landed. The gitlink moves to the merge commit rather than the PR's branch head, which the squash makes unreachable — the same rule that applied to plugins#205 and #209, and the one charly#301 exists for. Verified inside the submodule, because the superproject cannot answer it: `git -C docs merge-base --is-ancestor e3e7508 origin/main` -> rc=0, where the same query run from here returns 128 (objects absent, question unevaluated, and falsy under a bare `if`). Both gates at this pin, every submodule at its gitlink: skills: no NEW drift. Carrying 24 known-stale artifact(s) docs: no NEW drift. Carrying 63 known-stale artifact(s) All four producer legs are now landed and pinned at merge commits: spec 9a586f5 v0.2026230.1417 sdk 6b7a59f v0.2026230.1550 plugins aa5bcfe v2026.230.2142 (#205 then #209) docs e3e7508 (#70) Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
P8b — the box-build podman DRIVE moves into candy/plugin-build
Reverses the P8 "permanent facade". The podman DRIVE (build-order loop, per-image lock, push, inline merge gate) now LIVES in the compiled-in
candy/plugin-build(imports only sdk); charly's host side is a pure RESOLVE/RENDER seam provider. Operator-approved honoring of the original program's verdict #1 ("orchestration + podman I/O → candy/plugin-build").Architecture (2 seams, F11 action nouns)
plugin.go(Invoke runs the drive),drive.go(runBoxBuild/runBoxGenerate/buildImages/mergeBox/driveConfig),podman.go(buildImage/pushImage/arg-builders/retryCmd + per-image lock viakit.AcquireImageBuildLock).HostBuild("build-resolve")(build_resolve_host.go) — loader RESOLVE + Containerfile RENDER + privileged builder-bootstrap + builder-ensure → the serializable drive-model.HostBuild("merge")(build_merge_host.go, TRANSITIONAL) — merges by ref via the sharedmergeImageRef(extracted fromMergeCmd.runOne, R3). Deletes when P14a landsverb:oci; the candy then swaps toInvokeProvider("verb","oci",OpMerge,…). Consumesspec.MergeRequest/MergeReply(P14a's oci.cue, sdk#28).R5 deletions (grep self-test clean)
Deleted from
charly/build.go: runBoxBuild, runBoxGenerate, buildImages, buildImage, pushImage, the arg-builders, cacheArgs, retryCmd, imageTags, mergeAfterBuild, hostBuildImage, hostBuildGenerate + theregisterHostBuilder("image"/"containerfiles")init. Deleted fromfilelock.go: imageBuildLockPath, acquireImageBuildLock (→kit, R3). Facade-claim comments swept (main.go/remote_image.go/host_build_vm_build.go/validate.go).Boundary-law re-judgment (documented, not silent)
generate.go/build_target_oci.go/intermediates.go/layers.go STAY core PINNED BY the loader Mechanism + the P2 runtime-Candy decision — RE-JUDGED at P15/P16. Pure-compute relocations (intermediates→deploykit, format_config resolvers→buildkit, build_stage_atomic→kit) deferred to P8b-followup (collide with P13/P14 concurrent sdk work).
R10 gate — fully tested and validated (pasted)
task build:binary→ exit 0 (full charly builds with the drive compiled-in via go.work).go test ./charly/...→ ok (all-green with box submodules present; without them 2 loader tests fail environmentally — confirmed by re-run).golangci-lint run→ 0 issues (charly + candy/plugin-build + sdk);gofmt -lempty.charly box generateoutput byte-identical pre/post (render unchanged, host-side).charly box build fedora -C box/fedora→ exit 0 — full 39-step multi-stage build via the candy drive,Successfully tagged ghcr.io/opencharly/fedora-builder+ghcr.io/opencharly/fedora(dependency chain, DAG-level loop).merge.auto:true(transient, reverted): candymergeBox→HostBuild("merge")→mergeImageReffired — "Merged: 3 layers → 1 layers" + "Merged: 2 layers → 1 layers", exit 0.charly box merge fedora→ "Merged: 3 layers → 1 layers" exit 0 (extraction correct).charly box validate→ exit 0 (candy ADE: description + plan + deterministic check).Cross-repo landing (sequencing)
Depends on opencharly/sdk feat/p8b-build-engine (BuildResolve* wire + kit lock) → rebases onto sdk#28 (P14a's MergeRequest/MergeReply) which lands first. The sdk submodule pointer + go.mod require re-bump to the merged sdk tag at landing. The plugins-skill "permanent facade" sweep rides the batched P-program docs cutover.
Assisted-by: Claude (fully tested and validated)
https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif