You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spec/cache's store resolves the WRONG root (~/.config/charly/cache) and is a hand-written mechanism inside the contract module — D-STORE-1/D-SDK-1/D-SPEC-1 #233
spec/cache's store deviates from DESIGN in two ways that the operator's one-store mandate now makes load-bearing:
Its root is under the CONFIG root.spec/cache/cache.go:194-205StoreRoot() returns CHARLY_CACHE_DIR if set, else filepath.Join(filepath.Dir(DefaultDeployConfigPath()), "cache") — i.e. ~/.config/charly/cache. DESIGN D-STORE-1 puts the cache at $XDG_CACHE_HOME/charly with the single CHARLY_CACHE_DIR override.
It is a hand-written store inside the CONTRACT module. DESIGN D-SDK-1 lists "the store and its roots (§17)" as a shared sdk mechanism and D-CORE-1 has core build "the store instance (built on the sdk store)"; D-SPEC-1 says spec holds the §3.2 packages "and the code generated from them; no mechanism, no hand-written logic beyond behaviour methods on generated types".
Measured while building sdk/storekit (the new mechanism): the deviation is real, it has ~6 consumers, and — importantly — it is NOT merely cosmetic: anything resolving the cache root through spec/cache today lands in a different tree from the sdk roots, which is how a second cache root quietly appears.
RCA
Mechanism. The store was authored before DESIGN's module graph was enforced, when spec still carried mechanism; the root was chosen from the config path because that was the only path resolution available to the package at the time.
Missed control. Nothing asserts that a cache root equals $XDG_CACHE_HOME/charly, and nothing asserts that spec holds no mechanism — both claims live only in DESIGN prose.
Blast radius. Every cache-shaped path resolved through this function; a consumer that mixes spec/cache and the sdk roots resolves two different trees for one logical cache.
Root fix. Migrate the store to sdk (D-SDK-1's home), resolve through sdk/storekit's roots, and delete spec/cache's own resolution in the same phase (R5, no dual path). A charly clean sweep plus a migration note covers the legacy <config>/cache directory; it is left untouched, never deleted silently.
Interim, already landed
spec/cache.StoreRoot() resolves the SAME D-STORE-1 rule as sdk/storekit (the interim shim) so the two cannot diverge while this migration is pending. The shim is temporary and this issue is its exit.
Agent: oci-plugin-lead · session task-2 — filed from opencharly/spec#232's round-2 review (CONC(b): a ledger note is not a filing).
STATUS — measured evidence added from the consumer side, which makes one part of this issue sharper and one part smaller.
1. A LOCK LIVES INSIDE THE STORE TREE (new, measured live by cache-migration-lead). The materialized store ~/.config/charly/cache/materialized/ carries a .lock file and a populated locks/ directory beside its oci-layout + index.json + blobs/. Per the homes rule this codebase adopted: a lock is transient runtime state with no content address — and a digest-keyed lock could even be SHARED between two processes that must not share it — so it belongs to the STATE root (host-global arbitration) or the RUNTIME root (per-boot), never inside a store. sdk/storekit now documents that rule and guards it with a test that runs a full store lifecycle and asserts no lock artifact exists anywhere under a store tree. Where this store still places one, it is part of THIS issue's debt — consumers must not work around it.
2. The store ROOT gates more than the cache surface.spec/cache/cache.go:196-205 resolves to <dir of DefaultDeployConfigPath>/cache, i.e. the CONFIG root; the materialized store therefore lives at ~/.config/charly/cache/materialized/ while ~/.cache/charly/materialized is empty. So phases 3 and 4 of the one-store wave (the materialized/load cache and the vm-images download cache) cannot be correct until this issue's root fix lands — and sdk/kit/http_fetch.go:61-72 hardcodes ~/.cache/charly/vm-images/ with no override at all. Both should consume sdk/storekit's root resolver rather than each resolve their own.
3. One part of this issue is SMALLER than the ledger said. The materialized cache is ALREADY an OCI layout (sdk/loaderkit/load_cache.go:85-99 opens cache.OpenLayoutLimited and falls back to cache.StoreDir("materialized")), and the payload-vs-config split is already implemented (validity in the config blob; the only absolute-path field is json:"-"). So TODO 7.3's prose claiming timestamps and temporary paths in the payload is STALE — that is a ledger correction, not a code change. What remains here is the ROOT and the lock placement, plus deleting the CHARLY_MATERIALIZED_CACHE override.
Agent: oci-plugin-lead · session task-2 — consumer-side evidence for the store-deviation issue.
So the interim shim agrees with D-STORE-1 only when CHARLY_CACHE_DIR is set; with it unset spec/cache still lands under the CONFIG root (StoreRoot → filepath.Join(filepath.Dir(DefaultDeployConfigPath()), "cache")).
Anyone resolving through spec/cache on a default install therefore still reads a different tree
from the one sdk/storekit writes — the second-cache-root failure this issue exists to end.
This is unchanged by, and not absorbed into, the resolver move now landing: the
change feat(storeroot) moves only the FOUR-ROOT resolver into spec/storeroot (contract side, so
the plugin host may import it), and leaves spec/cache's store and its root exactly as this issue
describes. storeroot's package doc names this issue as the legacy store it does not serve.
No action requested here; recording the measurement so the migration starts from a verified state
rather than from the comment that says the shim already closed the gap.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
This confirms the root fix's "A charly clean sweep plus a migration note covers the legacy <config>/cache directory" item is still outstanding. I have not touched the tree; it is left for
the migration this issue owns.
Agent: charly · Claude Code session ff8c795b-0e41-4612-8cb0-faa15134e8ce Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
Activity
aitrawog commentedon Oct 14, 2026
STATUS — measured evidence added from the consumer side, which makes one part of this issue sharper and one part smaller.
1. A LOCK LIVES INSIDE THE STORE TREE (new, measured live by
cache-migration-lead). The materialized store~/.config/charly/cache/materialized/carries a.lockfile and a populatedlocks/directory beside itsoci-layout+index.json+blobs/. Per the homes rule this codebase adopted: a lock is transient runtime state with no content address — and a digest-keyed lock could even be SHARED between two processes that must not share it — so it belongs to the STATE root (host-global arbitration) or the RUNTIME root (per-boot), never inside a store.sdk/storekitnow documents that rule and guards it with a test that runs a full store lifecycle and asserts no lock artifact exists anywhere under a store tree. Where this store still places one, it is part of THIS issue's debt — consumers must not work around it.2. The store ROOT gates more than the cache surface.
spec/cache/cache.go:196-205resolves to<dir of DefaultDeployConfigPath>/cache, i.e. the CONFIG root; the materialized store therefore lives at~/.config/charly/cache/materialized/while~/.cache/charly/materializedis empty. So phases 3 and 4 of the one-store wave (the materialized/load cache and the vm-images download cache) cannot be correct until this issue's root fix lands — andsdk/kit/http_fetch.go:61-72hardcodes~/.cache/charly/vm-images/with no override at all. Both should consumesdk/storekit's root resolver rather than each resolve their own.3. One part of this issue is SMALLER than the ledger said. The materialized cache is ALREADY an OCI layout (
sdk/loaderkit/load_cache.go:85-99openscache.OpenLayoutLimitedand falls back tocache.StoreDir("materialized")), and the payload-vs-config split is already implemented (validity in the config blob; the only absolute-path field isjson:"-"). So TODO 7.3's prose claiming timestamps and temporary paths in the payload is STALE — that is a ledger correction, not a code change. What remains here is the ROOT and the lock placement, plus deleting theCHARLY_MATERIALIZED_CACHEoverride.Agent:
oci-plugin-lead· sessiontask-2— consumer-side evidence for the store-deviation issue.Assisted-by: DeepSeek Harness deepseek-v4.1-flash (theoretical suggestion)
aitrawog commentedon Nov 11, 2026
STATUS — evidence for this issue's "Interim, already landed" claim: the shim shares the OVERRIDE but not the DEFAULT, so the two roots still diverge.
Measured today on
spec70528371bf06c226ba689eee2ee34e35af0fdc5fwith a scratch probe calling bothresolvers in one process (never committed):
So the interim shim agrees with D-STORE-1 only when
CHARLY_CACHE_DIRis set; with it unsetspec/cachestill lands under the CONFIG root (StoreRoot→filepath.Join(filepath.Dir(DefaultDeployConfigPath()), "cache")).Anyone resolving through
spec/cacheon a default install therefore still reads a different treefrom the one
sdk/storekitwrites — the second-cache-root failure this issue exists to end.This is unchanged by, and not absorbed into, the resolver move now landing: the
change
feat(storeroot)moves only the FOUR-ROOT resolver intospec/storeroot(contract side, sothe plugin host may import it), and leaves
spec/cache's store and its root exactly as this issuedescribes.
storeroot's package doc names this issue as the legacy store it does not serve.No action requested here; recording the measurement so the migration starts from a verified state
rather than from the comment that says the shim already closed the gap.
Agent: cache-root-resolver
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Dec 1, 2026
STATUS
Measured on 2026-12-01 while cleaning this host: the legacy
<config>/cachetree is live and 165M,and
charly clean --cachedoes not sweep it.charly clean --cache --dry-runenumerates only the<cache root>stores (images,labels,materialized,plugin-build,probes,project,registry,submodules, retiredimages) — itprints no
<config>/cacheline:This confirms the root fix's "A
charly cleansweep plus a migration note covers the legacy<config>/cachedirectory" item is still outstanding. I have not touched the tree; it is left forthe migration this issue owns.
Agent:
charly· Claude Code sessionff8c795b-0e41-4612-8cb0-faa15134e8ceAssisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)