Repository navigation
feat(schema): add the kubevirt substrate kind (6th deploy substrate) - #161
Conversation
Adds kubevirt: as the 6th deploy substrate - a KubeVirt VirtualMachine on a Kubernetes cluster whose plan walks in the guest over SSH (the vm venue shape). Served out-of-process by the new plugin-kubevirt. - #ResourceKind gains kubevirt; #KubevirtValue added (schemagen auto-derives KindValueDefs[kubevirt]). - New schema/kubevirt.cue: #KubeVirt + the 4-arm #KubevirtSource boot medium, domain shape, GPU host devices, firmware, network, instancetype, migration, snapshot. Reuses #VmCloudInit (R3). - #Kubernetes gains a kubevirt: cluster-policy sub-block. - substrate_template.cue: #ResolvedKubeVirt + resolve input/reply. - New kubevirt_client.cue: the host<->plugin internal wire family. - #Deploy gains the machine-written kubevirt_state: field (#KubeVirtDeployState). - KubevirtSource hand-written in spec/union_types.go (the VmSource precedent). - #SchemaVersion bump note; regen artifacts. - Tests: KindValueDefs/ResourceKinds membership, valid template accepted, unknown key rejected.
Review — BLOCKHead SHA: Change class: contract/schema (additive new Security screen: PASS (no finding — no secrets/egress, no guardrail edits, no new deps). Blocks
Also flag for the author (non-gating detail to address in the same tree): the "How tested" block reports summarized exit codes ( Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The 6th deploy substrate needs its SubstrateKind const so the status collectors and the flat fan-out can label a kind:kubevirt row (R3: the const set mirrors spec.ResourceKinds).
Review — BLOCKHead SHA: Change class: contract/schema (additive new Security screen: PASS (no finding — no secrets/egress, no guardrail/rulebook edits, no new deps, no scope-vs-description mismatch that hides behavior). Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The status/venue consumers need the kind:kubevirt template map alongside kubernetes/pod/vm/local/android (R3: #ProjectTemplates mirrors #ResourceKinds). Adds KubeVirt to #ProjectTemplates (CUE-sourced, opaque RawBody).
Review — BLOCKHead SHA: Change class: contract/schema (additive new Security screen: PASS (no finding — no secrets/egress, no guardrail or rulebook edits, no new deps, no hidden behavior beyond the stated kind addition). Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…union comment Addresses the pr-validator findings: - #KubeVirtDeployState: rename snapshots -> snapshot (matches the Go yaml/json tag and the #VmDeployState.snapshot convention) + declare the ephemeral block the Go struct mirrors, so the CUE<->Go lockstep claim holds. - #KubevirtSource: 5-way -> 4-way (the union has exactly 4 arms).
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).
main added kindcluster as a 6th substrate kind (#162) after this branch opened; kubevirt becomes the 7th. Resolved: - node.cue #ResourceKind: both kindcluster + kubevirt. - resolvedproject.cue / status_types.go: both template maps + both status consts. - cue_types_gen.go / vocab_gen.go: regenerated (not hand-merged). Both kind value defs (#KindclusterValue, #KubevirtValue) coexist.
Review — PASSHead SHA: Change class: contract/schema (additive Security screen: PASS (T1–T4 — no secrets/egress, no guardrail/rulebook/validator edits, no new deps or version pins, no scope-vs-description mismatch; every diff item is accounted for in the body). Checklist: All applicable rules PASS or NA. Comment dispositions (all re-derived against the CURRENT head, not the SHA each was posted on):
All CUE↔Go field names/tags re-verified line-by-line across every new def ( 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(schema): add the kubevirt substrate kind (6th deploy substrate)
Adds
kubevirt:as the 6th deploy substrate — a KubeVirt VirtualMachine on a Kubernetes cluster whose plan walks in the guest over SSH (thevmvenue shape). Served out-of-process by the new plugin-kubevirt; this schema is the contract it and charly core both decode.Summary
#ResourceKindgainskubevirt;#KubevirtValueadded beside the other#<Kind>Valuedefs (schemagen auto-derivesKindValueDefs["kubevirt"]— no hand map).schema/kubevirt.cue:#KubeVirt(cluster/context/namespace, the 4-arm#KubevirtSourceboot medium —container_disk|data_volume|pvc|clone— domain shape, GPU host devices, firmware, network, instancetype/preference, run_strategy, migration, snapshot) plus its sub-blocks. Reuses#VmCloudInitfor cloud-init (R3).#Kubernetesgains akubevirt:cluster-policy sub-block.substrate_template.cue:#ResolvedKubeVirt+ resolve input/reply.schema/kubevirt_client.cue: the host↔plugin internal wire family.#Deploygains the machine-writtenkubevirt_state:field (#KubeVirtDeployState, withsnapshot:+ephemeral:matching the Go mirror); hand-writtenKubeVirtDeployState/KubeVirtDeploySnapshotinspec/hand_state_types.go.KubevirtSourcehand-written inspec/union_types.go(theVmSourceflat-union precedent).#ProjectTemplatesgainskubevirt(opaque template map);SubstrateKubevirtstatus-kind const.#SchemaVersionbump note; regeneratedcue_types_gen.go/vocab_gen.go.How tested
Schema/generator + the live host-side gate (the changed schema + kind path executing in a rebuilt
charlyagainst a realkind: kubevirtproject):Live host-side gate —
charlyrebuilt with this spec + the companion sdk#289 + plugin-substrate#16 worktrees (devgo.work), run against/tmp/kvproj(a realkind: kubevirttemplate + akubevirt:disposable bed):And the deep-validate rejects a bad entity live (GPU with both
resource_nameanddevice_name):New unit tests (fail without the change):
TestKindValueDefs_HasKubevirt,TestResourceKinds_HasKubevirt,TestKubevirtValue_TemplateAccepted,TestKubevirtValue_UnknownKeyRejectedinschema/kubevirt_test.go.Rulebook compliance
charly box validatereports0 warnings); the two prior validator findings (thesnapshots/snapshotCUE↔Go divergence + the "5-way" comment) are fixed in26ed2ab.#VmCloudInit+ the#DeployValuedisjunct; the schemagenkindValueDefsderivation means no hand-maintained word→def map.node.cue/version.cuelands with the 6th kind.cue_types_gen.go,vocab_gen.go) are validated at their boundary byTestGenReproducible+TestCueKinds_Corpus.VmSourceprecedent. Regeneration is a no-op (TestGenReproducible).OpValidateaccept a realkubevirttemplate and reject the XOR violations?) was proved LIVE via the rebuilt binary above, not assumed.git statusinspected; branch-only, no force-push.Change classification
charly box validateon a realkind: kubevirtproject.charly(charly box validateOK + the XOR rejection), but the full fresh-rebuild R10 VM lifecycle bed is not in this repo (it lands with plugin-kubevirt + the check beds).Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)