bug: Some files are still written to `~/.lean-ctx` post-migration
lean-ctx version: lean-ctx 3.8.7 (official, https://github.com/yvgude/lean-ctx)
OS: Linux
AI tool: N/A
What happened:
Navigated to a project I've used lean-ctx in and opened neovim. Two new files popped up in ~/.lean-ctx: active_transcript.json and context_radar.jsonl.
What you expected:
~/.lean-ctx not to be used as a write destination any more.
Steps to reproduce:
- Open file indexed by
lean-ctxwith Neovim - Observe
~/.lean-ctxstill used as a write destination bylean-ctx
Relevant output: N/A
Yes, seems conflicting locations. Dashboard ui, changing settings changes/addes a config to C:\Users\steph.lean-ctx The doctor moves those files to C:\Users\steph.config\lean-ctx
if i change a setting in the dash ui, it sets it in .lean-ctx then forgets the other settings.
Fixed on main in 65a4ce080c.
Root cause: the data resolver returned ~/.lean-ctx whenever that directory merely existed, even after the data markers had moved to XDG — so data diverged from config/state/cache and editor sessions kept writing active_transcript.json / context_radar.jsonl back into the legacy dir.
The legacy/mixed decision now lives in one source of truth (paths::single_dir_override): a legacy dir wins only while it still holds data markers, so once split, data flips to $XDG_DATA_HOME/lean-ctx like the rest.
Locked in by a cross-category contract test plus a source-level legacy-path firewall (rust/tests/legacy_path_firewall.rs) that fails CI if a new ~/.lean-ctx hardcode is introduced. Will be closed with the next release.
Does that also fix #439 or is that a separate issue?
@teadatuntud Same root cause, not a separate bug. #436 (with #434/#429) fixed the data-dir resolver: once doctor --fix empties the markers, data/config/state/cache all flip to $XDG_* and the data tree no longer reappears in ~/.lean-ctx.
#439 is the broader "primary data dir" symptom. The resolver fix covers the bulk of it, but a few feature-specific writers still hard-coded ~/.lean-ctx and bypassed the resolver — those are now migrated too (see #439, 05fd7a443b). Will close both with the next release.
Fixed in v3.8.8 as part of the now-complete ~/.lean-ctx → XDG migration — every remaining direct writer routes through the typed data_dir()/state_dir() resolvers, and a source-level legacy-path firewall test prevents regressions. Thanks for the report!
Release: https://github.com/yvgude/lean-ctx/releases/tag/v3.8.8