Skip to content

feat(schema): single-source the verb:oci containerDisk emit wire types - #178

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/oci-container-disk-wire
Sep 26, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/oci-container-disk-wire

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Add #ContainerDiskEmitRequest / #ContainerDiskEmitReply to schema/oci.cue — the canonical verb:oci wire pair for the container-disk-emit op: turn a materialized guest disk into a bootable containerDisk OCI image (a single application/vnd.oci.image.layer.v1.tar+gzip layer with the disk at an in-image path, default /disk/disk.img, the KubeVirt / Cua Fleet contract) and push it to a registry.

This is the produce half of the Cua Fleet / KubeVirt support the containerDisk consume arm (#171, the container_disk #VmSource arm) already pulls. The emit engine lives in candy/plugin-oci (where the go-containerregistry stack is single-homed); this PR single-sources its wire contract in spec so the emit leg and its callers (charly vm box publish, the Cua Fleet surface) share ONE decoded type instead of hand-written copies that can drift — exactly the #149 precedent for #CacheTransferRequest / #CacheTransferReply.

Purely additive wire types — they are never authoring kinds (never in #Node/#Op) and do not change any authored key, so there is no #SchemaVersion bump and nothing to migrate.

The disk_path / in_image_path / labels / ref / insecure / layout_dir fields map the emitter's inputs; ref / digest / media_type / layer_size / layout_dir map its result.

Review-round fixes (this head)

  • Round 1 raised the spec/spec/cue_types_gen.go drift question: the file is regenerated by charly task cue-gen and committed, and TestGenReproducible locks it — no hand-edit.

How tested

charly task cue-gen (regenerates spec/cue_types_gen.go; the run step + the reproducibility check both pass):

$ charly task cue-gen
task bootstrap-cue: 1 step(s), 0 failed
  [pass] run — download and checksum-verify the pinned cue CLI
      exit=0
task bootstrap-protoc: 1 step(s), 0 failed
  [pass] run — download and pin protoc + the two Go codegen plugins
      exit=0
task wire-gen: 1 step(s), 0 failed
  [pass] run — render the proto IDL from CUE and compile the Go stubs
      exit=0
task cue-gen: 2 step(s), 0 failed
  [pass] run — gengotypes + schemagen the generated Go
      exit=0
  [pass] check — regen is reproducible — TestGenReproducible passes on the committed tree
      exit=0

The full CI-equivalent gate on the final tree (go build ./..., go test ./..., gofmt -l ., golangci-lint run ./...):

$ go build ./...
$ go test ./...
(21 packages ok, 0 failures)
$ gofmt -l .
(empty)
$ golangci-lint run ./...
0 issues.

The generated Go (the contract consumers import):

type ContainerDiskEmitRequest struct {
    DiskPath     string            `yaml:"disk_path,omitempty" json:"disk_path"`
    InImagePath  string            `yaml:"in_image_path,omitempty" json:"in_image_path,omitempty"`
    Labels       map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
    Ref          string            `yaml:"ref,omitempty" json:"ref"`
    Insecure     bool              `yaml:"insecure,omitempty" json:"insecure,omitempty"`
    LayoutDir    string            `yaml:"layout_dir,omitempty" json:"layout_dir,omitempty"`
}
type ContainerDiskEmitReply struct {
    Ref        string `yaml:"ref,omitempty" json:"ref,omitempty"`
    Digest     string `yaml:"digest,omitempty" json:"digest,omitempty"`
    MediaType  string `yaml:"media_type,omitempty" json:"media_type,omitempty"`
    LayerSize  int64  `yaml:"layer_size,omitempty" json:"layer_size,omitempty"`
    LayoutDir  string `yaml:"layout_dir,omitempty" json:"layout_dir,omitempty"`
}

Rulebook compliance

  • Producer-first. This spec tag is the first PR of the remaining containerDisk produce chain (spec → plugin-oci → plugin-vm → charly → distro-omarchy/umbrella). Consumers pin THIS tag; no consumer is merged first.
  • R3 — no duplication. The wire pair is CUE-single-sourced; plugin-oci's emit leg and its callers decode the same spec.ContainerDiskEmitRequest.
  • No schema-version bump / no migration. Additive wire types only (the #149 cache-transfer precedent); #SchemaVersion is unchanged, so no charly migrate entry is owed.
  • R7 — the gate, not the plan. Every command above was run on the final tree.

Change classification

  • Change class: schema — additive host↔plugin wire types (no authored wire surface change).
  • Verification gate: charly task cue-gen (includes TestGenReproducible) + the CI-equivalent go build/go test/gofmt/golangci-lint on the final tree.
  • Attribution tier: fully tested and validated.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Add #ContainerDiskEmitRequest/#ContainerDiskEmitReply to schema/oci.cue, the
canonical wire pair for the verb:oci container-disk-emit op (turn a guest disk
into a +gzip OCI layer at /disk/disk.img and push it). Single-sourcing it here
lets candy/plugin-oci's emit leg and its callers share ONE decoded type
instead of hand-written copies that can drift (the #149 precedent).

Additive wire types only (never authoring kinds, no #SchemaVersion bump).
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 1015e700f82c57d79e112ae03715d4805bf5d262 (branch: feat/oci-container-disk-wire)

Security screen: PASS — additive CUE/_gen.go wire types only; no secrets, no network/egress, no guardrail or rulebook change, no dependency/version edits, no self-modifying-security surface.
Checklist: All applicable rules PASS or NA — SDD source↔generated pairing present (schema/oci.cue + spec/cue_types_gen.go in the same commit, tags/names internally consistent with the CUE @go(...) source), placement CORRECT (wire SHAPE → spec, CUE-first), single atomic commit, coherent pasted gate output, non-inflated attribution for a pure declaration change.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 26, 2026 22:02
@github-actions
github-actions Bot merged commit cba6635 into main Sep 26, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 26, 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.

2 participants