Repository navigation
feat(schema): single-source the verb:oci cache-transfer wire types - #149
Conversation
…CacheTransferRequest/#CacheTransferReply)
The verb:oci cache-push/cache-pull transport (candy/plugin-oci) and its
`charly cache push/pull` operator surface (candy/plugin-cache) hand-wrote the
same peer-dispatch JSON envelope in two modules — the drift risk R3 forbids. The
existing OCI wire types (#MergeRequest/#MergeReply, #ImageUserInput/#UserInfo)
are CUE single-sourced here; the cache-transfer pair joins them.
Adds #CacheTransferRequest{dir,ref,insecure?} and
#CacheTransferReply{digest?,entries?,ref?} to schema/oci.cue; regenerates
spec/cue_types_gen.go (reproducibility-gated — TestGenReproducible passes, two
consecutive gens are byte-identical).
Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS (no secrets/egress, no guardrail or rulebook weakening, no supply-chain edit). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
#178) 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). Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
Single-sources the verb:oci cache-transfer wire types in CUE. The transport (candy/plugin-oci's
cache-push/cache-pull) and itscharly cache push/pulloperator surface (candy/plugin-cache) each hand-wrote the same peer-dispatch JSON envelope — the drift risk R3 forbids. The existing OCI wire types (#MergeRequest/#MergeReply,#ImageUserInput/#UserInfo) are CUE single-sourced here inschema/oci.cue; the cache-transfer pair joins them:#CacheTransferRequest { dir, ref, insecure? }— the named cache's OCI Image Layout dir + the registry ref.#CacheTransferReply { digest?, entries?, ref? }— the resolved digest, the count of entry manifests moved, the canonicalised ref.The Go structs (
spec.CacheTransferRequest/spec.CacheTransferReply) are regenerated intospec/cue_types_gen.gobytask cue:gen; both plugins will consume them (their own PRs, producer→consumer order).Files (2):
schema/oci.cue(+19),spec/cue_types_gen.go(+23, generated).How tested
specis a contract/library module — nocharly.ymlproject, nomain/deployable target, nodisposable: trueentity. Per the R10 change-class matrix's mergedContract / library modulerow (layer-charly-check#20, 2026-09-23), the repo's own committed CI is the change-class gate: build + test + gofmt + golangci-lint green on the PR head, with the suite genuinely executing the changed path (the generator).TestGenReproducibleis the coverage that fails without the change: the generatedspec/cue_types_gen.gomust be a byte-identical re-run of the CUE source. Verified — a secondtask cue:genproduces no diff, and the two new structs appear:Rulebook compliance
/charly-internals:go(the schema→spec generation recipe + the CUE single-source rules) and/charly-internals:git-workflow.gofmt/go vet/go testclean.feat/cache-transfer-wireoff freshorigin/main; no force-push.TestGenReproducibleexecutes the generator and fails on any drift.N/A — spec builds libraries; no main/deployable target, so the module suite is the class gate(the mergedContract / library modulerow). The live transport bed rides plugin-oci (already merged).schema/*.cue, generated bytask cue:gen, reproducibility-gated.Change classification
gofmt+go vet+go test ./...) +TestGenReproducible.fully tested and validated.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)