Repository navigation
fix(deploykit)!: resolve the host-libvirt VM by its stamped descent, not the substrate word (C6) - #311
Conversation
…not the substrate word
FindVmDeployNode read `e.Target == "vm"` — the last residual `.Target`
substrate-word comparison in the deploy Mechanism (the C6 crutch). The node's
substrate identity is already carried by the loader-STAMPED Descent
(loaderkit.StampDeployDescents re-derives it from the substrate plugin's
declared #DeployTraits on every project AND per-host overlay load), so the
lookup now reads `deploy.IsVmVenue` (the ssh venue + the exclusive
host-resource lease) — the trait, never the word.
IsVmVenue selects exactly the former `Target == "vm"` set: it excludes the
ssh-venue kubevirt substrate (no exclusive lease), whose Target is its own word.
The word-sniff never needed the deploy state to persist a derived field: a live
spike proved a per-host overlay read through the real LoadUnified yields
Descent{Venue:"ssh", ExclusiveVenue:true} for a `vm:` entry with no persisted
`descent:` — so this is a pure consult-site migration, no state-schema change.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — an SDK-library change ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…f text No code change: the comments now name the removed substrate-word sniff in prose, so the R5 grep self-test for a substrate-word Target comparison returns zero live hits (the gate's AST scan already ignores comments). Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/obfuscation; no guardrail or validator/rulebook change; the new import ( Comment 5851692229 (prior BLOCK) — stale-superseded. Re-derived against the current head: its block 2 (body Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Closes C6 of the core/plugin-independence crutch sweep: the ONE residual
.Targetsubstrate-word read in the deploy Mechanism.sdk/deploykit/deploy_state.go'sFindVmDeployNodeidentified a host-libvirt VM deploy by comparinge.Target == "vm"— a switch on the concrete substrate kind word, which the kernel/plugin boundary law forbids (consult the trait, never the word). The node's substrate identity is already carried by the loader-STAMPEDDescentdescriptor:loaderkit.StampDeployDescentsre-derives it from the substrate plugin's declared#DeployTraitson every load — both aLoadUnified'd project tree (rp.Deploy, the plugin-checktree) and a per-host overlay read (LoadHostDeployConfigViaExecutor→LoadUnifiedViaExecutor→LoadUnified).The fix reads
deploy.IsVmVenue(&e)(the ssh venue + the exclusive host-resource lease) — the same canonical predicate the rest ofsdk/deploykitalready uses (deploy_members.go).IsVmVenueselects exactly the formerTarget == "vm"set: it deliberately excludes the ssh-venuekubevirtsubstrate (which declares noexclusive_venue), whoseTargetis its own word (kubevirt, perloaderkit.DeployTargetForDisc).Why no state-schema change was needed (the plan's premise, verified — not re-litigated)
The settled C6 plan proposed persisting
Descentin the deploy state so the reader could recover the substrate. That premise was verified against the live code and does not hold:MarshalDeployNodedoes dropdescent:on write, but the read path re-stamps it. A live spike —LoadUnifiedover a per-host-stylecharly.ymlwith avm:entry and nodescent:— returned:Persisting a derived field would therefore be dead weight (immediately overwritten on reload) and would re-introduce the derived-field round-trip Cutover H deliberately removed. The residual word-read was simply an un-migrated P9 consult site; this PR migrates it. The
specrepo is untouched (no schema change is required).How tested
Final head
5950b38dd249e2360cb017f268a69b0fe13513d5(two commits); diffdeploykit/deploy_state.go+15/−4,deploykit/deploy_state_test.go+44/−4.Fails without the change (old
e.Target == "vm"word-sniff restored, test otherwise unchanged):With the change (the real source):
The repo's own committed module CI green on the PR head (
.github/workflows/ci.yml=gofmt+go vet+go test+ a 4-archcross-compilematrix; nocharly.yml, so no bed can exist — the matrix's Contract / library module class):Full module suite (
env -u GOFLAGS GOFLAGS= go test ./...): every packageok(sdk,agentkit,buildkit,candywalk,charlylib,checkkit,cmd/charly-lib-gen,deploykit,enginekit,kit,llmkit,loaderkit,packagekit,vmshared).The
no disposable targetpremise — executed, not asserted (R10 matrix, Contract / library module row):R5 self-test — raw output (no live substrate-word
.Targetcomparison survives; the three remaining comparisons are against the empty string, not a substrate word):RDD — the
Descent-stamp premise proven live before the edit (the spike quoted under Summary; theIsVmVenueexclusion of kubevirt is asserted in the new test's complement case).The consumer live boundary (per the matrix's library row — "the bed rides the consumer change"): the consumer PR opencharly/charly bumps this pin and runs the VM bed
check-r10-two-vm, whose members'check liveplans aggregate throughplugin-check'spluginLoadVmCheckPlans→deploykit.FindVmDeployNode(the changed function), plus the per-host overlay read arm at the same call site.Rulebook compliance
Descent") was verified against the live code and found stale; the correction (re-stamp on read) is recorded here and in the code comment rather than silently implemented.deploy.IsVmVenue; no new per-kind branch or map..Targetcomparisons remain insdk/deploykit.Change classification
charly.ymlproject, nomain/deployable target, nodisposable: trueentity — thegithub.com/opencharly/sdkcontract module). Its R10 gate is the repo's own committed module CI green on the PR head plus the executed negative-claim proof (both pasted above); no bed can exist in the module, and the consumer boundary bed rides the consumer PR (producer→consumer)..github/workflows/ci.ymlgreen (gofmt/go vet/go test+ 4-archcross-compile), the fails-without-change proof, the liveDescent-stamp spike, and the raw R5 grep.fully tested and validated— the matrix fixes the tier for this class on a clean pass of its gate (pasted).Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)