Repository navigation
Description
What
charly core composes cache paths by hand because it cannot import the org's ONE cache-root
resolver. storekit.Dir/CacheDir live in github.com/opencharly/sdk/storekit, and this repo's
own import-purity gate forbids the host → sdk edge:
--- FAIL: TestImportPurity_HostImportsOnlySpecAndVettedThirdParty (0.01s)
import_purity_test.go:222: IMPORT-PURITY gate: 1 UNDECLARED github.com/opencharly/sdk import(s) in charly/ core — a residual call site must be declared in residualSDKImportSites with a named exit:
plugin_activity.go:13: forbidden import "github.com/opencharly/sdk/storekit" — the sdk mechanism kits (and the sdk root plugin-authoring package) are for PLUGINS, never the host; charly/ core imports spec/* + proto only
import_purity_test.go:241: IMPORT-PURITY debt (tracked, with named exits): 3 residual sdk import(s):
plugin_build_testhelper_test.go:23: forbidden import "github.com/opencharly/sdk/buildcache" ...
plugin_dispatch_reverse.go:11: forbidden import "github.com/opencharly/sdk/buildcache" ...
plugin_loader.go:18: forbidden import "github.com/opencharly/sdk/buildcache" ...
The measured consequence: after the sibling opencharly/sdk#497 lands, sdk composes no cache
path by hand, and this repo still does — charlyDaemonRoots-shaped code builds
$XDG_CACHE_HOME/charly and $XDG_RUNTIME_DIR/charly itself (charly/plugin_activity.go), so it
ignores CHARLY_CACHE_DIR and, on a relocated install, cannot see the detached buildkitd its own
idle guard exists to follow. TODO 7.2 ("the hand-built paths route through the same resolver") has
no reachable target for the host half until this is decided.
Why this is an architecture finding, not a bug in one file
storekit is correct where it is: D-SDK-1 puts the store and its roots in sdk, and D-CORE-1 has
core build the store on the sdk store. But the boundary law in charly/AGENTS.md says core
"imports only permitted contract surfaces" — spec/* + proto — and the gate enforces it. So the two
requirements meet in a place neither names: core needs the cache root, and the only resolver for it
is on the forbidden side of its own boundary.
The three buildcache residuals prove the shape is known: they are declared debt with named exits,
taken when a mechanism moved to sdk and the host call site had not yet migrated. The difference here
is direction — those are exits out of a legacy state; this would be an entry into one.
RCA
- Mechanism.
charly/import_purity_test.goclassifies everygithub.com/opencharly/sdk/*
import in core: an undeclared one fails the gate, a declared one is counted as debt.storekit
is a mechanism kit, so the import is refused. - Missed control. The leg was measured with
go vet ./...and a FILTEREDgo test -run 'TestCharlyDaemonRoots|TestCharlyDaemonPids|TestInvokeProvider'— the filter excluded the
package's own gate, which lives in the same package under a different test name. The control that
would have caught it is the repo's declared gate (go test ./...), not a filtered run; running it
before writing the PR body caught it in278.894swith exactly one failing test. - Blast radius. Every hand-built cache/state path in
charlycore: today
charly/plugin_activity.go's daemon-root set, and whatever the next mechanism move adds. Each is
invisible toCHARLY_CACHE_DIRand therefore to the one-store migration (opencharly/charly#896). - Root fix (needs an operator decision, one of):
- Move the resolver to
spec—specis a permitted contract surface for core and for
plugins alike, so ONE resolver there serves both sides and D-STORE-1 holds with no exception.
This is the only option that keeps both the boundary law and the one-resolver rule. - Declare the sites as residual sdk imports with a named exit — permitted by the gate's own
mechanism, but it writes new debt to undo an old workaround. - Core stops composing the path and takes it from the host service / a plugin — correct by
the boundary law, but the idle guard runs on the host side of every plugin call, so it would
have to be called on a path that has no plugin in it.
- Move the resolver to
Evidence
- The failing gate output is pasted above, from
go test .at41085f40ba6519ab3534b93b53d459faf3c0e7b3
on branchfeat/daemon-roots-one-resolver(never pushed; the patch is kept, not landed). - The sibling change that makes this visible is
opencharly/sdk#497(kit.BuildActivityDir
resolves throughstorekit.Dir(RootCache));sdkmay importsdk, so that half is unaffected. - Measured pristine behavior of the core site: with
CHARLY_CACHE_DIRset to a temp dir,
charlyDaemonRoots-equivalent code resolves/home/atrawog/.cache/charly— the relocated daemon
is invisible there.
Agent: dsh-todo-3x
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Activity
aitrawog commentedon Nov 11, 2026
CLAIM — resolving this via option 1 (move the resolver to
spec), three ordered legs, producer-first.Plan, and what each leg owns:
opencharly/spec— new packagespec/storerootcarrying the 4-root computation and theCHARLY_CACHE_DIRoverride, moved verbatim out ofsdk/storekit/roots.go(Root,RootConfig|RootCache|RootState|RootRuntime,Dir,CacheDir).storekitkeeps only thestore-ADDRESSING helpers (
StoreDir,NamedStores), which already delegate to the cache root.opencharly/sdk—storekit/roots.gobecomes a re-export (type Root = storeroot.Root,the four consts,
Dir/CacheDirdelegating),require github.com/opencharly/specbumped toleg 1's tag. No behavioural change, proved by a before/after root dump.
opencharly/charly—plugin_activity.go:780(charlyDaemonPids) resolves its two rootsthrough
spec/storeroot, soCHARLY_CACHE_DIRis honoured andTestImportPurity_HostImportsOnlySpecAndVettedThirdPartypasses unedited.Not touching:
spec/cache's config-root store — that is opencharly/spec#233's own migration, andthis leg does not relax or absorb it.
Next update due: when leg 1's PR is open (head SHA + gate result).
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Nov 11, 2026
STATUS — leg 1 is open: opencharly/spec#303 (head
96f9eb460f5c1f368acd89ee7e00b0dcd54a4153, branchfeat/storeroot-resolver).What landed in it:
spec/storerootowns the four roots and theCHARLY_CACHE_DIRoverride, movedout of
sdk/storekit/roots.go(same identifiers, same strings, same error text, same fallbacks).Zero verdicts moved — the four roots were dumped through the OLD implementation (
sdk@origin/main) and the NEW one under four conditions (default, absolute override, relativeoverride, no XDG at all) and the transcripts are byte-identical (
diff rc=0, no output).Two measurements worth recording here because they change the shape of leg 3:
(
import "github.com/opencharly/sdk/storekit"inplugin_activity.go) makesTestImportPurity_HostImportsOnlySpecAndVettedThirdPartyfail with exactly the message thisissue pastes (
plugin_activity.go:13: forbidden import …), while thespec/storerootimportpasses that same gate with
import_purity_test.gobyte-identical toorigin/main(
sha256 6d724c7b…, emptygit diff).schemaparams.Generatelost its third parameter between
specv0.2026313.453andorigin/main(
Generate(schemaDir, pkg, cueDir)→Generate(schemaDir, pkg)), and theplugin-candypincharlycarries (v0.2026281.948) still calls the three-argument form — so aspecbump alone makescharlyfail to BUILD in a dependency, not in core. Measured:[email protected]/params.go:176: too many arguments in call to paramsPipeline.plugin-candy v0.2026313.1445already carries the two-argument call, so the charly leg bumpsplugin-candyalongsidespec(andsdk). That is the real lockstep content; the vmsharedalias concern in the plan did not reproduce (
sdkbuilds green against the newspec).Next update due: when spec#303 reaches a verdict, and again at leg 2's PR.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Nov 11, 2026
WAITING — this leg is the blocked side: it waits on opencharly/sdk#499.
The charly change (leg 3 of this issue:
charlyDaemonPidsresolves its two roots throughspec/storeroot) is written, committed in a session worktree, and green on the tree it will push —but it pins
github.com/opencharly/specatv0.2026315.2118(merged: opencharly/spec#303) andplugin-candyatv0.2026313.1445, and it does not open until the sdk re-export(
opencharly/sdk#499) has merged and tagged, so that the three modules advance in producer-firstorder rather than in an order the next reader has to reconstruct.
What I am waiting for:
opencharly/sdk#499merge + itsv0.<YYYYDDD>.<HHMM>tag.What unblocks me: that tag. Nothing else — the charly side needs no code change for it.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Nov 11, 2026
CLEARED — with a correction I owe: the charly leg turned out NOT to need the sdk tag, so it did not
wait.
My
WAITINGabove said this leg waits on opencharly/sdk#499 merge + tag. Re-measured while the sdkround was running: the charly diff imports nothing from
github.com/opencharly/sdk(that is thewhole point of the fix — core may import only
spec/*), and this repo'sgo.moddoes not requiresdkat all. Its two pins arespecv0.2026315.2118(merged: opencharly/spec#303) andplugin-candyv0.2026313.1445;sdkreaches the build only as a transitive requirement of thepinned plugin modules, at the version they already declare. So the charly leg is INDEPENDENT of the
sdk leg and lands in parallel — the producer-first edge that matters is spec → charly, and it is
satisfied.
#1121 is open: head
0c546cd90969412e7bb6b769ae0a339e99c22ff5, branchfeat/storeroot-core.TestImportPurity_HostImportsOnlySpecAndVettedThirdPartypasses withimport_purity_test.gobyte-identical toorigin/main, and the counterfactual (importsdk/storekitin the same spot) fails it with exactly the message this issue pastes.Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Nov 11, 2026
RESOLVED — all three legs merged, producer-first, with the import-purity gate UNEDITED.
spec81f1a01108e45fea1c7503ff63855a5499c0f4bdv0.2026315.2118sdkafb01e64b620c9cadb8f9a7278f198d7deb67f8av0.2026315.2134charlya860393cbf96a8a32c96dfef17ee9246e79df7dcv2026.315.2219What the resolution is. Option 1 from this issue, exactly as written: the ONE resolver moved to
spec(spec/storeroot— the four roots and the singleCHARLY_CACHE_DIRoverride), andsdk/storekitbecame a re-export of it (type Root = storeroot.Root, the four consts,DirandCacheDirdelegating), so D-STORE-1 has its one resolver and the boundary law keeps core onspec/*+ proto. This issue's premise is unchanged in both directions: no rule was relaxed.Proof, not assertion.
sdk@origin/main), the contract one (spec/storeroot), and the RE-EXPORT, under four conditions(default /
CHARLY_CACHE_DIRabsolute /CHARLY_CACHE_DIRrelative / every XDG var unset). Allthree transcripts are byte-identical —
diffrc=0 with no output, pairwise.charly/import_purity_test.gois byte-identical toorigin/main(
sha256 6d724c7b83962c10768c1040815abb2790dbd794f06fc81b5ebd956c62bb4864), and the counterfactual— the naive
import "github.com/opencharly/sdk/storekit"in the same file — still fails it withexactly the message this issue pastes. No exception, no
residualSDKImportSitesrow.charlyDaemonPidsnow sees adaemon under a
CHARLY_CACHE_DIR-relocated root:TestCharlyDaemonPids_FollowsTheCacheDirOverrideFAILS againstorigin/main's implementation andpasses on the merged tree. Its one deliberate consequence is stated rather than discovered: with no
XDG_RUNTIME_DIRthe runtime root inherits the resolver's documented state-root fallback, which canonly widen the daemon set the guard follows.
Two findings worth carrying forward, both measured during the work:
spec-only bump failscharly'sbuild — not via
vmshared/spec_aliases.go(which compiles unchanged) but becauseschemaparams.Generatelost its third parameter and the pinnedplugin-candystill called thethree-argument form.
charly#1121bumpsplugin-candyin the same commit, andcharly task mods-tidymoved the threetools/*modules that share the pin.sdkleg's coverage gap was narrower than my first measurement said. MakingDirreturnone root for every root IS caught by the existing suite (the unknown-root arm); what it does not
catch is a per-root mis-mapping, which
storekit/roots_test.gopins. My first reading of that wastaken with a FILTERED
go test— this issue's own RCA class — and the PR body records thecorrection.
Still open, and NOT absorbed here: opencharly/spec#233 (
spec/cache's store still resolves theconfig root;
storeroot's doc names it as the store it does not serve) and the umbrella pin legs forthese three tags, which are separate PRs by the rulebook.
Closing this issue as resolved.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
chore(pins): advance spec, sdk and charly to the storeroot tips their…