v0.4.7
Highlights
Go LSP Hybrid Type Resolution (experimental)
A new tree-sitter + LSP hybrid engine for Go brings cross-file type-aware call resolution — a first for codebase-memory-mcp. The C-based type resolver (internal/cbm/lsp/) combines tree-sitter AST parsing with a lightweight type registry, scope tracker, and 30,000+ Go stdlib definitions to resolve method calls, interface dispatches, and struct field accesses across package boundaries.
This is a foundational step: the same hybrid approach will be extended to TypeScript, Python, Java, and other languages in upcoming releases.
Key components:
lsp_bridge.go—CrossFileDefstruct andRunGoLSPCrossFileCGo bridgego_lsp_cross.go— cross-file definition index with struct field and interface method enrichmentgo_dep_registry.go— third-party Go module parser for dependency-aware resolutionlsp/go_lsp.c— C type resolver with scope-aware variable tracking, method set resolution, and channel direction inferencelsp/generated/go_stdlib_data.c— 30K+ Go stdlib type/function definitions for out-of-the-box resolution
.gitignore and .cbmignore Support
The indexer now respects .gitignore patterns — generated code, build artifacts, and vendored dependencies that are gitignored are no longer indexed. This is the most requested feature since launch.
- Full .gitignore hierarchy support: nested .gitignore files, .git/info/exclude, negation (!), globstar (**), directory-only patterns (logs/)
- .cbmignore — a new file that stacks additional ignore patterns on top of .gitignore, specific to codebase-memory-mcp indexing
- .cgrignore remains supported for backwards compatibility
- Zero file handle leaks — custom repository matcher reads and closes files immediately, avoiding the upstream library's handle leak (critical for Windows)
Memory Safety Fixes
- Swift scanner heap-buffer-overflow — the vendored Swift tree-sitter scanner called calloc(0, sizeof(ScannerState)), allocating a 0-or-1-byte region, then wrote a uint32_t (4 bytes) to it. Fixed to calloc(1, ...). Detected by the new AddressSanitizer CI job.
- File handle leak on Windows — the go-gitignore library's NewRepository opens .gitignore files but never closes them. Replaced with a custom repoMatcher that uses os.ReadFile + strings.NewReader — zero leaked handles. Fixes Windows CI failures.
New Features
- Persistent config store — ConfigStore backed by SQLite for server settings (auto_index, auto_index_limit, mem_limit). CLI config subcommand for get/set/list/delete.
- Comprehensive --help / -h — all 14 MCP tools documented with parameter schemas and JSON payload examples
- Symlink skipping — symlinked files and directories are no longer indexed, preventing duplicate nodes in the graph
- .worktrees directory skipping — git worktree directories are excluded from indexing (thanks @wassertim, #37)
Bug Fixes
- Cypher LIMIT respected — explicit LIMIT clauses in query_graph Cypher queries are now honored instead of being silently capped (thanks @re-thc, #40)
- 54 golangci-lint issues fixed — errcheck, gocognit, funlen, nilerr, gocritic, gosec, noctx across 10 files
- Expanded hardcoded ignore list — 28 new ecosystem-specific directories added (.next, .nuxt, .terraform, zig-cache, .cargo, bazel-out, etc.). Generic directories (bin, build, out) moved to fast-mode-only to avoid false exclusions in Go/CMake/Maven projects.
Infrastructure
- AddressSanitizer CI job — new test-asan workflow job catches heap-buffer-overflow, use-after-free, and other memory bugs in the C code
- CI dry-run improvements — workflow enhancements for cross-platform testing
Contributors
- @wassertim — .worktrees directory skipping (#37)
- @re-thc — Cypher LIMIT fix (#40)
Full changelog: v0.4.6...v0.4.7