Skip to content

fix(vm)!: key the per-host VM state by its deploy identity (sdk#301 consumer leg) - #52

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/c6-descent
Sep 27, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/c6-descent

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The plugin-vm consumer leg of sdk#301 (v0.2026270.3). sdk#301 retired the vm:-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's vm: cross-ref. plugin-vm was still computing the retired vm:<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) to deploykit.SaveVmDeployState, not "vm:"+domainID. Load-bearing: the compiled-in readers (plugin-check's FindVmDeployNode/ResolveVmSshPort and plugin-deploy-vm's resolvePriorVmState) all look up the identity key.
  • charly vm destroy removes the IDENTITY-keyed entry when --domain names it; a direct charly vm destroy <entity> (no --domain) uses the vm:<entity> addressing form, whose From-scan resolves the deploy-keyed entry via its vm: cross-ref.
  • charly vm build resolves its persisted ExistingState by the exact IDENTITY key (the retired vm:<identity> key's identity part) — not a scan by the vm: entity cross-ref, which is ambiguous when sibling beds share one entity.

Dependency pins. candy/plugin-vm/go.mod moves github.com/opencharly/sdk v0.2026269.1204 → v0.2026270.152 and github.com/opencharly/spec v0.2026269.1205 → v0.2026269.2150. The spec move is required by the sdk pin: [email protected]'s own go.mod requires spec v0.2026269.2150, so MVS resolves spec to 2150 (matching go.sum's two new hashes).

Companion: plugin-deploy-vm (its OpPostTeardown RemoveEntries key), which the bed resolves at runtime.

How tested

Head 08d23fb57b352aeb4868a4326009f36da1435a5e; diff go.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):

charly check run check-r10-two-vm: [check-live] FAIL after 32.571s: exit 1
charly: error: command "check": resolving local vm deploy state for "check-r10-two-vm":
  ambiguous vm deploy lookup for "check-r10-two-vm" (vm "r10-vm"): both "vm:check-r10-two-vm"
  and "vm:r10-vm-member" declare from "r10-vm" — the caller must resolve the exact deploy node
  instead of scanning by entity
charly check run check-r10-two-vm: FAIL (steps=6)

With the change (charly built at sdk v0.2026270.152 with a temporary replace 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 via CHARLY_REPO_OVERRIDE; disposable bed):

$ charly check run check-r10-two-vm
charly check run check-r10-two-vm: [bring-up-members] PASS
charly check run check-r10-two-vm: [check-live] START
charly check run check-r10-two-vm: [cleanup-members] PASS after 1m12.89s
charly check run check-r10-two-vm: PASS (steps=13)

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 build path is exercised live by this bed: 2026.270.0314/vm-build.log shows Building VM "r10-vm" (source.kind=cloud_image), so resolveVmBuild (the changed LookupKey) ran; its lookup is a miss here (no per-host entry is named r10-vm), exactly as pre-#301.

Repo gate:

$ gofmt -l .
$ go vet ./...
(clean)
$ go test ./...
ok  	github.com/opencharly/plugin-vm/candy/plugin-vm	24.530s

Rulebook compliance

  • R1 — the failure was RCA'd to sdk#301's key change; the review-flagged vm_build_resolve.go entity scan was itself RCA'd and replaced by the exact identity key.
  • R2 — the whole plugin-vm consumer surface is fixed here; the plugin-deploy-vm leg and the charly pin bump follow in this cutover.
  • R3 — reuses the sdk's ONE canonical identity keying (SaveVmDeployState/RemoveVmDeployEntry/LookupKey); the newly-introduced entity scan was removed, not kept.
  • R4 — no workaround: the identity key is the sdk's one documented lookup; no scan/fallback added.
  • R5 — no vm:-keyed state write or read remains in plugin-vm; the surviving vm: strings are the still-valid CLI ADDRESSING form (charly vm destroy <entity>), not the retired state key.
  • R6 — no destructive or history-rewriting operation; the destroy path's intent is unchanged (only its key).
  • R7 — the live bed FAILs before and PASSes after (both pasted).
  • R8 — the emitted per-host overlay (user-visible config) is validated live: identity-keyed, no vm:-keyed entries.
  • R9 — the changed plugin was built and served from THIS tree in the live run (dev-tree override/replace, stated above).
  • R10 — the disposable charly check run check-r10-two-vm gate ran to completion (PASS (steps=13)) against this tree.

