Skip to content

test(vm): move the body behaviour test with the body - #43

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/vm-tests
Nov 14, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/vm-tests

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

opencharly/spec#304 unit 8, the coverage half. The vm body lives in this plugin CUE module since plugin-substrate#42, and its ONE behavioural test still called the spec package defValue against the shipped schema. It moves HERE, before the contract leg deletes the vm body, so the coverage never lapses. Its lifecycle in full: the spec copy (TestVmBackendKrunCrossRules in schema/engine_vocab_and_vm_backend_test.go) stays where it is until the contract leg deletes the #Vm it compiles against; that leg is tracked as the next unit-8 item on opencharly/spec#304, and the coordination pair is posted on this PR and on that issue.

The test, unchanged in behaviour: TestVmBackendKrunCrossRules - three accepted krun shapes (container_disk, the krun knobs, and a bootc source), five libvirt/qemu-only fields that must be rejected NAMING the field they reject (libvirt, autostart reported at the backend rule, firmware, machine, cloud_init), a non-OCI source rejected, and a positive control proving the same fields are legal under backend libvirt - so the rejections are about the backend, not the fields.

The harness is the point. It composes exactly what the host gate composes - the spec base and this plugin served unit - and compiles every literal in the def own CUE context. The allErrors flattener moves with it because the assertion is about the error NAMING, and the CUE top-level Error() truncates to (and N more errors).

Why only one test: measured, this kind has no value-gate tests in spec (unlike pod/local/kubevirt), and its other vm-named test files - vm_iso_source_test.go, vm_container_disk_source_test.go, vm_box_metadata_test.go - exercise the KEEPERS (VmSource, VmBoxSource) that stay in the contract, so they stay with them.

How tested

$ cd candy/plugin-substrate && go vet ./...
$ # (no output)
$ go test -count=1 -run TestVmBackendKrunCrossRules -v .
=== RUN   TestVmBackendKrunCrossRules
--- PASS: TestVmBackendKrunCrossRules (0.42s)
$ go test -count=1 ./...
ok  	github.com/opencharly/plugin-substrate/candy/plugin-substrate	16.954s

R10 honesty, premise pasted

$ ls
AGENTS.md
candy
CHANGELOG
charly.yml
README.md
$ grep -c check: charly.yml
0

This repo declares no check bed; its change-class gate IS its Go suite, run above.

Rulebook compliance

  • R0 - skills first; go, plugin and cutover-policy govern this class.
  • R1 - the two compile anomalies (testing missing from the moved imports, and CUE own errors package) were mine and are fixed in the commit that introduced them.
  • R2 - the test ends up in ONE place (the body home) with the same assertions; UNTIL the contract leg lands the spec copy still exists, so this PR is the ADD half of an ordered move and not yet the de-duplication. That is the units 4-7 ordering: coverage first, deletion second, both proven by the same assertions.
  • R3 - the harness composes the real base and the real served unit; no stub.
  • R4 - no product change.
  • R5 - this is the ADD half; spec copy goes in the contract leg, coordinated on both threads.
  • R6 - a worktree off fresh origin/main; one commit.
  • R7 - the rejections name the exact field, and the positive control makes them backend-specific.
  • R8 - N/A, no service boundary.
  • R9 - a Go test over the embedded schema.
  • R10 - the repo suite, premise pasted.

Change classification

Kind: one behavioural test moves from the spec schema package to the plugin that owns the body. Not breaking: test-only, assertions preserved.

Breaking change + rollback: none - test-only; rolling back reverts this squash and the contract originals would then still exist.

Filed issues

None - nothing separable.

Files changed

file what changed
candy/plugin-substrate/vm_body_test.go new: TestVmBackendKrunCrossRules over the composed unit, with allErrors + checker

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

opencharly/spec#304 unit 8: the vm body lives in this plugin CUE module since #42, and its
one behavioural test - TestVmBackendKrunCrossRules, the krun acceptance shapes plus the
libvirt/qemu-only field rejections with their error naming - still called spec defValue
against the shipped schema. It moves HERE, before the contract deletes #Vm, so the
coverage never lapses.

The harness composes base & served unit (composedBodySchema) and compiles every literal in
the DEF OWN CUE context; the test, its allErrors flattener and the checker helper are the
same three, unchanged in behaviour.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 2012c6cd6883932043b638abf5792f729f7c65d2 (branch: feat/vm-tests)

Change class: code — one Go behavioural test added in a cross-repo move (opencharly/spec#304 unit 8).

Blocks

  1. R2 / R5 / R1 — the move is split into add-now/delete-later, and the "one place" claim is false. The body's own text says "this is the ADD half; spec copy goes in the contract leg" and "before the contract leg deletes the vm body," yet the R2 compliance line asserts "the test exists in ONE place, the body home." Both cannot be true: the body also states the spec test "still called the spec package defValue," so after this PR the test exists in the spec package AND here. Hard-cutover (R5) requires the removed/renamed symbol be swept in the SAME change — an add-here/remove-in-a-different-PR is a Phase-2 split unless the spec-side removal lands atomically. Either remove the spec copy in this cutover, or prove it is already gone, and fix the R2 line to state the real current duplication.

  2. A1 / R1 — body does not clearly account for the spec copy's fate. "It moves HERE" (implies the source is deleted by this PR) contradicts "spec copy goes in the contract leg" (source deleted later, elsewhere). State unambiguously where the spec-side TestVmBackendKrunCrossRules / defValue test currently lives and exactly when/where it is deleted. As written, the diff item's full lifecycle is not accounted for.

  3. COORD — required coordination comment is missing. The body asserts the change is "coordinated on both threads" and that this PR must precede "the contract leg" (i.e. it blocks another item). The comment thread is empty (0 comments); there is no WAITING/HOLDING comment naming both sides, which Part II perf(status): direct per-host config read + bulk ledger read #6/perf(status): cache the guest tool-probe results #7 requires on both threads. Post the coordination comment naming this PR and the contract leg.

Comment dispositions

No comments were posted (thread is empty); nothing to disposition.

Verdict: BLOCK


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

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

HOLDING opencharly/spec#304 unit 8, the contract leg (deletes #Vm) - this PR must land first.

The vm body moved into plugin-substrate (plugin-substrate#42) and its one behavioural test moves into the same module HERE, BEFORE the contract stops declaring #Vm. The spec-side copy of TestVmBackendKrunCrossRules stays in schema/engine_vocab_and_vm_backend_test.go until that leg deletes the def it compiles against.

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 92d252e670f700caa58f7c586a21cb74e3e0cb1c (branch: feat/vm-tests)

Security screen: PASS
Checklist: All applicable rules PASS or NA. The diff is a test-only add in the plugin that owns the body (placement: CORRECT); it compiles against composedBodySchema (pre-existing, confirmed by the pasted go test pass), no secrets/network/eval, no guardrail change.

Comments:

  • bot BLOCK @6880449906 — stale-superseded: all three findings are resolved in the current body/thread. (1) The R2 line now states the add-half/de-dup honestly; (2) the body names the exact spec file (schema/engine_vocab_and_vm_backend_test.go) and its deletion condition/tracking (opencharly/spec#304); (3) a HOLDING coordination comment naming both sides is present.
  • @aitrawog HOLDING @6880510920 — verified-non-blocking: valid coordination metadata, first line HOLDING, names blocking side (this PR), blocked side (spec#304 unit-8 contract leg), and unblock condition; posted on the maintainer account; Agent: before Assisted-by:.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 14, 2026 16:21
@github-actions
github-actions Bot merged commit 61131de into main Nov 14, 2026
3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 14, 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