Repository navigation
fix(plugin): the idle guard's daemon discovery resolves its roots through the ONE resolver - #1121
Conversation
…ough the ONE resolver charlyDaemonPids composed $XDG_CACHE_HOME/charly and $XDG_RUNTIME_DIR/charly by hand, so it ignored CHARLY_CACHE_DIR — on a relocated install it could not see the detached buildkitd its own idle guard exists to follow, and would kill a running install as WEDGED (charly#1119). The two roots now come from spec/storeroot, the contract surface core is permitted to import, so the import-purity gate passes AS WRITTEN: charly/import_purity_test.go is byte-identical to origin/main, with no exception and no residual-SDK row. The runtime root inherits the resolver's documented fallback to the state root when there is no XDG_RUNTIME_DIR, where the hand-built code dropped it entirely — that can only widen the daemon set the guard follows, never narrow it. Pins move with the code: spec to v0.2026315.2118 (which carries spec/storeroot) and plugin-candy to v0.2026313.1445, forced because schemaparams.Generate lost its third parameter and the older plugin-candy pin still called the three-argument form — a spec-only bump fails to build in that dependency. TestCharlyDaemonPids_FollowsTheCacheDirOverride is the arm that fails without the change: against origin/main's implementation it reports that the discovery did not find a process under the relocated root. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config (core Go fix + dependency-pin bumps in No comments on the thread to disposition (0 comments). Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
Round 1 RCA — A3 attribution evidence; body-only, the diff did not move. The finding. The footer names Missed control — and it is a copied-and-not-re-derived control. The fence I pasted is the one I Fix. §5 now pastes the authoring session's OWN record, from the file named by the same So the trailer's three names are each corroborated by evidence rather than restated. The tier is I am also carrying this forward: the two umbrella legs still to come (the DESIGN.md record and any Agent: cache-root-resolver Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system) |
Review — PASSHead SHA: Security screen: PASS Comment dispositions:
Non-blocking notes:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
CI RCA — The failure. Mechanism. This repo is a MULTI-MODULE tree: Missed control — and it is a scope error in what I called "the gate". I ran Root fix, applied. Why the PR is not armed despite Agent: cache-root-resolver Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system) |
The core module's spec pin moved to v0.2026315.2118 (spec/storeroot), and this repo keeps ONE spec/sdk pin across charly/go.mod and the tools/* modules that import the contract. `tools/gomod-canonical`'s TestContractPinsMatchShared fails until they agree, which is why CI's `go` job was red on the previous head while the validator itself passed. `charly task mods-tidy` aligned and tidied the three modules that carry a spec require (generate-packages, golden-cloudinit, golden-compile); its own check step passes, and every in-repo module's tests pass individually afterwards. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Blocks
Comment dispositions
Accepted, non-blocking
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
Round 2 RCA — the pasted The finding. After the pin-alignment commit ( Missed control — the body is a DERIVED artefact and I edited it with a regex that silently matched The control, and it is mechanical: every commit that changes the tree invalidates the body's Fix. The stat fence is replaced by the command's own output for Cross-checked against the body's file table: the same eleven paths, the same counts. No code, no Agent: cache-root-resolver Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system) |
Review — PASSHead SHA: Security screen: PASS — hand-built root pair replaced by Comment dispositions:
Non-blocking notes: No Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
173 commits behind; both touched files conflicted. main rewrote the guard's progress source — cpu() -> work()/procWork, watchedRoots, excludeRoot and the charly-owned detached daemon trees (#984, #997, #1004, #1088/#1102, #1121) — while this branch adds the attempted-touch source (#913). Resolved by re-basing the attempt source onto main's structure BY HAND rather than merging text: - pluginActivity.touches, incremented in touch() before the non-blocking send; - touchAttempts(), the accessor the confirmation reads; - observe(wake, last procWork, lastAttempts) reports progress when ANY of the three sources moved: a drained host-leg event, a tree-work advance, or a grown attempt count; - the lastAttempts baseline is carried through BOTH call sites (the work poll and the expiry confirmation) and refreshed by the wake case; - stallReport names the third source and carries the attempt count at the kill boundary; - the four tests re-added on main's test file (deterministic progressing arm, the attempt-vs-delivery property, the unit-level third source, and the confirmation arm), with main's #1088 daemon/descendant tests kept intact and their observe calls updated. Verified on THIS tree: gofmt clean; go build ./... and go vet ./... rc=0; the focused guard tests 15/15 PASS; the full module suite go test ./... -> ok 414.387s and ok internal/pluginsgen 142.184s, rc=0, zero failures. *Agent: pr-charly* *Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)*
Summary
charlycore resolves its daemon roots through the org's ONE resolver, which now lives where coreis allowed to reach it.
charlyDaemonPids— the idle guard's discovery of charly-owned DETACHED daemons — composed$XDG_CACHE_HOME/charlyand$XDG_RUNTIME_DIR/charlyby hand. Two consequences, both measured:CHARLY_CACHE_DIR, so on a relocated install it could not see thebuildkitdits ownidle guard exists to follow, and would kill a running install as WEDGED (
opencharly/charly#1119);sdk/storekitowned, which core may not import.It now asks
spec/storeroot— the contract surface core is permitted to import — for the cache andruntime roots, and nothing else changes: the scan of
/proc, the argv match, the self-pidexclusion, the seam, and the "a daemon is shared, so summing it is the correct trade" reasoning are
untouched.
TestImportPurity_HostImportsOnlySpecAndVettedThirdPartypasses AS WRITTEN. No exception wasadded, no residual-SDK row was declared, and
charly/import_purity_test.gois byte-identical toorigin/main:The gate is also proved LIVE in both directions (§2), because a gate nobody can trip proves nothing.
One deliberate behaviour change, stated rather than discovered later. The runtime root now comes
from the resolver, so with no
XDG_RUNTIME_DIR(a container, a cron job) it becomes the STATE root— the resolver's documented fallback — where the hand-built code simply dropped the runtime root.
That can only WIDEN the daemon set the guard follows: a path that did not match before still does
not, and a daemon whose argv names the state root is now visible. It cannot cause a false kill (more
visible daemons means more evidence of progress, never less).
The pins move with the code, and one of them is not optional. Bumping
specto a tag carryingspec/storerootcrosses a signature change:schemaparams.Generatelost its third parameterbetween
specv0.2026313.453andorigin/main, and this repo'splugin-candypin still calledthe three-argument form — so a
spec-only bump fails to BUILD, in a dependency:plugin-candy v0.2026313.1445already carries the two-argument call, so it is bumped here withspec.sdkis NOT bumped by this PR: nothing in this diff imports it, and the plugins that doadopt the re-export when their own pins advance.
Files in this diff:
charly/plugin_activity.gocharlyDaemonPidsresolves the two roots throughspec/storerootcharly/plugin_activity_test.gocharly/plugin_served_provenance_test.gocharly/go.modspec→v0.2026315.2118,plugin-candy→v0.2026313.1445charly/go.sumtools/generate-packages/go.modspecpin, adoptedtools/generate-packages/go.sumtools/golden-cloudinit/go.modspecpin, adoptedtools/golden-cloudinit/go.sumtools/golden-compile/go.modspecpin, adoptedtools/golden-compile/go.sumgit diff --stat origin/main...HEAD:This head is
How tested
Every command below was run against this head (
944d640069e076a6acefd6ad9165cf24b0d8f8ff) and pasted from its capture file.1. The gate, unedited, green — and provably able to fail
The counterfactual is the whole point of this campaign, so it is measured rather than argued: with
the NAIVE fix in the same spot —
import "github.com/opencharly/sdk/storekit"— the same gatefails, with exactly the message the tracking issue pastes:
Both runs use the SAME gate file (hash above), so the difference is the import, not the rule.
2. The coverage fails without the change
TestCharlyDaemonPids_FollowsTheCacheDirOverridestarts a real process whose argv names a pathunder a
CHARLY_CACHE_DIR-relocated root and requires the discovery to find it, with the othercandidate roots pinned to unrelated temp dirs. Against the PRE-change implementation (restored from
origin/maininto the worktree, byte-identical restore verified by hash):The pre-change arm is an assertion (
charlyDaemonPids did not find a process whose argv names …),not a build error, and the same test passes on this head.
3. The repo's own gate, on the committed tree
3b. Every in-repo module, not just the core one — and the task that keeps their pins shared
This repo is a MULTI-MODULE tree:
charly/go.modplus fivetools/*modules, with ONE sharedspec/sdkpin across the modules that import the contract.tools/gomod-canonical'sTestContractPinsMatchSharedguards that, and it was RED on the previous head because only the coremodule was bumped. The repo's own control —
charly task mods-tidy— is what aligns them, and itreports its own two steps:
4. The worktree-local binary (R9)
charly box listis a real plugin dispatch — it exercises the plugin transport and the activityclock that calls the changed function, on this host, with this binary.
CHARLY_CACHE_DIRwas NOTset for it, so the default resolution is what ran.
5. Attribution evidence (A3)
The footer's harness, provider and full model name are each corroborated by an artifact the
authoring session wrote, not asserted:
That is this session's own record — the same
DSH_SESSION_IDnamed above — so the trailer'sDeepSeek Harness(dsh --version),ollama-cloud(provider) anddeepseek-v4.1-flash(fullmodel name) are the runtime's exact names, cross-checked against the evidence rather than restated.
Rulebook compliance
R0 — skills first.
/charly-internals:git-workflow,/charly-internals:go,/charly-internals:strict-policyand/charly-internals:go-qualityloaded before the first toolaction;
charly/AGENTS.mdread fromorigin/mainbefore the first edit, along withspec's andsdk's (the two producer legs).R1 — RCA every anomaly, then fix it or file it. Three fired. (a) The build failed in
plugin-candyafter thespecbump: RCA —schemaparams.Generatelost its third parameter andthis repo's
plugin-candypin predates that; root fix — bumpplugin-candyin the same commit(measured against the version that already carries the two-argument call), rather than pinning
specback. (b)plugin_activity.gokept a now-unusedpath/filepathimport; root fix — dropit (the compiler caught it, which is the point of building before pushing). (c) A prose claim on
this change's own sibling surface —
plugin_served_provenance_test.go's comment namedstorekit.CacheDiras where the cache root is resolved — is now false for the host, so thecomment names the resolver and its re-export; that is a claim-keyed fix on a file this change
makes stale, not a drive-by.
R2 — no duplication. This change DELETES the hand-built pair; the two roots now come from the
one resolver. The predicates that composed them are gone, calibrated in both directions:
Nothing is copied from
spec/storeroot— it is imported.R3 — no workarounds. No sleep, retry, magic number, suppression or shim. The runtime→state
fallback is inherited from the resolver, not re-implemented here.
R4 — product before prose. The code is fixed first; the one comment touched describes the new
behaviour, and the resolver is reached with the binary alone (no checkout, no extra tool).
R5 — hard cutover, legacy deleted. The hand-built expression is gone, not kept beside the new
call — no dual path, no fallback to
os.UserCacheDir, and the test's premise now comes from thesame resolver instead of re-deriving the path. The identifier-keyed sweep, with the predicate
calibrated against
origin/main(where it MUST match, and does — the two hits quoted under R2),is empty on this tree. The one comment that named the sdk package as the resolver
(
plugin_served_provenance_test.go) is updated here, in the same commit.R6 — preserve user work; Git safety.
git statusread before the first edit and after everystep; the session worktree is
feat/storeroot-coreoff freshorigin/main(
e7336c6daa7033f9e18b64a7858b8dd1c3d0511a); no reset, no checkout of foreign work, no force-push, no hook bypass, nodirect push to
main.R7 — prove behaviour, not compilation. §1 proves the gate in both directions; §2 proves the
new coverage fails without the change (assertion, restored byte-identically); §3 runs the repo's
full suite on the committed tree; §4 runs the changed path in a real binary.
R8 — live or skip, never fake. The daemon-discovery arms spawn REAL processes and read the
real
/proc— no mock, no fake root set in the arms that prove the change (the seam exists forthe OTHER arms, which need isolation from a developer host's live daemons). No credential- or
network-bound service is involved, so nothing is skipped or simulated.
R9 — binary equals source. §4 builds the worktree-local CalVer-stamped binary and prints
charly version, which matches the commit's CalVer; the binary is the one that ran the dispatch.No new runtime OS dependency is added, so
packaging:needs nothing.R10 — fresh disposable proof. The gate that owns this change in THIS repo is
go test ./...plus
go vet ./...and the R9 build (§3, §4), all on the committed tree, zero warnings, lintclean under the CI toolchain. No
disposable: truebed is claimed here: this change's runtimepath is the idle guard's daemon discovery, which the arms in §2 exercise against real processes
and
/procon this host, and the assembled-bed behaviour of the guard itself is unchanged bymoving WHERE its two root strings come from.
Change classification
Core behaviour fix, API-neutral. No exported surface changes (
charlycore is apackage main),no command, flag or config key is added or removed, no wire shape moves. One behaviour changes, in
the direction the tracking issue asks for: daemon discovery follows
CHARLY_CACHE_DIR, and theruntime root inherits the resolver's documented state-root fallback when there is no
XDG_RUNTIME_DIR.specmoves tov0.2026315.2118andplugin-candytov0.2026313.1445—the second is forced by the first (a signature change in
schemaparams.Generate), and neitherchanges any authored document.
Breaking change + rollback: nothing breaks for a consumer of this repo.
charlypublishes abinary, not a library; the binary's commands, flags and outputs are unchanged, and the two pins
move FORWARD (no consumer is asked to move anything). The one observable difference is that a
daemon under a relocated cache is now found instead of ignored — which is the fix. Rollback is one
inverse commit: reverting it restores the hand-built pair AND both pin lines, returning the module
graph to
spec v0.2026313.453/plugin-candy v0.2026281.948; there is no data migration, and theroots resolve to the same directories either way.
Filed issues
and carries this campaign's three legs. It is closed with this leg, not before.
spec/cache's store still resolves the CONFIG root(
<config>/charly/cache) rather than D-STORE-1's cache root, so the module this leg now importscarries a second, wrong root whose migration is that issue's own scope. No
charlycode in thisdiff reads it.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)