Skip to content

refactor(loader): remove LibvirtGraphicsListeners YAML expander (JSON decoder serves both paths) - #6

Merged
atrawog merged 2 commits into
mainfrom
feat/listen-json-superconsumer
Jul 8, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/listen-json-superconsumer

Conversation

@atrawog

@atrawog atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Consumer half of the sdk LibvirtGraphicsListeners.UnmarshalJSON fix (sdk v0.2026189.59, already merged). With the sdk type now a json.Unmarshaler, the CUE normalizer's implementsJSONUnmarshaler guard short-circuits it, so cue.Value.Decode runs the tri-shape decoder on both the YAML read path and the opaque substrate-decode path (a de-typed vm body). The charly-side expandLibvirtListenersNode expander (+ its cueShorthandExpanders entry) is now dead and deleted (R5) — one decoder serves both paths (R3, the Matcher/PortScope precedent).

Fixes the check-cross-vm-http web-vm regression (pre-existing, from Cutover L): listen: 127.0.0.1 scalar shorthand (and object/list forms) failed on the opaque path with "cannot unmarshal string into … LibvirtGraphicsListeners".

Bumps the sdk pointer 945974e → 0561805.

Change class + gate (R10)

Cross-repo (sdk pointer bump + loader Go). The failure is a load-time decode, so the gate is box validate (which folds + resolves web-vm's vm body through the exact opaque path) + the unit decoders:

  • go test ./... green (+ TestLibvirtListeners_OpaqueNotExpander locking the fix + the sdk TestLibvirtListeners_JSONTriShape); golangci-lint 0 issues; task build:charly R9 (charly version 2026.189.0109).
  • Live: charly -C box/fedora box validate exit 0 (before: vm resolve: decode: cannot unmarshal string into LibvirtGraphicsListeners).
  • R5: git grep expandLibvirtListenersNode → only CHANGELOG.

Tier: fully tested and validated.

Assisted-by: Claude (fully tested and validated)

… decoder serves both paths)

Consumer half of the sdk UnmarshalJSON fix (v0.2026189.59): the sdk type is now
a json.Unmarshaler, so implementsJSONUnmarshaler short-circuits it and
cue.Value.Decode runs its tri-shape UnmarshalJSON on both the YAML and opaque
substrate-decode paths. expandLibvirtListenersNode (+ its expander-map entry) is
dead → DELETED (R5); one decoder serves both paths (R3). Fixes check-cross-vm-http
(listen: 127.0.0.1 scalar shorthand on the opaque vm path). sdk pointer
945974e → 0561805. Live: box/fedora box validate exit 0.

Assisted-by: Claude (fully tested and validated)
@atrawog

atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: code/config (cross-repo: sdk pointer bump 945974e → 0561805 + loader Go in charly/cue_normalize.go)

Item Verdict
security & anti-tampering (T1–T4) PASS — 4 files, all accounted for in the summary; no scope mismatch, no secrets/exfiltration, no guardrail/CI/branch-protection edits. The only supply-chain change is the sdk pointer bump, independently verified below. No embedded instructions to the validator.
description complete PASS — Summary + Change class/gate (R10) with pasted evidence + tier.
change-class gate matches pasted evidence PASS — reproduced live (see below).
attribution tier justified PASS — fully tested and validated; the changed decode path executed live against the fresh-built binary.
R5 grep self-test clean PASS — git grep expandLibvirtListenersNode returns only CHANGELOG/2026.189.0110.md.
R1–R4 / clean architecture PASS — one decoder serves both paths (R3, the Matcher/PortScope precedent); expander + cueShorthandExpanders entry fully deleted (R5); no workaround/dup.
CHANGELOG present PASS — CHANGELOG/2026.189.0110.md (placeholder; finalized at merge).
skills honored PASS — cue-loader normalizer design (implementsJSONUnmarshaler short-circuits a json.Unmarshaler); R3/R5.

