Repository navigation
refactor(charly): vmshared→spec envelope-route repoint — all 23 passthrough symbols (task #16) - #128
Conversation
…directly (#52b) vmshared_aliases.go's Op/BundleNode/Step/... (and this batch's 13 symbols: LibvirtDomain, LibvirtGraphicsListeners, MCPServerYAML, PackageItem, PortScope, PreemptibleConfig, TunnelYAML, ShellConfig, EnvDependency, ServiceEntry, InstallContext, BuildStageContext, CandyPluginDecl) are pure `= spec.X` passthroughs -- legitimate E-envelope types the kernel is supposed to reference, routed through the forbidden vmshared mechanism-kit hop instead of sdk/spec directly. Repointed every consumer (production + test) to reference spec.X directly and deleted the now-unused bindings. First of several sub-batches decomposing the full 23-symbol/278-file vmshared repoint (task #16); the remaining 10 envelope passthroughs and 6 genuine vmshared mechanism functions (no spec equivalent) are out of scope for this cutover. Assisted-by: Claude (analysed on a live system)
…pec (#52b-2) DistroDef (-> spec.ResolvedDistro), VmDeployState, Matcher, MatcherList, PortSpec, CandyYAML repointed directly to spec.X across every consumer; vmshared_aliases.go bindings deleted. Found and fixed three new mechanical- rewrite bug classes beyond the first sub-batch's method-call collision: (1) a struct field literally named after the old bare type (embedded or not) whose composite-literal key must stay unqualified even though the field's type is now spec.X; (2) a local "spec" parameter/variable (the established VmSpec shorthand throughout vm_bootstrap.go/vm_build.go/ vm_bootc_install.go/vm_cloud_image.go) shadowing the spec package import once a second parameter needed spec.X in the same function -- fixed by renaming the local identifier to vmSpec in each of the 8 affected functions; (3) Go's variadic "...Type" ellipsis false-matching the rewriter's preceding-dot selector exclusion, silently skipping a real bare-type reference -- fixed the one instance and hardened the tool. go build/go vet both caught every instance; none shipped uncaught. Assisted-by: Claude (analysed on a live system)
BoxConfig repointed directly to spec.BoxConfig across 27 files; the
vmshared_aliases.go binding deleted. Handled the known method-name
collision by hand: uf_box_generic.go declares two accessor methods
literally named BoxConfig (on UnifiedFile and Config) -- the method
NAMES stay unqualified (Go requires it) while their return types become
spec.BoxConfig. A filter bug of my own (comparing git-grep's "./file.go"
output against a bare "file.go" exclusion tuple) let the batch script
briefly re-corrupt the already-hand-fixed file plus vmshared_aliases.go's
own declaration line; go build caught both instances immediately
("expected '(', found '.'"), reverted before commit.
Assisted-by: Claude (analysed on a live system)
Step repointed directly to spec.Step across 31 files; the vmshared_aliases.go binding deleted. 21 of 23 spec-passthrough symbols done. Proactive collision check (method/field/embedded/local-var/ ellipsis) found none for this symbol -- go build and go vet both passed clean on the first attempt, unlike the previous three sub-batches. Assisted-by: Claude (analysed on a live system)
BundleNode repointed directly to spec.BundleNode across 86 files (the largest sub-batch to date, 99 candidate consumer files measured); the vmshared_aliases.go binding deleted. 22 of 23 spec-passthrough symbols done. Proactive collision check found none for this symbol -- go build and go vet both passed clean on the first attempt, the second sub-batch in a row with zero fix-up round. Assisted-by: Claude (analysed on a live system)
…#52b-6) Op repointed directly to spec.Op across 68 files (136 candidate consumer files measured, the largest fan-out); the vmshared_aliases.go binding deleted. 23 of 23 spec-passthrough symbols done -- task #16 complete. Op is a struct field name shared by five unrelated structs (Operation.Op, OpStep.Op, Step.Op, Matcher.Op, ExternalPluginStep.Op), each using "Op:" as a composite-literal field key that must never be qualified -- hardened the rewrite tool with a general field-key exclusion (any occurrence followed by ':' inside a composite literal, regardless of which struct owns the field). A struct field DECLARATION (`Op string`, no colon in Go's declaration syntax) evaded that rule; go build caught the one instance (provider.go's Operation.Op) immediately, fixed by hand. Assisted-by: Claude (analysed on a live system)
Brings the branch up to date with main post-#127 (7be18e7, v2026.197.1051), resolving 27 conflicts across the alias files, VM engine relocations (P8b-rest: charly/vm_bootc_install.go + vm_bootstrap.go + vm_build.go + vm_cloud_image.go moved to candy/plugin-vm), bundle_members.go's teardown error-joining refactor (#55), and 20 test files needing both the vmshared-repoint's spec.X qualification and main's independent changes combined. vmshared_aliases.go resolved via the intersection of both branches' independent alias-dissolution deletions (mine: the 23 spec-passthrough repoint symbols; main's, from my own merged PR #127: the DEAD+TESTONLY slice). Assisted-by: Claude (analysed on a live system)
go build caught one bare-reference fallout from the main merge: host_build_vm_build.go (arrived via main's P8b-rest expansion, never in the 27-file conflict list since the repoint never touched it before) referenced VmDeployState bare -- one of the 23 repointed symbols whose vmshared_aliases.go binding is now gone. Qualified to *spec.VmDeployState. gofmt -w also fixed import-ordering drift (spec before vmshared alphabetically) in 8 test files from an earlier batch-script conflict resolution -- pure formatting, re-verified go build/vet/golangci-lint clean after. Adds the CHANGELOG entry for the merge round (conflict-resolution patterns, the one bug found+fixed, and the audit method used). Assisted-by: Claude (analysed on a live system)
…ator findings Renames the final-round CHANGELOG entry to the merge-time CalVer and appends the fresh pr-validator's independent findings: the delta re-gate onto post-#131 main, the adversarial spot-check of the BoxConfig/Op/BundleNode collision-handling, the R5 sweep, the investigation resolving why ~28 additional vmshared spec-passthrough-shaped symbols correctly stay out of this cutover's scope (their consumers sit in the not-yet-started K4 migration wave), the cross-PR sweep, and the no-`!`-marker justification. Assisted-by: Claude (analysed on a live system)
pr-validator — APPROVED ✅Change class: charly Go code (mechanical type-repoint sweep, zero behavior change claimed). Checklist
Architecture gateEvery one of the 23 repointed symbols IS an E-envelope type the boundary law says core should reference via placement: CORRECT Deep investigation (validator-initiated, resolved as NOT a defect)Cross-referencing Adversarial spot-checks (the 3 hardest documented collisions)
Merge-round (delta re-gate, done twice)The branch was Cross-PR sweep (comment-intake)Zero comments/reviews on #128 itself. #118 holds by design (merges last). #130/#112 (Codex-assisted) are scope-excluded per the standing operator directive; #130's own coordination thread (already posted by a teammate) covers its overlap with #131, unrelated to this repoint. Marker decision: no
|
opencharly/marketplace#128 landed as 1f85098, tagged v2026.216.1427, carrying the skill-side half of this cutover: three surfaces described `--repo` resolution as it was before it worked. This bump is what makes this PR's R5 sweep TRUE OF WHAT IT SHIPS. Review caught that the sweep was clean only in the working tree, because the `plugins` submodule was checked out at #128's then-unmerged branch head — while the gitlink this PR actually shipped (53d21497), and plugins origin/main, both still carried the falsified row. Merging then would have recorded a lying doc on charly@main. The ordering this PR already demonstrated one commit earlier for `spec` (bump only AFTER the producer merged) is now applied to `plugins` as well. The same review found the pasted sweep command missing its `-E`, so as transcribed it returned zero hits and "proved" clean trivially. The body now carries the executed alternation with `-E`; the two surviving hits are both sanctioned — plugins' own CHANGELOG (R5 history) and the generated docs projection that regenerates via `task docs:sync`. No re-gate owed: `plugins` is not in go.work (it holds skills and agent definitions, no compiled Go), and the binary is BYTE-IDENTICAL across this bump, so the final-tree gate at run-calver 2026.216.1347 still governs. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
Summary
The vmshared→spec envelope-route repoint (task #16, folded into the #52 alias-inventory theme). COMPLETE: all 23 spec-passthrough symbols repointed. These are E-envelope types the kernel is supposed to reference directly (per the boundary law) — the defect was the route (
vmshared, a forbidden mechanism kit), not the reference;sdk/specis core's explicitly-allowed import.6 commits, one symbol group at a time, each proactively collision-checked before the mechanical rewrite:
BoxConfigonUnifiedFile/Config, handled by hand.Opis a struct FIELD NAME shared by five unrelated structs (Operation.Op,OpStep.Op,Step.Op,Matcher.Op,ExternalPluginStep.Op), each usingOp:as a composite-literal key that must never be qualified. Generalized the rewrite tool's exclusion rule to catch any field-key position regardless of owning struct. One further edge case — a struct field DECLARATION (Op string, no colon in Go's declaration syntax) — evaded even that rule;go buildcaught the single instance immediately, fixed by hand.Remaining in
vmshared_aliases.go(correctly out of scope): 6 genuinevmsharedmechanism functions with nospecequivalent (InstallSignalHandler,ParseLibvirtURI,PollRemote,RegisterShutdownHook,SweepStaleTemps,pollUntil), plus the deploykit-defined E-envelope symbols (InstallPlan/DeployExecutor/etc.) tracked separately as task #13 (an SDK package-boundary move, sequenced after this).Bug classes found and fixed across the whole series (every one caught by
go build/go vetbefore shipping):spec(the established*VmSpecshorthand throughout VM code) shadowing the package import....Typevariadic ellipsis false-matching the "preceded by dot" selector-exclusion rule.Op:case, the most pervasive).Merge round: main (post-#127,
7be18e7/v2026.197.1051) merged inBrought the branch up to date with
main's just-landed PR #127 (alias dissolution, teardownrobustness, the VM disk-build engine's move into
candy/plugin-vm, the loader-residue fold).27 conflicted files, resolved by three patterns:
vmshared_aliases.go) — both branches independently shrunk thetype block (mine: the 23 repoint symbols; main's, from my own earlier PR refactor(core)!: wave-1 core hygiene — alias dissolution (#52) + teardown robustness (#55) + loader-residue fold (#46) + gitlink bumps + P8b Tier-1 (VM disk-build → plugin-vm) #127: DEAD+TESTONLY).
Resolved to the intersection of survivors.
vm_bootc_install.go/vm_bootstrap.go/vm_build.go/vm_cloud_image.gomoved tocandy/plugin-vm/vm_bootc_engine.go/vm_bootstrap_engine.gounder P8b-rest (restructured to take pre-resolved refs); took main'splugin-side versions wholesale since
candy/plugin-vmis alias-EXEMPT (a separate package withits own pre-existing
vmshared-importing convention). Same for thevm_disk_builder.go→vm_disk_layout.gorename and the unrelatedloader_driver.go→materialize.gorename(PR chore(box/cachyos): bump gitlink — charly-cachyos is no longer a check bed #46-super's loader-residue fold).
blocks,
bundle_members.go'stearDownMembers(main's refactor(check): core drives the kit plan walk through PlanContext (P5 consumer) #55 error-joining/--if-existsrework*BundleNode→*spec.BundleNoderepoint), and a few lines where main independentlyrenamed a function (
compileLocalPkgStep→deploykit.CompileLocalPkgStep) on the exact line myrepoint also touched.
One post-merge build failure, found and fixed (R1):
host_build_vm_build.go:142: undefined: VmDeployState. This file arrived via main's P8b-rest expansion (38→235 lines) and was never inthe 27-file conflict list (git auto-merged it cleanly, since my repoint never touched it before),
so it was never individually checked against the repoint.
VmDeployStateIS one of the 23repointed symbols (sub-batch 2) — fixed the one call site to
*spec.VmDeployState.Audit method: the lighter form (per revised guidance — gofmt -r is NOT a reliable AST-safety
oracle for composite-literal keys/locals, so it cannot serve as an independent verification tool)
Chose the lighter audit (proactive scan + go build/vet/test across the whole merged tree, not a
full per-hunk gofmt-r-delta classification) because the residual risk category — a bare reference
to one of the 23 old alias names surviving somewhere the 27-conflict list didn't cover — is a
guaranteed hard compile error, never a silent pass: package main no longer declares any of
the 23 old bare names at all after the repoint, so a missed site cannot both go unqualified and
still compile.
go build/go vet/go test, run clean acrosscharlyAND every touched pluginmodule (
plugin-vm,plugin-box,plugin-build,plugin-loader,plugin-tunnel), is acomplete proof for that risk class — and is exactly what caught the one real bug above.
Supplemented with a proactive grep across every touched non-test file for the ONE class a
compiler can't catch (a rewrite landing inside a string literal instead of code): found only
legitimate prose/real-code matches (error-message text referencing real
spec.package symbols,one pre-existing local variable named
spec), no corruption.Test plan
Every one of the 6 original commits passed the full gate individually:
go build/go vet/go test ./...(~90-120s),gofmt -l .+golangci-lint fmt --diffclean,golangci-lint run ./...0 issues, an R5 grep self-test,task build:binary+charly box validateexit 0.Merge-round final gate (this round, on the fully merged tree):
go build/go vet/go test ./...green oncharly(100s) and all 5 touched plugin modules;golangci-lint run ./...0 issues;gofmt -l .+golangci-lint fmt --diff— found and fixed import-orderingdrift (
specbeforevmsharedalphabetically) in 8 files from an earlier batch conflictresolution via
gofmt -w .(pure formatting), re-verified green after;task build:binaryclean (
charly version= 2026.197.1120);charly box validateexit 0, zero warnings;git submodule update --init --recursive— all 8 submodule gitlinks resolved forward,git submodule statusclean.Confirmation bed (one bed, per team-lead's ruling that this type-route-only,
zero-behavior-change repoint doesn't need a full bed roster — main's HEAD already passed 7
beds at the refactor(core)!: wave-1 core hygiene — alias dissolution (#52) + teardown robustness (#55) + loader-residue fold (#46) + gitlink bumps + P8b Tier-1 (VM disk-build → plugin-vm) #127 landing):
charly check run check-sidecar-pod:(started 13:32:13, finished 13:38:50 — ~6m37s; a real podman build + pod deploy + 12-step
check-plan cycle, exit code 0)
https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif