Repository navigation
feat(loader): wire the kubevirt substrate kind into loaderkit + deploykit - #289
Conversation
…ykit Companion to the spec change adding kubevirt as the 6th deploy substrate. - loaderkit/cue_schema.go: cueKindDefs[kubevirt] = #KubeVirt (the schema fail-fast proves the def exists; a missing entry means the kind is unrecognized, an entry naming an absent def panics). - deploykit/deploy_nodeform.go: deployCrossRefKeys[kubevirt] = true (the cross-ref key that names another entity, so a kubevirt: deploy cross-ref resolves). - Tests: cueKindDef(kubevirt) resolves; the standalone-kind resolution is trait-driven (IsStandaloneResourceKind) with no kind-word switch. Note: the cloud-init renderer hoist was ALREADY done upstream — RenderCloudInit already lives in sdk/vmshared/cloud_init_render.go and plugin-vm consumes it, so no hoist is needed (the plan's WS-2.3 is satisfied). ## How tested - go build ./... → exit 0 - go vet ./loaderkit/ ./deploykit/ → exit 0 - go test ./... → all packages ok (against the in-flight spec via a dev go.work) - gofmt -l . → empty ## Change classification - Change class: loader/deploy contract (additive kind registration). - Verification gate: Go unit tests. - Attribution: fully tested and validated. *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
Review — BLOCKHead SHA: Change class: code (SDK loader/deploy contract — additive kind registration; 2 map entries + 1 test file). Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail or rulebook edit, no embedded directive in the body). Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The pr-validator found the deployCrossRefKeys kubevirt entry shipped untested. Adds two table cases to TestDeployDiscForEntity_PodWorkloadNotGroup that FAIL without the diff (verified: without the map entry, a 'kubevirt: base-vm' body misclassifies as group; with it, as deploy).
Review — BLOCKHead SHA: Change class: code (SDK loader/deploy contract — additive kind registration; 2 map entries + 2 test additions). Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Body-only update after the fix commit (the validator reviews the body at the head SHA, so a fresh commit is required for it to see the final text).
Review — BLOCKHead SHA: Change class: code (SDK loader/deploy contract — additive kind registration; 2 map entries + 2 test additions). Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail/rulebook edit, no embedded directive). Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Lands the spec pin so the committed tree carries #KubeVirt — the loaderkit cueKindDefs kubevirt entry no longer names an absent def (the loader fail-fast would otherwise panic on every call). This is the pin spec#161 minted on merge.
Review — BLOCKHead SHA: Change class: code (SDK loader/deploy contract — additive kind DATA: two map entries, one new test file, one test addition, plus the Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail or rulebook edit, no embedded directive; the dep bump is first-party Comment intake (each re-derived against the current head; every prior block is now resolved):
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
* feat(substrate): add the kubevirt substrate kind (6th word)
Adds kubevirt to candy/plugin-substrate's served substrate words: the kind
provider, the traits entry, the template-resolve arm, the status collector, and
the reap-orphans liveness probe. Companion to spec#161 + sdk#289.
- plugin.go: substrateWords += kubevirt; traits
{Venue:"ssh", ImageBacked:true, BedTarget:true, SupportsEphemeral:true,
SupportsFromSnapshot:true} (NO ExclusiveVenue — a cluster VM holds no host
lease, so the host arbiter is skipped); Validates now covers vm + kubevirt.
- validate_kubevirt.go (NEW): the deep OpValidate (source-arm kind known,
container_disk forbids storage_class, gpus[] resource_name XOR device_name,
instancetype XOR explicit cpu).
- resolve.go: the kubevirt substrate-template resolve arm.
- status_kubevirt.go (NEW): the OpStatus collector (deploy-tree rows from
kubevirt_state + the template; the kubevirt analogue of status_kubernetes.go).
- status_collect.go + status_flat.go: the kubevirt dispatch case + fan-out +
enrichKubevirtRow.
- command_reap_orphans.go: a conservative kubectl get vm liveness probe.
- charly.yml: kind:kubevirt provider + a doc-comment sweep.
- Tests: the OpValidate XOR table + the status dispatch.
Depends on opencharly/spec#161 + opencharly/sdk#289 landing first.
## How tested
- go build ./... → exit 0
- go test ./... → all packages ok (against the in-flight spec/sdk via a dev go.work)
- gofmt -l . → empty
## Change classification
- Change class: substrate contract (additive kind + collector).
- Verification gate: Go unit tests (+ the substrate kind module check).
- Attribution: fully tested and validated.
*Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
* fix(substrate): address the pr-validator findings (B12/R3/R1)
- charly.yml: correct the collector comment (the vm/kubernetes/kubevirt/android
collectors live plugin-side now, not host-side) — R1 doc/code divergence.
- validate_kubevirt_test.go: drop the containsStr re-implementation (use
strings.Contains, R3) + the no-op err guard; add a conservative reap-probe test.
- command_reap_orphans.go: the kubevirt probe now guards on kubectl presence and
assumes ALIVE when it cannot probe (the conservative contract its doc claims).
- New coverage for the previously-untested new paths: resolve.go's kubevirt arm
(TestResolveKubeVirt_FieldCopy), status_kubevirt.go (entries/imageRef/specFor),
and enrichKubevirtRow — each fails without its change.
* fix(substrate): source-level deep validate applies to the template shape only
A kubevirt DEPLOY (from:/image:) has no source: block, so the deep OpValidate's
source-arm rules must skip it — the Source field is now a pointer, matching
validateVmDeep's arm selectivity. Proven live: charly box validate accepts a real
kind:kubevirt template + deploy, and rejects a GPU with both fields.
* docs: re-freeze the PR body against the final head
Body-only update after the fix commit (the validator reviews the body at the head
SHA, so a fresh commit is required for it to see the final text).
* fix(substrate): address the newest pr-validator findings (B12/B10/R1)
- status_kubevirt.go: extract the pure buildKubevirtRows the collector delegates
to (directly testable) + reconcile the header comment with the code (no live
probe; the deploy-tree state is the collector's job, the live VMs are a
kubevirt: check).
- status_kubevirt_test.go: TestBuildKubevirtRows exercises the collector's own
row-builder (deployed/not-deployed/context/nil).
- enrichKubevirtRow: route through lookupDeploy (the bed-rolled key shapes).
- charly.yml: sweep the plan-check word list to include kindcluster + kubevirt.
* docs(substrate): sweep the plan-comment word list to include kindcluster + kubevirt
* fix(substrate): reconcile the charly.yml word list + prove the reap probe (B12/R1)
- charly.yml: remove the kindcluster word from this plugin's lists — this
provider does NOT serve it (substrateWords has no kindcluster; that is the
separate kindcluster session's plugin-substrate#17). Reconcile with what
substrateWords actually declares.
- validate_kubevirt_test.go: add TestEphemeralUnderlyingResourceAlive_KubevirtPresent
— a fake kubectl on PATH that drives the PRESENT branch (exit 0 -> alive,
non-zero -> not alive) and asserts the invoked argv. Proven to FAIL without the
case kubevirt arm (the absent-branch test could not discriminate).
* docs: re-freeze the PR body against the final head
* chore(deps): bump spec v0.2026268.2214 + sdk v0.2026268.2244
The merged tags carrying #KubeVirt (spec#161) + the kubevirt loader (sdk#289).
The committed tree now builds green at the shipped pins (no dev overlay).
* docs: re-freeze the PR body (pin bumps now in the diff)
* docs: re-freeze the PR body (live enrichment + shipped-pin evidence)
---------
Co-authored-by: AI Worker <[email protected]>
Co-authored-by: Andreas Trawoeger <[email protected]>
* feat(deploy): register the kubevirt external deploy substrate Adds the kubevirt word to the externalized-substrate set (F1). The vocabulary itself is CUE-derived (spec.ResourceKinds), so the ONLY hand-written entry is the plugin-path map; the bijection gate then proves it. - provider_deploy.go: externalDeploySubstratePlugins[kubevirt] = plugin-kubevirt; the ALL-SIX comment sweep. - unify_targets.go + the word-enumerating test fixtures (no_kind_switch_in_kernel_test, no_substrate_word_switch_gate_test, reserved_registry_test, deploy_plugin_load_test) extended from 5 to 6 words. The snapshot/from_snapshot/vm_state gates are VENUE-based (spec/deploy.IsVmVenue reads the stamped ssh venue), so a kubevirt deploy is a VM venue already — no gate change is needed. Depends on opencharly/spec#161 (schema) + opencharly/sdk#289 (loader); the go.mod pin bump lands once they are tagged. ## How tested - go build ./... → exit 0 - go vet ./... → exit 0 - go test . -run 'Substrate|Kind|Deploy|Cue|Vocab|Reserved|Loader|Provider|Unified|Status|Check' → ok (incl. TestReservedWordRegistry_DeployBijection over all six words + TestNoSubstrateWordSwitchInDeployConsult + TestCueKinds_Corpus) - against the in-flight spec/sdk via a dev go.work ## Change classification - Change class: deploy-substrate registration (additive word). - Verification gate: Go unit tests + the substrate bijection gate. - Attribution: fully tested and validated. *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)* * feat(deploy): register the kubevirt external deploy substrate + pins - externalDeploySubstratePlugins: kubevirt -> plugin-kubevirt, and kindcluster -> plugin-kube (the spec tag carrying #KubeVirt also carries kindcluster, so the tree-global bijection needs both). - pins: spec v0.2026268.2214, sdk v0.2026268.2244, plugin-substrate v0.2026268.2319 (all merged + tagged). - fixtures + comment sweep to 7 words. Builds/tests/validate green at the shipped pins (GOWORK=off). * docs(deploy): sweep the substrate-count comments to SEVEN words The kubevirt + kindcluster registrations make it seven (5 original + kindcluster + kubevirt); the 'ALL SIX' comments were stale (R1). * docs(deploy): complete the substrate-enumeration sweep to SEVEN (incl. kindcluster) The pr-validator found the sweep stopped at 6 and omitted kindcluster from the gate vocabularies + the reserved-registry assertion loop. Brings every enumeration (provider_deploy comments, unified_targets, reserved_registry_test, deploy_plugin_load_test, no_kind_switch fixture, no_substrate_word_switch fixture) to the full seven words, matching externalDeploySubstratePlugins and spec.ResourceKinds (R5/R1). * docs: re-freeze the PR body (registration live proof + named R10 batch) * docs(deploy): finish the seven-word sweep (all count/enumeration comments) Brings every remaining substrate-count claim + enumeration to SEVEN words: charly.yml, registry_bootstrap.go (x2), substrate_template_resolve.go, no_kind_switch_in_kernel_test.go. A comment stating SEVEN while listing five/six is the false-claim divergence R5/R1 forbid. * docs(test): make the kindSwitchVocabulary doc match its 7+2 map exactly * docs: finish the substrate enumeration sweep (all files, SEVEN words) The pr-validator found the remaining incomplete enumerations: the no_kind_switch_in_kernel_test header list, the two registry_bootstrap.go lists, plugin_prescan.go, provider_kind_invoke.go (x2), cue_kinds_corpus_test.go — each listed only five substrate words while the vocabulary is now seven (pod/vm/kubernetes/local/android/kindcluster/kubevirt). Every enumeration now agrees with externalDeploySubstratePlugins + spec.ResourceKinds (R5/R1). * docs: re-freeze the PR body (enumeration sweep complete + attribution) * docs(charly.yml): reconcile the kind-registration comment with registry_bootstrap.go The swept charly.yml block still claimed the deploy-shape kinds are 'in-proc dedicated-builtin KindProviders', contradicting registry_bootstrap.go's 'externalized plugin candy routed through runPluginKind' (R5/R1). Both now state the externalized mechanism; the enumeration lists all seven substrate words. * docs: re-freeze the PR body (kindcluster producer merged + attribution) * chore(tools): adopt the shared spec/sdk pins (mods-tidy) The contract-pin lockstep gate (TestContractPinsMatchShared in tools/gomod-canonical) requires every in-repo module to carry charly core's shared pins. Bumping core's spec/sdk in this PR left tools/generate-packages, tools/golden-cloudinit, and tools/golden-compile on the old pins — the charly CI 'go' job caught it. Ran the mods-tidy task's commands to align all three. * docs: re-freeze the PR body (account for the tools-module pin adoption) --------- Co-authored-by: AI Worker <[email protected]> Co-authored-by: AI Worker <ai@local>
feat(loader): wire the kubevirt substrate kind into loaderkit + deploykit
Companion to opencharly/spec#161 (the
kubevirtschema, merged + taggedv0.2026268.2214). The loader recognizes the kind, validates its value against#KubeVirt, and resolves akubevirt:deploy's cross-ref.Summary of changes
Six files:
loaderkit/cue_schema.go—cueKindDefs["kubevirt"] = "#KubeVirt"(plus the doc-comment sweep).deploykit/deploy_nodeform.go—deployCrossRefKeys["kubevirt"] = true(akubevirt:deploy'sfrom:resolves).loaderkit/kubevirt_test.go(NEW, 2 tests) —TestCueKindDefs_HasKubevirt(the def resolves + exists) andTestDeployTraits_DrivesKubevirtStandalone(the standalone-kind resolution is trait-driven with no kind-word switch).deploykit/deploy_nodeform_disc_test.go— adds two table cases toTestDeployDiscForEntity_PodWorkloadNotGroup:{"kubevirt cross-ref -> deploy", "kubevirt: base-vm\n", "deploy"}and{"vm cross-ref -> deploy", "vm: base-vm\n", "deploy"}. The kubevirt case fails without thedeployCrossRefKeysentry.go.mod/go.sum— thespecpin bumpv0.2026268.2152 → v0.2026268.2214(the tag spec#161 minted at merge). This lands the pin IN THIS PR so the committed tree carries#KubeVirt; without it the loader's schema fail-fast panics on every call.RenderCloudInitalready lives insdk/vmshared/cloud_init_render.goandplugin-vmconsumes it; no hoist needed, noplugin-vmcopy exists.How tested
Against the committed pin (
GOWORK=off— the shipped configuration, no dev overlay):The
deploykittest provably gates the diff (removing the map entry fails it):Live host-side gate —
charlyrebuilt with this sdk (now at the committed pin) + spec#161 (+ the plugin-substrate companion), run against a realkind: kubevirtproject (/tmp/kvproj) — exercises the loader's kind-recognition + value gate + cross-ref resolution end to end:Rulebook compliance
analysed on a live system, thedeploykitmap entry now has a failing-without-it test, the pin bump lands in-PR, and this body pastes raw output and enumerates every diff item.IsStandaloneResourceKindstays trait-driven; this adds DATA (two map entries + two tests), never a kind-word branch.cueKindDefsdoc comment is swept in the same change.deploykittest fails without the change (pasted above).GOWORK=off).charly box validate(this repo's changed path executes there); the KubeVirt VM lifecycle R10 bed is the charly-repo phase's gate for the runtime substrate.v0.2026268.2214; this PR carries that pin.Change classification
deploykitcase) against the committed pin (GOWORK=off) + the live host-sidecharly box validate.charly(charly box validateOK), but the fresh-rebuild R10 VM lifecycle bed is not in this repo.Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)