bug: Migration seems fundamentally broken (`~/.lean-ctx` still used as primary data directory)
lean-ctx version: lean-ctx 3.8.7 (official, https://github.com/yvgude/lean-ctx)
OS: Linux
AI tool: Claude Code
What happened:
The migration seems to be fundamentally broken. I started a new session in a project I'm using lean-ctx in and all files are written to ~/.lean-ctx instead of the appropriate XDG directories. So while the files were correctly moved by lean-ctx doctor --fix, nothing is actually using them later. What am I missing?
P.S. This may be connected to #434, #436 etc.
What you expected:
lean-ctx to actually use the updated XDG directories post-migration.
Steps to reproduce:
- Migrate via
lean-ctx doctor --fix - Start a new Claude Code session in
lean-ctxindexed project directory - Observe that every previously migrated directory is re-created in
~/.lean-ctxand files are saved into them
Relevant output: N/A
Same root cause as #434/#436, not a separate bug.
The data-dir resolver used to adopt ~/.lean-ctx whenever it merely existed, so after doctor --fix moved your data the resolver kept pointing at the old (now marker-free) dir and a new session re-created the whole tree there. Fixed on main in 65a4ce080c: the legacy decision now requires actual data markers (single_dir_override), so once split, data/config/state/cache all flip to $XDG_*.
A handful of feature-specific writers also hard-coded ~/.lean-ctx and re-created it regardless of the resolver. Migrated in 05fd7a443b to the typed data_dir() resolver (the same category doctor --fix moves them to):
- multi-agent
shared_knowledge.json(core::agents) - Jira OAuth credentials (
core::providers::jira_oauth) - personal-cloud cache/knowledge (
cloud_client/cloud_sync)
The one remaining hard-coded writer is the background auto-updater's log path; it's pinned by a source-level firewall test (rust/tests/legacy_path_firewall.rs) and will follow. Will close with the next release.
Fixed in v3.8.8. The data resolver no longer re-adopts a marker-free legacy ~/.lean-ctx, and every remaining direct writer (multi-agent knowledge, Jira OAuth, cloud cache, LaunchAgent/update logs, the A2A task store, the ctxpkg signing key, …) now routes through the typed data_dir()/state_dir() resolvers. A cross-category contract test plus a source-level legacy-path firewall lock the invariant in. Thanks for the report!
Release: https://github.com/yvgude/lean-ctx/releases/tag/v3.8.8