Repository navigation
fix(spec): LibvirtGraphicsListeners UnmarshalJSON tri-shape - #3
Conversation
Cutover L made vm bodies opaque JSON; LibvirtGraphicsListeners had UnmarshalYAML + a charly-side expander but no UnmarshalJSON, so `listen: 127.0.0.1` scalar shorthand (and object/list forms) failed on the JSON path (check-cross-vm-http). Add UnmarshalJSON + inferListenTypes; both read paths now share one decoder (R3; the redundant YAML expander is removed in the superproject cutover). Additive method, no wire-key change, no schema/protocol bump. Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: code/config (sdk contract — Go library, producer half of a B6 producer→consumer landing) I re-derived every check independently against
Decision: APPROVED. The change adds Assisted-by: Claude (fully tested and validated) |
Assisted-by: Claude (fully tested and validated)
Summary
Cutover L de-typed the vm substrate body to opaque JSON decoded into
spec.Vm, butspec.LibvirtGraphicsListenershad onlyUnmarshalYAML+ a charly-side YAML expander — noUnmarshalJSON. The documentedlisten: 127.0.0.1scalar shorthand (and object/list forms) therefore failed on the JSON path with "cannot unmarshal string into …" — thecheck-cross-vm-httpweb-vm bed failure (identical on main, pre-existing). AddedUnmarshalJSON+inferListenTypesaccepting all three shapes; the YAML path decodes the same three viacue.Value.Decoderunning this method (the Matcher/PortScope self-decoding strategy), so one decoder now serves both paths (R3) — the redundantexpandLibvirtListenersNodeis removed in the consuming superproject cutover.Change class + gate
sdk contract.
go build ./... && go test ./...green; newTestLibvirtListeners_JSONTriShapecovers scalar/object/list/null/malformed. Purely additive Go method — no wire-key change → no#SchemaVersion/sdk.ProtocolVersionbump. Live proof (check-cross-vm-httpgreen) rides the superproject consumer PR that bumps this pointer.Tier: fully tested and validated.
Assisted-by: Claude (fully tested and validated)