lean-ctx icon indicating copy to clipboard operation
lean-ctx copied to clipboard

bug: `lean-ctx doctor --fix` migration leaves behind `latest.json`

Open teadatuntud opened this issue 5 months ago • 2 comments

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:

  1. 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

teadatuntud avatar Jun 16 '26 07:06 teadatuntud

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.

yvgude avatar Jun 16 '26 13:06 yvgude

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

yvgude avatar Jun 17 '26 00:06 yvgude