Repository navigation
refactor(check,k8s): thematic hygiene batch — sdk-interface-drift fixtures, dead code, stale refs - #161
Conversation
…tures, dead code, stale refs Fix go vet failures in candy/plugin-http and candy/plugin-port: both plugins' fakeCC test fixtures fell behind kit.CheckContext after the sdk control-plane work added ResolveEndpoint/ResolveGraphicsEndpoint/ ResolveClusterContext/ResolveImageLabel. Patched each fixture minimally rather than centralizing into a new shared test-support package for two callers whose exercised behavior already diverges. Re-derived (fresh on current main, not merged from the stale feat/wave3-leaves branch) two dead-code/duplication fixes: deleted the zero-caller ValidatePreemptibleAcrossDeploy, and folded defaultK8sOutputDir out of the stray bundle_add_cmd_k8s.go into k8s_generate.go, deduping the inline copy in k8s_deploy_from_box.go. The third duplicate the original commit unified (status_collect_k8s.go's k8sTreeRoot) has since relocated to candy/plugin-substrate under an unrelated K5 move; the kernel/plugin boundary law forbids unifying it by call across that boundary, so fixed its stale doc comment instead. Swept for the stale check-charly-selftest-pod bed-name reference; the one hit lives in the sdk submodule, landing as its own companion PR (opencharly/sdk#76, documentation reviewed, no gitlink bump here). Added scratchpad/ to .gitignore. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Fix a stale bed-name reference in `WriteCandySteps`'s localpkg hard-error comment (`deploykit/candy_steps.go`). The comment cited "the check-charly-selftest-pod defect" as the motivating incident for making a `RenderLocalPkgImageInstall` failure a hard error instead of a silent Containerfile-comment fallback. That bed name has never resolved to anything in either the sdk or the superproject charly repo's history (confirmed independently via `git log --all -S` in both repos) — traced to commit `95b95c5` in the charly repo, which used the same wrong name. The bed that actually plays this role today (the charly toolchain localpkg deploy witness — opencharly-git pacman install + dep auto-resolve) is `check-charly-vm`, confirmed present in the superproject `charly.yml`. Corrected the comment to name it. Companion charly-repo leg (same thematic hygiene batch): opencharly/charly#161. pr-validator: independently re-verified the phantom-name and replacement-name claims, re-ran go build/vet/test/gofmt/golangci-lint clean on the PR head and again after the BEHIND update-branch merge (zero file overlap with main's advance), confirmed the R5 grep self-test (phantom name survives only in already-merged CHANGELOG history), and finalized the merge-time CalVer 2026.201.0649. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; documentation reviewed)
pr-validator — APPROVED ✅Change class:
Comments considered: none — the PR carries zero comments. Cross-PR interactions considered:
Independent re-verification performed (adversarial — nothing taken on the author's word)
(Recovery note, disclosed: my first attempt at this bed used a foreground 10-minute timeout that got killed mid-run, orphaning the VM domain — DecisionPASS. Every rule-set item is independently verified compliant against the exact head commit Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
pr-validator: rename the CHANGELOG placeholder to the merge-time CalVer and add a validator addendum noting the check-k8s-deploy disposable-bed proof for the defaultK8sOutputDir/GenerateK8sKustomize fold. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — merged ✅Merged (squash) as Sequence: initial validation PASS at head Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
…loader-cone Merges origin/main (6d436e2, "thematic hygiene batch — sdk-interface-drift fixtures, dead code, stale refs" — #161, which fixes the plugin-http/ plugin-port fakeCC fixture failures + #159 builder_venue.go work) into feat/w9-loader-cone. Clean auto-merge, one conflict: charly/go.mod's sdk require version (HEAD v0.2026201.636 vs main v0.2026201.603) — resolved to v0.2026201.649, matching the sdk gitlink bump below. No overlap between #159/#161's touched files (builder_venue.go, k8s_generate.go, k8s_deploy_from_box.go, validate_preempt.go, bundle_add_cmd_k8s.go deleted, plugin-substrate/status_k8s.go) and the W9 retype surface (layers.go/unified.go/resolved_project_host.go/render_baked_metadata.go). sdk gitlink -> 5cf230d (sdk#76, a docs-only hygiene fix, confirmed a descendant of the previous db63ef1 pin). Verified: task build:binary (2026.201.0649, zero go.work.sum drift); charly go test ./... 97.7s green; gofmt/vet/golangci-lint clean; GOWORK=off go mod verify clean; superproject task cue:gen no-op beyond the pre-existing untouched box/cachyos pointer noise; charly box validate exit 0. candy/plugin-http + candy/plugin-port: the previously-reproduced fakeCC fixture failures are now GREEN after this merge (confirming #161's fix landed correctly here). This is the W9 loader-cone cutover's FINAL rebase — the full 10/10 disposable bed roster (check-exampledeploy, check-substrate, check-builder-vm, check-k3s-vm, check-group, check-structkind, check-sidecar-pod, check-charly-vm, check-local-vm, check-k8s-deploy) passed against this lineage's immediate predecessor (6b07a93); check-k8s-deploy's one roster-run flake was concurrency contention (isolated re-run PASS 10/10), not a regression, and is tracked separately (bed-robustness batch). Axis measurements (charly/ only, vs 6d436e2): axis-A (non-test non-alias files importing an sdk mechanism kit) 139 vs main's 141 (net -2); non-test LOC 46,835 vs main's 48,177 (net -1,342); *_aliases.go count 1 (vmshared_aliases.go) on both sides — no regression. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Summary of changes
Thematic hygiene batch (task #10) — four independently-surfaced, zero-file-overlap
fixes bundled per the Cutover Sizing Law rather than four solo landing ceremonies:
go vetfix —candy/plugin-http+candy/plugin-port: both plugins'fakeCCtest fixtures fell behindkit.CheckContextafter the sdkcontrol-plane work added
ResolveEndpoint/ResolveGraphicsEndpoint/ResolveClusterContext/ResolveImageLabel. Patched each fixture with thefour missing no-op methods. R3 check performed first: swept
fakeCCrepo-wide (only these 2 copies exist), and their exercised behavior (HTTP
canned responses vs. plain Exec/Mode) already diverges meaningfully — a new
shared sdk/kit test-support package for two trivial stub sets would be
over-engineering, so patched each minimally.
Re-derived
feat/wave3-leaves' two fixes fresh on current main (did NOTmerge that stale branch):
ValidatePreemptibleAcrossDeploy(re-confirmedzero call sites via
git grepbefore deleting — RDD; its param type haddrifted to
*deploykit.BundleConfigunder an intervening K-wave move,but the zero-caller fact still held).
defaultK8sOutputDirout of the stray one-functioncharly/bundle_add_cmd_k8s.gointo its siblingk8s_generate.go,deduping the inline copy in
k8s_deploy_from_box.go. The thirdduplicate the original commit unified (
status_collect_k8s.go'sk8sTreeRoot) no longer lives incharly/core — it relocated tocandy/plugin-substrate/status_k8s.gounder an unrelated K5status-subsystem move that landed after the stale branch was cut. The
kernel/plugin boundary law forbids a plugin importing charly core, so
that copy can no longer be unified by call; fixed its stale doc comment
instead (it cited a filename that never matched even in the original
commit).
Stale bed-name sweep —
check-charly-selftest-podnever resolves toany bed in current history. The one hit found is in the sdk submodule
(
deploykit/candy_steps.go), not this repo — landing as its own companionPR, docs(deploykit): fix stale check-charly-selftest-pod bed-name reference sdk#76 (
documentation reviewed, comment-only). ThisPR does NOT bump the sdk gitlink: nothing in this batch consumes the
sdk comment fix, and the next sdk-gitlink bump rides the in-flight W9
producer PR instead (per team-lead ruling — avoids manufacturing a
gitlink race with that in-flight lane).
.gitignore: addedscratchpad/(the session scratch dir, currentlyshowing untracked).
Change class
charlyGo code (candy/plugin-http, candy/plugin-port, candy/plugin-substrateare Go modules too) + a trivial
.gitignoreconfig addition. Runtime tierthroughout — no docs-only carve-out (the k8s/preempt dead-code deletions and
plugin-substrate comment fix are code-adjacent, not pure prose).
How R10-tested — exact gate, commands, and pasted output
/charly-check:check"R10 gate by change class" —charlyGo code →go test ./...+go vet+task build:binary(R9 freshness) +charly box validate. None of the four members touch a box/candy/pod/DeployTarget mechanism, a substrate kind's runtime behavior, an IR/loader/resolver path, or a deploy walk — they are (a) two test-fixture-only files with zero production code touched, (b) dead-code deletion + a helper relocation with no behavior change (byte-identical output — same computation, same call sites), (c) two comment-only edits. No disposable bed composes or exercises any of these specific lines differently thango test/go vet/go buildalready do, and this is a documentation-reviewed cross-check for member (3)'s twin (already gated at that tier on the sdk PR). Given that, the compile+test+lint+validate battery below is the correct, complete gate — a bed run here would not exercise anything these edits could break that the battery doesn't already prove.charly box validate(below) is the closest composing check and passes clean.task build:binarysucceeded from this branch's HEAD (merged ontoorigin/main@ 09172e1) with zero warnings;charly version→2026.201.0632, matching the rebuilt binary.go test ./...executes plugin-http's and plugin-port's full test suites (which now compile and pass against the realverb{}.RunVerb);go build/go vetexecute the k8s helper fold + preempt-validator deletion through full compilation (a broken fold or a still-referenced deleted symbol fails to compile — this IS the failure mode these edits could introduce);charly box validatewalks the full project config, which exercisesdefaultK8sOutputDir's new call site indirectly via config load, though not the k8s deploy path itself (no k8s deploy exists in this project'scharly.yml— the deploy:k8s preresolver call site is unreachable fromvalidateand untouched in shape, only relocated).Attribution tier
fully tested and validated— every changed code path compiled, vetted, andexecuted via
go test/go build/charly box validateagainst the freshrebuild; the fixture fixes are proven by their own now-passing test suites.
Harness rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:go-quality,/charly-check:check— all loaded before any edit (per the Skill Dispatcher: candy plugin work, charly Go source, strict-policy R3/R5 discipline, git workflow, go-quality gates, check-bed naming sweep).go vetinterface-mismatch RCA'd to the sdk control-plane addition of 4 CheckContext methods; the wave3-leaves re-derivation RCA'd the intervening K-wave drift (param type change, K5 status-subsystem relocation) before applying; the stale bed-name RCA'd viagit log --all -Sin both repos before correcting. All gate output above is zero-warning.git grepfor both deleted identifiers (ValidatePreemptibleAcrossDeploy,bundle_add_cmd_k8s) and the swept stale bed name — all pasted above, only the sanctioned "moved from" provenance comment remains.git status/git worktree list/gh pr list(universal PR-gate audit) run before opening this PR; branch merged (not rebased) ontoorigin/mainafter confirming zero file-overlap with the just-landed fix(command): restore nested CLI grammar for check/box-list (F-CLI-NEST) #160 (09172e1, F-CLI-NEST) viagit show --stat.task build:binaryrebuilt from this exact source;charly versionconfirmed2026.201.0632matching. No new runtime OS dependency introduced.go testsuites, which would FAIL without the interface-satisfaction fix); the dead-code deletion is proven by a successful compile (a live caller would fail to build); the comment fixes carry no runtime coverage requirement.ValidatePreemptibleAcrossDeploywas re-verified live viagit grepon THIS tree (not assumed from the stale branch) before deleting, exactly per RDD's "never trust, verify" mandate applied to a re-derivation. ADE/SDD: N/A — no candy plan or.cueschema touched.main(this PR, squash-merged); no Phase 2/deferred scope; the approved brief executed as given, with the one necessary escalation (the sdk crossroad) resolved before continuing.candy/plugin-substrate) is EXACTLY the boundary law in action: a plugin cannot import charly core, so the fix is a doc-comment correction, not a forced code unification across the boundary.task build:binary+charly box validate(config-only, no deploy).gofmt -l .empty on every touched file;golangci-lint run ./...0 issues (charly + plugin-http + plugin-port + plugin-substrate, each their own module);go vetclean;go test ./...green throughout.CHANGELOG/2026.201.0000.mdstaged (placeholder CalVer — the pr-validator finalizes it).Cross-repo note
sdk companion PR: opencharly/sdk#76 (
docs(deploykit): fix stale check-charly-selftest-pod bed-name reference,documentation reviewed). Landing order: independent — this PR does not depend on sdk#76 merging first (no gitlink bump here), and sdk#76 does not depend on this PR. Both may land in either order.Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)