Files
codebase-memory-mcp/src
Andrew Hundt 47bbe5cd51 watcher: register all session-accessed projects for auto-reindex
Previously only the CWD project at startup was watched for file changes.
Now any project the AI session interacts with gets registered:

- handle_index_repository: call cbm_watcher_watch() after successful
  index+pagerank, so explicitly indexed projects get auto-reindexed on
  file changes (same pattern as auto-index thread at lines 3503-3505)

- resolve_store: call cbm_store_get_project() to get root_path from DB,
  then cbm_watcher_watch() when a new store is opened. Only runs on the
  new-store path (early-return skips already-cached projects). Covers
  all data-access tool paths: search_code_graph, trace_call_path, get_code.

TDD: 3 new tests in test_tool_consolidation.c (all pass, 2193 total):
  watcher_registered_after_index_repository
  watcher_registered_on_resolve_store
  watcher_not_registered_for_unknown_path
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-03-23 04:21:17 -04:00
..