Skip to content

fix(vm): cloud-init unit-layout split + idempotent qemu vm start - #268

Merged
atrawog merged 6 commits into
mainfrom
feat/cloudinit-unit-fix
Aug 14, 2026
Merged

atrawog merged 6 commits into
mainfrom
feat/cloudinit-unit-fix

Conversation

@atrawog

@atrawog atrawog commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

Two root-caused defects in the VM bootstrap path, both surfaced by the check-debian-debootstrap-vm bed, both fixed here. They batch as one cutover because they are the same theme (VM bootstrap correctness) and one bed run proves both.

1. cloud-init unit-layout split (charly/charly.yml + candy/plugin-vm/build_defaults.yml)

The Debian/Ubuntu debootstrap bootloader install_template enabled a fixed unit list naming the legacy cloud-init service unconditionally.

cloud-init 24.3 (upstream PR #5489, "Single Process Optimization") split that unit: cloud-init.service was renamed to cloud-init-network.service, and a new cloud-init-main.service daemon was added, with the four stage services becoming shims that connect to it over /run/cloud-init/share/*.sock.

  • Debian 13 ships cloud-init 25.1.4 (≥ 24.3): the legacy name no longer exists, so every debootstrap build emitted Failed to enable unit: Unit cloud-init.service does not exist. The step's || true swallowed it, so the bed passed while the template's own comment asserted a layout the distro had not shipped in two releases. R1: a warning is not a pass, and a doc-vs-reality divergence is an incident.
  • Ubuntu 24.04 ships cloud-init 24.1.3 (< 24.3): the legacy unit is the real one there, and the template's enable is load-bearing — the package postinst does not enable the daemon on that version.

So neither name can simply replace the other. The enable loop now tests for each unit file (in both /usr/lib/systemd/system and /lib/systemd/system) before enabling it, covering both layouts, and the comment states the version pivot instead of asserting one layout. On Ubuntu the enable is a no-op in practice (the postinst already creates the wants symlink), but the loop keeps the legacy name regardless — relying on a package's postinst is an undeclared dependency, and the existence guard makes carrying it free.

Applied to both copies of the build vocabulary — charly/charly.yml (embedded) and candy/plugin-vm/build_defaults.yml (the faithful copy) — per R3.

2. charly vm start was not idempotent on the QEMU backend (candy/plugin-vm/vm.go)

Starting a VM whose QEMU process was already running re-executed the stored command; the second QEMU then failed to lock the pidfile:

qemu-system-x86_64: cannot create PID file: Cannot lock pid file: Resource temporarily unavailable
charly: error: command "vm": qemu start failed: exit status 1

This broke the update step of every QEMU-backed bed: vm create already starts the domain, so the rebuild path's ensure-running guard hit an already-live VM every time. vm start now returns a clean no-op when the recorded process is alive, matching the libvirt backend's already_running semantic.

3. One QEMU liveness predicate, in sdk/vmshared (QemuAlive, R3) — the F2 adoption

The liveness probe existed in THREE places: inline in vm start, inline in vm list's state scan, and — unhardened — in candy/plugin-preempt's holder probe, the arbiter that decides whether a preemptible GPU-holder VM is running. All three now call one vmshared.QemuAlive; the two inline copies are deleted. The predicate belongs in sdk/vmshared because it has consumers in more than one module and the module already owns this class (VmStateRoot, RenderQemuArgv).

It also asserts more than the earlier copy did. A bare Signal(0) probe reports a recycled PID as "running", and a /proc/<pid>/cmdline substring match on qemu-system narrows that only to "some qemu" — a PID reused by a DIFFERENT VM's qemu still passes, so vm start would no-op on a stopped VM and the arbiter would refuse to preempt a departed holder. QemuAlive matches -pidfile <stateDir>/qemu.pid as adjacent NUL-separated argv fields, so a live process is confirmed to be the qemu started for THAT state dir. That match rests on a CALLER invariant, not a renderer guarantee: RenderQemuArgv appends -pidfile conditionally (if paths.PidFile != ""), and what makes the argv reliable is that every production launch sets PidFile to <vmStateDir>/qemu.pid. Table-tested in the sdk (qemu_liveness_test.go), including the recycled-onto-another-VM case that the substring check accepted.

Pin bumps required by the adoption: sdk → v0.2026226.1201 (050b0af, the merged sdk#134), spec → 4cff4d0 (v2026.225.2111, the sdk's packaging-contract requirement), the plugin go.mod/go.sum bumps (go 1.26.4, spec v0.2026225.1800), and the workspace go-version bump (go.work + charly/go.mod → 1.26.4).

Diffstat vs 29c5140e (the merged charly#267): 70 files, 245 insertions / 272 deletions. The bulk is the sdk-pin go.sum reconciliation across the plugin candies (the F2 adoption bumps sdk to 050b0af, so every plugin's go.sum must match the new sdk deps); the authored change is 10 files — charly/charly.yml, candy/plugin-vm/build_defaults.yml, candy/plugin-vm/vm.go, candy/plugin-vm/vm_qemu.go, candy/plugin-preempt/holder_dispatch.go, charly/go.mod, charly/go.sum, sdk, spec, CHANGELOG/2026.226.0953.md.

Change class

code/config (build vocabulary + candy/plugin-vm + candy/plugin-preempt Go + sdk/spec pin bumps)

Landing order — charly#267 landed, branch updated

charly#267 (the sdk-adopt cutover) has landed (29c5140e, tagged v2026.226.1608). This branch was updated onto it: git merge origin/main resolved the qemu-file overlap — charly#267 carried a local qemuAlive that this PR's F2 deletes — by keeping the F2 vmshared.QemuAlive (sdk 050b0af, v0.2026226.1201) and deleting the local copy + its unused imports (bytes, strconv, strings, syscall). The sdk submodule stays at 050b0af; go.work.sum was reconciled via go work sync. The tree builds and the full workspace test suite is green.

How R10-tested — exact gate, commands, and pasted output

Fresh R10 on the FINAL tree (with the F2 adoption), run after the charly#267 merge and the branch update.

  • The gate for this change class: the beds that exercise the change — charly check run check-debian-debootstrap-vm and charly check run check-ubuntu-debootstrap-vm (both disposable: true), which automate build → deploy → check-live → update → check-live-rebuild → cleanup. The update step is the one that exercises the qemu idempotency fix.
  • Binary: rebuilt from this source via task build:binary → charly version = 2026.226.1629. Both fixes verified embedded (strings bin/charly | grep -c 'cloud-init-main cloud-init-network' → 2; grep -c 'is already running' → 2; grep -c 'qemu.pid' → 1, the vmshared.QemuAlive predicate).
  • Zero warnings on the changed path: the debian run dir has zero warning matches across every log. The ubuntu run dir has exactly 3 warning matches — update-rc.d: warning: start and stop actions are no longer supported (vm-build.log:1348) and useradd warning: libvirt-qemu's uid 64055 is greater than SYS_UID_MAX 999 (deploy-add.log:2655, update.log:2662) — all three from the distro's own package postinsts, identical to the pre-F2 run 2026.226.1022 (same lines), so they are pre-existing distro noise, not from the changed path. The changed path (the cloud-init unit enable + the qemu vm start guard) emits zero warnings in both beds.

Debian bed (run from box/debian, the submodule that owns the bed):

charly check run check-debian-debootstrap-vm: [vm-build] PASS after 1m7.905s
charly check run check-debian-debootstrap-vm: [vm-create] PASS after 758ms
charly check run check-debian-debootstrap-vm: [deploy-add] PASS after 3m32.311s
charly check run check-debian-debootstrap-vm: [bring-up-members] PASS after 0s
charly check run check-debian-debootstrap-vm: [check-live] PASS after 6.441s
charly check run check-debian-debootstrap-vm: [update] PASS after 3m45.388s
charly check run check-debian-debootstrap-vm: [check-live-rebuild] PASS after 6.306s
charly check run check-debian-debootstrap-vm: [cleanup] PASS after 882ms
charly check run check-debian-debootstrap-vm: [cleanup-members] PASS after 0s
charly check run check-debian-debootstrap-vm: PASS (steps=9)

[exited with code 0]

Ubuntu bed (run from box/ubuntu):

charly check run check-ubuntu-debootstrap-vm: [vm-build] PASS after 1m58.578s
charly check run check-ubuntu-debootstrap-vm: [vm-create] PASS after 726ms
charly check run check-ubuntu-debootstrap-vm: [deploy-add] PASS after 3m9.108s
charly check run check-ubuntu-debootstrap-vm: [bring-up-members] PASS after 0s
charly check run check-ubuntu-debootstrap-vm: [check-live] PASS after 2.848s
charly check run check-ubuntu-debootstrap-vm: [update] PASS after 2m58.9s
charly check run check-ubuntu-debootstrap-vm: [check-live-rebuild] PASS after 2.797s
charly check run check-ubuntu-debootstrap-vm: [cleanup] PASS after 735ms
charly check run check-ubuntu-debootstrap-vm: [cleanup-members] PASS after 0s
charly check run check-ubuntu-debootstrap-vm: PASS (steps=9)

[exited with code 0]

Coverage that fails without the change

Both halves have a witness in the same bed, and both were observed failing on the unfixed tree:

  • qemu idempotency — run 2026.226.0940 (same bed, same tree, WITHOUT the vm start fix) failed at [update] FAIL after 3.982s with the pidfile-lock error above. With the fix: [update] PASS after a full rebuild. The step goes from a 4-second hard failure to a full multi-minute rebuild.
  • cloud-init — the debian run's vm-build.log has zero occurrences of Failed to enable (grep -c → 0), with cloud-init-main / cloud-init-network enabled (lines 1297-1298, 1373-1374). Before the fix the same log carried Failed to enable unit: Unit cloud-init.service does not exist. The ubuntu run's vm-build.log (cloud-init 24.1.3, below the split) has zero Failed to enable AND the legacy cloud-init.service IS enabled (line 1377) — the load-bearing enable the existence guard preserves.

Go gates (final tree)

gofmt -l empty · go vet ./... clean (charly module, workspace resolution) · per-module go test -count=1 ./... green across every go.work module (charly, sdk, spec, all 60 candy/plugin-*) · golangci-lint run ./... → 0 issues on the charly module + the two changed plugin modules (candy/plugin-vm, candy/plugin-preempt). One environment caveat: the spec module's proc temp-sweep tests fail when TMPDIR is overridden (the sandbox /tmp-quota workaround) because the sweep scans a hardcoded /tmp while os.TempDir() follows TMPDIR; with TMPDIR unset they pass — a pre-existing environment artifact, not a regression.

Attribution tier

analysed on a live system — the changed runtime paths (the qemu vm start guard + the cloud-init unit enable) ran live on two disposable beds with retained output (above), including the previously-failing update step. The complete fresh-rebuild R10 for the whole nFPM cutover (the Phase 3 check beds) has not passed yet — that is the nFPM cutover's own gate, not this PR's.

Harness rulebook compliance — state HOW each is satisfied

  • R0 skills: loaded /charly-vm:vm, /charly-vm:debian-debootstrap-vm, /charly-distros:debian, /charly-check:check, /charly-internals:root-cause-analyzer, /charly-internals:git-workflow.
  • R1 RCA + zero warnings: both defects were root-caused before any edit — the cloud-init one to the 24.3 unit split (identified by version, with the Debian-25.1.4 / Ubuntu-24.1.3 pivot established), the qemu one to the pidfile lock on a re-executed start command. Neither was retried or dismissed. The changed path emits zero warnings in both beds; the only warning matches in the ubuntu run dir are 3 pre-existing distro postinst messages, identical to the pre-F2 run (see "How R10-tested"). The swallowed Failed to enable warning is precisely what R1 forbids treating as a pass.
  • R2 no out-of-scope split: the qemu defect surfaced during this cutover's R10 and blocked it, so it is fixed in the same tree under the same gate rather than deferred. The F2 adoption is the consumer half of the merged sdk#134 producer — a structural B6 dependency, not a deferral.
  • R3 no duplication: the cloud-init fix lands in BOTH copies of the build vocabulary; the qemu liveness probe is ONE predicate in sdk/vmshared (QemuAlive), shared by vm start, vm list, and the preempt arbiter — the three local copies are deleted.
  • R4 no workaround: no sleeps, retries, or magic numbers — an existence test and a process-liveness probe. No ad-hoc qemu/virsh commands; the beds ran via charly check run.
  • R5 delete legacy completely: the inline pidfile-liveness block in vm list, the local qemuAlive in candy/plugin-vm/vm_qemu.go, and the bare Signal(0) probe in candy/plugin-preempt/holder_dispatch.go are all REMOVED, not left beside the shared predicate. No transitional path.
  • R6 git safety: clean tree verified before and after commit; no force-push; branch pushed fast-forward.
  • R7 prove behavior: the end-to-end bed sequence ran on the final tree; go test alone was not treated as the gate.
  • R8 artifact invariants: N/A — no generation change.
  • R9 binary == source: binary rebuilt via task build:binary (2026.226.1629) and invoked through this worktree's bin/; both fixes verified present in the built artifact. No new runtime OS deps.
  • R10 disposable + coverage: proven on check-debian-debootstrap-vm + check-ubuntu-debootstrap-vm (both disposable: true), fresh rebuild, zero warnings, with the failing-without-the-change witnesses above.
  • RDD / ADE / SDD: RDD — the bed WAS the instrument that surfaced both defects and is the proof. ADE — the bed's existing deterministic check: steps are unchanged and still pass. SDD N/A — no .cue edits, no generated files.
  • Hard cutover: one atomic cutover; both fixes complete, nothing staged for later.
  • Kernel/plugin boundary law: placement correct — the Go change is confined to candy/plugin-vm + candy/plugin-preempt (the plugins that own vm start/vm list/the preempt arbiter); no core charly/*.go touched, no new imports, no alias.
  • Disposable-only autonomy: check-debian-debootstrap-vm is disposable: true (box/debian/charly.yml:39); the destroy+rebuild was authorized by that flag, not inferred.
  • CHANGELOG: CHANGELOG/2026.226.0953.md (placeholder CalVer, finalized by the validator at merge).

Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)

Two root-caused VM-bootstrap defects, both surfaced by the
check-debian-debootstrap-vm bed.

1. The Debian/Ubuntu debootstrap bootloader install_template enabled the
   legacy `cloud-init` unit unconditionally. cloud-init 24.3 (upstream PR
   #5489) split it: `cloud-init.service` became `cloud-init-network.service`
   plus a new `cloud-init-main.service` daemon. Debian 13 ships 25.1.4, where
   the legacy name is gone, so every debootstrap build emitted "Failed to
   enable unit: Unit cloud-init.service does not exist" — swallowed by the
   step's `|| true`, so the bed passed while the template's comment described
   a layout the distro had not shipped in two releases (R1: a warning is not a
   pass). Ubuntu 24.04 ships 24.1.3, BELOW the split, where the legacy unit is
   real and the enable is load-bearing — so neither name can simply replace
   the other. The loop now tests for each unit file before enabling it and
   covers both layouts. Applied to charly/charly.yml AND the faithful copy in
   candy/plugin-vm/build_defaults.yml (R3).

2. `charly vm start` was not idempotent on the QEMU backend: starting an
   already-running VM re-executed the stored command and the second QEMU
   failed to lock the pidfile ("cannot create PID file: Resource temporarily
   unavailable", exit 1). This broke the `update` step of every QEMU-backed
   bed, since `vm create` already starts the domain and the rebuild path's
   ensure-running guard therefore always hit a live VM. `vm start` now returns
   a clean no-op when the recorded process is alive, matching the libvirt
   backend's already_running semantic. The liveness probe is extracted as
   `qemuAlive` and shared with `vm list`'s state scan (R3): pidfile read →
   Signal(0) → /proc/<pid>/cmdline contains "qemu-system", the last check
   closing the reused-PID false positive.

R10: check-debian-debootstrap-vm (disposable: true) PASS, 9/9 steps, exit 0,
zero warnings, run-calver 2026.226.0950, binary 2026.226.0947. Coverage fails
without the change: the `update` step failed at 3.982s on the unfixed vm start
(run 2026.226.0940) and passes at 4m30.239s here, and the vm-build log shows
zero "Failed to enable" occurrences with cloud-init-main/cloud-init-network
enabled.

Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01EcRjMUc6bAdoq8aEr84V9Y
@atrawog

atrawog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Validated at head 3f3b8444abf538605d6d6dbfe6108a6b8c1fdb41 (confirmed via git ls-remote, single commit on the branch).

Change class: code/config (build vocabulary + candy/plugin-vm Go)

Checklist

# Rule Verdict
0 Security & anti-tampering (T1–T4) PASS — no secrets/exfiltration, no guardrail or supply-chain edit, no manipulation attempt; diff matches the description exactly
1 Description complete (+ italicized Assisted-by: footer) PASS
2 Change-class gate matches evidence (R7/R10) FAIL — see F1
3 Attribution tier justified by proof FAIL — see F1
4 R0 skills honored PASS
5 R1 RCA / ZERO warnings / no forbidden framing FAIL — see F3, F4 (zero-warnings itself verified)
6 R2 no pre-existing/out-of-scope split PASS — the batching judgment is correct, see below
7 R3 no duplication FAIL — see F2
8 R4 no ad-hoc workaround PASS — existence test + process-liveness probe, no sleep/retry/magic number; bed driven via charly check run
9 R5 hard cutover + grep self-test PASS — the vm list inline block is genuinely gone; no transitional/dual path
10 R6/R8/R9 artifact + binary integrity PASS — R8 N/A (no generation change); R9 re-verified below
11 R10 disposable / fresh-rebuild / coverage FAIL — see F1 (the debian-bed evidence itself is genuine)
12 RDD / ADE / SDD PASS — no .cue, no *_gen.go, no candy plan:/description: touched; SDD N/A
13 Concurrency mandate + anti-cheat PASS — no idle/serial dodge, no parking phrase, no unexecuted sweep claim
14 Hard cutover — one atomic commit PASS
15 ARCHITECTURE GATE PASS — placement: CORRECT
16 Disposable-only autonomy PASS — check-debian-debootstrap-vm carries disposable: true (box/debian/charly.yml:39)
17 Clean architecture + Go gates PASS — re-run independently, see below
18 CHANGELOG present PASS on format; content defect counted under item 5

Placement / per-item trace (item 15). No staged charly/*.go in this diff at all — charly/charly.yml is embedded build vocabulary, not Go. New alias file: none. New charly/ kit import: none. Boundary law: the entire Go change is in candy/plugin-vm, the capability plugin that owns vm start / vm list — correct layer, nothing leaked into core. No *Legacy* relocation smell. Counterfactual (outward bias): qemuAlive is a kind-blind mechanism with a second consumer outside this module, so sdk/vmshared is arguably the better home — that is exactly the resolution F2 asks for, and it moves outward, not inward.

What I re-derived independently (all of it, not the author's word)

Go gates — re-run by me, GOWORK=off in candy/plugin-vm, isolated GOLANGCI_LINT_CACHE:

gofmt -l .            → (empty)
go vet ./...          → (clean)
go test -count=1 ./... → ok github.com/opencharly/charly/candy/plugin-vm 2.238s
golangci-lint run ./... → 0 issues.

R9 — binary equals source. ./bin/charly version → 2026.226.0947, built 11:50:06; every changed source file last written 11:49:08–11:49:38, before the build; tree clean at HEAD. Both fixes present in the artifact (strings bin/charly | grep -c 'cloud-init-main cloud-init-network' → 2, 'is already running' → 2). No new runtime OS deps.

R10 bed evidence — cross-checked on disk, not taken from the body. box/debian/.check/check-debian-debootstrap-vm/2026.226.0950/summary.yml exists, ok: true, 9 steps all ok: true, total_seconds: 634 (step durations sum to exactly 634), calver matches. Warning sweep across every log in the run dir: grep -ric warning → 0 on all 8 files. Genuine.

Coverage-fails-without-the-change — verified, and the cloud-init half needed evidence the PR body never pointed at. The qemu witness is real: 2026.226.0940/summary.yml shows update: duration_seconds: 4, ok: false, total_seconds: 355, ok: false, against 270/ok: true in 0950. For the cloud-init half, no run dir in this worktree contains a pre-fix build — every run here (0909, 0940, 0950) already had the fix. I located the real pre-fix witness myself in the sibling feat/sdk-adopt worktree, and it is decisive — same log, same line number, before and after:

# PRE-FIX  (sdk-adopt/box/debian/.check/check-debian-debootstrap-vm/2026.226.0748/vm-build.log)
1369:Executing: /usr/lib/systemd/systemd-sysv-install enable cloud-init-local
1373:Failed to enable unit: Unit cloud-init.service does not exist
1377:Synchronizing state of cloud-config.service ...

# POST-FIX (this PR's 2026.226.0950/vm-build.log)
1369:Executing: /usr/lib/systemd/systemd-sysv-install enable cloud-init-local
1373:Synchronizing state of cloud-init-main.service with SysV service script ...
1374:Executing: /usr/lib/systemd/systemd-sysv-install enable cloud-init-main

All six pre-fix debian runs carry the failure and enable cloud-init-main zero times. So the fix is load-bearing on Debian, not cosmetic — it turns a swallowed error into an actually-enabled daemon. Line 755 confirms cloud-init all 25.1.4-1+deb13u1, matching the PR's version claim.

R2 batching judgment — I agree with the author, on my own reasoning. The qemu defect is not a second cutover riding along: it surfaced inside this cutover's own R10 (0940 [update] hard-failed at 3.982s on the pidfile lock) and blocked it — the cloud-init fix could not be proven on a green bed until vm start was idempotent. R2 path 1 (fix in the same tree, under this cutover's R10) is the default for a blocking issue, and the two share a theme and a single proving bed. Correct as batched.

Provenance of the qemu port — faithful and complete. Both hunks are byte-identical to feat/sdk-adopt c4dc2b08: identical blob transitions on both branches (vm.go 1ef64f18 → 389bb8b2, vm_qemu.go d5b0445d → e16baa7a). No drift, nothing dropped.

/proc/<pid>/cmdline reasoning — sound as far as it goes. bytes.Contains(cmdline, "qemu-system") does reject a PID recycled by an unrelated process, which a bare Signal(0) accepts. See F4 for where it stops short.


Blocking findings

F1 — the gate ran too few beds: check-ubuntu-debootstrap-vm co-composes the changed template and was never run

ubuntu inherits the changed entity verbatim (charly/charly.yml:978-980):

ubuntu:
    distro:
        inherits: debian
        version: "24.04"

The ubuntu: block overrides bootstrap, base_user, and debootstrap — it does not override bootloader.install_template. So the edited enable loop is the one Ubuntu builds run, and check-ubuntu-debootstrap-vm exists and composes it. Only the debian bed was run.

This is not a formality here: Ubuntu is the distro on the other side of the version pivot the change is explicitly about, and it is where the new existence guard carries its risk. Before this PR a wrong unit name produced a visible Failed to enable unit: …; after it, a guard whose paths don't match reality skips the enable silently. My own reading of the pre-fix Ubuntu log says the guard will pass there (/usr/lib/systemd/system/cloud-init.service is the symlink target the postinst creates, so -e succeeds) — but that is a code-and-log reading, and RDD is explicit that a high-risk assumption is settled on a bed, not on a reading. Run charly check run check-ubuntu-debootstrap-vm and paste it.

This is also what caps item 3: fully tested and validated requires the fresh-rebuild R10 on every affected disposable target. As proved today the ceiling is analysed on a live system; running the ubuntu bed restores the claimed tier.

F2 — R3: a third copy of the qemu liveness probe survives, still carrying the false positive this PR says must be closed

The PR states it replaced "the inline duplicate" (singular). There were two other copies. candy/plugin-preempt/holder_dispatch.go:249-262:

data, err := os.ReadFile(filepath.Join(dir, name, "qemu.pid"))
if err != nil { return false }
pid, err := strconv.Atoi(strings.TrimSpace(string(data)))
if err != nil { return false }
proc, err := os.FindProcess(pid)
if err != nil { return false }
return proc.Signal(syscall.Signal(0)) == nil

That is the exact predicate qemuAlive now owns, minus the cmdline check — i.e. it is the unfixed version of the probe this PR just hardened, left live in the arbiter that decides whether a preemptible GPU-holder VM is running. R3 requires the fix to apply to every surface it logically covers, and the PR names no thematic batch for this one, so the parking exception does not apply either.

The cross-module boundary (plugin-preempt and plugin-vm are separate Go modules) is the reason it wasn't done, not a reason it can't be: sdk/vmshared already hosts exactly this class of shared VM helper (VmStateRoot, StartLibvirtUserSession, RenderQemuArgv), and candy/plugin-vm/vmshared_aliases.go:54 shows the plugin already consumes it. Lift qemuAlive there and have both call sites use it — which also satisfies item 15's outward counterfactual.

F3 — a verified-false claim about Ubuntu in the shipped CHANGELOG, the commit message, and the PR body

All three assert:

Ubuntu 24.04 ships 24.1.3, BELOW the split, where the legacy unit is the real one and the template's enable is load-bearing (the package postinst does not enable the daemon there)

The parenthetical is false, and the author's own Ubuntu bed log disproves it — sdk-adopt/box/ubuntu/.check/check-ubuntu-debootstrap-vm/2026.226.0556/vm-build.log:

1371:Setting up cloud-init (24.1.3-0ubuntu3) ...
1377:Created symlink /etc/systemd/system/cloud-init.target.wants/cloud-init.service → /usr/lib/systemd/system/cloud-init.service.

The postinst does enable it, into precisely the target cloud-init.service's [Install] WantedBy= names. Corroborated independently by the enable loop in the same log: systemctl enable cloud-init (and cloud-init-local, cloud-config, cloud-final) each produced no output at all on Ubuntu — systemd prints Created symlink … whenever an enable has anything to create, so silence means already-enabled. The template's enable is a no-op on Ubuntu, not load-bearing.

The conclusion the PR draws is still right — Debian 13 has no cloud-init.service and Ubuntu 24.04 has no cloud-init-main/-network, so neither name can replace the other and both must stay in the loop. Only the stated justification is wrong. R1 binds the cutover's own new prose exactly as it binds pre-existing docs ("being newly authored — never pre-existing — is not an exemption"), so this is fixed in-tree, claim-keyed across all three surfaces. The charly.yml / build_defaults.yml code comment is accurate as written and needs no change.

F4 — the qemuAlive doc comment overstates what the cmdline check delivers

// … a dead PID, or a reused PID that now belongs to an unrelated process, must
// report false — the cmdline check closes the reused-PID false-positive …

bytes.Contains(cmdline, []byte("qemu-system")) closes reuse by a non-qemu process. A PID recycled onto another VM's qemu — routine on a host running several beds — still reports this VM as alive, and vm start then no-ops on a stopped VM. The precise check is already available at zero cost: sdk/vmshared/qemu_render.go:155-156 appends -pidfile <stateDir>/qemu.pid to the argv, so /proc/<pid>/cmdline contains this VM's own absolute pidfile path. Matching that instead of the generic substring genuinely closes the case and makes the comment true. (Folding this into F2's sdk/vmshared move fixes both sites at once.)

Comments considered: none — the PR carried no comments.

Cross-PR interactions considered:

Decision

Three blocking findings, each independently verified by me rather than inferred: a bed the change-class gate requires and did not run (F1), an R3 claim the tree does not satisfy (F2), and a factual claim in shipped prose that the project's own logs contradict (F3), plus F4's overstated comment. The underlying engineering is sound — both root causes are correctly identified, the debian bed evidence is genuine and I confirmed the pre-fix witness the body did not cite, and the batching judgment is right. Fix the four findings in the same tree, re-run both debootstrap beds, and re-push; the status resets and I re-run.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

atrawog added a commit to opencharly/sdk that referenced this pull request Aug 14, 2026
…134)

feat(vmshared): add QemuAlive, one hardened QEMU liveness predicate

Adds `vmshared.QemuAlive` — one hardened QEMU liveness predicate — and routes
the package's existing `KillQemuByPID` through the same shared resolution step
(`qemuProcFromStateDir`). The predicate reads `<stateDir>/qemu.pid`,
`Signal(0)`, then matches `-pidfile <stateDir>/qemu.pid` as adjacent
NUL-separated `/proc/<pid>/cmdline` argv fields, whole-field — so a live
process is confirmed to be the qemu started for THAT state dir, rejecting both
a recycled PID and a different VM's qemu on a reused PID.

The consumer (opencharly/charly#268) deletes three divergent hand-rolled
copies (two bare `Signal(0)` probes on main, plus the in-flight `vm start`
guard), which is the R3 unification this producer enables. Placement is
`sdk/vmshared` on the sdk-kit criterion: consumers in more than one module,
and the module already owns both couplings (`VmStateRoot` resolves the state
dir, `RenderQemuArgv` emits the argv).

The `-pidfile` match rests on a documented CALLER invariant: `RenderQemuArgv`
appends `-pidfile` conditionally (`if paths.PidFile != ""`), and every
production launch sets it to `<vmStateDir>/qemu.pid` — observed in production
during the live invocation, not assumed.

Tested: whole-module gates green (gofmt, go build, go vet, go test 10
packages, golangci-lint 0 issues); coverage mutation-verified against the
weaker predicates this replaces; invoked live against a real charly-managed
qemu VM in both directions (running → true, after `charly vm stop` → false,
with the stale pidfile still on disk). Fresh-rebuild R10 belongs to the
consumer PR (charly#268).

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
sdk#134 landed QemuAlive in sdk/vmshared (v0.2026226.1201). Adopt it at all
three call sites and delete the local copies:

- candy/plugin-vm/vm.go: the idempotent already-running guard in `vm start`
  and `vm list`'s state scan now call vmshared.QemuAlive.
- candy/plugin-vm/vm_qemu.go: the local qemuAlive (a bare Signal(0) +
  "qemu-system" substring) is deleted.
- candy/plugin-preempt/holder_dispatch.go: the holder probe — the arbiter
  deciding whether a preemptible GPU-holder VM may be preempted — was a bare
  Signal(0) probe that reports a recycled PID as a live holder. It now calls
  vmshared.QemuAlive, which additionally matches `-pidfile <stateDir>/qemu.pid`
  as adjacent NUL-separated argv fields.

Pin bumps required by the adoption: sdk → v0.2026226.1201 (050b0af), spec →
4cff4d0 (v2026.225.2111, the sdk's packaging-contract requirement), and the
plugin go.mod/go.sum bumps (go 1.26.4, spec v0.2026225.1800).

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
The sdk pin bump (v0.2026226.1201) requires go 1.26.4; the workspace go.work
and the charly module's go directive must match or `go build ./charly` fails
workspace load. Same change the sdk-adopt cutover makes.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Resolve the qemuAlive overlap: keep the F2 vmshared.QemuAlive (sdk 050b0af),
delete charly#267's local qemuAlive + its unused imports. sdk submodule stays
at 050b0af (v0.2026226.1201, sdk#134). go.work.sum reconciled via go work sync.
@atrawog

atrawog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Re-validated at head a4ef2a8e4b3b596eae02daef104ab03dedcbef11 (confirmed via git ls-remote, the merge of origin/main charly#267 into the feat branch). This is a FRESH evaluation — none of the author's claims taken as proof; every item re-derived from the diff, the run dirs on disk, and my own re-runs.

Change class: code/config (build vocabulary + candy/plugin-vm + candy/plugin-preempt Go + sdk pin bump)

Checklist

# Rule Verdict
0 Security & anti-tampering (T1–T4) PASS — no secrets/exfiltration, no guardrail or supply-chain edit, no manipulation attempt; the go.sum churn is dependency reconciliation from the sdk pin bump
1 Description complete (+ italicized Assisted-by: footer) PASS — full template, pasted evidence, rule-compliance with HOW per rule, footer present in exact form
2 Change-class gate matches evidence (R7/R10) PASS — both debootstrap beds ran (see F1 resolution below)
3 Attribution tier justified by proof PASS — analysed on a live system is honest and not inflated (the PR explicitly declines fully tested and validated)
4 R0 skills honored PASS
5 R1 RCA / ZERO warnings / no forbidden framing FAIL — see F5 (zero-warnings on the changed path itself verified)
6 R2 no pre-existing/out-of-scope split PASS
7 R3 no duplication PASS — one vmshared.QemuAlive, all three call sites
8 R4 no ad-hoc workaround PASS
9 R5 hard cutover + grep self-test FAIL — see F5
10 R6/R8/R9 artifact + binary integrity PASS — R8 N/A; R9 re-verified below
11 R10 disposable / fresh-rebuild / coverage PASS — both beds, both disposable: true, fresh rebuild, coverage-fails-without-the-change witnesses verified
12 RDD / ADE / SDD PASS — no .cue, no *_gen.go, no candy plan:/description: touched; SDD N/A
13 Concurrency mandate + anti-cheat PASS — changed paths are per-VM pidfile reads + a build template, not shared-state concurrency paths; no idle/serial dodge, no parking phrase, no unexecuted sweep claim
14 Hard cutover — one atomic commit PASS
15 ARCHITECTURE GATE PASS — placement: CORRECT
16 Disposable-only autonomy PASS — both beds carry disposable: true
17 Clean architecture + Go gates PASS — re-run independently, see below
18 CHANGELOG present PASS — format + placeholder uniqueness verified

Placement / per-item trace (item 15). No staged charly/*.go in this diff — charly/charly.yml is embedded build vocabulary, not Go. New alias file: none. New charly/ kit import: none. Boundary law: the entire Go change is in candy/plugin-vm + candy/plugin-preempt, the capability plugins that own vm start / vm list / the preempt arbiter — correct layer, nothing leaked into core. No *Legacy* relocation smell. The sdk/vmshared home for the predicate is the outward-correct placement (consumers in two modules).

The four prior findings — each independently re-verified

  • F1 (gate ran too few beds) — RESOLVED. Both run dirs exist on disk and are genuine: box/debian/.check/check-debian-debootstrap-vm/2026.226.1630/summary.yml and box/ubuntu/.check/check-ubuntu-debootstrap-vm/2026.226.1641/summary.yml — each ok: true, 9 steps all ok: true, step counts and durations coherent. The update step (the qemu-idempotency witness) PASSED in both (debian 225s, ubuntu 179s), and both update.log files show the no-op path executed live: VM charly-check-<distro>-debootstrap-vm is already running. Ubuntu is the distro on the other side of the version pivot, so this closes the F1 gap.
  • F2 (third liveness copy) — RESOLVED. vmshared.QemuAlive is the single predicate at all three call sites: candy/plugin-vm/vm.go:297, candy/plugin-vm/vm.go:649, candy/plugin-preempt/holder_dispatch.go:251. The local qemuAlive in candy/plugin-vm/vm_qemu.go is deleted (grep returns nothing). sdk submodule at 050b0af (v0.2026226.1201, the merged sdk#134).
  • F3 (false postinst claim) — RESOLVED. The CHANGELOG and PR body now state the postinst DOES enable the daemon on Ubuntu: "the cloud-init postinst already creates /etc/systemd/system/cloud-init.target.wants/cloud-init.service". The ubuntu bed log corroborates (line 1377: Created symlink ... cloud-init.target.wants/cloud-init.service).
  • F4 (overstated cmdline check) — RESOLVED. QemuAlive matches -pidfile <stateDir>/qemu.pid as adjacent NUL-separated argv fields (qemuCmdlineOwnsPidfile), which genuinely closes the recycled-onto-another-VM case. sdk/vmshared/qemu_liveness_test.go covers it: TestQemuCmdlineOwnsPidfile case "another vm's qemu on a recycled pid" (want false) and TestQemuAliveLiveForeignQemu (a live qemu-system-named process that owns no pidfile must report false). I ran the sdk tests: ok github.com/opencharly/sdk/vmshared.

What I re-derived independently

Go gates — re-run by me (GOWORK=off in each module, isolated GOLANGCI_LINT_CACHE, GOTMPDIR on root fs):

gofmt -l .            → (empty, both modules)
go vet ./...          → (clean, both modules)
go test -count=1 ./... → ok plugin-vm 2.276s; ok plugin-preempt 0.189s
golangci-lint run ./... → 0 issues (both modules)
go build ./charly/... → (clean, workspace resolution with the new sdk pin)

R9 — binary equals source. ./bin/charly version → 2026.226.1629, built 18:29; every changed source file last written 18:15–18:17, before the build; tree clean at HEAD. Both fixes embedded (strings bin/charly | grep -c 'cloud-init-main cloud-init-network' → 2, 'is already running' → 2, 'qemu.pid' → 1).

R10 bed evidence — cross-checked on disk, not taken from the body. Both summaries verified above. Warning sweep: debian run dir → 0 warning matches across all 7 logs. Ubuntu run dir → exactly 3 matches, byte-identical to the pre-F2 run 2026.226.1022 (same lines): update-rc.d: warning: start and stop actions are no longer supported (vm-build.log:1348) and useradd warning: libvirt-qemu's uid 64055 is greater than SYS_UID_MAX 999 (deploy-add.log:2655, update.log:2662) — distro postinst noise, not from the changed path. The PR body discloses this accurately.

Coverage-fails-without-the-change — verified. The qemu witness is real: 2026.226.0940/summary.yml shows update: duration_seconds: 4, ok: false, total_seconds: 355, ok: false, and its update.log carries the exact error: qemu-system-x86_64: cannot create PID file: Cannot lock pid file: Resource temporarily unavailable. The cloud-init witness: debian vm-build.log (1630) shows cloud-init-main/cloud-init-network enabled (lines 1297–1298, 1373–1374) with zero Failed to enable; ubuntu vm-build.log (1641) shows the legacy cloud-init.service enabled (line 1377) with zero Failed to enable.

CHANGELOG format. Filename 2026.226.0953.md matches ^\d{4}\.\d{3}\.\d{4}\.md$; H1 byte-equal # 2026.226.0953 — VM bootstrap: …; placeholder does not exist as a tag or on main.

Blocking finding

F5 — R5 stale-reference + R1 claim-keyed divergence in candy/charly-vm/charly.yml (lines 934–949)

The F2 adoption deleted the local qemuAlive function, but the candy description that documents the qemu liveness probe was not swept. It still names the deleted identifier and describes the mechanism this PR replaced:

candy/charly-vm/charly.yml:934:  already-running guard is `qemuAlive`.** The libvirt backend checks
candy/charly-vm/charly.yml:935:  `already_running`; the qemu backend checks `qemuAlive(stateDir)`
candy/charly-vm/charly.yml:936:  (read `<stateDir>/qemu.pid` → `Signal(0)` → `/proc/<pid>/cmdline`
candy/charly-vm/charly.yml:937:  contains `qemu-system` — the cmdline check closes the reused-PID
candy/charly-vm/charly.yml:938:  false-positive a bare `Signal(0)` would report as "running"). A
candy/charly-vm/charly.yml:949:  The same `qemuAlive` probe drives the `vm list` qemu state scan

Two independent violations, both on the exact surface this cutover changed:

  1. R5 identifier-keyed sweep. qemuAlive is a deleted identifier (removed by this PR's F2 adoption; the function is now vmshared.QemuAlive). R5 requires every reference naming a deleted identifier to be updated in the same commit; the grep self-test must return only CHANGELOG//migration context. These hits are in a live, published candy description — not historical context.
  2. R1 claim-keyed sweep. Line 937 asserts "the cmdline check closes the reused-PID false-positive" — the EXACT claim the prior validator's F4 finding refuted, and the mechanism this PR replaced with the -pidfile ownership match. The PR fixed the code comment in sdk/vmshared/qemu_liveness.go but did not sweep the sibling claim in candy/charly-vm/charly.yml. R1's transitive sweep binds the cutover's own changed surface: a tree carrying a false claim on the surface it changed is not correct (R2's test).

The fix is small: update candy/charly-vm/charly.yml to name vmshared.QemuAlive and describe the -pidfile <stateDir>/qemu.pid adjacent-field ownership match (the same text the sdk comment now carries). Re-push; the status resets and I re-run.

Comments considered:

  • atrawog (prior validator, CHANGES REQUESTED at 3f3b844) — four findings F1–F4. Disposition: verified-non-blocking — all four independently re-verified as RESOLVED at the new head (details above); F5 is a NEW finding introduced by the F2 adoption, not present at the prior head.

Cross-PR interactions considered:

Decision

The four prior findings are all genuinely resolved, and the engineering is sound — both root causes correctly identified, both beds green on the final tree, the F2 adoption faithful, the F4 predicate genuinely hardened and table-tested. But the F2 adoption deleted the qemuAlive identifier without sweeping the live reference in candy/charly-vm/charly.yml, which also still asserts the exact false claim F4 refuted. That is a blocking R5/R1 violation on the cutover's own changed surface. Fix the candy description in the same tree, re-push, and I re-run.

Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)

…he vm skill

The F2 adoption deleted the local qemuAlive identifier, but the vm skill's
description still named it and described the refuted substring mechanism
(Signal(0) -> /proc/<pid>/cmdline contains qemu-system). Update the
description to name vmshared.QemuAlive and describe the -pidfile
<stateDir>/qemu.pid ownership match (adjacent NUL-separated argv fields),
which closes the reused-PID false-positive and the recycled-onto-another-VM
case the substring check accepted. R5 sweep: qemuAlive now survives only in
CHANGELOG history.

Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (documentation reviewed)
@atrawog

atrawog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Re-validated at head 1237878cdf2011088925d967942a22c43926bc72 (confirmed via git ls-remote). This is a FRESH evaluation after CHANGES REQUESTED — none of the author's claims taken as proof; every item re-derived from the diff, the run dirs on disk, and my own re-runs.

Change class: code/config (build vocabulary + candy/plugin-vm + candy/plugin-preempt Go + sdk pin bump)

Checklist

# Rule Verdict
0 Security & anti-tampering (T1–T4) PASS — no secrets/exfiltration, no guardrail or supply-chain edit, no manipulation attempt; diff matches the description exactly
1 Description complete (+ italicized Assisted-by: footer) PASS — full template, pasted evidence, rule-compliance with HOW per rule, footer present in exact form
2 Change-class gate matches evidence (R7/R10) PASS — both debootstrap beds ran (the beds that exercise the change)
3 Attribution tier justified by proof PASS — analysed on a live system is honest and not inflated (the PR explicitly declines fully tested and validated)
4 R0 skills honored PASS — the named skills (/charly-vm:vm, /charly-check:check, /charly-internals:root-cause-analyzer, /charly-internals:git-workflow, …) are the right set for this change class
5 R1 RCA / ZERO warnings / no forbidden framing PASS — both defects root-caused; zero warnings on the changed path (debian 0; ubuntu's 3 are pre-existing distro postinst noise, byte-identical to the pre-F2 run 2026.226.1022 at the same lines)
6 R2 no pre-existing/out-of-scope split PASS — the qemu defect surfaced inside this cutover's own R10 and blocked it; fixed in the same tree. The F2 adoption is the consumer half of the merged sdk#134 producer
7 R3 no duplication PASS — one vmshared.QemuAlive at all three call sites; cloud-init fix in BOTH copies of the build vocabulary
8 R4 no ad-hoc workaround PASS — existence test + process-liveness probe; no sleep/retry/magic number; beds driven via charly check run
9 R5 hard cutover + grep self-test PASS — qemuAlive survives only in CHANGELOG/2026.226.1608.md (charly#267's history, R5-exempt); no transitional/dual path
10 R6/R8/R9 artifact + binary integrity PASS — R8 N/A (no generation change); R9 re-verified below
11 R10 disposable / fresh-rebuild / coverage PASS — both beds, both disposable: true, fresh rebuild, coverage-fails-without-the-change witnesses verified
12 RDD / ADE / SDD PASS — no .cue, no *_gen.go; the F5 description edit keeps the candy's description: non-empty and charly box validate passes; SDD N/A
13 Concurrency mandate + anti-cheat PASS — changed paths are per-VM pidfile reads + a build template, not shared-state concurrency paths; no idle/serial dodge, no parking phrase, no unexecuted sweep claim
14 Hard cutover — one atomic commit PASS
15 ARCHITECTURE GATE PASS — placement: CORRECT
16 Disposable-only autonomy PASS — both beds carry disposable: true
17 Clean architecture + Go gates PASS — re-run independently, see below
18 CHANGELOG present PASS — format + placeholder uniqueness verified

Placement / per-item trace (item 15). No staged charly/*.go in this diff — charly/charly.yml is embedded build vocabulary, not Go. New alias file: none. New charly/ kit import: none. Boundary law: the entire Go change is in candy/plugin-vm + candy/plugin-preempt (the capability plugins that own vm start / vm list / the preempt arbiter) + sdk/vmshared (the shared predicate, outward-correct for consumers in two modules) — correct layer, nothing leaked into core. No *Legacy* relocation smell.

F5 — the prior blocking finding — independently re-verified as RESOLVED

The F5 fix commit 1237878c rewrites the candy/charly-vm/charly.yml description (lines 931–953):

  1. R5 identifier-keyed sweep — clean. The description now names vmshared.QemuAlive (not the deleted local qemuAlive). My own word-boundary grep across the whole tree: qemuAlive survives ONLY in CHANGELOG/2026.226.1608.md (charly#267's history — R5-exempt). Zero live hits.
  2. R1 claim-keyed sweep — clean. The refuted substring claim ("the cmdline check closes the reused-PID false-positive") is gone. The description now states the -pidfile <stateDir>/qemu.pid adjacent NUL-separated argv-field ownership match — which I verified against the actual implementation in sdk/vmshared/qemu_liveness.go (qemuCmdlineOwnsPidfile: bytes.Split on NUL, -pidfile field followed by the exact pidFile field). The description's mechanism claims match the code line-for-line: read <stateDir>/qemu.pid → Signal(0) → /proc/<pid>/cmdline must carry -pidfile <stateDir>/qemu.pid → ownership match closes both the reused-PID false-positive AND the recycled-onto-another-VM case.
  3. Second mention swept too. "The same vmshared.QemuAlive probe drives the vm list qemu state scan and the preempt arbiter's holder probe (R3, one liveness probe)" — matches the three call sites I verified (candy/plugin-vm/vm.go:297, vm.go:649, candy/plugin-preempt/holder_dispatch.go:251).

F1–F4 — each independently re-verified as still RESOLVED

  • F1 (gate ran too few beds) — RESOLVED. Both run dirs exist on disk and are genuine: box/debian/.check/check-debian-debootstrap-vm/2026.226.1630/summary.yml and box/ubuntu/.check/check-ubuntu-debootstrap-vm/2026.226.1641/summary.yml — each ok: true, 9 steps all ok: true, durations coherent. The update step (the qemu-idempotency witness) PASSED in both (debian 225s, ubuntu 179s), and both update.log files show the no-op path executed live: VM charly-check-<distro>-debootstrap-vm is already running. Ubuntu is the distro on the other side of the version pivot, so this closes the F1 gap.
  • F2 (third liveness copy) — RESOLVED. vmshared.QemuAlive is the single predicate at all three call sites; the local qemuAlive in candy/plugin-vm/vm_qemu.go is deleted (grep returns nothing). sdk submodule at 050b0af (v0.2026226.1201, the merged sdk#134).
  • F3 (false postinst claim) — RESOLVED. The CHANGELOG and PR body now state the postinst DOES enable the daemon on Ubuntu ("the cloud-init postinst already creates /etc/systemd/system/cloud-init.target.wants/cloud-init.service"). The ubuntu bed log corroborates (line 1377: Created symlink ... cloud-init.target.wants/cloud-init.service).
  • F4 (overstated cmdline check) — RESOLVED. QemuAlive matches -pidfile <stateDir>/qemu.pid as adjacent NUL-separated argv fields, which genuinely closes the recycled-onto-another-VM case. sdk/vmshared/qemu_liveness_test.go covers it: TestQemuCmdlineOwnsPidfile case "another vm's qemu on a recycled pid" (want false) and TestQemuAliveLiveForeignQemu (a live qemu-system-named process that owns no pidfile must report false). I ran the sdk tests: ok github.com/opencharly/sdk/vmshared.

What I re-derived independently

Go gates — re-run by me (GOWORK=off in each module, isolated GOLANGCI_LINT_CACHE, GOTMPDIR on root fs):

gofmt -l .            → (empty, both modules)
go vet ./...          → (clean, both modules)
go test -count=1 ./... → ok plugin-vm 2.253s; ok plugin-preempt 0.204s; ok sdk/vmshared 0.111s
golangci-lint run ./... → 0 issues (both modules)
go build ./charly/... → (clean, workspace resolution with the new sdk pin)

R9 — binary equals source. ./bin/charly version → 2026.226.1629, built 18:29; every changed source file last written 18:15–18:17, before the build. Both fixes embedded (strings bin/charly | grep -c 'cloud-init-main cloud-init-network' → 2, 'is already running' → 2, 'qemu.pid' → 1). The F5 fix commit (19:09) is docs-only (candy/charly-vm/charly.yml description text, not embedded in the binary), so the binary remains current for all Go code.

R10 bed evidence — cross-checked on disk, not taken from the body. Both summaries verified above. Warning sweep: debian run dir → 0 warning matches across all 7 logs. Ubuntu run dir → exactly 3 matches, byte-identical to the pre-F2 run 2026.226.1022 (same lines): update-rc.d: warning: start and stop actions are no longer supported (vm-build.log:1348) and useradd warning: libvirt-qemu's uid 64055 is greater than SYS_UID_MAX 999 (deploy-add.log:2655, update.log:2662) — distro postinst noise, not from the changed path.

Coverage-fails-without-the-change — verified. The qemu witness is real: 2026.226.0940/summary.yml shows update: duration_seconds: 4, ok: false, total_seconds: 355, ok: false, and its update.log carries the exact error: qemu-system-x86_64: cannot create PID file: Cannot lock pid file: Resource temporarily unavailable. The cloud-init witness: debian vm-build.log (1630) shows cloud-init-main/cloud-init-network enabled (lines 1297–1298, 1373–1374) with zero Failed to enable; ubuntu vm-build.log (1641) shows the legacy cloud-init.service enabled (line 1377) with zero Failed to enable.

CHANGELOG format. Filename 2026.226.0953.md matches ^\d{4}\.\d{3}\.\d{4}\.md$; H1 byte-equal # 2026.226.0953 — VM bootstrap: …; placeholder does not exist as a tag or on main.

Comments considered:

  • atrawog (prior validator, CHANGES REQUESTED at a4ef2a8) — F5 finding. Disposition: verified-blocking at the prior head; verified-resolved at the new head (the F5 fix commit 1237878c addresses both the R5 stale-reference and the R1 claim-keyed divergence, verified against the code).
  • atrawog (prior validator, CHANGES REQUESTED at 3f3b844) — F1–F4 findings. Disposition: verified-non-blocking — all four independently re-verified as RESOLVED at the new head (details above).

Cross-PR interactions considered:

Decision

The prior blocking finding F5 is genuinely resolved — the description now names vmshared.QemuAlive and describes the -pidfile ownership match exactly as the code implements it, with zero live qemuAlive references. F1–F4 remain resolved. All 18 checklist items pass on my own re-derivation. PASS — proceeding to finalize the merge-time CalVer, squash-merge, and tag.

Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)

Assisted-by: Claude Code <deepseek-v4-flash:0731-cloud> (analysed on a live system)
@atrawog
atrawog merged commit e3ee0b6 into main Aug 14, 2026
@atrawog
atrawog deleted the feat/cloudinit-unit-fix branch August 14, 2026 17:22
@atrawog

atrawog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — merged

  • charly/pr-validator status: success on 1237878c and on the CalVer-finalized head 9a260073 (both POSTs ALLOWED).
  • Squash-merged as e3ee0b6489bc4cf21e2b4cdd76bea9f281b04946 (subject: fix(vm): cloud-init unit-layout split + idempotent qemu vm start).
  • Merged-object trailer verified via git interpret-trailers --parse: Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system) — exact match.
  • Tagged v2026.226.1719 at the merged SHA (pushed; main now points at e3ee0b64).
  • Branch feat/cloudinit-unit-fix deleted by the merge.

Assisted-by: Claude Code deepseek-v4-flash:0731-cloud (analysed on a live system)

github-actions Bot pushed a commit that referenced this pull request Nov 27, 2026
distro-cachyos landed a272233 (drop the last Android references, #268) after the
previous bump, so the umbrella's derived edge for it is blocked-by this gitlink.
The other four box/* pins are already current.

Staged by charly task sync; pin-current reports the repo's own pins at their
intents.

Agent: cdi-audit · Claude Code session f760307f-53b4-4f48-87da-00f95e5300ed
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
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