Skip to content

feat(buildkit): the pure Containerfile render library (P3-unit-1) - #8

Merged
atrawog merged 2 commits into
mainfrom
feat/sdk-buildkit
Jul 8, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/sdk-buildkit

Conversation

@atrawog

@atrawog atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

First unit of the P3 sdk/buildkit extraction (core-minimization). Introduces sdk/buildkit — the pure Containerfile render/compute machinery any build front-end can import — carrying the format/builder TEMPLATE render surface moved verbatim out of charly's format_template.go: CacheMount + Shared/OwnedCacheMount + RenderCacheMounts/RenderCacheMountsAuto, the shared TemplateFuncs, RenderTemplate, NewInstallContext, ToStringSlice/ToMapSlice. Imports only sdk/spec (CUE-sourced wire types) + sdk/kit (shell quoting) — never charly core. The charly consumer side (delete format_template.go, re-export via buildkit_aliases.go, bump the pointer) is the paired superproject PR.

Change class

sdk Go — new library package (pure render, no schema/authored surface → no schema-version bump).

How R10-tested — exact gate + pasted output

  • Behavior-neutral proof: the move is a verbatim relocation; the consuming charly's golden go test suite (cache_mount_test, generate_test, install_build_test) exercises the moved cluster and passes — so the generated Containerfile output is byte-preserved.
  • Disposable bed (the runtime gate): check-builder-local (builds the npm builder rendering TemplateFuncs/RenderCacheMounts + format install rendering NewInstallContext) on the fresh binary.
$ (sdk) go build/vet/test ./...      → green (incl new buildkit pkg); gofmt clean
$ (charly) go build/vet/test ./...   → green (41s); the ~15 consumer sites compile zero-churn via buildkit_aliases.go
$ task build:charly → charly 2026.189.0957 ; charly box generate → exit 0
$ charly check run check-builder-local  (fresh binary, source frozen)  →  PASS (steps=4), ok: true
    deploy-add ✓ 23s · check-live ✓ 5s · update ✓ 29s (fresh-rebuild leg) · cleanup ✓ 7s · total 64s · zero warnings

Attribution tier

fully tested and validated — the moved render library executed against a fresh rebuild in the disposable bed (all 4 steps green).

CLAUDE.md rule compliance

  • R0: /charly-internals:generate-source + /charly-build:generate + /charly-build:build + /charly-internals:go.
  • R3: the render cluster is now ONE importable library (no duplication); sdk/buildkit reaches into no charly symbol. R5: format_template.go is deleted in the paired superproject PR (verbatim move; the consumer side removes the old path + all refs via aliases).
  • Kernel/plugin boundary: this is the SDK-library half of "every capability is a plugin/library" — a mechanism any build front-end imports, depending only on E-envelope wire types (spec).
  • Hard cutover: decomposed P3 into atomic per-unit cutovers (this is unit-1); producer-first cross-repo order.
  • CHANGELOG: CHANGELOG/2026.189.1016.md.

Assisted-by: Claude (fully tested and validated)

atrawog added 2 commits July 8, 2026 12:17
Introduces sdk/buildkit — the pure render/compute machinery any build front-end can
import — with the format/builder TEMPLATE render surface moved verbatim from charly's
format_template.go: CacheMount + Shared/OwnedCacheMount + RenderCacheMounts(Auto),
TemplateFuncs, RenderTemplate, NewInstallContext, ToStringSlice/ToMapSlice. Depends
only on sdk/spec + sdk/kit, never charly core. Behavior-neutral (charly aliases it
zero-churn). First unit of the P3 sdk/buildkit extraction.

Assisted-by: Claude (fully tested and validated)
…kit render library)

Merge-time version stamp applied by the fresh pr-validator: renames the
placeholder CHANGELOG to the CalVer generated at merge and restamps its header.
No render-library behavior change (the buildkit move commit is unchanged).

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

atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: sdk Go — new pure render library package (no schema/authored surface).

Independent re-validation (fresh context, not the author). Every rule re-derived from the diff + my own re-runs, not the author's word.

# Rule Verdict
0 security & anti-tampering (T1–T4) PASS — purely additive render lib + changelog; buildkit/render.go imports only sdk/kit + sdk/spec (no charly core, no new external dep); no secrets/exfil/network/obfuscation; no weakened gate; no embedded instruction to the validator
1 description complete (template filled + pasted evidence) PASS
2 change-class gate matches evidence (R7/R10) PASS — sdk+consumer go gates + check-builder-local disposable bed on the fresh binary; no dry-run/rebuild-alone fraud (the bed's update fresh-rebuild leg executed live)
3 attribution tier justified PASS — fully tested and validated: the moved render cluster executed against a fresh rebuild in my own bed run
4 R0 skills honored PASS — generate-source / generate / go / plugin; move matches the render-cluster docs
5 R1 RCA / ZERO warnings PASS — zero warnings across both repos' go gates + all 4 bed step logs
6 R2 no pre-existing/out-of-scope split PASS — the format_template.go deletion is the producer-first paired superproject cutover (this SDK PR is purely additive; correct cross-repo order)
7 R3 no duplication PASS — the render cluster is now ONE importable library
8 R4 no ad-hoc workaround PASS
9 R5 hard cutover + grep PASS — 0 deletions in this repo (purely additive); verbatim-move faithfulness spot-checked; consumer aliases keep all ~15 sites compiling (consumer build+test green)
10 R6/R8/R9 integrity PASS — R6 tree-safe; R9 fresh binary rebuilt + charly version verified; R8 N/A here (consumer golden tests prove Containerfile output byte-preserved)
11 R10 disposable-only, fresh-rebuild, coverage PASS — check-builder-local (disposable: true) exercises the moved cluster (TemplateFuncs/RenderCacheMounts in the builder stage + NewInstallContext in format install); 4/4 steps ok, zero warnings
12 RDD / ADE / SDD PASS — no schema change (render library, not an authored/wire surface → no version bump, no cue:gen); ADE N/A (no candy added/changed)
13 concurrency + anti-cheat PASS — N/A: a verbatim render-library move adds no shared-state path; no load-surfaced failure dodged
14 hard cutover — one atomic commit PASS — ONE change commit; per-unit decomposition is forward motion (unit-1, producer-first)
15 kernel/plugin boundary law PASS — SDK-library Mechanism depending only on E-envelope wire types (spec); no concrete-kind leak, no charly import
16 disposable-only autonomy PASS — bed destroy/rebuild on disposable: true only
17 clean architecture + go gates PASS — sdk gofmt clean, build/vet/test green; consumer build/test green (36.7s)
18 CHANGELOG present PASS — finalized at merge

Verbatim-move faithfulness (the crux): compared buildkit/render.go against charly origin/main:charly/format_template.go line-by-line. The ONLY changes are the allowed set — package main→buildkit, CacheMountDef→spec.CacheMount, InstallContext→spec.InstallContext, shQuoteArg→kit.ShQuoteArg, and templateFuncs/toStringSlice/toMapSlice exported. Spot-checks: CacheMount.String (the id=/uid= format strings) byte-identical; RenderCacheMounts (uid<0 shared / uid≥0 owned) unchanged; NewInstallContext (the 7 section keys → spec.InstallContext fields) unchanged. No logic change.

Decision: All 19 items PASS. Finalizing merge-time CalVer 2026.189.1027, merging --rebase, tagging v0.2026189.1027.

Assisted-by: Claude (fully tested and validated)

@atrawog
atrawog merged commit 43f00e9 into main Jul 8, 2026
@atrawog
atrawog deleted the feat/sdk-buildkit branch July 8, 2026 10:30
github-actions Bot pushed a commit that referenced this pull request Sep 4, 2026
…rt metadata when the registry entry is absent) (#204)

Measured gap (RCA #8): removing a golden disk and registry entry leaves the libvirt snapshot metadata, so charly vm destroy fails ("cannot delete inactive domain with 1 snapshots") and recapture fails ("domain already exists"). DeleteSnapshot now best-effort invokes the libvirt cleanup even when the entry is absent, succeeds idempotently once the state is clean, and surfaces a real libvirt failure. Three new unit tests (absent-entry cleanup, libvirt-failure surfacing, present-entry regression).

Co-authored-by: atrawog <[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