Repository navigation
feat(deploykit): deliver the microVM shape — a rootfs and a kernel in one VM box - #380
Conversation
… one VM box A microVM's root drive is a FILE the VMM attaches, and the kernel it boots with is a SEPARATE file; the two usually live in different directories. The emitter could describe one file at one fixed path, so a reader had nothing to find a second artefact by. - The emitter's body is extracted into an artefact-LIST-driven builder (`emitVmBoxArtifacts`), so both shapes share ONE validation, staging rule, render and build (R2); `EmitVmBox` and `EmitVmBoxAt` keep their signatures and behaviour as thin wrappers. - `EmitVmBoxMicroVM` delivers the root drive and the kernel at the shipped microVM paths (`/rootfs.img`, `/vmlinux`) and records the layout it WROTE in `spec.VmBoxMetadata.Artifacts` only AFTER the build succeeds — a failed emit leaves the caller's metadata untouched, so a label can never describe a box that was not built. - Staging: when the artefacts share a directory it IS the context (today's behaviour — the file is never copied, buildah streams it into the layer); otherwise a context is staged in which a qcow2 overlay is flattened and every other artefact is hardlinked, a byte copy only when the filesystem refuses the link, so a multi-gigabyte rootfs is still not copied. - `go.mod` adopts the contract that carries the arms (`opencharly/spec#229`, merged `cd1d563`) — which required the alias deletion that landed separately as `#378`. Gates on this tree, the module's own CI-equivalents: gofmt clean, build and vet rc=0, `go test` rc=0 (15 ok packages), golangci-lint 0 issues, cross-compile amd64/arm64/arm/386. New coverage: the two-artefact render (pure), the deterministic guards (nil metadata; a missing artefact refused before anything is staged; a failed emit records NO layout), and a LIVE e2e that builds a real box from two artefacts in DIFFERENT directories and asserts both land at their recorded paths, that the label round-trips the layout AND the provenance, and that the sources survive — live podman, skipping visibly without it. Both controls measured: dropping the kernel from the delivery fails the e2e at `podman cp /vmlinux`, and dropping the layout recording fails it at the recorded-layout assertion. Also corrected: `AGENTS.md` still told a reader to bump the spec `#SchemaVersion`, which the contract module deleted (R4); and the engine-guard helper's `engine` parameter — always "podman" in this package — is removed rather than suppressed, since clean `main` reports 0 lint issues and this change's added call surfaced that dead surface. Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (every diff item is accounted for in the body's file table), no secrets/egress, no guardrail weakening (the Non-blocking note (rulebook gap): the diff adopts Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — the verdict is PASS; the head's red checks are a transient proxy failure, and the remedy is a re-run, not a change to the diff. The verdict, read in full: Why the PR is still RCA (measured cause, not inferred). The failing step's own log names it: That is a transient module-proxy failure while CI downloaded a transitive dependency. Missed control, stated plainly: my pre-push gate ran the CI-equivalents locally — where the module cache already holds every dependency — and I read that as "the head will be green". CI adds a network fetch surface my local cache hides, and that is exactly where this failed. The control that catches it costs one command and is now part of the routine: read a red check's failing-step log before concluding anything about the diff — it named the class immediately instead of inviting a hunt through my change. What is owed on the non-blocking note (and why it is not fixed here): the untagged pseudo-version is a consequence of Action now: re-run the failed Agent: dsh-firecracker (DSH / deepseek-v4.1-flash) Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated) |
Review — PASSHead SHA: Security screen: PASS — all 8 diff items accounted for in the body's file table; no secrets/egress; the Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
… e2e creates its container The live e2e ran on the CI runner (so the engine was usable and the skip guard did its job) and failed at `podman create` with nothing but `exit status 125` — because the helper used `.Output()`, which keeps stdout and throws the engine's own reason away. A failing test that hides its cause turns one read into a guessing game, and it is the same defect class as an unsubstantiated claim: the evidence is discarded at the moment it is produced. `CombinedOutput` now, with the command and the reference in the message, so the next CI failure names its own cause. Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — all 8 diff items are accounted for in the body's file table; no secrets/egress; the Comment dispositions:
Non-blocking note (rulebook gap): the diff adopts Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…tch image needs
The CI run named its own cause as soon as the engine's stderr stopped being discarded:
podman create …: exit status 125: Error: no command or entrypoint provided, and no CMD
or ENTRYPOINT from image
A `FROM scratch` image that only COPYs artefacts carries no CMD, and a runner whose podman enforces
the image config refuses to create a container from it. `create` executes nothing, so the command it
demands is inert.
- ONE helper (`createContainer`) now owns "make a container object to read a layer from": it supplies
the placeholder, returns the engine's own output on failure, and is used by BOTH e2e tests. The
pre-existing overlay e2e carried the same latent defect, shielded only by the `qemu-img` skip that
runs above its own create.
- `strings` is dropped from the microVM e2e, which no longer trims the engine's output itself.
Gates: gofmt clean, `go vet` ok, `go test -count=1 ./...` rc=0 (15 ok packages, the live tests
included), golangci-lint 0 issues.
Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)
|
STATUS — head Finding 1 — a failing test that hid its own cause. The live e2e failed on the CI runner while passing locally, and its message was only Finding 2 — the cause that fix exposed. RCA / missed control (the one worth carrying forward). My pre-push gate ran the CI-equivalents locally, where the module cache already holds every dependency and the engine is this host's podman, and I read "green locally" as "green on the head". CI adds two surfaces my local run cannot see — a network fetch and a different engine build — and the first red I saw ( A second, quieter miss — my own comment. My previous status said "no commit is added, the head stays The verdict's non-blocking note, and why it is not fixed here. The Gates on this head: gofmt clean, Agent: dsh-firecracker (DSH / deepseek-v4.1-flash) Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated) |
Review — PASSHead SHA: Security screen: PASS — all 8 diff items accounted for in the body's file table; no secrets/egress/obfuscation; the Checklist: All applicable rules PASS or NA. One shared emitter ( Comment dispositions:
Non-blocking note (rulebook gap): the diff adopts Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Teaches
deploykit's VM-box emitter to deliver the microVM shape: two artefacts in one box — a raw/ext4 rootfs and the kernel booted with it — and records the in-image layout it wrote. Closes #379, and is the consumer half of the contract that landed asopencharly/spec#229(umbrella ledger WI-3).The shape is not hypothetical: a microVM's root drive is a file the VMM attaches, produced on a device-less host by
mke2fs -t ext4 -d <tree> <file>(measured as ledger probe P3), and the kernel is a separate file.EmitVmBoxAtwrapped exactly one file from one directory, so a reader had nothing to find a second artefact by.Every file in the diff, accounted for:
deploykit/vm_box_emit.goEmitVmBoxMicroVM; the microVM path constants; the staging helpersdeploykit/vm_box_emit_test.godeploykit/vm_box_emit_microvm_e2e_test.godeploykit/vm_box_emit_e2e_test.go,deploykit/engine_guard_test.goengineparameter removed; its call sites updatedgo.mod,go.sumspec→ the merged commit that carries the armsAGENTS.mdOne implementation, two shapes (R2).
EmitVmBoxandEmitVmBoxAtkeep their signatures and behaviour as thin wrappers overemitVmBoxArtifacts; there is no second render path. The build context is the artefacts' own directory when they share one — exactly today's behaviour, where the disk is never copied because buildah streams it into the layer — and otherwise a staged context in which a qcow2 overlay is flattened and every other artefact is hardlinked (a byte copy only when the filesystem refuses the link,EXDEV), so a multi-gigabyte rootfs is still not copied.The layout record cannot lie.
EmitVmBoxMicroVMbuilds against a copy of the caller's metadata carrying the layout, and writes that layout back to the caller only after the build succeeds. A failed emit leaves the metadata untouched, so a label can never describe a box that was not built — and there is a gate for exactly that.How tested
The module's own CI-equivalents, on the committed head (
ae88057):The coverage that matters — a LIVE e2e (real podman), plus the pure gates:
TestEmitVmBoxMicroVM_Livebuilds a real box whose two artefacts live in different directories and asserts three things at the artefact's own boundary: (a) both files are in the image at the recorded paths, byte for byte; (b)VmCapabilitiesFromLabelsreturns the same layout and the provenance — the rootfs arm with its format and built size — which is all a source-lesscharly deploy from-boxhas to work from; (c) the caller's source files still exist, proving the staging links rather than moves. It skips visibly when the engine is unusable (requireUsableEngine), never mocked (R8).Both controls measured — each new behaviour made to fail:
Two findings fixed in this change rather than deferred (R1):
misspellon a word in a new comment (reworded), andunparam—requireUsableEngine'sengineparameter is always"podman"in this package. Measured discriminator before classifying it: cleanmainreports0 issues(with the cache cleared), and this change's added call surfaces it. It is dead surface, so it is removed, not suppressed (R3 forbids the//nolintroute); a parameter returns with the second engine, not for a hypothetical one.AGENTS.mdtold a reader to bump the contract's#SchemaVersion— a stamp the contract module deleted (specCHANGELOG/0.2026270.938.md). Corrected in this change (R4), because a contradicted instruction is a defect in the artifact a reader trusts.One CI finding, and the two steps it took to resolve it — both measured, neither guessed:
podman create: exit status 125, because the helper used.Output()and threw the engine'sstderr away. A failing test that hides its cause is the same defect class as an unsubstantiated
claim: the evidence is discarded where it is produced. Capturing it made the next run name the
cause in one line.
Error: no command or entrypoint provided, and no CMD or ENTRYPOINT from image. AFROM scratchimage that only COPYs artefacts carries no CMD, and a runner whose podman enforcesthe image config refuses to create a container from it — while
createexecutes nothing, so thecommand it demands is inert. One helper (
createContainer) now owns that step, supplies theplaceholder, keeps the engine's output on failure, and is used by both e2e tests: the
pre-existing overlay e2e carried the same latent defect, shielded only by the
qemu-imgskipabove its own create.
Rulebook compliance
/charly-internals:plugin,/charly-internals:go,/charly-internals:install-plan,/charly-internals:capabilities,/charly-internals:git-workflow; and this repo's ownAGENTS.mdread before acting in it.EXDEV), the layout is recorded only after a real build, and the dead parameter is removed instead of silenced.AGENTS.mdinstruction is corrected in the same change.git statusclean before the commit; one commit for the PR (the branch was never pushed, so the parked WIP commit was amended into it rather than layered); no force-push, no bypass, PR-only.requireUsableEngineskips with the engine's own output when podman is unusable.N/A — this module ships no binary and no runtime OS dependency; the gates are the module's own.validate / validaterun on this head. The consumer that boots from this artefact is the substrate plugin (WI-5) and its bed (WI-13), which own the runtime proof.rootfs+kernel, which is what the contract calls it.N/A — no disposable target is touched: this is library mechanism proven at its own boundary; the RDD that fixed the shape (the rootfs producer on a device-less host) is recorded in the umbrella ledger.N/A — no concurrency is introduced; the emitter stages into a per-call temp directory.gofmtclean andgolangci-lint0 issues, pasted; the lint finding this change surfaced was fixed, not silenced.Change classification
SDK/plugin-library Go module: a refactor of one emitter into a shared artefact-list builder, a new entry point for the microVM shape, and the contract adoption. No authored schema (the contract landed separately as
opencharly/spec#229), no plugin behaviour, no consumer change.Attribution evidence (authoring runtime, not a config read). Harness DSH,
dsh --version→0.2.0-rc.2,DSH_PROFILE=web,DSH_SESSION_ID=session-1df63bd3-95ba-4edc-a628-63c2122888d7; model and provider read from the harness's own record of this session:Tier:
fully tested and validated— the module's change-class gate passed in full on the committed head (gofmt, vet, test, lint, cross-compile), the new behaviour was exercised live against the real engine (a box built and extracted), and each new behaviour was controlled by removing it and watching the proof fail.Closes #379
Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)