bug: `lean-ctx doctor --fix` migration leaves behind `latest.json`
lean-ctx version: lean-ctx 3.8.7 (official, https://github.com/yvgude/lean-ctx)
OS: Linux
AI tool: Claude Code
What happened: Ran the suggested migration command to migrate data to XDG directories.
What you expected:
~/.lean-ctx/ to be empty.
Steps to reproduce:
lean-ctx doctor --fix
Relevant output:
After running the --fix command (note: Removed orphaned lines removed, username redacted):
Installed Claude Code hooks at /home/<username>/.claude/hooks
Neovim (mcphub.nvim) MCP already configured at ~/.config/mcphub/servers.json
[...]
5/6 passed — run lean-ctx doctor for details
report saved: /home/<username>/.lean-ctx/doctor/latest.json
ls -R ~/.lean-ctx (note: username redacted):
/home/<username>/.lean-ctx:
doctor
/home/<username>/.lean-ctx/doctor:
latest.json
Fixed on main in 65a4ce080c.
After the data moved to XDG, leftover reports (doctor/latest.json, setup/, status/) and the now-empty ~/.lean-ctx lingered, so the next run re-detected the old location and even wrote its fix report back into it.
doctor --fix now drains any remaining non-runtime entries into the typed XDG dirs and removes the empty directory (xdg_migrate::reclaim_legacy); the fix report lands in XDG.
Covered by a new integration contract test (rust/tests/xdg_legacy_contract.rs). Will be closed with the next release.
Fixed in v3.8.8. doctor --fix now drains and removes a residual ~/.lean-ctx (including a leftover latest.json). Thanks for the report!
Release: https://github.com/yvgude/lean-ctx/releases/tag/v3.8.8