Repository navigation
fix(vm)!: key the per-host VM state by its deploy identity (sdk#301 consumer leg) - #52
Conversation
…01 consumer leg) sdk#301 (v0.2026270.3) retired the `vm:`-prefixed per-host overlay key: the per-host deploy state is now keyed by the deploy IDENTITY, with the VM ENTITY carried in the entry's `vm:` cross-ref. This is the plugin-vm consumer leg. - `charly vm create`'s port_auto persist now passes the IDENTITY (domainID) to SaveVmDeployState, not `"vm:"+domainID` — so the compiled-in reader (plugin-check / plugin-deploy-vm, via the sdk's identity lookups) finds it. - `charly vm destroy` removes the IDENTITY-keyed entry when --domain names it, and uses the `vm:<entity>` ADDRESSING form (the sdk's From-scan) for a direct entity destroy. - `charly vm build` resolves its persisted state through the entry's `vm:` cross-ref (From-scan) instead of the retired `vm:<entity>` key. - Bump the sdk pin to v0.2026270.152. Proven live: `charly check run check-r10-two-vm` PASS (steps=13) with this plugin plus the plugin-deploy-vm teardown-key companion. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: candy/plugin code change (Go) + Blocks
Comment thread: empty (0 comments) — nothing to consider. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…y scan (R1/R3) The first cut translated the retired `vm:<identity>` lookup into a scan by the `vm:` entity cross-ref — the exact scan-by-entity the RCA forbids (ambiguous when sibling beds share one entity, non-deterministic on a map). The faithful translation is the IDENTITY key itself (the retired key's identity part), which resolves the exact deploy entry with no ambiguity. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Change class: candy/plugin code (Go) + Security screen (T1–T4): PASS — no secrets/egress, no network/endpoint additions, no guardrail/validator/rulebook edits, no embedded instructions; the Checklist: All applicable rules PASS or NA — the body accounts for every changed file (incl. both pins), pastes fails-before/passes-after output, names the gate/target/fresh rebuild, and answers R1–R10; the changed primary paths ( Comment 5852446248 (prior BLOCK @ Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…026270.402) The compiled-in plugin-vm now keys the per-host VM state by the deploy identity (opencharly/plugin-vm#52), so the sdk#301 identity-keyed reader finds it. The external plugin-deploy-vm companion (opencharly/plugin-deploy-vm#26) is resolved at runtime from its merged tag. Proven live: check-r10-two-vm PASS (steps=13). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…d; gate sdk coverage restored; sdk#301 consumer pins (#704) * feat(charly)!: close C6 — delete the deploy-mechanism substrate-word read; restore the gate's sdk coverage Bump the sdk pin to v0.2026270.152 (the merged C6 sdk change), which deletes the last `.Target == "<substrate>"` read in sdk/deploykit: FindVmDeployNode now reads the loader-stamped descent via deploy.IsVmVenue. Drop the now-obsolete `deploy_state.go` entry from the P9 word-switch gate's allowlist, and restore the gate's sdk/deploykit coverage. Its `../sdk/deploykit` glob assumed an in-tree sdk submodule and has matched NOTHING since the sdk de-submodule cutover, so the gate silently lost the deploy-Mechanism half of its contract (the allowlist entry it carried was a no-op). The sdk source is now located through the build's own module resolution (`go list -m`), and an empty result is a hard failure — a gate that scans nothing must not pass. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * chore(charly): pin plugin-vm to the merged sdk#301 consumer leg (v0.2026270.402) The compiled-in plugin-vm now keys the per-host VM state by the deploy identity (opencharly/plugin-vm#52), so the sdk#301 identity-keyed reader finds it. The external plugin-deploy-vm companion (opencharly/plugin-deploy-vm#26) is resolved at runtime from its merged tag. Proven live: check-r10-two-vm PASS (steps=13). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Summary
The plugin-vm consumer leg of sdk#301 (
v0.2026270.3). sdk#301 retired thevm:-prefixed per-host overlay key: the per-host deploy state is now keyed by the deploy IDENTITY (the same string the tree/config/CLI use), with the VM ENTITY carried in the entry'svm:cross-ref. plugin-vm was still computing the retiredvm:<domainID>key itself, so its writes no longer matched the identity-keyed readers — the failure my C6 bed surfaced.charly vm create's port_auto persist now passes the IDENTITY (domainID) todeploykit.SaveVmDeployState, not"vm:"+domainID. Load-bearing: the compiled-in readers (plugin-check'sFindVmDeployNode/ResolveVmSshPortandplugin-deploy-vm'sresolvePriorVmState) all look up the identity key.charly vm destroyremoves the IDENTITY-keyed entry when--domainnames it; a directcharly vm destroy <entity>(no--domain) uses thevm:<entity>addressing form, whose From-scan resolves the deploy-keyed entry via itsvm:cross-ref.charly vm buildresolves its persistedExistingStateby the exact IDENTITY key (the retiredvm:<identity>key's identity part) — not a scan by thevm:entity cross-ref, which is ambiguous when sibling beds share one entity.Dependency pins.
candy/plugin-vm/go.modmovesgithub.com/opencharly/sdk v0.2026269.1204 → v0.2026270.152andgithub.com/opencharly/spec v0.2026269.1205 → v0.2026269.2150. The spec move is required by the sdk pin:[email protected]'s owngo.modrequiresspec v0.2026269.2150, so MVS resolves spec to 2150 (matchinggo.sum's two new hashes).Companion: plugin-deploy-vm (its
OpPostTeardownRemoveEntrieskey), which the bed resolves at runtime.How tested
Head
08d23fb57b352aeb4868a4326009f36da1435a5e; diffgo.mod±2,go.sum+4,vm.go+10/−5,vm_build_resolve.go+5/−1,vm_create_orchestrate.go+4/−3.Fails without the change (the pre-fix
vm:key, live disposable bed):With the change (charly built at sdk
v0.2026270.152with a temporaryreplace github.com/opencharly/plugin-vm/candy/plugin-vm => <this tree>so the compiled-in plugin is THIS source; plugin-deploy-vm served from its companion tree viaCHARLY_REPO_OVERRIDE; disposable bed):The per-host overlay after the run contains no
vm:-keyed entries (identity-keyed entries written and removed by the identity-aware teardown).The
vm buildpath is exercised live by this bed:2026.270.0314/vm-build.logshowsBuilding VM "r10-vm" (source.kind=cloud_image), soresolveVmBuild(the changedLookupKey) ran; its lookup is a miss here (no per-host entry is namedr10-vm), exactly as pre-#301.Repo gate:
Rulebook compliance
vm_build_resolve.goentity scan was itself RCA'd and replaced by the exact identity key.SaveVmDeployState/RemoveVmDeployEntry/LookupKey); the newly-introduced entity scan was removed, not kept.vm:-keyed state write or read remains in plugin-vm; the survivingvm:strings are the still-valid CLI ADDRESSING form (charly vm destroy <entity>), not the retired state key.vm:-keyed entries.charly check run check-r10-two-vmgate ran to completion (PASS (steps=13)) against this tree.Change classification
check-r10-two-vm, run live against this tree (dev-tree override/replace, pasted).gofmt/go vet/go test+ the livecheck-r10-two-vmbed (fails-before / passes-after).fully tested and validated.Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)