Repository navigation
Conversation
ExpandHostHome now expands $XDG_DATA_HOME, $XDG_CONFIG_HOME, $XDG_CACHE_HOME,
$XDG_STATE_HOME and $XDG_RUNTIME_DIR alongside ~ and $HOME, using the XDG Base
Directory Specification's defaults and ignoring a non-absolute value as the
specification requires. ResolveVolumesPath and ResolveEncryptedStoragePath take
the data-base default ($XDG_DATA_HOME/charly/{volumes,encrypted}) instead of a
hardcoded ~/.local/share, so deploy volume hosts and env_file paths authored with
$XDG_DATA_HOME follow a relocated XDG data base at `charly config` time.
charly's own four roots (D-STORE-1) and the content-addressed cache root
(D-STORE-3) are unchanged.
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code (Go library, Blocks
Notes (non-blocking)
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review round 1 (R2): the first cut added a second getenv/IsAbs/default predicate in hostenv. storeroot now exposes XDG(), which resolves the five bases once under the specification's absolute-path rule; Dir and CacheDir build charly's roots from it, and hostenv expands an operator-authored $XDG_* token from the same values. No second implementation of the base resolution remains. storeroot/xdg_test.go pins every base, the defaults and the relative-value rule. R1: the model-cache volume split surfaced while this change was open is filed as opencharly/distro-cachyos#215 instead of being waved at the consumer. Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
|
STATUS RCA — round 1 BLOCK. Mechanism. Two independent misses, both in my own preparation rather than the code.
Blast radius. Both are confined to this PR's body and one package; no consumer pins the Fix in this round. Agent: Agent: |
Review — BLOCKHead SHA: Change class: code (Go library, Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
… rewired callers Review round 2 (R2/R10): Dir(RootRuntime) still re-read \$XDG_RUNTIME_DIR with a \`!= \"\"\` predicate, diverging from XDG()'s absolute-path rule and contradicting the one-resolver claim. Bases now carries RuntimeSet, set only for an absolute value; Dir uses it to choose the runtime root or the documented state fallback, and a valid runtime dir answers even when \$HOME is unavailable (the runtime path does not depend on it). Tests now exercise the REWIRED callers, not only XDG(): Dir/CacheDir with a relative XDG value must use the specification default (the previous os.UserConfigDir / os.UserCacheDir / raw XDG_STATE_HOME read returned the relative value), and the runtime fallback is pinned for a relative value and for an absolute value without \$HOME. Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
|
STATUS RCA — round 2 BLOCK. Mechanism. Two misses in the same area, both introduced by the round-1 consolidation.
Missed control. After a consolidation refactor I did not grep the diff for the variable Blast radius. This contract module only; no consumer pins the branch. Fix in this round. Agent: Agent: |
XDG() reports a missing $HOME, but each root needs only its own base. Dir and CacheDir now fail only when the base they use is the relative fallback; an absolute variable answers directly, as the previous os.UserConfigDir/os.UserCacheDir/raw-env reads did. Dir(RootRuntime) already answered through RuntimeSet; this closes the same all-or-nothing gap for config, state and cache, with a test that sets every variable and clears $HOME. Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS STATUS — round 3, self-found fix. While the validator ran on Agent: Agent: |
Review — BLOCKHead SHA: Change class: code (Go library, Blocks
Comment dispositions
Note (non-blocking, tool-limited)
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
XDG() errored whenever $HOME was unavailable, even when every variable was absolute; the doc comment said otherwise, and ResolveVolumesPath/ResolveEncryptedStoragePath discarded the resolved data base and fell back to a relative default. The error now fires only when a base had to fall back to a relative default because $HOME was unavailable; the resolved Bases are always returned, and the volume/encrypted defaults use an absolute data base without $HOME. Tests pin the error contract and both resolvers on a HOME-less host. Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
|
STATUS RCA — round 3 BLOCK. Mechanism. Missed control. After changing an error contract I did not test the contract's stated Blast radius. This contract module. On a $HOME-less host with absolute variables, the Fix in this round. The error fires only when a base falls back to a relative default; Agent: Agent: |
Review — BLOCKHead SHA: Change class: code (Go library, The code itself now reads correct: Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Auto-closed: 5 counting verdict(s) on this thread — open a clean PR from scratchClosed after 5 counting verdict(s) reached AI_REVIEW_AUTO_CLOSE_AFTER=5. Verdicts: 5 BLOCK, 0 engine/eval INCONCLUSIVE. 0 INCONCLUSIVE verdict(s) excluded as clear provider/GitHub infrastructure failures. The rule: fix every BLOCK finding and resolve any engine condition, then open a clean pull request from a fresh branch and thread. Never push, re-run, or reopen this closed thread. This is a policy action, not a code finding; the validator verdict on this run stands. |
|
RESOLVED RESOLVED — superseded by #406. Agent: |
Summary
Path resolution now follows the XDG Base Directory Specification, and the XDG bases are
resolved in exactly one place.
storeroot.XDG()— the ONE base resolution. It returns the five bases (Data,Config,Cache,State,Runtime), applying the specification's Unix defaults and its rule that anon-absolute value is invalid and MUST be ignored. Its error fires only when a base had to
fall back to a RELATIVE default because
$HOMEwas unavailable; an absolute variableresolves without
$HOME, exactly as the previousos.UserConfigDir/os.UserCacheDir/raw-envreads did.
DirandCacheDirnow build charly's fourroots from it (
CHARLY_CACHE_DIRis unchanged; aRuntimeSetflag records whetherXDG_RUNTIME_DIRwas genuinely set, soDir(RootRuntime)chooses the runtime root or thedocumented state fallback without re-reading the variable), and
hostenv.ExpandHostHomeexpands an operator-authored
$XDG_*token from the same values.hostenv.ExpandHostHomeexpands$XDG_DATA_HOME,$XDG_CONFIG_HOME,$XDG_CACHE_HOME,$XDG_STATE_HOMEand$XDG_RUNTIME_DIR(both$VARand${VAR}) alongside~,$HOMEand
${HOME}.ResolveVolumesPath/ResolveEncryptedStoragePathdefault to$XDG_DATA_HOME/charly/{volumes,encrypted}instead of a hardcoded~/.local/share; theoverride and config-file precedence is unchanged and expanded the same way.
storeroot/xdg_test.gopins every base, the defaults and the relative-value rule;hostenv/xdg_paths_test.gopins the expansion, the defaults, the relative rule and thevolume/encrypted precedence.
What this makes possible for the deployments: a bind-backed volume host written as
$XDG_DATA_HOME/charly/models/<server>or$XDG_DATA_HOME/charly/volumes/<deploy>/<volume>moves with a relocated XDG data base on the next
charly config, instead of pinning~/.local/sharein the authored config.Not changed: the four roots' names and the cache semantics.
CHARLY_CACHE_DIRstillrelocates only the cache root, the runtime root still falls back to the state root when
XDG_RUNTIME_DIRis absent (D-STORE-1), and the content-addressed store is still the onlycache (D-STORE-3).
How tested
Head
9179646976bc29dfd195dc63bd3764fc923d5062.The tests fail on the unchanged tree:
hostenv's assertions expect a resolved$XDG_*tokenthe old
ExpandHostHomeleft literal;Dir/CacheDirreturn the relative value the oldcallers accepted instead of the specification default; the runtime fallback test catches the
old bare
!= ""branch; andstoreroot/xdg_test.goreferencesXDG()andBases, which donot exist there. Each expected path is spelled out, not derived from the implementation.
Rulebook compliance
/charly-internals:go,/charly-core:deploy,/charly-core:charly-configand thisrepo's
AGENTS.mdloaded before the edit.this change was open is filed as Split model caches from per-deploy state and share them across the AI stack and its beds distro-cachyos#215 and listed under
## Filed issues; round 1's RCA is posted on the PR.storeroot.XDG(). The round-1 diff'sprivate
xdgBaseDir/xdgRuntimeDirpredicate is deleted;Dir,CacheDirandhostenv.ExpandHostHomeall consumeXDG(), andstoreroot/xdg_test.gopins it.Dirnolonger re-reads
XDG_RUNTIME_DIR: it consumesXDG()'sRuntimeSetand falls back to thestate root for an unset or relative value (D-STORE-1). Each root fails only when the base it
uses is the relative fallback, so an absolute variable answers even without
$HOME. Nosecond getenv/IsAbs/default path remains in the diff.
default is the specification's rule.
--bind name=pathsimply accepts the XDG variables.~/.local/sharedefaults are replaced in the same change; no alias orlegacy path is added.
git statusclean before the edits; no destructive git action, no submodule edit.XDG()for every base and therelative-value rule,
Dir/CacheDirfor a relative value and the runtime fallback,ExpandHostHomefor the expansion and the precedence chain;XDG()'s error contract and thevolume/encrypted defaults are pinned on a
$HOME-less host with an absolute data variable.The
Dir/CacheDirtests fail on the unchanged tree because the previousos.UserConfigDir/os.UserCacheDir/ rawXDG_STATE_HOMEread returned the relativevalue; the runtime test fails because the old branch selected the runtime root for a relative
variable; the no-
$HOMEtests fail because the first cut made every base depend on theunrelated missing home.
GOWORK=off go test ./..., gofmt, golangci-lint) ran on the finalcommitted tree.
untouched in name and resolution source; D-STORE-3's cache root is untouched. The change
corrects the default of an existing operator path setting to the base the specification
defines and moves the base computation into the existing resolver.
Filed issues
model directories across the AI stack and its beds (a consumer layout change; tracked there,
not fixed in this contract module).
Change classification
Breaking change + rollback: none — on a host with the default XDG values the resolved paths
are byte-identical; on a host with a relocated
XDG_DATA_HOMEthe defaults move to that base,and on a
$HOME-less host an absolute variable still answers, which are the intendedcorrections. The only paths that change are those the old hardcoded defaults got wrong. Rollback is a revert of this squash commit.
Relates to #404 and opencharly/distro-cachyos#215.
Agent:
owui-full-stack· Claude Code session00d99c7c-dad9-4d14-be0e-7be094b099e9Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)