Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ jobs:

- name: Install deps (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
run: sudo apt-get update && sudo apt-get install -y subversion zlib1g-dev

- name: Install deps (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install subversion

- name: Test
run: scripts/test.sh CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
Expand All @@ -95,7 +99,7 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Install deps (Ubuntu)
run: sudo apt-get update && sudo apt-get install -y clang zlib1g-dev
run: sudo apt-get update && sudo apt-get install -y clang subversion zlib1g-dev

- name: ThreadSanitizer tests
run: make -f Makefile.cbm test-tsan CC=clang CXX=clang++
Expand All @@ -121,6 +125,7 @@ jobs:
mingw-w64-clang-${{ matrix.pkg }}-zlib
make
git
subversion

- name: Test
shell: msys2 {0}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ src/
pass_*.c Individual pipeline passes (definitions, calls, usages, etc.)
httplink.c HTTP route extraction (Go/Express/Laravel/Ktor/Python)
discover/ File discovery with gitignore support
watcher/ Git-based background auto-sync
watcher/ Git/SVN working-copy background auto-sync
cli/ CLI subcommands (install, update, uninstall, config)
ui/ Graph visualization HTTP server (first-party httpd)
internal/cbm/ Tree-sitter AST extraction (64 languages, vendored C grammars)
Expand Down
7 changes: 4 additions & 3 deletions Makefile.cbm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ CXXFLAGS_PROD = $(CXXFLAGS_COMMON) -O2
SANITIZE = -fsanitize=address,undefined -fno-omit-frame-pointer
EDITOR_TEST_DEFINES = -DCBM_JSON_LIKE_ENABLE_TEST_API=1 \
-DCBM_TOML_EDIT_ENABLE_TEST_API=1 -DCBM_YAML_ENABLE_TEST_API=1 \
-DCBM_TEXT_EDIT_ENABLE_TEST_API=1 -DCBM_CLI_ENABLE_TEST_API=1
-DCBM_TEXT_EDIT_ENABLE_TEST_API=1 -DCBM_CLI_ENABLE_TEST_API=1 \
-DCBM_SVN_STATE_ENABLE_TEST_API=1
CFLAGS_TEST = $(CFLAGS_COMMON) $(EDITOR_TEST_DEFINES) -g -O1 $(SANITIZE)
CXXFLAGS_TEST = $(CXXFLAGS_COMMON) -g -O1 $(SANITIZE)

Expand Down Expand Up @@ -236,7 +237,7 @@ UNIXCODER_BLOB_SRC = vendored/nomic/code_vectors_blob.S
TRACES_SRCS = src/traces/traces.c

# Watcher module (new)
WATCHER_SRCS = src/watcher/watcher.c
WATCHER_SRCS = src/watcher/watcher.c src/watcher/svn_state.c

# Git context module (new)
GIT_SRCS = src/git/git_context.c
Expand Down Expand Up @@ -359,7 +360,7 @@ TEST_GRAPH_BUFFER_SRCS = tests/test_graph_buffer.c

TEST_PIPELINE_SRCS = tests/test_registry.c tests/test_pipeline.c tests/test_fqn.c tests/test_route_canon.c tests/test_path_alias.c tests/test_configlink.c tests/test_infrascan.c tests/test_worker_pool.c tests/test_parallel.c tests/test_index_resilience.c

TEST_WATCHER_SRCS = tests/test_watcher.c
TEST_WATCHER_SRCS = tests/test_watcher.c tests/test_svn_state.c

TEST_LZ4_SRCS = tests/test_lz4.c
TEST_ZSTD_SRCS = tests/test_zstd.c
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ Enable automatic indexing on MCP session start:
codebase-memory-mcp config set auto_index true
```

When enabled, new projects are indexed automatically on first connection. Previously-indexed projects are registered with the background watcher for ongoing git-based change detection. Configurable file limit: `config set auto_index_limit 50000`.
When enabled, new projects are indexed automatically on first connection. Previously-indexed projects are registered with the background watcher for ongoing Git or SVN working-copy change detection. Configurable file limit: `config set auto_index_limit 50000`.

Watcher registration is controlled separately by `auto_watch` (default `true`). Set `config set auto_watch false` to keep a session from registering its project with the background watcher — useful when working across many projects and you want each session contained to explicit indexing.

SVN auto-watch requires a trusted system `svn` executable available on `PATH`; project-local clients are not used. Observation runs locally against the working copy and does not query SVN history or add an SVN-specific interval. Git and SVN projects share the watcher's existing adaptive polling cadence and the same indexing pipeline: ordinary changes take the incremental route, while the pipeline may perform a full rebuild when its existing safety threshold requires one. If SVN observation is unavailable or temporarily fails, the current graph remains available and the watcher retries on a later poll.

### Keeping Up to Date

```bash
Expand Down Expand Up @@ -191,7 +193,7 @@ Removes owned agent config entries, skills, hooks, instructions, and the install

### Distribution & operation
- **Single static binary, zero infrastructure**: SQLite-backed, persists to `~/.cache/codebase-memory-mcp/`
- **Auto-sync**: Background watcher detects file changes and re-indexes automatically
- **Auto-sync**: Background watcher detects Git and SVN working-copy changes and re-indexes automatically
- **Route nodes**: REST endpoints are first-class graph entities
- **CLI mode**: `codebase-memory-mcp cli search_graph '{"project": "my-project", "name_pattern": ".*Handler.*"}'`
- **Available on**: npm, PyPI, Homebrew, Scoop, Winget, Chocolatey, AUR, `go install`
Expand Down Expand Up @@ -598,7 +600,7 @@ See [docs/cbmignore.md](docs/cbmignore.md) for the full `.cbmignore` how-to: syn
codebase-memory-mcp config list # show all settings
codebase-memory-mcp config set auto_index true # auto-index on session start
codebase-memory-mcp config set auto_index_limit 50000 # max files for auto-index
codebase-memory-mcp config set auto_watch false # don't register background git watcher (default: true)
codebase-memory-mcp config set auto_watch false # don't register background Git/SVN watcher (default: true)
codebase-memory-mcp config reset auto_index # reset to default
```

Expand Down Expand Up @@ -712,7 +714,7 @@ src/
pipeline/ Multi-pass indexing (structure → definitions → calls → HTTP links → config → tests)
cypher/ Cypher query lexer, parser, planner, executor
discover/ File discovery (.gitignore, .cbmignore, symlink handling)
watcher/ Background auto-sync (git polling, adaptive intervals)
watcher/ Background auto-sync (Git/SVN polling, adaptive intervals)
traces/ Runtime trace ingestion
ui/ Embedded HTTP server + 3D graph visualization
foundation/ Platform abstractions (threads, filesystem, logging, memory)
Expand Down
Loading
Loading