Repository navigation
fix(workflows): a sub-agent runs only what it can own — defer long beds, refuse host-local - #47
Conversation
…efuse host-local beds An R10 roster over 62 disposable beds returned 26 real passes and 26 beds with NO verdict, orphaned 3 running libvirt domains + 4 pod containers, recorded a bed that had actually PASSED as a failure, and ran a `host: local` deploy that installed packages as root on the operator's workstation (fixed separately: distro-cachyos v2026.190.2109). Root cause (RCA, not inference): verify-beds.js drove EVERY bed through an agent() sub-agent. A sub-agent returns synchronously, its background children die with it, and its one foreground `charly check run` is Bash-capped at 600s -- so it cannot own a bed that outlives its turn. Long beds were force-terminated before writing summary.yml; their libvirt domains (owned by virtqemud) and pod containers (owned by conmon) survived the killed orchestrator and were orphaned. This was a divergence INSIDE CLAUDE.md, not merely doc-vs-code. Its concurrency Key Rule already mandates "persistent-session run_in_background ownership of every >600s bed", while R10's change-class matrix said to fan the whole roster through /verify-beds. Both sentences now agree (R1 claim-keyed sweep: R10 matrix + the Agents-section workflow bullet + the workflow's own meta.description; the four plugins doc surfaces ride in plugins PR #20). The fix -- the workflow runs only what it can own. Beds partition three ways, nothing silently dropped: SHORT run here, in parallel, exactly as before. LONG vm/android substrate, or newest .check/<bed>/<calver>/summary.yml records total_seconds >= 600 -- long by MEASUREMENT, not a hand-maintained list. Deferred, returned in deferredLongBeds[] with the exact command, for the PERSISTENT session to own as run_in_background tasks. HOST-LOCAL a local: deploy, or a bed with a nested local: member (how check-group reaches the host), whose host: is local. Refused: it applies candies to the operator workstation; test beds belong in a disposable eval VM. The result carries deferredLongBeds, refusedHostLocalBeds and gateComplete -- a partial roster can no longer be mistaken for a green R10 gate. check-openclaw-full-pod (measured 1414s) is now deferred despite passing inside an agent last time: it passed above the cap, on luck. R10 (workflow-script class -- the changed control flow executed live): node --check clean; the partition predicates unit-tested standalone over 9 synthetic beds (5/5), confirming a REMOTE local: bed still runs while a HOST-LOCAL one is refused, and that a host-local bed is refused rather than merely deferred. Then the real workflow ran one bed per branch: total: 1 passed: [check-sidecar-pod] failed: [] gateComplete: false check-sidecar-pod exit 0, 10/10 steps ok, total_seconds 178 deferredLongBeds: check-k3s-vm -- substrate 'vm' always boots a machine refusedHostLocalBeds: check-local -- host-local: applies candies to the workstation The refusal and deferral were asserted against the MACHINE, not merely reported: the host's pacman transaction count was unchanged by the beds (only the opencharly-git rebuild that `task build:charly` performs), /etc/check-group-marker never appeared, no libvirt domain was created, no container left running. Mid-run charly's stale-binary guard correctly refused the first invocation; the runner cleared it with `task build:charly` and re-ran with no flags. Trap recorded: Workflow({name}) resolves a registry snapshot taken at session start, so an edited .claude/workflows/*.js is NOT what runs. The first attempt at this cutover's own gate launched the OLD script -- which would have applied check-local to the host -- and was killed in its discover phase before any bed started (host verified unmutated). Use Workflow({scriptPath}), which takes precedence. Assisted-by: Claude (fully tested and validated)
…-return carries gateComplete
The pr-validator on the paired plugins PR caught that this cutover fixed /verify-beds while
leaving /verify-status carrying the identical defect: verify-status.js drove its four
hardcoded substrate beds through ephemeral agent() calls to completion, including check-local
(HOST-LOCAL -- it applies candies to the operator workstation), check-k3s-vm (vm) and
check-android-emulator-pod (android).
Every substrate bed it names is disqualified from sub-agent ownership -- check-pod measures
>=600s; the other three are vm/android/host-local -- so a RUNNER form of that workflow is
invalid by construction. It is now a PLANNER: zero beds run; it emits per substrate the exact
command, the summary.yml path to read, and the status-shows-*
deploy-scope assertion that bed proves, for the PERSISTENT session to own as a
run_in_background task. Dead BED_SCHEMA/runBed/parallel() runner deleted (R5 grep self-test:
BED_SCHEMA, runBed, parallel(, skippedPrereq, statusAssertions all absent).
R3: the bed-safety classifier stays in ONE place, verify-beds.js -- verify-status does not
re-implement it. An RDD spike first proved the runtime's workflow() inline delegation exists
and that delegating a host-local bed returns a refusal with totalRan: 0, running nothing; the
spike was discarded.
That spike also caught a bug in this cutover's own code: verify-beds' no-short-beds early
return omitted gateComplete, so a caller testing got undefined. Fixed.
Audited the siblings: /triage-check-failure explicitly instructs its agents not to re-run
; /audit-deploy-configs runs no beds. Both clean.
R10 (workflow-script class -- the changed control flow executed live):
verify-status (planner): total 0, ranHere [], gateComplete false, 4 planned entries;
local -> "HOST-LOCAL: applies candies to the operator workstation -- run it inside the
disposable eval VM, never on this host". Zero beds ran; host untouched.
verify-beds (partition): check-sidecar-pod PASS 10/10 (178s), check-k3s-vm deferred,
check-local refused, gateComplete false.
Assisted-by: Claude (fully tested and validated)
…e sweep (76413b5) Integrates plugins CHANGELOG/2026.190.2206.md (PR #20, squash 76413b5): the five doc surfaces that asserted /verify-beds runs every bed, and the /verify-status bullet that described it running check-pod / check-k3s-vm / check-local / check-android-emulator-pod to completion. Both workflows now state -- and this repo's code now implements -- that a sub-agent runs only what it can own. /verify-beds partitions SHORT (run) / LONG (deferred to the persistent session) / HOST-LOCAL (refused). /verify-status runs zero beds; it plans. Assisted-by: Claude (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: workflow scripts ( Fresh evaluation, independent of the author. The engineering is sound and the RCA is genuine — but the cutover's claim-keyed R1/R5 sweep is incomplete: it missed the superproject Checklist verdict
Blocking findings (fix in THIS tree — R1/R5 claim-keyed sweep, R2 blocking)The cutover changes
Both are one-line prose edits; after them, DecisionNot merged. Everything else in the cutover is compliant and well-executed — the RCA is genuine (verified against Assisted-by: Claude (analysed on a live system) |
The pr-validator on PR #47 caught that the claim-keyed R1/R5 sweep updated CLAUDE.md, both workflow meta.descriptions, and five plugins doc surfaces -- but missed this repo's README, the "Features & command reference" doc owner. Merging would have landed code that no longer runs every bed beside a README saying it does. Three sites corrected to the by-owner framing: README.md:570-571 "to run a whole roster ... one `charly check run <bed>` per agent" README.md:580-583 "dynamic workflows run charly check run/live/box against the beds" README.md:879-880 "/verify-beds runs every disposable check bed as the R10 gate" Each now states: SHORT beds via /verify-beds; every LONG bed (vm/android substrate, or last run >=600s) owned by the persistent session as a background task, because an ephemeral sub-agent cannot own a bed that outlives its turn; host-local beds refused; a gateComplete:false result is a PARTIAL roster, never a green gate. Claim-keyed grep across the whole tree (excluding CHANGELOG history) now returns nothing. The lesson is procedural and is recorded in the changelog: a claim-keyed sweep is a grep across the whole tree, not a walk through the doc set one happens to remember. This is the SECOND surface a fresh evaluator had to find in this cutover -- the first was /verify-status. Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅ (re-validation of the fix)Change class: workflow scripts ( Independent re-validation of head Re-verified against the fix (not taken on the author's word)
Standing verifications from the first pass (unchanged files, still valid)RCA genuine (SKILL.md:486-488 on main really reads "NEVER the sub-agent DecisionApproved. The sole prior blocker (unswept Assisted-by: Claude (analysed on a live system) |
…ds ownership cutover) pr-validator stamps the merge-time CalVer at merge, not author time. Renames the placeholder CHANGELOG/2026.190.2340.md to CHANGELOG/2026.190.2227.md and updates its heading. Version generated UTC at merge; monotonic above v2026.190.2122. Assisted-by: Claude (fully tested and validated)
… (candy/plugin-box) (#89) P15 — the build-mode charly box verb HANDLERS (generate/validate/new/pkg) move out of charly core into a new COMPILED-IN command plugin candy/plugin-box, nested under the shared box grammar group via the generic NestedCommandProvider mechanism. Core BoxCmd stays the dispatch spine (build/merge/labels/feature/inspect/list + the authoring verbs). Plus a validate.go dead-stub sweep (validateBaseReferences/validateDNS deleted, validateLibvirt cleaned). Seams (no new capability, no duplication): generate → InvokeProvider(build:generate); new → sdk/kit scaffold engine directly; validate/pkg → HostBuild("cli") to hidden K1-doomed core __box-validate/__box-pkg. inspect/list retained (K1). Retained core surfaces each carry a tracked K-wave exit (K1/#46/#47). Advances the v2 plugin-host core direction. Validated by fresh pr-validator V-P15b: R10 check-commands-local PASS (box-new-validate-generate + box-pkg-dispatches exit=0, corroborated on disk); go build/test/vet/gofmt/golangci-lint(0)/cue:gen-repro all green (re-run); boundary-law clean; plugins gitlink reconciled to merged #43 main. Assisted-by: Claude (fully tested and validated)
Renamed placeholder CHANGELOG/2026.198.0311.md to the actual merge-time CalVer (evaluator step, computed via `date -u` per the #47 lesson — never `git show --date=format` in the commit's local TZ). Assisted-by: Claude Sonnet 5 (analysed on a live system)
) * feat(core): K3 wire-to-spec Path 1 — pure import repoint (5 files) Five charly/*.go files used ONLY deploykit/kit types that a prior wave (SDK envelope relocation, task #13) already moved to sdk/spec as Go type aliases (deploykit.InstallPlan/EmitOpts/DeployExecutor = spec.X in sdk/deploykit/steps.go; kit.LabelDescriptionSet/LabeledDescription = spec.X in sdk/kit/planrun.go). Repoint each to import spec directly instead of deploykit/kit — a same-type swap with byte-identical runtime behavior (these were literal Go type aliases, not distinct types), so no bed re-run is needed for this change class. - deploy_preresolve.go: deploykit.InstallPlan -> spec.InstallPlan - deploy_substrate_lifecycle.go: InstallPlan/EmitOpts/DeployExecutor -> spec.* - layer_artifacts.go: DeployExecutor/EmitOpts -> spec.* - plugin_grpc.go: DeployExecutor -> spec.DeployExecutor - description_collect.go: kit.LabelDescriptionSet/LabeledDescription -> spec.* Identified via a K1/wire-to-spec classification spike of the remaining 25 type-only files off charly/*.go's kit-import list: these 5 retire for free (Path 1); ~11-12 need real coordinated type migrations (Path 2, next); ~7-8 hold Go interfaces/function-value hooks structurally excluded from CUE generation, tracked separately (Path 3, task #21). Metric: charly/*.go kit-importing files 150 -> 145. R10 gate for this change class (orchestrator-ruled, per R10's own "run only the gate that exercises the change" principle): deploykit.X/kit.X here were literal Go type ALIASES of spec.X, so no runtime path can differ — a bed gate cannot fail on this change. go build/go vet/go test ./... (88s, full pass) + golangci-lint (0 issues) is the exhaustive, non-wasteful gate. Assisted-by: Claude Sonnet 5 (analysed on a live system) * chore(changelog): finalize merge-time CalVer 2026.198.0326 Renamed placeholder CHANGELOG/2026.198.0311.md to the actual merge-time CalVer (evaluator step, computed via `date -u` per the #47 lesson — never `git show --date=format` in the commit's local TZ). Assisted-by: Claude Sonnet 5 (analysed on a live system)
… rule removal (#596) * chore(deps): pin plugin-build v0.2026255.1833 — the podman store-size rule removal charly/go.mod required plugin-build v0.2026250.552, whose box-build drive ran `podman system df` and printed "warning: podman store is bloated (…)" before every image build. That is a statement about the local build HOST emitted into a bed's output, and the org's R10 gate counts un-allowlisted warning lines — so a bloated store on whatever host ran a bed gated unrelated PRs (pod-immich-ml#5, distro-cachyos#82/#83, plugin-check#45/#46/#47). The maintainer's directive removed the rule at source (opencharly/plugin-build#12, squash 847f6998, tag v2026.255.1833). This bump is the propagation step that puts the removal into every binary built from this tree: charly compiles plugin-build in, so charly/go.mod is what a user runs. Verified: the module tag resolves to 847f6998; the pinned revision ships no store_bloat.go and no production mention of the probe (it ships store_size_rule_test.go, which fails on the pre-removal tree); the built binary has zero occurrences of the format string; and a live box build emits zero warning lines where the pre-change binary emits the bloat line. Assisted-by: pi ollama-cloud/deepseek-v4-flash (analysed on a live system) * docs: address the validator BLOCK — pre-change bed control + named routing Append-only evidentiary/accounting update to the PR body (no tree change): - BLOCK 2 (R10 bed coverage): the R10 bed now RAN on the final tree — `charly check run check-alpine-repo` (pod, disposable: true), whose image-build step is the touched code path, including its `charly update` fresh rebuild and both post-rebuild live passes: ok: true, warnings: 0, errors: 0. The isolating pre-change control is pasted too: the same bed built and run from the unmodified base commit (5018afb) yields warnings: 1 — the bloat line, counted exactly as it gated pod-immich-ml#5. - BLOCK 1 (gate environment / deferred finding): the prescribed TMPDIR=/tmp/charly-ci red is root-caused and NAMED, not parked. Bisected to a single entry in that path: a foreign .git directory above the fixture root changes how loaderkit mounts a namespaced import (flat imports unaffected) — proven by a seven-entry single-variable sweep plus two negative probes, and identical at both pins / green in CI at the base SHA. Routed to batch `loaderkit-namespace-import-ancestor-gitdir` (owner opencharly/sdk, loaderkit) with its acceptance criterion, and the consumer pins to batch `charly-pin-propagation-consumers`; no in-tree test shim is added, because the resolution code lives in the SDK and masking it here would be an R4 workaround. Assisted-by: pi ollama-cloud/deepseek-v4-flash (fully tested and validated) * docs: paste the tracked-surface sweeps the R2/R5 answers rest on Addresses the second validator BLOCK (B14(d)/B10/B7 — compliance asserted with described-but-unpasted sweeps). Body-only change; no tree change. - The version-carrying sweep is pasted: `git grep -nE 'plugin-build[^[:space:]]*[[:space:]]+v[0-9]'` over the tracked surfaces returns exactly ONE plugin-build require site (charly/go.mod:16) plus its go.sum lines; the `compiled_plugins:` entry in charly/charly.yml is a NAME (no version) and charly/plugins_generated.go is a generated import. - The old-pin sweep is pasted and READ, and it corrects an over-broad claim: `v0.2026250.552` still pins plugin-preempt and plugin-status (different modules at the same CalVer minute) and appears in CHANGELOG history — no plugin-build line points at it. - The claim-keyed sweep for the removed behaviour is pasted: `store is bloated`, `store_bloat` and `podman system df` are all zero-hit (rc=1) in the tracked tree. Assisted-by: pi ollama-cloud/deepseek-v4-flash (fully tested and validated) --------- Co-authored-by: atrawog <[email protected]>
Summary
The runtime half of the workflow-ownership cutover. Paired
pluginsPR #20 is merged (76413b5,CHANGELOG/2026.190.2206.md); this bumps the gitlink.Change class: workflow scripts (
.claude/workflows/*.js) + CLAUDE.md + CHANGELOG +pluginsgitlink. Gate: execute the changed control flow live. Tier:fully tested and validated.What went wrong
An R10 roster over 62 beds returned 26 real passes and 26 beds with no verdict, orphaned 3 libvirt domains and 4 pod containers, recorded a bed that had actually passed (
check-debian-debootstrap-vm) as a failure, and rancharly-cachyos— ahost: localdeploy — installing packages as root on the operator's workstation for 697s (fixed separately:distro-cachyos v2026.190.2109).Root cause (RCA, not inference):
verify-beds.jsdrove every bed through anagent()sub-agent. A sub-agent returns synchronously, its background children die with it, and its one foregroundcharly check runis Bash-capped at 600s. It cannot own a bed that outlives its turn. Long beds were force-terminated before writingsummary.yml; theirvirtqemud/conmon-owned resources survived the killed orchestrator.This was a divergence inside CLAUDE.md. Its concurrency Key Rule already mandates "persistent-session
run_in_backgroundownership of every >600s bed", while R10's matrix said to fan the whole roster through/verify-beds. Both now agree.The fix
verify-bedspartitions three ways, nothing silently dropped:vm/android, or newestsummary.ymltotal_seconds >= 600deferredLongBeds[]local:deploy, or a bed with a nestedlocal:member, whosehost:islocalPlus
gateComplete— a partial roster can no longer read as a green gate.verify-statushad the identical defect (apr-validatorcaught it, blocking): it drovecheck-local,check-k3s-vmandcheck-android-emulator-podthrough ephemeral agents. Every bed it names is disqualified from sub-agent ownership, so a runner form is invalid by construction. It is now a planner: zero beds run. DeadBED_SCHEMA/runBed/parallel()deleted.R3: the classifier lives in one place (
verify-beds);verify-statusdoes not re-implement it.R10 evidence — the changed control flow executed live
node --checkclean on both. Partition predicates unit-tested standalone over 9 synthetic beds (5/5), confirming a remotelocal:bed still runs while a host-local one is refused.Asserted against the machine, not merely reported: the host's
pacmantransaction count was unchanged by any bed (the only entries are theopencharly-gitrebuildtask build:charlyperforms),/etc/check-group-markernever appeared, no libvirt domain was created, no container left running.An RDD spike (discarded) proved the runtime's
workflow()inline delegation exists and that delegating a host-local bed returns a refusal withtotalRan: 0. It also caught a bug in this cutover's own code:verify-beds' no-short-beds early return omittedgateComplete. Fixed.Sibling audit:
/triage-check-failureexplicitly forbids re-runningcharly check run;/audit-deploy-configsruns no beds. Both clean.Disclosures
a69c44e's message is partially mangled — I put backticks inside a double-quotedgit commit -m, so the shell ate three fragments (and harmlessly executed a barecharly check run, which errored with no bed argument). The branch is pushed and amending would require a force-push, which is forbidden. Squash-merge discards intermediate messages — please compose the squash message correctly and carry theAssisted-by:trailer.--squashfolds them).Workflow({name}), which resolves a session-start registry snapshot — it ran the OLD script and would have appliedcheck-localto the host. Killed in the discover phase; host verified unmutated. UseWorkflow({scriptPath}).Note for the evaluator
Do NOT run any host-local bed (
check-local,check-group,check-structkind,check-substrate,check-*-local,check-cross-local-http,check-cross-vm-http) and do not run/verify-bedswith no arguments — it would discover them. The operator has directed that alllocal:testing move into a dedicated eval VM (the next cutover).Merge with
--squash; tagv<CalVer>.Assisted-by: Claude (fully tested and validated)