mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
Rewrites search_code from a raw grep wrapper into a 4-phase pipeline: grep scan → graph block expansion → batch degree ranking → context assembly. - Scoped grep: queries indexed file paths from graph, passes to xargs grep — eliminates scanning vendored/generated code (Fixes #102) - Graph dedup: grep matches grouped into containing functions with in_degree, out_degree, qualified_name, label - Three output modes: compact (default, metadata only — token efficient), full (with function source), files (just file paths) - path_filter: regex on file paths (e.g. "^src/") to scope results - context: N lines around each match (like grep -C) in compact mode - directories: summary showing match distribution by top-level directory - Ranking: project source first, vendored demoted, tests penalized - Batch degree query via cbm_store_batch_count_degrees (2 SQL queries instead of 52 individual ones) - Fix yyjson pointer bugs: use strcpy variants for heap/stack strings - Add cbm_store_list_files() for indexed file enumeration - Code discovery gate hook: per-session block (PPID-keyed) nudging Claude toward codebase-memory-mcp tools before grep fallback