Repository navigation
gate-infrastructure hardening: vm-destroy false-success (#69), makepkg sibling-branch fetch (#72), unstamped-binary bed-runner guard (#74) - #109
Conversation
…n-teardown owner (#69) `charly vm destroy` printed "Destroyed VM" rc=0 while the libvirt domain kept running, and a manual bundle add/del of a vm: deploy leaked the domain. RCA: Run() trusted a single RESOLVED backend; a deploy-name positional resolves no kind:vm entity `backend:` pin so it fell back to the global vm.backend setting (qemu here) and took the qemu no-op arm (RemoveAll a non-existent state dir, errcheck-swallowed) while the real LIBVIRT domain kept running. Separately, a vm: deploy's bundle del had NO domain-teardown arm for the non-ephemeral case. Fix: - candy/plugin-vm/vm.go: destroyVmDomain() probes libvirt authoritatively (the domain-state op spawns the session daemon), tears the domain down from whichever backend actually holds it, and VERIFIES it is gone; Run() hard-errors "no such VM" on not-found (no unconditional success print). - candy/plugin-deploy-vm/lifecycle.go: vmPostTeardown fires `vm destroy <entity> --domain <domain> --keep-deploy` (best-effort) — the bundle-del domain-teardown owner, mirroring vmRebuild's proven vmCli-destroy. - candy/plugin-vm/vm_destroy_test.go: TestDestroyVmDomain_NotFound/_QemuStateDir. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01GZAcd3eoszb4PN5w5SELag
…nary bed-runner guard (#74) #72 — the eval-VM update phase's opencharly-git makepkg working copy fetched ALL branches of the (worktree-shared, all-branches) local superproject and, by git's DEFAULT fetch.recurseSubmodules=on-demand, on-demand-recursed into the sdk submodule for a sibling branch whose gitlink bumped sdk to an UNPUSHED SHA -> "not our ref" -> update phase exit 1. Fix (superproject build vocabulary, NOT pkg/arch - the RCA relocated it): the arch localpkg build_template's `makepkg -sf` now sets GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=fetch.recurseSubmodules GIT_CONFIG_VALUE_0=false, disabling the recursion (sdk is wired by PKGBUILD prepare() from a separate source, so superproject-fetch recursion is never needed). Applied to both //go:embed copies (charly/charly.yml + candy/plugin-vm/build_defaults.yml, R3). deb/rpm use no makepkg git+file:// clone (they go build from the working tree) -> arch-specific, documented. RCA proven by an isolated git spike; end-to-end by the check-local-vm bed's update phase (PASS steps=7, update phase ok:true) under the live sibling-gitlink state. #74 — a plain `go build -o bin/charly` produces CharlyVersion()=="unknown", and the bed runner then fails minutes later inside a plan step (or passes vacuously); the defect recurred twice. CheckBinaryStamped (main_freshness.go, called at the freshness-guard startup site) refuses `charly check run` on an unstamped binary, pointing at `task build:binary`; scoped to `run` via commandPathKey (ctx.Command() is "check <args>") + os.Args; bypassable via CHARLY_SKIP_FRESHNESS_CHECK. `charly version` also exits non-zero on "unknown". Tests: TestShouldRefuseUnstamped/TestCheckSubcommandIsRun/ TestVersionCmd_UnstampedReturnsError; live-proven end to end. Found + registered: #76 (word-keyed shared plugin cache races across worktrees). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01GZAcd3eoszb4PN5w5SELag
pr-validator — APPROVED ✅Change class: code/config — charly Go + candy build-vocab (gate-infrastructure thematic batch: #69 + #72 + #74) Independent re-validation (trusting no author claim): full diff + every changed file read in context; static gates re-run myself; R10 beds corroborated read-only from disk. Checklist (all PASS):
Decision: All three fixes are correct and independently proven. Non-blocking follow-up (validator finding, NOT a blocker): Assisted-by: Claude (analysed on a live system) |
/#72/#74) Evaluator-generated CalVer stamp for the gate-infrastructure batch cutover (vm-destroy false-success #69, makepkg sibling-branch fetch #72, unstamped-binary bed-runner guard #74). Renames the placeholder CHANGELOG to CHANGELOG/2026.195.0802.md and stamps its H1 to match; folded into the squash-merge. Assisted-by: Claude (fully tested and validated)
…sdk ledger-lock decoupling + build/substrate advance (Cutover C task 1, charly half, follow-up) Completes the seven-contract re-pin the group-removal conversion commit (dbf8e2a) started, to the settled CC-1 wave ledger: - spec v0.2026249.2215 -> v0.2026250.158: the refs WarmUp prefetch-warm fix (spec #109) — a persisted latest_tags entry is now PREFETCH-warm, killing the on-demand LatestTag strict re-probe O(n) network storm and the deterministic "fetching git metadata for 194 repo(s)" hang. - sdk v0.2026249.2239 -> v0.2026250.154: carries BOTH the contract floor (sdk #226) AND the fleet-del self-deadlock fix (sdk #227: kit.AcquireLedgerLock moved off charly.yml.lock onto the dedicated <config>.ledger.lock). Folded from sibling commit 3867f71e (feat/fleet-del-deadlock-pin-bump) — its bump is absorbed here rather than cherry-picked to avoid a broken intermediate sdk pin (the conversion commit's tree carried v0.2026250.17 uncommitted). - plugin-build v0.2026243.1627 -> v0.2026249.2311 and plugin-substrate v0.2026241.1038 -> v0.2026249.2326 (the substrate imageless agent_provisioned fold fix a857bd5 consumes). - plugin-check 2119 / plugin-preempt 2116 / plugin-fleet 2126 / plugin-migrate 2144 were already advanced by dbf8e2a — unchanged. - plugin-deploy-vm (v0.2026249.2224) / plugin-deploy-pod (v0.2026249.2212) are @github refs resolved at runtime to their latest tags — no go.mod require exists by design (externalized deploy substrates, provider_deploy.go). Verified: go build ./... and go vet ./... exit 0; go test -count=1 ./... fails ONLY the two distro-gated tests (TestCueKinds_Corpus and TestMaterializeSeam_RealFixtureDeterministic — both read the pre-conversion ../box/{arch,fedora,cachyos} submodule trees, the pending distro conversion wave's dependency, independent of this go.mod/go.sum-only diff); task build:binary exit 0, bin/charly version 2026.250.0054. The own-tree bed R10s + box validate are blocked at project resolve by the same pre-conversion distro import pins (arch v2026.241.1429 first) — they run when the distro conversion PRs land and the import pins bump (coordinated separately). Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)
…ags + box pointers + spec 200 / sdk 417 re-pins (#552) * feat(schema)!: remove the group kind from charly — unroll migration, provider drop, seven-contract re-pin (Cutover C task 1, charly half) * feat(schema)!: remove the group kind from charly — unroll migration, provider drop, seven-contract re-pin (Cutover C task 1, charly half) * fix(substrate): fold the imageless agent_provisioned pod as a DEPLOY — the shape classifier missed the Fleet gate exemption RCA (2026-09-07 runtime envelope drop): the canonical imageless agent_provisioned pod (agent_provisioned: true + iterate:, no image:/from:, no resource-member sibling) VANISHED from the resolved-project envelope Deploy map — every build:project consumer saw no-entity. Root cause: foldSubstrateKind classified deploy vs template via pl.IsDeployShape(pn) (from:/image: bodies only) || ResourceChildren — the agent_provisioned spelling the Fleet gate (spec.ValidateDeploymentTree → ValidateDeployRequiresBox) exempts from the box requirement matched NEITHER arm, so the node folded as a standalone TEMPLATE (acc.PluginKinds[pod]) and never entered acc.Fleet. The plugin-build #9 in-repo tests missed it because every test doc carries a watcher: sibling feeding the ResourceChildren arm. Fix: extend the foldSubstrateKind predicate with agentProvisionedBody(rawBody) so the classifier stays in lockstep with the gate exemption. TDD: substrate_imageless_deploy_test.go reproduces the drop pre-fix (acc.Fleet empty, node in the template map) and locks the discriminator (plain imageless pod stays a template; watcher-sibling shape unaffected). * chore(deps): the 10/11-contract re-pin — spec WarmUp prefetch-warm + sdk ledger-lock decoupling + build/substrate advance (Cutover C task 1, charly half, follow-up) Completes the seven-contract re-pin the group-removal conversion commit (dbf8e2a) started, to the settled CC-1 wave ledger: - spec v0.2026249.2215 -> v0.2026250.158: the refs WarmUp prefetch-warm fix (spec #109) — a persisted latest_tags entry is now PREFETCH-warm, killing the on-demand LatestTag strict re-probe O(n) network storm and the deterministic "fetching git metadata for 194 repo(s)" hang. - sdk v0.2026249.2239 -> v0.2026250.154: carries BOTH the contract floor (sdk #226) AND the fleet-del self-deadlock fix (sdk #227: kit.AcquireLedgerLock moved off charly.yml.lock onto the dedicated <config>.ledger.lock). Folded from sibling commit 3867f71e (feat/fleet-del-deadlock-pin-bump) — its bump is absorbed here rather than cherry-picked to avoid a broken intermediate sdk pin (the conversion commit's tree carried v0.2026250.17 uncommitted). - plugin-build v0.2026243.1627 -> v0.2026249.2311 and plugin-substrate v0.2026241.1038 -> v0.2026249.2326 (the substrate imageless agent_provisioned fold fix a857bd5 consumes). - plugin-check 2119 / plugin-preempt 2116 / plugin-fleet 2126 / plugin-migrate 2144 were already advanced by dbf8e2a — unchanged. - plugin-deploy-vm (v0.2026249.2224) / plugin-deploy-pod (v0.2026249.2212) are @github refs resolved at runtime to their latest tags — no go.mod require exists by design (externalized deploy substrates, provider_deploy.go). Verified: go build ./... and go vet ./... exit 0; go test -count=1 ./... fails ONLY the two distro-gated tests (TestCueKinds_Corpus and TestMaterializeSeam_RealFixtureDeterministic — both read the pre-conversion ../box/{arch,fedora,cachyos} submodule trees, the pending distro conversion wave's dependency, independent of this go.mod/go.sum-only diff); task build:binary exit 0, bin/charly version 2026.250.0054. The own-tree bed R10s + box validate are blocked at project resolve by the same pre-conversion distro import pins (arch v2026.241.1429 first) — they run when the distro conversion PRs land and the import pins bump (coordinated separately). Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated) * feat(cutover-c): land the distro conversion wave — the 4 converted distro import tags + box pointers + spec v0.2026250.200 + sdk v0.2026250.417 + the structkind plugin re-pin * chore: re-trigger the pr-validator — body re-classification (A1/A3/R2/R10 findings addressed; named batch #553) --------- Co-authored-by: atrawog <[email protected]>
gate-infrastructure hardening —
charly vm destroyfalse-success (#69), makepkg sibling-branch fetch (#72), unstamped-binary bed-runner guard (#74)Three independently-non-blocking bed/gate reliability fixes, landed as ONE cutover (one superproject leg — the RCA relocated #72's fix off pkg/arch, so there is NO pkg/arch PR).
#69 —
charly vm destroybackend-mismatch false-success +bundle deldomain-teardown ownercharly vm destroy <name>could printDestroyed VM charly-<name>and exit 0 while the libvirt domain kept running; a manualbundle add/bundle delof avm:deploy leaked the running domain.RCA:
VmDestroyCmd.Runtrusted a single RESOLVED backend. A deploy-name positional resolves nokind:vmentitybackend:pin → fell back to the globalvm.backendsetting (qemuon this host) → took the qemu no-op arm (RemoveAlla non-existent state dir, errcheck-swallowed) while the real LIBVIRT domain kept running. Separately, avm:deploy'sbundle delhad NO domain-teardown arm for the non-ephemeral case.Fix:
destroyVmDomain()probes libvirt authoritatively (backend-agnostic), tears the domain down from whichever backend actually holds it, and VERIFIES it is gone;Run()hard-errors "no such VM" on not-found (no unconditional print).vmPostTeardownfiresvm destroy <entity> --domain <domain> --keep-deploy— the bundle-del domain-teardown owner, mirroring vmRebuild's provenvmClidestroy. + regression unit tests.#72 — makepkg update-phase fetch: disable git's default on-demand submodule recursion
The eval-VM update phase's
opencharly-gitmakepkg working copy fetched ALL branches of the (worktree-shared) local superproject and, by git's DEFAULTfetch.recurseSubmodules=on-demand, on-demand-recursed into the sdk submodule for a sibling branch whose gitlink bumped sdk to a locally-committed-but-UNPUSHED SHA →fatal: remote error: upload-pack: not our ref …→ update phase exit 1. A concurrency landmine for every parallel-worktree wave.Fix (SUPERPROJECT build vocabulary — NOT pkg/arch; the RCA relocated it): the arch localpkg
local_pkg.build_template'smakepkg -sfnow setsGIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=fetch.recurseSubmodules GIT_CONFIG_VALUE_0=false. SAFE — the PKGBUILDprepare()wires sdk from a SEPARATEgit+file://source, so superproject-fetch recursion is never needed. Applied to BOTH//go:embedcopies of the vocab (charly/charly.yml+candy/plugin-vm/build_defaults.yml, R3). Proven by an isolated git spike (default fetch reproducesnot our ref;fetch.recurseSubmodules=false→ clean).deb/rpm — why unaffected (documented per R3, not blanket-patched): the deb (
dpkg-buildpackage) and rpm (rpmbuild) localpkgbuild_templates use NO makepkg and NOgit+file://clone — they build charly + welded plugins DIRECTLY from the superproject working tree ($SUPER/charly,$SUPER/candy/*viago build), thenpodman runa plaincp -aT /src+dpkg-buildpackage/rpmbuild. Nogit fetch, no submodule recursion → the mechanism cannot fail there. A fix on a surface that can't fail would be untestable noise.#74 — bed-runner precondition: refuse an unstamped ("unknown") binary
A plain
go build -o bin/charly ./charlyproducesCharlyVersion()=="unknown"; the bed runner then failed minutes later inside a plan step (or passed vacuously) — the defect recurred twice.Fix:
CheckBinaryStamped(ctx.Command())(the version-identity analog of the freshness guard, at the same startup site) refusescharly check runon an unstamped binary, pointing attask build:binary; scoped torunviacommandPathKey(Kong renders the check family's passthrough ascheck <args>) + os.Args; bypassable viaCHARLY_SKIP_FRESHNESS_CHECK.charly versionalso exits non-zero on"unknown". + 3 unit tests. Live-proven: unstampedcheck runrefuses (rc=1);check box/liveunaffected; stamped runs; version rc=1/0; bypass works.Found + registered while landing
~/.cache/charly/plugins/) is word-keyed shared-mutable state, so bed/dev plugin builds from different worktrees race (same class as fix(check): close the phase-resync goroutine leak + its data race #75's shared image tags). Surfaced during the docs(sdd): CLAUDE.md defers the exception catalog to its sole owner #69 part-b diagnosis; registered for the next bed-infra batch (+ a build-vocab-dup IOU register row).R10 evidence
charly vm destroy check-k8s-deploy-cluster+check-builder-vm(libvirt domains, qemu default backend) → destroyed;virsh -c qemu:///session listEMPTY;charly vm destroy definitely-not-a-vm-xyz→ rc=1.charly check run check-builder-vm: PASS, thenbundle add check-builder-vm(charly vm listshowscharly-check-builder-vm libvirt running) →bundle del check-builder-vm→charly vm listEMPTY +virsh list --allEMPTY.not our ref; CASE2fetch.recurseSubmodules=falseclean) +check-local-vmbed:PASS (steps=7), EXIT 0, update phase =ok:true— the makepkg update phase now succeeds through the LIVE adversarial state (four sibling worktrees carrying local, unpushed feat-branch submodule gitlinks — the exact pre-fix failure condition).check run→ refusal + rc=1;check box→ different error (unaffected); stamped → past guard;versionrc=1 unstamped / rc=0 stamped;CHARLY_SKIP_FRESHNESS_CHECK=1→ past guard.go test ./...(charly, 73s) + plugin-vm under-race; golangci-lint 0 both modules; gofmt/vet clean; R5 grep clean; embedded-defaults schema + plugin-vm vocab tests pass.Change class & landing
Code (charly Go + candy build-vocab). One superproject leg — zero submodule pointer bumps, no producer legs (the RCA relocated #72 off pkg/arch). R0–R10 satisfied: RDD (isolated #72 spike + disposable beds), R1 (each anomaly RCA'd — the qemu/errcheck backend fallback, the libvirt-daemon temp-HOME test-isolation incident I caused+fixed, the
check <args>ctx.Command() miss), R3 (both build-vocab copies; no<name>-host/-podsiblings), R5 (no removed identifiers; grep clean), R10 (fresh-rebuild live proofs pasted above, zero warnings). CHANGELOG placeholder2026.195.0620.md(validator finalizes the merge-time CalVer).Assisted-by: Claude (fully tested and validated)