You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): erase removes graph/cocoindex.db/.graph_hashes.json by type (#346) (#348)
* fix(cli): erase removes graph/cocoindex.db/.graph_hashes.json by type (#346)
`erase` reported success but left code_graph.lbug on disk because its
deletion was type-blind: shutil.rmtree silently no-ops on a regular file
(code_graph.lbug) and Path.unlink raises IsADirectoryError on a directory
(cocoindex.db), both swallowed; .graph_hashes.json was never targeted.
The next init then refused (exit 2), deadlooping the documented
`erase --yes` -> `init` clean-slate workflow.
Replace the type-blind deletes with a _rm_any helper that dispatches on
type (file/dir/symlink — a symlinked dir is unlinked, never recursed into,
so the target is not followed), so both the file-backed and dir-backed
LadybugDB layouts are handled. erase now also removes .graph_hashes.json
and lists it in the "Will delete:" preview. Deletion failures are warned
to stderr instead of swallowed, so erase no longer reports success while
leaving an artifact behind (the same silent-failure class as #346).
`reprocess` is unaffected: its full rebuild opens the existing .lbug and
_drop_all()s every node + edge table in place, and _init_hash_tracker
resets .graph_hashes.json — it never relies on the broken deletion.
Tests: add an always-on regression that creates a real lbug-file /
cocoindex.db-dir / hash-store layout and asserts erase removes all three;
convert the false-green test_init_after_erase_succeeds into a real
build -> erase -> re-init lifecycle check.
Co-Authored-By: Claude <noreply@anthropic.com>
* bump version to 0.6.6
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Deletes cocoindex state, the LadybugDB directory, and Lance tables under the index dir. Requires **`--yes`** or interactive confirmation on a TTY. Non-TTY without `--yes` exits **2**.
243
+
Deletes cocoindex state, the LadybugDB graph (`code_graph.lbug`), the graph builder's content-hash store (`.graph_hashes.json`), and Lance tables under the index dir. Requires **`--yes`** or interactive confirmation on a TTY. Non-TTY without `--yes` exits **2**.
0 commit comments