Independent verification (re-ran, trusted nothing):

  • sdk gitlink 0561805 is on the sdk's real origin/main, and 0561805:spec/union_types.go contains func (ll *LibvirtGraphicsListeners) UnmarshalJSON.
  • go build ./... clean; go test ./... green (49s); TestLibvirtListeners_OpaqueNotExpander PASS; golangci-lint 0 issues; gofmt -l clean.
  • task build:charly → charly version 2026.189.0113 (R9); pkg/arch/PKGBUILD restored.
  • Live load-time decode gate: charly -C box/fedora box validate → exit 0 (before the fix this failed at vm resolve: decode: cannot unmarshal string into LibvirtGraphicsListeners). box/fedora/charly.yml:687 (listen: 127.0.0.1 under web-vm's spice graphics:) confirms the gate genuinely folds+resolves the shorthand through the opaque path this PR repairs — the gate can fail on the change.

Decision: APPROVED. The failure class is a load-time decode; box validate executes the exact changed decode path on the real web-vm shorthand and now exits 0, the decode result is byte-locked by the unit test (type:address, address:127.0.0.1, matching the pre-regression expander output), and no downstream libvirt/render code changed. Finalizing the merge-time CalVer, merging --rebase, and tagging.

Assisted-by: Claude (analysed on a live system)

@atrawog
atrawog merged commit 1ec236c into main Jul 8, 2026
@atrawog
atrawog deleted the feat/listen-json-superconsumer branch July 8, 2026 01:23
atrawog added a commit that referenced this pull request Jul 9, 2026
…; fix -C fail-open

The pre-commit gate detected commits with a regex that could not span a quoted arg
with a space: a failed match was read as 'no commit' and allowed everything, so
git -C "$P" commit blocked with a misleading message and git -C "/has space" commit
bypassed the gate. Fixing that had grown into a ~200-line shell-parsing engine
(line-continuation normalization, eval/bash -c recursion, a wrapper safety net)
chasing obfuscations a static gate provably cannot close and no honest commit uses.

Wrong shape. These gates are DISCIPLINE BACKSTOPS, not security boundaries: every
change is re-validated by a fresh pr-validator agent and by GitHub branch protection.
Rewritten to catch the common honest mistakes cheaply and delegate the rest.

- New shared .claude/hooks/gitcmd.py: git_invocations() finds git [globals] <subcmd>
  via plain shlex.split (quotes handled -> a quoted spaced path is one token, the one
  real fix), plus hooks_path_override() and dash_c_dir(). The parsing was duplicated
  across both gates (same fail-open in each) and now lives once (R3).
- pre-commit-gate.sh: the five documented invariants as INDEPENDENT best-effort checks,
  so no single fragile parse disables the rest. An unresolvable -C (a $VAR / bad path)
  SKIPS the diff-dependent checks rather than inspecting the wrong repo.
- pre-push-gate.sh: force-push / --no-verify / core.hooksPath / push-to-main over the
  same shared parser, which also closes its identical fail-open (was task #6).
- Deleted the whole anti-obfuscation layer. Obfuscation (splitting the command word,
  runtime-generated strings) defeats any static parser in an infinite regress; GitHub
  branch protection is the authority for the adversarial case.

27-case behavioural suite on real repos, all pass: every invariant blocks its violation
and allows its honest form, incl. the original bug now fixed, -C to a submodule,
--no-verify inside a message, commit's own -c HEAD~1, echo-mention, and the push set.

Assisted-by: Claude (fully tested and validated)
github-actions Bot pushed a commit that referenced this pull request Aug 29, 2026
Carries plugin-marketplace#5 (marketplace.json description/version moved to top level per
the Claude Code plugin-marketplace spec — they were nested under metadata, so the published
catalog had neither as far as Claude Code is concerned) and #6 (the generator generates the
marketplace and nothing else: emit_hooks, emit_dispatcher and emit_setup deleted, -513 lines).

Verified at the tag rather than inferred from the PR numbers: the emitter carries
`json:"description,omitempty"` and emit_hooks.go is absent.

The corpus cannot receive either change until this ref advances, because generation resolves
the generator through this pin.

Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)

Claude-Session: https://claude.ai/code/session_01RsGxCtfzmm8S5wJzjSBGrY

Co-authored-by: atrawog <[email protected]>
github-actions Bot pushed a commit that referenced this pull request Aug 30, 2026
main ships the omarchy `installer:` block (#485) with a plugin-vm that
does not implement `source.kind: iso`. So the answer format is there and
unusable:

  charly: error: command "vm": vm "omarchy-vm":
    unsupported source.kind "iso" (want one of cloud_image, bootc, bootstrap)

#485 carried this bump as a second commit; the squash-merge landed only
charly/charly.yml. Confirmed:

  $ git show --stat 5caaf43 | tail -2
   charly/charly.yml | 236 +++++++++++++++++++++++++++++++++++++++++++
   1 file changed, 236 insertions(+)

So this is not a new dependency decision — it is the half of #485 that
did not land, restored, and re-verified against what is published now
rather than what was published then.

  plugin-vm      v0.2026240.2034 -> v0.2026242.1323
  plugin-distro  v0.2026242.804  -> v0.2026242.1131
  sdk            v0.2026241.2111 -> v0.2026242.1250
  spec           v0.2026242.753  -> v0.2026242.1251

plugin-vm brings the iso engine (#8), the virtio answers volume (#9) and
the per-domain seed (#10). plugin-distro brings the resolver that stops
`installer:` arriving nil at every consumer (#6) — without it the block
in charly.yml is silently dropped even once the engine exists. sdk and
spec bring the seed context's disk_size_bytes and the template
arithmetic the partition geometry needs.

Verified: `task build:binary` passes its own go.work.sum drift guard, and
the resulting binary builds an iso VM — vm-build and vm-create both PASS
on check-omarchy-iso-vm, where the previous binary failed in 761 ms with
the error above.

Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3

Co-authored-by: atrawog <[email protected]>
github-actions Bot pushed a commit that referenced this pull request Aug 30, 2026
distro-omarchy has landed two PRs that charly's gitlink does not yet reach:

  #5  omarchy-vm — the official ISO, installed unattended, and its
      disposable bed check-omarchy-iso-vm
  #6  charly-omarchy — the ready-to-run keeper deploy, and its
      disposable twin check-charly-omarchy-vm

Until this bump, none of those entities is reachable from charly: `charly -C
box/omarchy vm build omarchy-vm` resolves the pinned commit, which predates
them. The work was merged but not wired in.

Both beds pass on the submodule commit this pins:

  check-omarchy-iso-vm      PASS (steps=9), zero non-allowlisted findings,
                            13/13 after the disposable rebuild
  check-charly-omarchy-vm   PASS (steps=9), check-live 11/11

Policy B is preserved by construction: this repo's box/omarchy IS the pin the
umbrella mirrors, so the umbrella syncs to this rather than being hand-pinned.
That sync is its own PR in opencharly/opencharly.

Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3

Co-authored-by: atrawog <[email protected]>
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.

1 participant