Repository navigation
feat(vm)!: externalize the VM CLI into compiled-in command:vm (P10) - #64
Conversation
The last welded machinery command falls. charly vm ... (build/create/start/ stop/destroy/console/ssh/snapshot/gpu/import/clone/cp-box/list) moves OUT of core into the COMPILED-IN command:vm plugin (candy/plugin-vm), dispatched IN-PROC via Invoke(OpRun) with native stdio/TTY; the hidden __vm forwarder is deleted. Core keeps ONLY the kind-blind seam machinery. Four generic host<->plugin seams (F11 class-generic action nouns): - config-resolve (host_build_config_resolve.go): the host resolves the project config for one entity once (LoadUnified/ResolveRuntime/resolveVmBackend + #Vm defaults + persisted ledger state) and ships spec.ConfigResolveReply. - config-persist: the WRITE twin; the deploy-ledger lock stays host-side. - vm-build (host_build_vm_build.go): the VM-disk build engine stays core (P8-consistent); the thin vm build command forwards its flags. - egress->verb:egress, preempt->verb:arbiter, gpu->verb:gpu via InvokeProvider; the libvirt/qemu engine is a direct in-package call. Core deletions (R5): compiled_plugins += plugin-vm; main.go __vm + the false "LAST WELDED / Run handlers STAY core" framing deleted; 11 CLI files + 4 stale tests removed; the backend/lifecycle + shared GPU/SSH/scp helpers core still uses extracted to vm_backend_lifecycle.go / kept via surgery; the VM-disk build engine stays core behind the vm-build seam. Dead-code sweep (R5): golangci-lint (not run by the prior gate) surfaced 21 unused symbols the extraction orphaned (callers lived in the deleted CLI files) - all deleted: the 6 vm-cmd-only driver-switch shims (gpu_shim.go), arbiterProxy.clearPoison/resourcePoisoned (preempt.go), the whole dead create-RPC path (invokeVmCreate/vmCreateRenderedXML/vmCreateReq/vmPluginEnv. Create - create runs in-proc in the plugin now), 9 aliases (vmshared_aliases. go), hostArchRuntime+runtime import (bundle_add_cmd_vm.go), memlockUnlimited (devices.go). golangci-lint run 0 issues; grep on every deleted id -> only candy/plugin-vm + CHANGELOG. R10 (final post-deletion code, run 2026.193.0514): check-charly-vm 7/7 (total 255s, update 114s fresh-rebuild) + check-k3s-vm 7/7 (total 197s, update 80s), both exit 0, disposable teardown clean; golangci-lint 0 issues; go test ./... + vet + gofmt green; F11 gate green. Producer: opencharly/sdk (seam wire types) merged + tagged first (v0.2026193. 447); this commit bumps the sdk gitlink + charly/go.mod require. The plugins gitlink bump carries the R5 doc half of this cutover (plugins#29 - 15 vm source-map skill refs re-homed) + the Option A agent-spec tooling (plugins#28, per operator batching directive). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
pr-validator — APPROVED ✅Change class: charly/sdk Go (RUNTIME) — command/loader/deploy spine + a cross-cutting compiled-in-plugin move (P10: the VM CLI externalized into the compiled-in Independently re-derived against R0–R10 + the pillars, trusting no author claim. Re-ran every cheap gate live; cross-checked the R10 bed evidence on disk and proved it tested the final committed code. Checklist (all 18 PASS):
Decision: All gates I re-ran are green (build/vet/test, gofmt clean, golangci-lint 0 issues — the exact gate whose prior omission this PR's dead-code sweep exists to fix), R5 grep clean, security clean, boundary clean, gitlinks on Assisted-by: Claude (analysed on a live system) |
Rename the P10 CHANGELOG placeholder to the merge-time CalVer and rewrite its H1 to match. Version generated at merge by pr-validator. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01RCB6p1kLh2V3zrDnJXpzZ3
Summary
P10 — the VM CLI family externalized into the COMPILED-IN
command:vmplugin. The last welded machinery command falls:charly vm …(build / create / start / stop / destroy / console / ssh / snapshot / gpu / import / clone / cp-box / list) moves OUT of charly core into candy/plugin-vm, dispatched IN-PROC viaInvoke(OpRun)— so the handlers run in charly's own process with native stdio/TTY (console/ssh stay interactive), owning the CLI + the libvirt/qemu engine in-package. The hiddencharly __vmforwarder is deleted; core keeps ONLY the kind-blind seam machinery.The four host↔plugin seams (F11 class-generic action nouns)
A compiled-in command plugin imports only the sdk, so it reaches the host-only core Mechanisms over generic F10 reverse-channel seams:
config-resolve(charly/host_build_config_resolve.go) — the host resolves the project config for one entity ONCE (LoadUnified + ResolveRuntime + resolveVmBackend +#Vmdefaults + the persisted ledger state) →spec.ConfigResolveReply; the plugin owns every downstream action.config-persist— the WRITE twin; the deploy-ledger persist/remove runs host-side under its blocking config lock (a core Mechanism the plugin cannot hold across the module boundary).vm-build(charly/host_build_vm_build.go) — the VM-disk build engine (privileged pacstrap/bootc/cloud-image → qcow2) STAYS core, exactly as the box-build engine stayed core behindHostBuild("image")in P8; the thinvm buildcommand forwards its flags.verb:egress, preempt →verb:arbiter, GPU →verb:gpuviaInvokeProvider; the libvirt/qemu engine is a direct in-package call.Core deletions (R5 — the dead dual path is gone)
charly.ymlcompiled_plugins:+=plugin-vm(F8; the go-libvirt + govmm + libvirtxml stack now compiles into charly for this canonical placement).main.go: the hidden__vmcommand + the false "LAST WELDED machinery command / Run handlers STAY core / cannot move to the plugin" framing DELETED.charly/vm_backend_lifecycle.go; the shared GPU/SSH/scp helpers kept via surgery on gpu_allocate.go + vm_scp.go. The VM-disk build engine stays core behind the vm-build seam.__vm-forwarder design to the compiled-in reality;git grep '__vm'clean.Dead-code sweep — the extraction's orphaned core symbols (R5, folded in this landing)
golangci-lint run(which the prior gate did NOT run — it rango test+ F11 only) surfaced 21 unused symbols the extraction orphaned: their only callers lived in the deleted CLI files. All deleted here (each confirmed zero non-def callers + no surviving test ref; the plugin carries every equivalent): the 6 vm-cmd-only driver-switch shims ingpu_shim.go;arbiterProxy.clearPoison/resourcePoisonedinpreempt.go; the whole dead create-RPC path invm_plugin_client.go(invokeVmCreate,vmCreateRenderedXML, thevmCreateReqstruct +vmPluginEnv.Createfield — create now runs in-proc in the plugin); 9 unreferenced aliases invmshared_aliases.go;hostArchRuntime(+ theruntimeimport) inbundle_add_cmd_vm.go;memlockUnlimited(+ its stale doc-comment) indevices.go. After the sweep:golangci-lint run0 issues,go build/vet/test ./.../gofmtgreen, andgit grepon every deleted id returns onlycandy/plugin-vm/**+CHANGELOG/.Change class
charly Go touching the loader/command/deploy spine + a cross-cutting compiled-in-plugin move → RUNTIME class. Gate:
go test ./charly+task build:charly(R9) + the vm check beds.R10 evidence (both vm beds, fresh-rebuild
updategate, disposable teardown clean, exit 0)Final-code run
2026.193.0514— re-run on the FINAL post-deletion code (the 21-symbol dead-code sweep above included; binary rebuilt viatask build:charly),.check/<bed>/2026.193.0514/summary.yml:ok: true· exit 0.ok: true· exit 0.golangci-lint run0 issues;go test ./...+go vet+gofmtGREEN; F11 uniform-API gate GREEN; zero warnings. Aftertask build:charlyon the FINAL post-deletion code,charly vm list/createroute ONLY through the compiled-incommand:vm(core CLI gone) and render a real VM through the seams live on both beds.CLAUDE.md compliance
__vm+ the CLI handlers + all stale refs/docs deleted in one commit; grep self-test clean.vm-build(P8-consistent), like config loader behindconfig-resolve.Producer: opencharly/sdk (the seam wire types) merged + tagged first; this PR bumps the sdk gitlink to the merged commit + the
charly/go.modrequire to the merged sdk tag.Plugins gitlink bump — carries TWO merged plugins commits: (a) the R5 doc half of THIS cutover (opencharly/marketplace#29 — 15 vm source-map skill refs re-homed to their post-P10
candy/plugin-vm/+charly/vm_backend_lifecycle.gohomes; the R5 grep self-test that P10's code deletions require), and (b) the Option A agent-spec tooling (plugins#28 — the 6 roster agents gainSkill/SendMessage/Write), which rides along per the operator batching directive.Assisted-by: Claude (fully tested and validated)
https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif