Repository navigation
feat(kit)!: P12a check/ADE architecture fold — movable-now sub-batch - #59
Conversation
Relocates the genuinely-portable half of the P12-rest RDD trace (the check/ADE surface) into sdk/kit and sdk/deploykit: AgentGrader (+ RunAgentOnce/parseVerdict/buildGraderPrompt), ContainerInspection + ResolveCheckVarsBuild/Runtime, the HTTP-do path (HTTPClientFor/ DoHTTPRequest/FormatHTTPHeaders), ValidatePlanSteps, and the local-image resolution surface (ListLocalImages/ResolveLocalImageRef/ ExtractCalVerTag/LooksLikeFullRef/ErrImageNotLocal) plus CheckBoxContainerChain in deploykit. Every piece needed no host callback — the trace's actionable finding was that this batch has a much larger movable-now surface than the P8b-rest precedent. BareVolumeName relocated from deploykit to kit (a pure string helper with no deploykit-specific coupling) so checkvars.go's mergeRuntimeVars can call it without a kit->deploykit import cycle; deploykit's own caller now calls kit.BareVolumeName. The GATED-R-ITEM half of the trace (needs the live core *Config/*Generator graph) is unchanged and joins the tracked K-wave-exit list. Verified via: go build/vet/test + golangci-lint (0 issues, after clearing a stale shared lint cache referencing another worktree) on every sdk package; gofmt clean. Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: charly-or-sdk Go (sdk library relocation — no wire-format/schema change, no CLI-visible behavior change) Checklist:
Comments considered: none (PR carries zero comments). Cross-PR interactions considered: sdk has no other open PRs. Checked sibling repos: opencharly/charly has 4 open PRs (#130 fix/r10-validation-followup, #128 feat/52b-vmshared-spec-repoint, #118 feat/p16-kernel-manifest-gate, #112 fix/openclaw-security-pin) — none reference this branch or touch Decision: PASS. Every relocated symbol is portable, single-sourced, correctly placed per the kernel/plugin boundary law and this repo's own established K-wave relocation precedent, and defined exactly once. All sdk-module gates (build/vet/test/lint/gofmt/mod-verify/mod-tidy) independently re-run green. The companion runtime evidence was cross-checked against real on-disk bed-run artifacts (not taken on the author's word) and corroborated in full except for one immaterial version-string citation. One Phase-3 mechanical fix required: rewrite the CHANGELOG H1 to match the finalized CalVer (this repo's own recurring divergence class) — handled at merge, not a blocker to PASS. Assisted-by: Claude Sonnet 5 (analysed on a live system) |
pr-validator finalization: rename the placeholder CHANGELOG entry to the merge-time CalVer and correct its H1 heading to match (the recurring filename<->H1 divergence class this repo has hit before). Assisted-by: Claude (fully tested and validated)
pr-validator — independent post-merge confirmation (NOT a gating action)This PR is already MERGED (commit `94956cd03d47fd3c4e775cfc67a198e2025c57eb`, tag `v0.2026197.1320`, finalized A fresh, independent evaluator (new context) re-derived the full R0–R10 + pillars checklist against the pre-finalization head `b049002` (byte-identical code blobs to what is now on `main`) and concurs the change is compliant:
Independent verdict: the merge was correct. Assisted-by: Claude (analysed on a live system) |
PR #59 (the P12a-proper cutover) merged as 94956cd while this follow-up was in flight, renaming the placeholder CHANGELOG/2026.197.1300.md to the merge-time CHANGELOG/2026.197.1320.md. Moves this follow-up unit's content onto the canonical file and drops the now-orphaned placeholder-named copy. Assisted-by: Claude (fully tested and validated)
Summary of changes
Relocates the genuinely-portable half of the P12-rest RDD trace (charly
core's check/ADE surface) into
sdk/kitandsdk/deploykit— the sdk legof the P12a architecture-fold cutover (companion superproject PR:
opencharly/charly, branch
feat/p12a-check-fold, references this branch bycommit
b049002via the in-treereplacedirective so it builds today, butits own R10 gate ran against this exact commit).
kit/grader.go(+grader_test.go) —AgentGrader(the productionStepGrader),RunAgentOnce,parseVerdict,buildGraderPrompt,lastVerdictObject,lastLines,GraderDefaultTimeout. Relocated fromcharly/check_feature_grader.go. Lives inkit, NOTcandy/plugin-check,because charly core CONSTRUCTS an
&AgentGrader{}value directly(
host_build_check_run.go'shostFeatureLive) — core may only import sdk,never a plugin candy, so the concrete type core instantiates must live
where core can reach it.
kit/checkvars.go(+checkvars_test.go) —ContainerInspection+siblings,
CheckVarResolver,ResolveCheckVarsBuild,ResolveCheckVarsRuntime. Every dependency was already portable:spec.BoxMetadata,vmshared.BundleNode(unused param, reserved forfuture per-deploy overrides), and a plain
{engine} inspectshell-out.kit/http_do.go(+http_do_test.go) —HTTPClientFor,DoHTTPRequest,FormatHTTPHeaders. Relocated fromcharly/check_http.go, itselfpreviously relocated FROM
candy/plugin-httpINTO core solely to shareone implementation between the in-proc and reverse-channel
HTTPDolegs— core had no core-specific need for this logic at all.
kit/planvalidate.go—ValidatePlanSteps. Invoked by BOTHcharly box validateand the externalizedcharly featureHostBuildseam; one copy reachable from both without a core→plugin import (R3).
kit/local_image.go(+local_image_test.go) —LocalImageInfo,ListLocalImages,ParseLocalImagesJSON,ResolveLocalImageRef,ResolveNewestLocalCalVer,ExtractCalVerTag,LooksLikeFullRef,ErrImageNotLocal.ParseLocalImagesJSON/ExtractCalVerTagare exported(charly core's
retention.gocalls them from a different package now);LooksLikeFullRefhad 4 OTHER core callers beyond the moved file — allrepointed to
kit.LooksLikeFullRefin the companion PR (R3single-source).
kit/deploy_name.go—SanitizeDeployName(relocated fromcharly/k3s_post.go, which had 4 core call sites) +BareVolumeName(relocated from
sdk/deploykit/quadlet.go— a pure string helper with nodeploykit-specific coupling, needed by
checkvars.go'smergeRuntimeVarswithout a kit→deploykit import, which would cyclesince deploykit already imports kit).
deploykit/check_box_chain.go—CheckBoxContainerChain, the R44Option-A box-mode executor. Relocated from
charly/check_box_container.go(imported onlysdk/kit+ stdlib — zerocharly-core-only state). Lives alongside
ContainerChain(deploykitalready owns that constructor).
deploykit/quadlet.go's ownBareVolumeNamedefinition deleted in favor of callingkit.BareVolumeName(deploykit already imports kit elsewhere in thisfile).
Change class
charly-or-sdk Go (sdk library relocation — no wire-format / schema change,
no CLI-visible behavior change; purely portable code moved to its natural
home).
How R10-tested — exact gate, commands, and pasted output
go build/go vet/go test/golangci-lint runon every sdk package (sdk is a library module, not abinary — its own R10 has no bed of its own). The RUNTIME proof that these
relocated functions still work correctly lives in the companion
superproject PR, whose R10 beds (
check-sidecar-pod,check-commands-local)exercise this code through the charly binary, plus a live targeted proof of
the riskiest piece (
AgentGrader) via a realclaudeCLI invocationagainst a disposable pod.
The companion PR's beds are the runtime proof:
check-sidecar-pod | pod | ok | 12 steps | 334sandcheck-commands-local | local | ok | 6 steps | 231s, both including their fresh-rebuildupdatestep, run on charlybinary version
2026.197.1235/2026.197.1238respectively (built fromthis sdk commit via the in-tree replace).
task cue:gen-adjacent regen is not applicable here either (no schematouched).
go build/go testbelow ran against the committed tree.binary.
kit.AgentGrader.Gradespecifically was exercised with a REALagent CLI (
claude -p --dangerously-skip-permissions), not just thedispatch path: a temporary spike step was added to a disposable pod's
candy,
charly check feature run <pod> --agent claudewas run, the realClaude CLI spawned, probed the live deployment (
charly status,supervisorctl status), and returned a parsed PASS verdict — provingRunAgentOnce,parseVerdict,lastVerdictObject, andbuildGraderPromptall work correctly end-to-end. The spike step wasreverted before commit (verified clean via
git diff).store/arbiter code in this diff).
Companion superproject beds (charly binary built from this sdk commit):
Attribution tier
fully tested and validated
Justified: build/vet/test/lint/gofmt all ran and are pasted; the relocated
code's runtime behavior was proven live through the companion PR's fresh
binary on two disposable R10 beds including their fresh-rebuild steps, PLUS
a targeted live invocation of the riskiest relocated piece (the real agent
grader) that actually executed and returned a genuine parsed verdict.
Harness rulebook compliance
/charly-internals:go(Go source structure + the aliassurface this repoints),
/charly-internals:plugin(the kit-vs-pluginplacement rule — core constructs
AgentGraderdirectly, so it lives inkit),
/charly-check:check(the R10 gate + beds proving the runtimebehavior).
golangci-lintreporting findings from an unrelated worktree) was RCA'd as a stale
shared lint-cache artifact (
golangci-lint cache cleanresolved it,confirmed not dismissed) — same root cause as a prior incident this
session. A separate, genuine finding (golangci-lint
unparamonplanTagFilter's now-dead return value, surfaced in the companion PRonce every
RunPlancaller stopped taking a filter arg) was fixed atits root by simplifying the function, not suppressed. Zero warnings in
the final gate output.
RunPlancaller (companionPR) I found
--tagoncharly box/check feature runhas been a no-opsince this repo's earliest recorded history (confirmed via
root-cause-analyzer) — non-blocking to THIS cutover's own claim
(architecture-fold, not a feature fix), so it is NOT fixed here; routed
to the project's next check-correctness thematic batch (tracked as task
docs(changelog): fix 2026.192.1709 H1 to match its filename and tag #25) rather than silently ignored.
BareVolumeNamemoved DOWN from deploykit to kitrather than duplicated (deploykit's own caller now calls
kit.BareVolumeName);ParseLocalImagesJSON/ExtractCalVerTagexportedrather than re-implemented for the cross-package caller.
definition is deleted in the companion PR (not aliased/re-exported) —
deploykit/quadlet.go's oldBareVolumeNamebody is likewise deletedoutright in this PR, not kept alongside the new kit copy.
additions + one function-body deletion in an existing file).
binary) — the runtime gate ran via the companion PR's charly binary, see
above.
touched.
companion PR's binary was freshly built + content-marker-verified
(
deploykit.CheckBoxContainerChainsymbol present) against this exactsdk commit.
disposable beds + the targeted live agent-grader proof, all on fresh
rebuilds, zero warnings. Every relocated function is exercised by the
existing test suite (relocated 1:1) plus the live beds.
AgentGraderwas verified against the real caller (
host_build_check_run.goconstructing
&AgentGrader{}directly), not assumed. ADE — N/A (nocandy/plan changed in this leg). SDD — N/A (no
.cueschema touched).dual-mode code (the old charly-core definitions are deleted in the
companion PR's SAME commit, not phased).
charly core's placement decisions) — but this PR is the concrete
RESULT of applying it: every relocated piece needed no host callback and
is portable, matching the E/M/B/D/R test from the P12-rest trace.
exclusively against
disposable: truedeploys (check-sidecar-pod),destroyed + rebuilt unattended, torn down after.
gofmt -l .empty,golangci-lint run ./...= 0 issues,go vetclean,go test ./...green — all pastedabove.
CHANGELOG/2026.197.1300.mdstaged (placeholder CalVer;the pr-validator finalizes it at merge).
Assisted-by: Claude Sonnet 5 (fully tested and validated)