Skip to content

feat(schema): microVM artefact arms — a raw/ext4 rootfs and a kernel in the VM-box contract #228

Closed

Description

@aitrawog

What

Add the microVM artefact arms to the VM-box contract: a #VmBoxSource arm for a charly-produced raw/ext4 rootfs and one for a kernel, plus the in-image layout record that lets one image carry both files and a reader find them.

This is the artefact half of the Firecracker + Fireactions integration (umbrella ledger WI-2; the substrate contract landed as #227). The delivery vehicle already exists — a VM box is an OCI image whose layers carry the artefact and whose labels carry #VmBoxMetadata on ai.opencharly.vm.box (sdk/deploykit.EmitVmBoxAt / VmCapabilitiesFromLabels) — and this issue widens what that vehicle can carry.

Why

Every existing #VmBoxSource arm describes a disk: cloud_image, bootc, clone, bootstrap, iso, container_disk. A Firecracker microVM's root drive is not one of those: the ledger's probe P3 showed the usable producer on a device-less host is mke2fs -t ext4 -d <tree> <file> — a raw/ext4 rootfs file built from an OCI image's tree, with no loop device, no device-mapper and no privileged container. And a microVM needs two artefacts, not one: that rootfs and a kernel (with its command line), because the VMM boots them together and the kernel is not inside the disk.

Today neither has a provenance arm, and the vehicle can only describe ONE file at a fixed path (/disk.qcow2, or /disk/disk.img for the KubeVirt containerDisk convention).

Scope

  1. schema/vm_box_metadata.cue:
    • #VmBoxSource.kind gains rootfs and kernel, each with its arm fields (origin ref/url, format, size, digest, command line, kernel release).
    • #VmBoxMetadata gains an optional artifacts record naming each delivered file and its in-image path — the microVM shape carries a rootfs and a kernel; the disk-only shapes keep today's path conventions untouched.
  2. schema/firecracker_test.go (or a new test file): the arms validate, the closed gate still rejects unknown keys, and the disk-only shapes keep validating unchanged.
  3. charly task cue-gen — regenerated, with a clean second run a no-op.

Wire compatibility. Every added field is OPTIONAL, so an artefact published today keeps parsing. #VmBoxMetadata is whole-struct-marshalled into ai.opencharly.vm.box, so its json tags ARE the wire contract (the R8 note in the file header) — optional ? → omitempty. No new OCI label is added, and CapabilityLabelMap is unaffected because that map covers #BoxMetadata, not #VmBoxMetadata.

Not in this issue

Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)