Change classification

  • Change class: Candy/plugin (a plugin candy whose behaviour is observable at the charly VM-bed boundary) → build + run a bed that composes the changed entity. The composing bed is charly's check-r10-two-vm, run live against this tree (dev-tree override/replace, pasted).
  • Verification gate: plugin gofmt/go vet/go test + the live check-r10-two-vm bed (fails-before / passes-after).
  • Attribution tier: fully tested and validated.

Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

…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)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: fa8b855d143af3831e8bf7d4cdf68c7ba969c87e (branch: feat/c6-descent)

Change class: candy/plugin code change (Go) + go.mod/go.sum dependency pins. Security screen (T1–T4): no finding — no secrets, no network/egress, no guardrail weakening, no self-instruction; the sdk/spec pins move to the versions the body names.

Blocks

  1. A1 — the rulebook-compliance section does not answer every applicable rule. The section answers only R1, R2, R5, R7, R9. For a plugin code change the applicable rules also include R3 (no duplication — relevant: vm_build_resolve.go hand-rolls a From-scan), R4 (no ad-hoc workarounds), and R6/R10 (destructive vm destroy / disposable+fresh-rebuild+coverage). None of these is answered with a one-line HOW or N/A — <reason>. Add each missing applicable rule, or state N/A — <reason>.

  2. A1 — the Summary does not account for the spec pin bump. candy/plugin-vm/go.mod bumps both github.com/opencharly/sdk v0.2026269.1204 → v0.2026270.152 and github.com/opencharly/spec v0.2026269.1205 → v0.2026269.2150 (with matching new go.sum hashes). The Summary names only the sdk bump; a diff item missing from the body's accounting is a defect. State why spec moved and whether it is required by the sdk pin.

  3. R1/R3 — candy/plugin-vm/vm_build_resolve.go (new for _, e := range dc.Deploy { if e.From == boxName { … break } }) reintroduces exactly the scan-by-entity the PR's own RCA forbids. The body's pasted failure is ambiguous vm deploy lookup … both "vm:check-r10-two-vm" and "vm:r10-vm-member" declare from "r10-vm" — the caller must resolve the exact deploy node instead of scanning by entity. The replacement build code resolves by the vm: entity cross-ref (e.From == boxName) and silently takes the first match, with no ambiguity handling. When two entries share the entity (as your own evidence shows) it resolves the wrong entry — and if dc.Deploy is map-backed, non-deterministically. Resolve the exact deploy node (identity key) or surface the ambiguity, consistent with the RCA; do not land a new scan-by-entity call site. Also confirm whether check-r10-two-vm actually exercises charly vm build — if not, the changed build path never ran live and the fully tested and validated tier is inflated for it (A3).

Comment thread: empty (0 comments) — nothing to consider.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…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)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 08d23fb57b352aeb4868a4326009f36da1435a5e (branch: feat/c6-descent)

Change class: candy/plugin code (Go) + go.mod/go.sum dependency pins — requires build + a bed composing the changed entity.

Security screen (T1–T4): PASS — no secrets/egress, no network/endpoint additions, no guardrail/validator/rulebook edits, no embedded instructions; the sdk/spec pin moves match the body's MVS explanation and the four new go.sum hashes.

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 (runVmSpecCreate identity persist, identity-aware destroy, resolveVmBuild LookupKey(boxName)) executed against the rebuilt tree; tier fully tested and validated is justified; placement: CORRECT (capability stays in the plugin candy; no core/sdk re-coupling, no alias growth, no new core mechanism import).

Comment 5852446248 (prior BLOCK @ fa8b855): stale-superseded — re-derived against the current head; all three blocks are resolved: (1) the rulebook section now answers R1–R10, not just R1/R2/R5/R7/R9; (2) the Summary/Dependency-pins paragraph now accounts for the spec v0.2026269.1205 → v0.2026269.2150 bump and why the sdk pin forces it; (3) the vm_build_resolve.go entity scan (for _, e := range dc.Deploy { if e.From == boxName … }) is gone, replaced by the exact identity dc.LookupKey(boxName) — so the block-3 R1/R3 concern no longer reproduces.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 27, 2026 04:02
@github-actions
github-actions Bot merged commit 3211add into main Sep 27, 2026
1 of 2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 27, 2026
aitrawog added a commit to opencharly/charly that referenced this pull request Sep 27, 2026
…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)
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Sep 27, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants