Repository navigation
feat(spec)!: SDD-conversion batch — the last 13 hand-written wire files land - #92
Conversation
…es land Converts agent/deploy/distro/doctor/enc/feature/gpu/init/k8sgen/resource/ settings/substrate_template/vm from hand-written sdk/spec/*_wire.go to CUE defs (sdk/schema/*.cue), per the standing SDD mandate: wire types are CUE-sourced without exception, and a hand-written wire struct not yet converted is conversion-in-progress, never a sanctioned exception. sdk/spec/*_wire.go is now an extinct file class. Two representation reshapes were required for byte-compatible generation (both zero wire-format change, proven via a 21-case marshal-parity harness): HostProbeReply.GroupAccessible int-keyed -> string-keyed map (CUE has no int-keyed-map construct; encoding/json already renders int map keys as decimal strings), and VFIOGpu's embedded VFIOPCIDevice flattened (CUE unification has no Go-embedding concept; Go's own JSON promotion already made the wire shape identical) with a new spec.NewVFIOGpu constructor. Scope/ReverseOpKind (named enum types with Go behavior) and the pure Diagnostics/LifecycleOptsFromEmit/ResolvedDistro/ResolvedAndroid methods stay hand-written beside their CUE-generated siblings, mirroring the existing Status/status_result.go and Op.Kind()/charly_methods.go precedents. An RDD-caught #KeyValue/kindValueDefs naming collision was avoided by renaming to #EnvKV with a charly-name alias. Breaking: HostProbeReply.GroupAccessible changes from map[int]bool to map[string]bool (JSON-wire-identical; Go-source-breaking for any direct int-keyed construction/read — fixed in the companion charly PR) and VFIOGpu loses its anonymous-embedded VFIOPCIDevice field (also JSON-wire-identical; fixed via the new spec.NewVFIOGpu constructor). Verified: GOWORK=off build/vet/test all green (incl. TestGenReproducible), go mod tidy/verify clean, the 21-case marshal-parity harness all PASS, and a full charly-workspace build/vet/test (charly/ + all candy/plugin-* modules, incl. the two out-of-workspace plugin-deploy-vm/-pod modules) against this branch, all green. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
…e.go citations Follow-up to the SDD-conversion batch: three seam.cue doc comments and ir_enums.go's two doc-comment citations still named the just-deleted sdk/spec/*_wire.go files (deploy_wire.go, substrate_template_wire.go, vm_wire.go) as the current home of types this same batch converted to CUE. Caught by the R5 grep self-test before push. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — APPROVED ✅Change class: charly-or-sdk Go (sdk-only; runtime tier). Fresh independent re-derivation performed in a standalone clone ( Change class → gate check. 13 hand-written Independent re-derivation (all commands re-run by me, live, in a fresh clone)
SDD mandate — verified at 100%, not accepted on the author's word
R10 bed evidence — cross-checked against on-disk artifacts, not trusted blind
Cross-repo / cutover-sizing noteThis PR converts sdk wire types only; the companion Security & anti-tampering (T1–T4)No exfiltration, no scope-mismatch (every changed file accounted for in the description), no weakened guardrail ( Comment intakeNone — the PR carries zero comments. Cross-PR interactions considered
Checklist
Decision: PASS. Independently re-derived every claim in the PR body against a fresh standalone clone rather than trusting the pasted output — build/vet/test/lint/mod-tidy/mod-verify all reproduced green, the wire-file deletion and zero-new-disjunction/zero-new-hand-exception claims verified directly against the diff, and the disposable-bed evidence cross-checked byte-for-byte against artifacts left on disk. No blocking finding. Proceeding to finalize the merge-time CalVer, merge, and tag. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system) |
pr-validator: rewrite the CHANGELOG placeholder to the merge-time CalVer. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
pr-validator — merged + tagged
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system) |
… VFIOGpu Companion to `opencharly/sdk#92` (merged, `v0.2026203.1311`): bumps the `sdk` gitlink + `charly/go.mod` require, and updates every consumer of the two representation reshapes that PR's `HostProbeReply.GroupAccessible` and `VFIOGpu` CUE conversion required (both wire-format-identical, Go-source breaking). - `sdk` gitlink bumped to `922b3469`; `charly/go.mod` require bumped to `v0.2026203.1311`. - `HostProbeReply.GroupAccessible` is now `map[string]bool` (was `map[int]bool`) — updated construction/read call sites. - `VFIOGpu` no longer embeds `VFIOPCIDevice` anonymously — every composite literal replaced with the new `spec.NewVFIOGpu(d)` constructor. - One stale doc-comment citation of the deleted `sdk/spec/deploy_wire.go` repointed to `sdk/schema/buildwire.cue`. - Mechanical gofmt rider: 8 files left unformatted by #179 (whitespace-only, verified via `git diff -w --ignore-blank-lines` emptiness). Independently re-verified by a fresh pr-validator: JSON wire-identity of the GroupAccessible reshape confirmed mechanically; sdk gitlink verified as sdk's real origin/main HEAD; fresh rebuild + go test/vet/lint + the check-exampledeploy disposable bed all re-run from scratch on the exact PR head, all green. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
…c/*_wire.go files land Documentation-only sweep: repoints every skill reference to the 13 hand-written `sdk/spec/*_wire.go` files (`deploy`/`init`/`gpu`/`doctor`/ `enc`/`feature`/`k8sgen`/`resource`/`settings`/`substrate_template`/`agent`/ `distro`/`vm`) to their new CUE homes, following `opencharly/sdk#92` (merged, `v0.2026203.1311`) and its companion `opencharly/charly#181` (merged, `v2026.203.1349`). - Rewrites the "Generation coverage" bullet in `internals/skills/go/SKILL.md` to mark the whole `sdk/spec/*_wire.go` class LANDED. - Repoints the deploy-wire file-map rows in `internals/skills/install-plan/SKILL.md`, `internals/skills/plugin/SKILL.md`, `check/skills/android/SKILL.md`, `automation/skills/enc/SKILL.md`, `core/skills/charly-doctor/SKILL.md`. - Closes an R1 divergence: `internals/agents/pr-validator.md`'s `arbiter_wire.go` worked example updated from "still in-flight" to its actual LANDED state. Independently re-verified by a fresh pr-validator against the real merged sdk content (every cited CUE/Go file confirmed to exist at sdk 922b3469; sdk/spec/*_wire.go confirmed EXTINCT; R5 grep self-test re-run from scratch). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; documentation reviewed)
Summary of changes
Converts the remaining 13 hand-written
sdk/spec/*_wire.gohost↔plugin wirefiles to CUE defs, per the standing operator directive: WIRE TYPES ARE
CUE-SOURCED WITHOUT EXCEPTION, and a hand-written wire struct not yet
converted is conversion-in-progress, never a sanctioned exception.
Converted:
agent,deploy(987 lines / ~50 types, converted LAST after thepattern was re-proven on the smaller files),
distro,doctor,enc,feature,gpu,init,k8sgen,resource,settings,substrate_template,vm.sdk/spec/*_wire.gois now an EXTINCT file class(joining
buildctx.cue/clean.cue/arbiter.cue, landed earlier).New/appended
sdk/schema/*.cue:settings.cue,feature.cue,doctor.cue,gpu.cue,enc.cue,k8sgen.cue,substrate_template.cue,buildwire.cue(new);
agent.cue,distro.cue,init.cue,vm.cue,resource.cue,sidecar.cue,deploy.cue,seam.cue,validateproject.cue(appended/repointed). Every def is a plain or discriminated struct — the
batch needed zero disjunctions anywhere, confirming the mandate's core claim.
Two representation reshapes, both zero-wire-format-change:
HostProbeReply.GroupAccessible(doctor):map[int]bool→map[string]bool.CUE has no int-keyed-map construct.
encoding/jsonalready renders amap[int]bool's keys as decimal strings on the wire, so this is a pureGo-side representation fix.
VFIOGpu(gpu): the former anonymous-embeddedVFIOPCIDeviceFLATTENED.CUE unification has no Go-embedding concept; Go's own JSON-promotion of an
embedded field already made the wire shape identical either way. A new
spec.NewVFIOGpu(d)constructor replaces everyVFIOGpu{VFIOPCIDevice: d}literal.
Hand-written exceptions (all pre-existing categories, none new):
Scope/ReverseOpKind(named enum types with Go behavior,spec/deploy_consts.go,mirroring
Status/status_result.go);Diagnostics.HasErrors(),LifecycleOptsFromEmit,ResolvedDistro.PrimaryFormat()/LocalPkgFormat(),ResolvedAndroid.IsEndpoint()/EffectiveSerial()(pure Go methods CUE cannotexpress, mirroring
Op.Kind());EncMethod*(spec/enc_consts.go, plainstring constants).
RawBodymoved from the deleteddeploy_wire.gotospec/scalar_aliases.go(a scalar alias, not a wire struct).RDD catch:
#KeyValuewould have collided with the schemagenkindValueDefsauto-registration (any top-level#<X>Valuedef is treated asa kind-value gate) — renamed to
#EnvKVwith aKeyValue = EnvKVcharly-namealias preserving every real consumer's type name.
Change class
sdk (charly-or-sdk Go) — cross-repo: this PR (sdk) lands first; a companion
opencharly/charlyPR (theNewVFIOGpu/GroupAccessibleconsumer fixes atthe 8 call sites, held until this merges + the gitlink bumps) and a companion
opencharly/pluginsPR (skill-doc sweep, held for the same reason) follow.How R10-tested — exact gate, commands, and pasted output
marshal-parity harness + a full charly-workspace build/test against the
branch + ONE composing disposable bed (
check-exampledeploy— the changetouches deploy/check wire:
InstallPlanView/InstallStepView/ReverseOp/DeployVenue/VenueDescriptor, and this bed is the sole live exerciser ofthe external-deploy-target reverse channel + the F3 build-engine channel
those types carry).
check-exampledeploy | local (pod) | ok | 6 steps | ~87s total—run on
charly version 2026.203.1239(built from this branch via atemporary
go.workuseoverride, since the superproject's committed sdkgitlink cannot point at an unmerged sdk PR),
.check/check-exampledeploy/2026.203.1255/.Single bed — not a cross-cutting loader/resolver change, so no roster fan-out.
updatestep (line below) IS thefresh-rebuild leg (
charly updatere-applies the deploy from the SAMErebuilt binary + regenerated plan).
step below exercises a converted type:
deploy-addmarshalsLifecycleOpts/DeployVenue/InstallPlanViewover the reverse channel;check-live's 5checks assert the plugin executed
InstallStepView(file-write + shell-hooksteps) via the round-tripped per-step IR, pushed via
PutFile, and drove theF3
RunHostStep/build-engine leg;updatere-applies idempotently;cleanupreplays the recordedReverseOps (teardown proof).loader/ledger/store/arbiter shared-state paths.
Attribution tier
fully tested and validated— the cutover's new/changed code paths (everyconverted type, both reshapes) executed live against a fresh rebuild via the
check-exampledeploybed above, plus the full standalone + workspace battery.Harness rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:cutover-policyloaded before any edit.#KeyValue/kindValueDefscollision (caught via the regeneratedKindValueDefsmap before commit, fixed by renaming to#EnvKV); (b) theint64-default-for-untyped-CUE-int gengotypes behavior (every
intfieldneeding Go
int, notint64, now carries an explicittype=intoverride —discovered by inspecting the ALREADY-LANDED arbiter.cue conversion's
OwnerPID/int64outcome and its companion candy/plugin-preempt fix,confirming the pattern rather than repeating the churn). Zero warnings in
the final battery (build/vet/lint/test all clean).
gpu_consts.godriver-switch wire types(
GpuSwitchInput/GpuSwitchReply) are a SEPARATE, untouched, pre-existinghand-written surface — explicitly out of scope for this batch (I did not
modify that file, so "modified code obligates full compliance" doesn't
apply); it is tracked debt for its own future batch. One unrelated
gofmt -lhit (vmshared/cloud_init_iso.go, a trailing-blank-line nit) ispre-existing on origin/main (from
e6b0208, not this PR's diff) — confirmedvia
git logblame — and is NOT part of this PR's changed-file set;reported, not silently fixed here (R2: genuinely unrelated, non-blocking).
mechanism (
spec.NewVFIOGpu, the string-key reshape) applied at every callsite, not per-site patches.
go.workuseoverride for cross-repo verification is a standard pre-mergeproducer/consumer testing technique (git-workflow B6), reverted before
every commit.
git grep '_wire\.go'(excluding CHANGELOG)returns only historical/explanatory "the former X is deleted" mentions —
pasted and reviewed; zero live references to any deleted file remain.
A companion follow-up commit (
cace03d) caught 3 stale doc-commentcitations in
seam.cue/ir_enums.gobefore push.git status/git stash listchecked before therebase-onto-origin/main (which had advanced with an unrelated dead-code
batch,
e6b0208);git stash -u+git rebase+git stash pop, no dataloss.
check-exampledeploybed IS the end-to-end gate(not just
go test).touched by this sdk-only change.
charly version 2026.203.1239,built from this exact branch (pasted above); no new runtime OS deps.
check-exampledeployisdisposable: true;fresh rebuild proven via its own
updatestep; the marshal-parity harnessis the new coverage this PR ships (would FAIL without the conversion's
byte-compatibility).
#KeyValuecollisionwere each proven empirically (a live
task cue:genrun + inspection),never assumed. ADE — N/A (no candy/box changed). SDD — this whole PR IS the
SDD pipeline in action;
task cue:genon the final tree is a verified no-op(
TestGenReproduciblepasses).batch + an R5-sweep follow-up, squashed at merge); no transitional/dual-mode
path — every hand file is deleted outright in the same commit as its CUE
replacement.
itself (clause-E), not a kernel/plugin placement question.
disposable: true;charly updateran unattended per standing authorization.
gofmt -l .clean for every file this PRtouches (the one unrelated pre-existing hit is noted above, not in this
diff);
golangci-lint run ./...0 issues;go vetclean;go test ./...green.
CHANGELOG/2026.203.1300.mdstaged (placeholder CalVer).Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)