Skip to content

fix(deploykit)!: resolve the host-libvirt VM by its stamped descent, not the substrate word (C6) - #311

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

Closes C6 of the core/plugin-independence crutch sweep: the ONE residual .Target substrate-word read in the deploy Mechanism.

sdk/deploykit/deploy_state.go's FindVmDeployNode identified a host-libvirt VM deploy by comparing e.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-STAMPED Descent descriptor: loaderkit.StampDeployDescents re-derives it from the substrate plugin's declared #DeployTraits on every load — both a LoadUnified'd project tree (rp.Deploy, the plugin-check tree) 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 of sdk/deploykit already uses (deploy_members.go). IsVmVenue selects exactly the former Target == "vm" set: it deliberately excludes the ssh-venue kubevirt substrate (which declares no exclusive_venue), whose Target is its own word (kubevirt, per loaderkit.DeployTargetForDisc).

Why no state-schema change was needed (the plan's premise, verified — not re-litigated)

The settled C6 plan proposed persisting Descent in the deploy state so the reader could recover the substrate. That premise was verified against the live code and does not hold: MarshalDeployNode does drop descent: on write, but the read path re-stamps it. A live spike — LoadUnified over a per-host-style charly.yml with a vm: entry and no descent: — returned:

SPIKE Deploys() "charly-local-vm" Target="vm" From="eval-vm" Descent=&{Transport:ssh Venue:ssh MachineVenue:true ExclusiveVenue:true ...}

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 spec repo is untouched (no schema change is required).

How tested

Final head 5950b38dd249e2360cb017f268a69b0fe13513d5 (two commits); diff deploykit/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):

$ go test ./deploykit/ -run TestFindVmDeployNode_ReadsStampedDescentNotTargetWord -v
=== RUN   TestFindVmDeployNode_ReadsStampedDescentNotTargetWord
    deploy_state_test.go:458: entity scan of a descent-stamped, Target-less vm node: ok=false err=<nil>; want true, nil
--- FAIL: TestFindVmDeployNode_ReadsStampedDescentNotTargetWord (0.00s)
FAIL

With the change (the real source):

$ gofmt -l .
$ env -u GOFLAGS GOFLAGS= go vet ./...
(clean)
$ env -u GOFLAGS GOFLAGS= go test ./deploykit/ -run TestFindVmDeployNode -v
--- PASS: TestFindVmDeployNode_AmbiguousFallbackErrors (0.00s)
--- PASS: TestFindVmDeployNode_ReadsStampedDescentNotTargetWord (0.00s)
PASS
ok  	github.com/opencharly/sdk/deploykit	0.021s

The repo's own committed module CI green on the PR head (.github/workflows/ci.yml = gofmt + go vet + go test + a 4-arch cross-compile matrix; no charly.yml, so no bed can exist — the matrix's Contract / library module class):

$ gh pr checks 311 -R opencharly/sdk
go	pass	1m29s
cross-compile (amd64)	pass	1m11s
cross-compile (arm64)	pass	25s
cross-compile (arm)	pass	1m7s
cross-compile (386)	pass	1m17s

$ for a in amd64 arm64 arm 386; do GOOS=linux GOARCH=$a CGO_ENABLED=0 go build ./... && echo "build linux/$a ok"; done
build linux/amd64 ok
build linux/arm64 ok
build linux/arm ok
build linux/386 ok

Full module suite (env -u GOFLAGS GOFLAGS= go test ./...): every package ok (sdk, agentkit, buildkit, candywalk, charlylib, checkkit, cmd/charly-lib-gen, deploykit, enginekit, kit, llmkit, loaderkit, packagekit, vmshared).

The no disposable target premise — executed, not asserted (R10 matrix, Contract / library module row):

$ git ls-files | grep -c charly.yml          # no charly.yml project -> no bed can exist
0
$ git grep -n 'disposable: true' -- ':!CHANGELOG/*'   # every hit is a Go literal/fixture, never a deployable entity
deploykit/deploy_nodeform_disc_test.go:34:  {"no workload -> group", "disposable: true\n", "group"},
deploykit/deploy_state.go:569:              // a user-authored `disposable: true` in place.
deploykit/secret_probe_test.go:158:         // `disposable: true` bed).
loaderkit/config_stack_test.go:124:         "version: ...\nbed:\n    pod:\n ... disposable: true\n ..."
loaderkit/deploy_load.go:133:               // ... a check bed is itself a `disposable: true` deploy, so a
loaderkit/parse_candy_manifest_fallback_test.go:27:  disposable: true
loaderkit/scan_candy_project_root_test.go:29:        disposable: true
loaderkit/validate_check_beds.go:44:        "kind:check bed %q must set `disposable: true` ..."

R5 self-test — raw output (no live substrate-word .Target comparison survives; the three remaining comparisons are against the empty string, not a substrate word):

