Skip to content

feat(build)!: box-build podman DRIVE moves into candy/plugin-build; host is a resolve/render seam (P8b) - #70

Merged
atrawog merged 7 commits into
mainfrom
feat/p8b-build-engine
Jul 12, 2026
Merged

atrawog merged 7 commits into
mainfrom
feat/p8b-build-engine

Conversation

@atrawog

@atrawog atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

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)

  • candy/plugin-build (DRIVE): plugin.go (Invoke runs the drive), drive.go (runBoxBuild/runBoxGenerate/buildImages/mergeBox/driveConfig), podman.go (buildImage/pushImage/arg-builders/retryCmd + per-image lock via kit.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 shared mergeImageRef (extracted from MergeCmd.runOne, R3). Deletes when P14a lands verb:oci; the candy then swaps to InvokeProvider("verb","oci",OpMerge,…). Consumes spec.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 + the registerHostBuilder("image"/"containerfiles") init. Deleted from filelock.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 -l empty.
  • BYTE-PARITY: charly box generate output byte-identical pre/post (render unchanged, host-side).
  • REAL BUILD: 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 SEAM: with merge.auto:true (transient, reverted): candy mergeBox → HostBuild("merge") → mergeImageRef fired — "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

…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
atrawog added 3 commits July 12, 2026 14:36
….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
atrawog added a commit to opencharly/sdk that referenced this pull request Jul 12, 2026
… (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)
atrawog added 2 commits July 12, 2026 15:20
…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
@atrawog

atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

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 @ 76254ba (sdk ccd68e0=v0.2026193.1308, box/fedora 3a9dae32). Every claim re-run, nothing taken on the author's word.

# Rule Verdict
0 Security T1–T4 PASS — diff == description (build-DRIVE relocation only); no secrets/exfiltration/egress; security machinery untouched; supply chain OK (sdk pin = merged sdk main HEAD, B6 order); no PR manipulation text
1 Description complete PASS — template filled, pasted evidence, tier + rule-compliance
2 Change-class gate (R7/R10) PASS — code/config runtime; fresh-rebuild concurrent roster below
3 Attribution tier PASS — fully tested and validated grounded in the concurrent fresh-rebuild roster (changed drive executed live)
4 R0 skills honored PASS — git-workflow, plugin (build class + F11 + HostBuild seams), go/SDD, generate, install-plan
5 R1 RCA / zero warnings PASS — all gates clean; roster warn-hits RCA'd as benign guest-pacman lines (not charly), zero-warnings met
6 R2 no pre-existing split PASS — deferred pure-compute relocations (task #24) are outside P8b's DRIVE claim, separable, own next cutover
7 R3 no duplication PASS — mergeImageRef one impl (extract-fn), kit.AcquireImageBuildLock one impl
8 R4 no ad-hoc workaround PASS — per-image lock is a real advisory flock (LOCK_EX, tag-stripped), not sleep/retry
9 R5 hard cutover + grep PASS — deleted identifiers grep-clean; present-tense stale claims swept + verified; no dual-mode (merge seam is documented-transitional-until-P14a)
10 R6/R8/R9 PASS — R8 byte-parity re-derived (470 files, diff -r exit 0); R9 rebuilt-binary+deps in roster
11 R10 disposable/fresh/coverage PASS — 5/5 disposable beds, fresh charly box build each, coverage relocated (podman_test.go + sdk/kit lock)
12 RDD/ADE/SDD PASS — ADE (desc+plan+check, validate exit 0); SDD BuildResolve*/Merge CUE-generated, repro gates PASS, no hand wire struct, no @go(-) added
13 Concurrency mandate PASS — 5 beds built SIMULTANEOUSLY; shared build-lock serialized correctly (visible contention, no corruption/deadlock)
14 Hard cutover — atomic PASS — squash → one commit on main; no Phase-2
15 Kernel/plugin boundary (F11) PASS — TestNoSinglePluginAPISurface PASS; build-resolve/merge are class-generic action nouns; candy imports only sdk; no concrete-kind leak
16 Disposable-only autonomy PASS — roster on disposable beds; clean teardown (no orphaned domains)
17 Clean arch + go gates PASS — gofmt clean; golangci-lint 0 issues (charly+candy+sdk); go vet clean; go test green
18 CHANGELOG present PASS — placeholder finalized to merge-time CalVer at merge

Independently re-run evidence: go build/go test exit 0 (all green even without box submodules); golangci-lint 0 issues ×3 modules; TestNoSinglePluginAPISurface + both reproducibility gates PASS; byte-parity main vs p8b box generate -C box/fedora → diff -r exit 0 across 470 files / 44 byte-identical Containerfiles.

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 (charly vm list + virsh both empty).

Non-blocking nit (follow-up, not a blocker): candy/plugin-bundle/{bundle_cmd.go:13,plugin.go:15} retain a past-tense "box-build engine stayed core behind HostBuild(\"image\") in P8" precedent citation — literally-true history, but the identical twin was corrected in host_build_vm_build.go this PR, so it's an incomplete-for-consistency claim-keyed sweep worth a quick tidy.

Decision: APPROVED. The box-build podman DRIVE cleanly relocates into candy/plugin-build (imports only sdk); the host is a pure resolve/render seam behind two class-generic action-noun host-builders; generate output is byte-identical; the concurrency-sensitive shared build-lock is a real sync primitive proven correct under simultaneous load. Finalizing the merge-time CalVer, squash-merging, and tagging.

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
@atrawog
atrawog merged commit 1f57282 into main Jul 12, 2026
@atrawog
atrawog deleted the feat/p8b-build-engine branch July 12, 2026 14:02
atrawog added a commit that referenced this pull request Jul 12, 2026
… 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)
atrawog added a commit that referenced this pull request Aug 18, 2026
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)
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