Skip to content
Merged
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![CI](https://img.shields.io/github/actions/workflow/status/DeusData/codebase-memory-mcp/release.yml?branch=main&label=main%20CI)](https://github.com/DeusData/codebase-memory-mcp/actions/workflows/release.yml)
[![Native and frontend tests](https://img.shields.io/badge/tests-native_%2B_frontend-blue)](#tests)
[![MCP tools](https://img.shields.io/badge/MCP_tools-17-blue)](#mcp-tools)
[![Languages](https://img.shields.io/badge/languages-163-orange)](https://github.com/DeusData/codebase-memory-mcp)
[![Languages](https://img.shields.io/badge/languages-164-orange)](https://github.com/DeusData/codebase-memory-mcp)
[![Hybrid LSP](https://img.shields.io/badge/Hybrid_LSP-type_resolution-blue)](#hybrid-lsp)
[![Agents](https://img.shields.io/badge/agent_surfaces-46-purple)](https://github.com/DeusData/codebase-memory-mcp)
[![Pure C](https://img.shields.io/badge/pure_C-no_language_runtime-blue)](https://github.com/DeusData/codebase-memory-mcp)
Expand Down Expand Up @@ -398,7 +398,7 @@ In this repository, test narrowing is on for every PR unless `TEST_IMPACT_MODE`
- `SEMANTICALLY_RELATED` (vocabulary-mismatch, same-language, score ≥ 0.80)

### Indexing pipeline
- **163 vendored tree-sitter grammars** compiled into the binary
- **164 vendored tree-sitter grammars** compiled into the binary
- **Generic package / module resolution**: bare specifiers like `@myorg/pkg`, `github.com/foo/bar`, `use my_crate::foo` resolved via manifest scanning (`package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `composer.json`, `pubspec.yaml`, `pom.xml`, `build.gradle`, `mix.exs`, `*.gemspec`)
- **Infrastructure-as-code indexing**: Dockerfiles (`Dockerfile.*`, `*.Dockerfile`, `Containerfile`: bases, what the container runs, `ENV`), container images (`Image`: the normalised repository, tag and digest on the edges; a repository built from several Dockerfiles, one per component tag, gets an `Image` per component), docker compose services (`Resource`), Kubernetes manifests (`Resource`, with `group`, `version`, `kind`, `namespace`, `labels` as `k=v,k2=v2`), Kustomize overlays (`IMPORTS` to their entries and patch files, `OVERRIDE` from their patches), Helm charts (`Chart`, `DEPENDS_ON`), Terraform / OpenTofu (`.tf`, `.tofu`, `.tfvars`) as graph nodes. A Service walks to the code it runs: Service → workload → `Image` → Dockerfile → `main`
- **[Hybrid LSP semantic type resolution](#hybrid-lsp)** for Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust, and Perl; a lightweight C implementation of language type-resolution algorithms, structurally inspired by and compatible with major language servers including tsserver / typescript-go, pyright, gopls, Roslyn, Eclipse JDT, and rust-analyzer (parameter binding, return-type inference, generic substitution, JSX component dispatch, JSDoc inference for plain JS files, namespace + trait + late-static-binding resolution for PHP, file-scoped namespaces + records + LINQ method syntax for C#, class-hierarchy + overload + lambda resolution for Java, extension-function + scope-function resolution for Kotlin, trait-method + UFCS resolution for Rust)
Expand Down Expand Up @@ -1124,14 +1124,14 @@ codebase-memory-mcp ships a **lightweight C implementation of language type-reso

**Two-layer architecture:**

1. **Tree-sitter pass**: fast, syntactic, runs for every one of the 163 languages. Extracts definitions, calls, imports.
1. **Tree-sitter pass**: fast, syntactic, runs for every one of the 164 languages. Extracts definitions, calls, imports.
2. **Hybrid LSP pass**: type-aware, runs above the tree-sitter pass per-language. Refines call edges using the import graph plus a per-file or pre-built cross-file definition registry. Languages without a Hybrid LSP pass yet fall back to textual resolution, with coverage varying by language and construct.

The result is a knowledge graph accurate enough to drive `trace_path` across packages, inheritance hierarchies, and stdlib calls; without paying for a language server process per project.

## Language Support

163 languages, counted by the vendored grammar directories in [the parser manifest](internal/cbm/vendored/grammars/MANIFEST.md). Benchmarked against 64 real open-source repositories (78 to 49K nodes):
164 languages, counted by the vendored grammar directories in [the parser manifest](internal/cbm/vendored/grammars/MANIFEST.md). Benchmarked against 64 real open-source repositories (78 to 49K nodes):

| Tier | Score | Languages |
|------|-------|-----------|
Expand All @@ -1158,7 +1158,7 @@ src/
ui/ Local HTTP server + embedded CBM Lens frontend
foundation/ Platform abstractions (threads, filesystem, logging, memory)
graph-ui/ CodeAtlasWeb: React, Monaco, and Three.js browser frontend
internal/cbm/ Vendored tree-sitter grammars (163 languages) + AST extraction engine
internal/cbm/ Vendored tree-sitter grammars (164 languages) + AST extraction engine
```

## Security
Expand Down
28 changes: 23 additions & 5 deletions THIRD_PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The core runtime headers in `internal/cbm/vendored/common/tree_sitter/`

## Tree-sitter Grammars

163 pre-generated parsers are vendored in `internal/cbm/vendored/grammars/<lang>/`
164 pre-generated parsers are vendored in `internal/cbm/vendored/grammars/<lang>/`
(generated `parser.c` plus `scanner.c` where applicable, compiled statically).
Each grammar is the work of its upstream authors and each grammar directory
contains the upstream `LICENSE` file.
Expand Down Expand Up @@ -77,8 +77,8 @@ License summary:
smart-coin language, written for this project because no usable public
grammar exists; its source and corpus tests live in
`tools/tree-sitter-chialisp/`.
- Twelve further grammars (`arkts`, `assembly`, `cfml`,
`cfscript`, `dotenv`, `javascript`, `pascal`, `pine`, `qml`, `sql`, `tsx`, `vbnet`) are
- Thirteen further grammars (`arkts`, `assembly`, `cfml`, `cfscript`, `dotenv`,
`javascript`, `pascal`, `pine`, `qml`, `sql`, `tsx`, `vba`, `vbnet`) are
self-maintained forks that retain their original upstream authors' licenses —
see the manifest for per-grammar provenance. `arkts` is a first-party derivative of
[tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript)
Expand All @@ -101,8 +101,26 @@ License summary:
MIT, (c) 2021 Derek Stride) is the upstream grammar with one (c) 2026
DeusData patch that accepts the SQLite syntax of real migration files
(PRAGMA, AUTOINCREMENT, WITHOUT ROWID, trigger bodies, virtual tables); its
grammar source lives in `tools/tree-sitter-sql/`. `vbnet` is described in its
own section below.
grammar source lives in `tools/tree-sitter-sql/`. `vba` and `vbnet` are described
in their own sections below.

### tree-sitter-vba

- **Project:** [harumiWeb/tree-sitter-vba](https://github.com/harumiWeb/tree-sitter-vba)
- **License:** MIT
- **Copyright:** (c) 2026 harumiWeb
- **Vendored at:** `internal/cbm/vendored/grammars/vba/`
- **Pinned commit:** `83c5c3c3c721` (v0.14.5)
- **Notes:** Visual Basic for Applications and Visual Basic 6 grammar (its
`vba` dialect), maintained here as a self-maintained fork without local
changes: upstream does not track its generated parser, so its grammar source
(`common/define-grammar.js` and `vba/grammar.js`, byte-identical to
upstream) and the regeneration recipe live in `tools/tree-sitter-vba/`, and
the parser is generated in this repository with tree-sitter-cli 0.25.10.
Upstream's `THIRD_PARTY_LICENSE.md` covers only its test fixtures, none of
which is carried here. The grammar is vendored ahead of VB6/VBA extraction
(#2564); provenance hashes are in
`internal/cbm/vendored/grammars/MANIFEST.md`.

### tree-sitter-vbnet (with CodeGraph's real-world VB.NET patch)

Expand Down
3 changes: 3 additions & 0 deletions internal/cbm/grammar_vba.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Vendored tree-sitter grammar: vba
// Each grammar compiled as separate unit (conflicting static symbols).
#include "vendored/grammars/vba/parser.c"
Loading
Loading