Activity

  1. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — I am taking #228.

    Plan: the two #VmBoxSource arms (rootfs, kernel) with their provenance fields, the optional #VmBoxArtifacts record on #VmBoxMetadata that names each delivered file and its in-image path, the CUE gates (both arms validate; the def stays closed; the disk-only shapes keep validating unchanged), then charly task cue-gen and the module's own gates.

    The design constraints that decide the shape, both already in the file: every added field is OPTIONAL, because #VmBoxMetadata is whole-struct-marshalled into ai.opencharly.vm.box and its json tags ARE the wire contract (the R8 note at the top of vm_box_metadata.cue) — so an artefact published today keeps parsing. And the existing disk path conventions (/disk.qcow2, /disk/disk.img) stay untouched constants in the reader; the new record is only for the shape that carries MORE than one file.

    Evidence for the whole integration — the live microVM boot, the rootfs producer measured on a device-less host, and the network — is in the umbrella ledger at .dsh/ledger/firecracker-fireactions-integration.md.

    Agent: dsh-firecracker (DSH / deepseek-v4.1-flash)

    Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)

  2. self-assigned this
    on Oct 14, 2026
  3. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the artefact arms are implemented and the PR is open: opencharly/spec#229, head 2cba4f0, branch feat/firecracker-artifact-contract (off fresh main d9a0ed5).

    One correction to this issue's own text, because the repo proved it wrong. The issue said "No new OCI label is added, and CapabilityLabelMap is unaffected". The first half is right (#VmBoxMetadata rides whole in ai.opencharly.vm.box), but the second was an incomplete reading of the machinery: the VM-box half has its own map, VmBoxLabelMap in spec/vm_box_labels.go, and TestVmBoxLabelCompleteness enforces that every spec.VmBoxMetadata field has an entry. The first run of the change failed on exactly that:

    --- FAIL: TestVmBoxLabelCompleteness
        spec.VmBoxMetadata fields without VmBoxLabelMap entry: [Artifacts]
    

    I had read the file's own R8 note and the capabilities skill — which documents the pod half's CapabilityLabelMap — and generalised from them without checking whether this contract has a twin. It does. The missed control was reading a sibling's gate instead of the gate that owns this file, and the root fix is in the PR: the map entry and a microVM-shaped second case in TestVmBoxMetadataLabelRoundTrip, so the new record is proven to survive the single label byte-for-byte. That round-trip is the gate this issue named, and it is the repo's own.

    What the PR carries: the rootfs and kernel arms on #VmBoxSource with the facts that belong to the artefact (format, built size, digest, release, command line), the #VmBoxArtifacts in-image layout record (paths only — what a file is stays on the source arm, so nothing is stated twice), and the optional artifacts field on #VmBoxMetadata. Five new CUE gates, each controlled by removing its own schema line; 24 packages ok; cue-gen reproducible; gofmt clean; lint 0 issues.

    Next: watch #229 for the verdict, fix or rebut every finding before the next push; then WI-3 in opencharly/sdk (the emitter/reader side), which is the consumer of exactly this contract. Next update: on the verdict.

    Agent: dsh-firecracker (DSH / deepseek-v4.1-flash)

    Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)

  4. aitrawog commented on Oct 14, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — by opencharly/spec#229, merged as cd1d563 (validator PASS on the first run, native auto-merge, squash).

    What landed: #VmBoxSource gains the microVM pair — rootfs (the file the VMM attaches, with its format and the size it was built at) and kernel (the uncompressed vmlinux, with digest, release and the command line that carries the guest's address for a TAP network) — plus #VmBoxArtifacts, the in-image layout record (paths only, so no fact is stated twice), and the optional artifacts field on #VmBoxMetadata. Five new CUE gates, each controlled by removing its own schema line; the module's 24 packages green; cue-gen reproducible; gofmt clean; lint 0 issues.

    One correction this issue's own text needed, and it was the repo that caught it. The issue claimed "no new OCI label is added, and CapabilityLabelMap is unaffected" — true of the pod half, incomplete about the machinery: the VM-box contract has its own map (VmBoxLabelMap in spec/vm_box_labels.go) and its own completeness gate, which failed on the first run of the change:

    --- FAIL: TestVmBoxLabelCompleteness
        spec.VmBoxMetadata fields without VmBoxLabelMap entry: [Artifacts]
    

    Both halves it demanded are in the PR: the map entry, and a microVM-shaped second case in TestVmBoxMetadataLabelRoundTrip proving the new record survives the single ai.opencharly.vm.box label. The missed control was reading a sibling's gate instead of the one that owns the file.

    One thing this merge did NOT get, and it is filed rather than papered over: the merge push produced no workflow runs at all, so there is no CalVer tag and no CHANGELOG entry for cd1d563 — the push actor was github-actions[bot] (the default GITHUB_TOKEN, whose pushes GitHub suppresses to prevent recursion), where earlier merges by charly-auto-merge[bot] did trigger. RCA, measurements and what is owed are in #230. The producer-first consumer can still pin the merged commit (cd1d563) — a merged ref — which is what the next leg (opencharly/sdk, WI-3) will do.

    Agent: dsh-firecracker (DSH / deepseek-v4.1-flash)

    Assisted-by: DSH deepseek-v4.1-flash (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions