Repository navigation
fix(charly,migrate)!: validation-correctness batch — vm PCI-hostdev concreteness + shell overlay retirement - #182
Conversation
…oncreteness + shell overlay retirement
Two independent fixes RCA'd during the dead-code-radical-removal batch,
landed together because they share the sdk schema-version bump:
1. Closes a validation gap: validateKindValueCUE's closedness-only gate
let a vm: libvirt PCI hostdev with an unset source.{domain,bus,slot,
function} slip through silently. A new, narrowly-scoped
validateKindValueConcrete enforces cue.Concrete(true) on exactly those
four fields for type: pci hostdevs only — never a blanket document-wide
flip (which was tried earlier and reverted: it broke 9 real cases
across vm/pod/local/k8s/candy). 5 new unit tests
(charly/provider_kind_invoke_concrete_test.go).
2. Retires the deploy-scope shell: overlay authoring field
(#Deploy.shell / #DeployShellOverlay, companion sdk PR) outright — it
had zero production consumer anywhere in this repo's history. New
migration-table entry strip-deploy-shell-overlay (touches_host: true)
+ the stripDeployShellOverlay reshaper hook
(candy/plugin-migrate/reshape_strip_deploy_shell.go), which strips
only a direct SEQUENCE-valued shell: key at any depth, leaving a
candy's own mapping-valued shell: (#Shell intrinsic init) untouched.
R5 sweep: vmshared_aliases.go, the dead
TestDeployShellOverlay_YAMLParse test, deploy.go/shellcollect.go
comments. All in-repo charly.yml files + box/fedora + box/cachyos
re-stamped to the new schema (the latter two locally only — their own
re-stamp PRs follow separately; box/cachyos was re-stamped here
because charly's own test suite loads it directly via LoadUnified).
sdk gitlink bumped to the pushed (not yet merged) sdk
feat/k5b-validation-concreteness branch tip; charly/go.mod's require
version stays at the prior tag for now (inert under the local `replace
../sdk`) — will be corrected to the real merged tag once the sdk PR
lands.
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: charly-or-sdk Go (validation logic + migration engine + schema-version-driven test-fixture re-stamps) I re-derived this independently in a fresh
Finding 1 (BLOCKING) —
|
Schema re-stamp leg of the K5-B validation-correctness batch (companion opencharly/sdk#93, merged as 168169d/v0.2026204.1223; opencharly/charly#182). This repo authors no deploy-scope shell: overlay, so the bump is a pure version-stamp update: charly migrate rewrote version: 2026.202.0105 -> 2026.204.1223 with zero other content change. Independently re-verified by the fresh pr-validator using a scratch charly binary built from the merged sdk: charly migrate idempotent, charly box validate exit 0, charly box generate exit 0, no live shell: overlay reference. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
Schema re-stamp leg of the K5-B validation-correctness batch (companion opencharly/sdk#93, merged as 168169d/v0.2026204.1223; opencharly/charly#182). This repo authors no deploy-scope shell: overlay, so the bump is a pure version-stamp update: charly migrate rewrote version: 2026.202.0105 -> 2026.204.1223 with zero other content change. Independently re-verified by the fresh pr-validator using a scratch charly binary built from the merged sdk: charly migrate idempotent, charly box validate exit 0, charly box generate exit 0, no live shell: overlay reference. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
Schema re-stamp leg of the K5-B validation-correctness batch (companion opencharly/sdk#93, merged as 168169d/v0.2026204.1223; opencharly/charly#182). This repo authors no deploy-scope shell: overlay, so the bump is a pure version-stamp update: charly migrate rewrote version: 2026.202.0105 -> 2026.204.1223 with zero other content change. Independently re-verified by the fresh pr-validator using a scratch charly binary built from the merged sdk: charly migrate idempotent, charly box validate exit 0, charly box generate exit 0, no live shell: overlay reference. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
Schema re-stamp leg of the K5-B validation-correctness batch (companion opencharly/sdk#93, merged as 168169d/v0.2026204.1223; opencharly/charly#182). This repo authors no deploy-scope shell: overlay and no vm: PCI hostdev, so the bump is a pure version-stamp update: charly migrate rewrote version: 2026.202.0105 -> 2026.204.1223 with zero other content change. Independently re-verified by the fresh pr-validator using a scratch charly binary built from the merged sdk: charly migrate idempotent, charly box validate exit 0, charly box generate exit 0 (confirmed genuine, non-hung wall-clock cost from this repo's large plugin-candy set; Containerfiles present for every composed image), no live shell: overlay reference. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
Schema re-stamp leg of the K5-B validation-correctness batch (companion opencharly/sdk#93, merged as 168169d/v0.2026204.1223; opencharly/charly#182). This repo authors no deploy-scope shell: overlay, so the bump is a pure version-stamp update: charly migrate rewrote version: 2026.202.0105 -> 2026.204.1223 with zero other content change. Independently re-verified by the fresh pr-validator using a scratch charly binary built from the merged sdk: charly migrate idempotent, charly box validate exit 0, charly box generate exit 0 (confirmed genuine, non-hung wall-clock cost; Containerfiles present for every composed image including the arch-namespaced ones this repo imports). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…k repoint, box gitlinks Fix round addressing both blocking findings from an independent PR-validator review of the original commit (RCA'd in CHANGELOG/2026.204.1223.md): 1. Kernel/plugin boundary-law violation: the vm PCI-hostdev concreteness check (validateKindValueConcrete) was landed directly in charly/provider_kind_invoke.go, hardcoding a kind-word branch + PCI field-path knowledge in core. Relocated to candy/plugin-substrate's "vm" capability via the sanctioned F7/C8 deep OpValidate mechanism: only the "vm" capability declares Validates:true, a new shared dispatchKindOpValidate helper (R3) drives the dispatch kind-blindly from both the flat op.Params kind path and the new foldSubstrateKind call site, and validateKindValueCUE is restored to closedness-only permanently. New candy/plugin-substrate/validate_vm.go (+ 5 unit tests) implements the check; the former 5 host-side unit tests became 5 charly-side integration tests proving the end-to-end wiring through the real compiled-in registry. 2. Committed-tree R7/R10 regression: box/fedora and box/cachyos were only LOCALLY re-stamped in the author's prior working tree, so a fresh checkout of the original commit would have failed go test ./charly/... the moment it merged. Fixed by resequencing: all 5 box/<distro> re-stamp PRs land FIRST as their own PRs (arch/debian/ubuntu at v2026.204.1300, fedora at v2026.204.1329, cachyos at v2026.204.1336), and this commit bumps all 5 gitlinks to their merged commits, so the committed tree is self-consistent. Also: sdk gitlink repointed to the MERGED opencharly/sdk#93 commit (168169d6, tag v0.2026204.1223, not the earlier unmerged branch tip); charly/go.mod's sdk require bumped to match; migrations.cue's strip-deploy-shell-overlay entry re-stamped to 2026.204.1223 (must equal the finalized schema version — a coupled pair); every in-repo charly.yml + test fixture re-stamped to match; CHANGELOG/2026.203.2359.md renamed to CHANGELOG/2026.204.1223.md with content updated to record both findings and their fixes. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — APPROVED ✅ (supersedes my prior CHANGES REQUESTED verdict)Change class: charly-or-sdk Go (validation logic + migration engine + schema-version-driven test-fixture re-stamps) Fully re-derived independently in a fresh Finding 1 (was BLOCKING) — go test regression: RESOLVED, reverified
Finding 2 (was BLOCKING) — architecture gate: RESOLVED, reverified
Full checklist (all PASS/N/A this round)0 security ✓ · 1 description ✓ · 2 gate ✓ (reran everything) · 3 attribution ✓ Comments considered: my own prior CHANGES REQUESTED comment (superseded by this one, per the git-workflow skill's re-run convention) — disposition: Cross-PR interactions considered: Decision: PASS. Both blocking findings were resolved correctly — not papered over — and I independently reproduced every claim rather than trusting the pasted evidence. Finalizing the merge-time CalVer, merging, and tagging now. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated) |
pr-validator: rename the placeholder CHANGELOG to this repo's own merge-time CalVer and rewrite its H1 heading to match. Distinct from the 2026.204.1223 schema-version value referenced throughout the body (that value is the cross-repo-shared sdk schema stamp, finalized separately at sdk#93's merge) — only this file's own identity changes. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
…n-correctness batch Documentation-only follow-on to the prior architecture-docs divergence batch, for the just-merged opencharly/sdk#93 + opencharly/charly#182 (K5-B validation-correctness batch). That prior batch correctly flagged MergeDeployShell as dead code but described the FIELD itself (#Deploy.shell/#DeployShellOverlay) as still authorable ("parsed but not applied"). The companion PRs deleted the field from the schema outright, so that description was stale. Fixes internals/skills/capabilities/SKILL.md and internals/skills/install-plan/SKILL.md to state the field's actual deletion. Independently re-verified by the fresh pr-validator, including checking the underlying fact behind the doc change (not just that the prose reads plausibly): the Origin field is an unconstrained string with no live call site ever setting it to "deploy", confirming that value's removal from the doc's descriptive list is accurate. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; documentation reviewed)
…re ResolveBox perf regression Merging #182 (the shell-overlay retirement + schema bump) into K1-unblock wave 2's branch surfaced two REAL, previously-dormant defects in fillNamespacedBoxes (resolved_project_host.go) — both exposed for the first time by this same wave making namespaced boxes visible to `charly box validate` (and every other resolved-project consumer) for the first time. Root-caused and fixed both in this cutover per R1/R2 (neither is separable from wave 2's own claim: shipping without them leaves `charly box validate` failing hard, or unusably slow). 1. NAMESPACED-BOX CANDY RESOLUTION (candy resolution error: unknown candy) rp.CandyModels came ONLY from the ROOT project's own ScanAllCandyWithConfigOpts scan. A namespaced box's candy dependency list - whether a LOCAL discover:-found candy (e.g. box/arch/candy/arch-pac-test) or a cross-repo @github-pinned candy from the parent superproject's shared library - was never resolvable at all: candy/plugin-box's validate rules never iterated a namespaced box before this wave added them to rp.Boxes, so the gap was dormant. Fix (three RDD iterations, documented in fillNamespacedBoxes' own doc comment - each ruled out via a live origin/main-vs-branch comparison and direct filesystem checks, not guessed): - First attempt (ScanAllCandyWithConfigOpts(dir, sub, opts)) fixed the remote-ref case but not local discover:-found candies: that function's scanLocalCandies(dir) always re-invokes LoadUnified(dir) fresh, ignoring its cfg parameter for local scanning entirely. - Second attempt (subUF.ProjectCandies(dir), reading uf.Candy directly) fixed local candies but silently dropped remote-ref fetching (a narrower, local-only method) - it REGRESSED the remote case back to "unknown candy" for every cross-repo pin. - Final fix: extracted ScanAllCandyWithConfigOpts's step-2-onward body (remote-ref collect, fix-point fetch, per-entity-version arbitration, finalize) into scanCandyFromLocal(localScanned, cfg, dir, opts) - R3, one pipeline, not a duplicate - fed with subUF.projectCandiesScanned (the namespace's OWN already-materialized local candy set) instead of a broken re-scan. This needed subUF's own base directory (a discovered candy's From: path is relative to ITS OWN root, not the caller's) - added UnifiedFile.RootDir, set once per materialize (materializeLoadedProject, from the root document's SrcDir) for BOTH the top-level project and every mounted namespace. fillNamespacedBoxes now walks uf.Namespaces (a *UnifiedFile tree, matching fillNamespacedTemplates' existing pattern) instead of cfg.Namespaces (a *Config tree, which never carried .Candy or a directory at all) - the real reason the first two attempts couldn't reach the right data. 2. RESOLVEBOX PERFORMANCE REGRESSION (69.5s -> 7.7s per resolve; ~530s -> ~130s full test suite; ~70s -> ~12s `charly box validate`) ResolveBox's fillBuildConfigFallback re-runs a full LoadUnified(dir) - the ENTIRE multi-repo project walk - on every call when opts.DistroCfg/BuilderCfg are nil. This was a dormant, pre-existing cost: main's own root-scope box loop has resolved ZERO boxes since the 2026-06 box inversion (main owns no boxes), so it never paid this price. fillNamespacedBoxes is the FIRST caller to run ResolveBox in a real loop at scale (this repo: 80 boxes across arch/cachyos/cachyos.arch/fedora) - confirmed via live timing instrumentation (removed before this commit): a uniform ~700-880ms per call, matching exactly the observed 69.5s total. Diagnosed only after two genuine background-process kills (the runaway test binary hit 25.7GB RSS / 215% CPU) - verified via a bounded sleep-only diagnostic that the harness itself was not at fault. Fix: projectResolvedProjectWithBoxes now pre-populates opts.DistroCfg/BuilderCfg from the values it ALREADY receives as parameters (loaded once by its own caller), before either its own root-scope box loop or fillNamespacedBoxes' namespace loop runs. Behavior-IDENTICAL, not a semantic change: the slow reload path always resolved the SAME dir regardless of which box/namespace was being processed, so caching what was always recomputed is a pure performance fix (distro: is confirmed to inherit across a namespace boundary per the project rulebook's own note). R10: `go build ./...` / `go vet ./...` clean. Full `go test ./...` green (129.328s, was 529.868s pre-fix and hanging/killed at the broken intermediate state). `charly box validate`: zero output, exit 0, both from the superproject root and standalone from every box submodule (arch/cachyos/debian/ubuntu/fedora individually verified). The 3 K1-unblock wave-2 namespace tests (resolved_project_namespace_test.go, bumped off a stale pre-#182 schema-version literal to LatestSchemaVersion()) pass. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Summary of changes
The charly-repo leg of the K5-B validation-correctness batch — two independent fixes RCA'd during the recent dead-code-radical-removal batch, landed together because they share the sdk schema-version bump (companion
opencharly/sdk#93, merged as168169d6447eac48caf8f8b91d8dd4306e265fa2, tagv0.2026204.1223).1. vm PCI-hostdev concreteness gap — closed via the "vm" plugin's
OpValidate, not a kernel patch.validateKindValueCUE's CUE gate (charly/provider_kind_invoke.go) is deliberately closedness-only (nocue.Concrete(true)) — a blanket concreteness flip was tried earlier and reverted because it broke 9 real cases across vm/pod/local/k8s/candy. That left one proven gap: avm:libvirt PCI hostdev whosesource.{domain,bus,slot,function}were never authored silently passed validation. This PR's first commit landed the fix directly in kernel code (validateKindValueConcrete, hardcodingif kind != "vm"+ the PCI field path) — an independent fresh PR-validator review correctly flagged this as a kernel/plugin boundary-law violation (ANY kernel branch encoding concrete-kind semantic knowledge is an R-item, never a kept exception, regardless of scope). The fix-round commit relocates it: onlycandy/plugin-substrate's"vm"capability now declaresValidates: true(F7/C8); a new shareddispatchKindOpValidatehelper (R3) drives the SAME kind-blind dispatch from both the flat op.Params kind path and the newfoldSubstrateKindcall site — no kind-word branch anywhere in host code;validateKindValueCUEis restored to closedness-only, permanently. Newcandy/plugin-substrate/validate_vm.go(+ 5 unit tests) implements the check — no CUE concreteness machinery needed, sincesourceis an openmap[string]stringand Go map key-presence already distinguishes "omitted" from "authored empty". The former 5 host-side unit tests are now 5 charly-side INTEGRATION tests (charly/provider_kind_invoke_concrete_test.go) proving the end-to-end wiring through the real compiled-in registry viacharly box validate.2. Deploy-scope
shell:overlay retired outright.#Deploy.shell/#DeployShellOverlayhad zero production consumer anywhere in this repo's history (fullgit -Sarchaeology) — its only would-be merge,MergeDeployShell(fed byshellOverlayToEntry), never had a real caller. New migration-table entrystrip-deploy-shell-overlay(touches_host: true, re-stamped to the FINAL schema version2026.204.1223) + thestripDeployShellOverlayreshaper hook (candy/plugin-migrate/reshape_strip_deploy_shell.go) strips only a direct SEQUENCE-valuedshell:key at any depth, leaving a candy's own MAPPING-valuedshell:(#Shellintrinsic init) completely untouched. R5 sweep:charly/vmshared_aliases.go(alias removed),charly/shell_schema_test.go(dead test deleted),charly/deploy.go/charly/shellcollect.go(comments updated). All in-repocharly.ymlfiles + all 5box/<distro>submodules re-stamped to2026.204.1223.3. Committed-tree R7/R10 regression — fixed by resequencing. The ORIGINAL commit re-stamped
box/fedora/box/cachyosonly LOCALLY (uncommitted) — a fresh checkout would have failedgo test ./charly/...(TestCandySourceDirs_OverrideAnchorsRemoteApk+ 4TestPluginInstallstepEnvelopeParity/*subtests) the moment this PR merged, before any box re-stamp PR existed to fix it. Fixed: all 5box/<distro>re-stamp PRs landed FIRST as their own PRs, and this PR's gitlinks now point at their MERGED commits:distro-arch→9210d7751d655ac7b7ae2e4f15d5bb5aa6aabb63, tagv2026.204.1300distro-cachyos→6428dcf11b6483191dc997f1b1e2840a6a855f7f, tagv2026.204.1336distro-debian→a8e969e8addfb297389c0d3c504c49040034f8f7, tagv2026.204.1300distro-fedora→cd3deea9a9d9048443061483aea3137aade23bfc, tagv2026.204.1329distro-ubuntu→2e8534107dd7959b2d67b953efdeb56b830b89a2, tagv2026.204.1300charly/go.mod's sdk require bumped tov0.2026204.1223to match.Change class
charly-or-sdk Go (validation logic relocated to a plugin + migration engine + schema-version-driven re-stamps + submodule gitlink bumps). Cross-repo:
opencharly/sdk#93(producer, MERGED) → the 5box/<distro>re-stamp PRs (MERGED, prerequisite per the resequencing above) →opencharly/charly(this PR, consumer — carries all 6 gitlink bumps).How R10-tested — exact gate, commands, and pasted output
go build/go vet/gofmt/go test ./charly/... ./candy/plugin-substrate/... ./candy/plugin-migrate/...— run TWICE: once in the working branch, and (per the fix-round ruling) once more against a genuinely freshgit cloneof the pushed branch with all 6 submodules initialized at their real committed pins (not the author's local worktree state) — this is what proves the COMMITTED tree, not local dirt, is self-consistent.charly box validate/charly migrateruns against real and synthetic fixtures.task build:binary— clean, nogo.work.sumdrift, in BOTH the working branch and the fresh clone../bin/charly, exercising: the stale-schema reject path, thestrip-deploy-shell-overlaymigration op (strip + idempotent no-op), the post-migratebox validatesuccess path, and the RELOCATEDvalidateVmDeepreject/accept branches (PCI missing-field / PCI complete / non-PCI / no-hostdevs / non-vm-kind) through the real compiled-incandy/plugin-substrateregistry.TestBuildPluginBinary_DifferentPluginsConcurrentfailing withdisk quota exceeded— RCA'd viadf -h /tmp(77% full) +du(bulk usage from OTHER unrelated teammates'/sessions' scratch dirs on this shared host, e.g.charly-pr112-*,fresh-full-test, various*-gocachedirs — none from this change). The failing test touches none of this PR's files. Re-ran in isolation after freeing local scratch: PASS (13s). Re-ran the full suite once more: PASS, zero failures. Documented per R1 as a genuine external/shared-host resource condition, not a code defect.Attribution tier
fully tested and validated— every new/changed code path (the relocatedvalidateVmDeepreject/accept branches, thestripDeployShellOverlaystrip/no-op branches, the full loader+validate+migrate pipeline, all 6 gitlink bumps) executed against a freshly built binary from a genuinely fresh clone of the committed tree, with pasted output for each; the one test failure encountered was RCA'd to a documented external cause and the retry+full-rerun evidence is included per R1.Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Harness rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:cutover-policy,/charly-build:migrate,/charly-build:validate.dispatchKindOpValidateextracted once, shared by both kind-decode paths (flat + substrate) instead of two copies of the F7/C8 dispatch logic.git grep 'validateKindValueConcrete'— ZERO hits (fully deleted).DeployShellOverlay/MergeDeployShell/shellOverlayToEntry— only the new hook identifier + historical comments, pasted above.git status/git branch --show-current/submodule status checked before every action; the PR was UPDATED IN PLACE (a fix commit appended, never force-pushed, never closed+reopened).task build:binaryrebuilt from the fresh-clone source; no new runtime OS dependency introduced./tmpclone/fixtures — never a shared/non-disposable target.git -S-archaeology-proven; the box gitlink regression was proven live (a real fresh-clone test failure), not guessed; the boundary-law relocation was independently validator-proven, not self-asserted. ADE — N/A. SDD — the sdk-side schema change (merged companion PR) regenerated its*_gen.go, verified byTestGenReproducible.mainare folded by squash at merge (the original + this fix round) — no transitional/dual-mode path in the final code (the old kernel-side check is fully deleted, not deprecated).candy/plugin-substrate(F7/C8OpValidate), reached via a fully kind-blind host dispatch (dispatchKindOpValidate) with zero kind-word branches incharly/./tmpfixtures/clones.gofmt -lclean,go vetclean, full test suite green (twice, worktree + fresh clone).CHANGELOG/2026.204.1223.md(renamed from the placeholder2026.203.2359.mdto match the finalized sdk schema version) staged, content updated to record both findings and their fixes.