Summary
When a subdirectory containing source files is deleted from the project, CodeGraph fails to detect the change and does not update the SQLite index. The deleted files remain in the database, and index counts (files, nodes, edges) stay unchanged.
This appears to be a cascade deletion bug: removing a parent directory does not trigger removal of its child file records from the index.
Reproduction Steps
codegraph init — initialize index
- Create nested source file:
docs/1/2/新建文件夹/_0204_.py
- Wait for CodeGraph to sync (check
Last Sync timestamp)
- Delete the subdirectory
docs/1 (which contains _0204_.py)
- Observe: index counts unchanged, deleted file still appears in queries
Attachment: Diagnostic Tool
I built a lightweight real-time monitor (codegraph_state.js) to visualize this bug. It displays live index counts alongside filesystem events, making the mismatch immediately obvious.
Author: feel free to use or adapt this tool for debugging.
codegraph_state.js
Summary
When a subdirectory containing source files is deleted from the project, CodeGraph fails to detect the change and does not update the SQLite index. The deleted files remain in the database, and index counts (files, nodes, edges) stay unchanged.
This appears to be a cascade deletion bug: removing a parent directory does not trigger removal of its child file records from the index.
Reproduction Steps
codegraph init— initialize indexdocs/1/2/新建文件夹/_0204_.pyLast Synctimestamp)docs/1(which contains_0204_.py)Attachment: Diagnostic Tool
I built a lightweight real-time monitor (
codegraph_state.js) to visualize this bug. It displays live index counts alongside filesystem events, making the mismatch immediately obvious.Author: feel free to use or adapt this tool for debugging.
codegraph_state.js