$ grep -rn '\.Target *[=!]= *"' deploykit/*.go | grep -v _test.go
deploykit/deploy_state.go:513:	if input.Target != "" && entry.Target == "" {
deploykit/deploy_tree.go:72:	if node == nil || node.Target == "" {
deploykit/quadlet_pod.go:116:		} else if s.Target != "" {

RDD — the Descent-stamp premise proven live before the edit (the spike quoted under Summary; the IsVmVenue exclusion 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 live plans aggregate through plugin-check's pluginLoadVmCheckPlans → deploykit.FindVmDeployNode (the changed function), plus the per-host overlay read arm at the same call site.

Rulebook compliance

  • R1 — the plan's stated root cause ("the loader cannot recover the node's substrate from 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.
  • R2 — the whole C6 scope: the word-read is deleted here, and the matching allowlist entry is removed in the consumer PR (charly) in the same cutover.
  • R3 — reuses the ONE canonical predicate deploy.IsVmVenue; no new per-kind branch or map.
  • R5 — raw grep self-test pasted above: zero live substrate-word .Target comparisons remain in sdk/deploykit.
  • R7 — coverage that fails without the change (pasted) and the changed path executed live.
  • Kernel/plugin boundary law — consult the stamped trait, never the substrate word.

Change classification

  • Change class: Contract / library module (a Go module with no charly.yml project, no main/deployable target, no disposable: true entity — the github.com/opencharly/sdk contract 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).
  • Verification gate: .github/workflows/ci.yml green (gofmt/go vet/go test + 4-arch cross-compile), the fails-without-change proof, the live Descent-stamp spike, and the raw R5 grep.
  • Attribution tier: 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)

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

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 05cbdf34c71f26563a505e34546343a760e9cf80 (branch: feat/c6-descent)

Change class: code/config — an SDK-library change (sdk/deploykit/deploy_state.go + deploy_state_test.go). Comment thread: empty (0 comments) — nothing to adjudicate.

Blocks

  1. A2 / A1 / B12 — the change's required gate was not run; the body defers it. The only evidence pasted is a module test (go test ./...) plus a unit-level fails-without-change run, and the body states outright: "The end-to-end R10 bed runs in the consumer PR (charly), which bumps this pin." A code change requires a fresh-rebuild bed run on a disposable: true target with pasted output; bare go test and "will test later (in another PR)" are the forbidden patterns. The body names no bed by name, no disposable target, and no fresh-rebuild confirmation. Fix: run the required bed(s) by NAME, fresh rebuild, ZERO warnings, and paste the output — or cite the R10 change-class matrix entry that genuinely exempts an SDK-library change (none is present, so this cannot be assumed away).

  2. A1 — the body's diff shape contradicts the current diff (rule 1: re-derive, don't inherit). The body claims deploykit/deploy_state.go +19/−4; the current diff — and its ### FILE: header — is +15/−4 (hunk 1: +1; hunk 2: +12/−2; hunk 3: +2/−2). The body must account for the current diff, not a prior revision. Correct the count.

  3. A3 — attribution tier is not justified by the proof. fully tested and validated requires the changed path to have executed against a fresh rebuild/bed. Here it executed only inside a unit test plus a code-reading "spike," and the bed is explicitly deferred (block 1). Ceiling is at most analysed on a live system until the bed actually runs.

  4. B14(d) / B10 — the sweep claim is asserted, not evidenced. The R5 self-test is given as a summary (grep -rn '\.Target *[=!]= *"' deploykit/*.go → "only == "" comparisons remain") rather than the raw, actually-executed command output. Paste the real grep output lines.

Verdict: BLOCK


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

View action run

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

Copy link
Copy Markdown

Review — PASS

Head SHA: 5950b38dd249e2360cb017f268a69b0fe13513d5 (branch: feat/c6-descent)

Security screen: PASS — no secrets/egress/obfuscation; no guardrail or validator/rulebook change; the new import (github.com/opencharly/spec/deploy) is an existing intra-org module dependency (not a new supply-chain pin); diff does exactly what the body claims (no scope mismatch).
Checklist: All applicable rules PASS or NA. Code change is a minimal, correct trait-consult swap (e.Target == "vm" → deploy.IsVmVenue(&e), matching the existing predicate use in deploy_members.go); the new test fails-without/passes-with and the pasted output is internally consistent (line 458 = the entity-scan assertion; +15/−4 and +44/−4 match both FILE headers). R5 raw grep output pasted; R10 class is a bed-less library module (executed charly.yml=0 / no disposable: true entity proof) with the consumer bed named (check-r10-two-vm). Placement: CORRECT (mechanism stays in the deploykit kit; no core/alias growth).

Comment 5851692229 (prior BLOCK) — stale-superseded. Re-derived against the current head: its block 2 (body +19/−4 vs diff) is resolved (body now states +15/−4, matching the header); its block 4 (grep asserted, not pasted) is resolved (raw output now pasted); its block 1 (gate deferred) is resolved by the very remedy it offered — the R10 change-class citation plus the executed negative proof that no bed can exist in this module — with the consumer bed named; its block 3 (tier) follows from the same class-gate evidence and the changed path having executed (fail-without/pass-with) against the fresh module build. No surviving finding reproduces against the current state.

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 01:52
@github-actions
github-actions Bot merged commit e22b639 into main Sep 27, 2026
6 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 27, 2026
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.

1 participant