Skip to content

Commit f599076

Browse files
Merge branch 'main' into fix/quarantine-exit-nonzero
2 parents bd79af5 + 095acc5 commit f599076

42 files changed

Lines changed: 355897 additions & 53 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile.cbm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ PIPELINE_SRCS = \
356356
src/pipeline/pass_complexity.c \
357357
src/pipeline/pass_cross_repo.c \
358358
src/pipeline/artifact.c \
359+
src/pipeline/pass_ensemble_routing.c \
359360
src/pipeline/pass_pkgmap.c
360361

361362
# SimHash / MinHash module

‎README.md‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
**The fastest and most efficient code intelligence engine for AI coding agents.** Full-indexes an average repository in milliseconds, the Linux kernel (28M LOC, 75K files) in 3 minutes. Answers structural queries in under 1ms. Ships as a native executable with a small verified runtime-asset set for macOS, Linux, and Windows — download, run `install`, done.
1818

19-
High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-sitter/) AST analysis across all 158 languages, enhanced with [**Hybrid LSP** semantic type resolution](#hybrid-lsp) for Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust, and Perl — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 15 MCP tools. No language runtime, hosted service, or API key. Plug and play across 43 supported automatic/conditional client surfaces.
19+
High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-sitter/) AST analysis across all 158 languages, enhanced with [**Hybrid LSP** semantic type resolution](#hybrid-lsp) for Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust, and Perl — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 15 MCP tools. No language runtime, hosted service, or API key. Plug and play across 44 supported automatic/conditional client surfaces.
2020

2121
> **Research** — The design and benchmarks behind this project are described in the preprint [*Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP*](https://arxiv.org/abs/2603.27277) (arXiv:2603.27277). Evaluated across 31 real-world repositories: 83% answer quality, 10× fewer tokens, 2.1× fewer tool calls vs. file-by-file exploration.
2222
@@ -34,7 +34,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si
3434
- **Plug and play** — native executable plus authenticated release-owned assets for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (amd64). The native install needs no Docker, language runtime, or API keys. Download → `install` → restart agent → done.
3535
- **158 languages** — vendored tree-sitter grammars compiled into the binary. Nothing to install, nothing that breaks.
3636
- **120x fewer tokens** — 5 structural queries: ~3,400 tokens vs ~412,000 via file-by-file search. One graph query replaces dozens of grep/read cycles.
37-
- **43 supported automatic/conditional client surfaces** — `install` configures detected clients and safely activates conditional clients only when their documented platform, marker, or explicit existing config path is present. See [Multi-Agent Support](#multi-agent-support) for the complete matrix and manual/UI-only boundaries.
37+
- **44 supported automatic/conditional client surfaces** — `install` configures detected clients and safely activates conditional clients only when their documented platform, marker, or explicit existing config path is present. See [Multi-Agent Support](#multi-agent-support) for the complete matrix and manual/UI-only boundaries.
3838
- **Built-in graph visualization** — 3D interactive UI at `localhost:9749`, served from the binary itself.
3939
- **Infrastructure-as-code indexing** — Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references. `Resource` nodes for K8s kinds, `Module` nodes for Kustomize overlays with `IMPORTS` edges to referenced resources.
4040
- **15 MCP tools** — search, trace, architecture, impact analysis, targeted index-coverage checks, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.
@@ -425,7 +425,7 @@ Restart your agent. Verify with `/mcp` — you should see `codebase-memory-mcp`
425425

426426
## Multi-Agent Support
427427

428-
`install` configures 43 client surfaces: 37 detected automatically and 6
428+
`install` configures 44 client surfaces: 38 detected automatically and 6
429429
conditional or explicit. “Conditional” means the installer writes only when the
430430
documented platform or an explicit, already-existing config path proves the
431431
target is active. It never flips experimental feature flags, enables plugins,
@@ -473,6 +473,7 @@ overwrite user-modified agents.
473473
| Crush | Detected | `.config/crush/crush.json` | Managed context path with explicit parent-to-child handoff |
474474
| Goose | Detected | `.config/goose/config.yaml` | `.goosehints` |
475475
| Mistral Vibe | Detected | `$VIBE_HOME/config.toml` | `AGENTS.md`, skill, and three matched agent/prompt pairs with explicit read-only graph-tool allowlists |
476+
| Grok Build | Detected | `$GROK_HOME/config.toml` | Owned `rules/codebase-memory.md`, skill, three graph agents with named-server `mcpInheritance` and exact `server__tool` dispatcher ids; context hooks withheld because its passive hook events discard stdout |
476477
| Qoder CLI | Detected | `~/.qoder/settings.json` | Skill, three directly MCP-attached agents with named-server scoping and exact per-tier graph-tool lists; `SessionStart`, `SubagentStart`, and post-`Read` coverage, including documented PowerShell execution on Windows |
477478
| Kimi Code CLI | Detected | `$KIMI_CODE_HOME/mcp.json` (default `~/.kimi-code`) | Same-root `AGENTS.md` + skill; fail-open `UserPromptSubmit` hook in `config.toml` |
478479
| GitLab Duo CLI | Detected | `$GLAB_CONFIG_DIR/duo/mcp.json` or platform fallback | Fail-open user `SessionStart` on macOS/Linux; hook withheld on Windows; no experimental global skill enablement |
@@ -521,7 +522,7 @@ carry the contract across fresh sessions and compaction: verify the graph projec
521522
and index freshness, query structural facts in the parent, then pass the project,
522523
qualified symbols, paths, and call-chain evidence in every delegated task.
523524
Claude, Codex, Gemini, Kiro, Qwen, Copilot, CodeBuddy, OpenCode, Kilo, Vibe,
524-
Qoder, Junie, and Factory receive Scout, Verify, and Auditor graph profiles.
525+
Qoder, Junie, Factory, and Grok Build receive Scout, Verify, and Auditor graph profiles.
525526
Kiro embeds this MCP server with `--tool-profile scout` for Scout and
526527
`--tool-profile analysis` for Verify/Auditor. Junie registers equivalent named
527528
server aliases because its subagent schema filters by server rather than by
@@ -547,7 +548,12 @@ project or plugin agents before user agents with the same name; reload the
547548
client after installation or profile changes.
548549
Cursor context
549550
hooks are withheld: session context injection has a known race, `subagentStart`
550-
is control-only, and read-only subagents cannot safely receive MCP access. Rovo
551+
is control-only, and read-only subagents cannot safely receive MCP access. Grok Build's
552+
passive hook events (`SessionStart`, `SubagentStart`, `PostToolUse`) discard
553+
stdout and `PreToolUse` honors only deny/rewrite decisions, so its context hooks
554+
are withheld; Grok also reads Claude and Cursor MCP, skill, and hook files
555+
through its compat layer, and the native `config.toml` entry shadows that copy
556+
by name. Rovo
551557
has no documented session context-output hook, and Bob
552558
documents neither a suitable hook nor a custom-agent surface. Those surfaces are
553559
not approximated with invented augmentation. Kimi plugins, Amp plugins, and
@@ -778,7 +784,7 @@ src/
778784
main.c Entry point (MCP stdio server + CLI + install/update/config)
779785
daemon/ Per-account session coordination, IPC, lifecycle, shared jobs/watchers
780786
mcp/ MCP server (15 tools, JSON-RPC 2.0, session detection, auto-index)
781-
cli/ Install/uninstall/update/config (43 client surfaces, hooks, instructions)
787+
cli/ Install/uninstall/update/config (44 client surfaces, hooks, instructions)
782788
store/ SQLite graph storage (nodes, edges, traversal, search, Louvain)
783789
pipeline/ Multi-pass indexing (structure → definitions → calls → HTTP links → config → tests)
784790
cypher/ Cypher query lexer, parser, planner, executor

‎THIRD_PARTY.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ License summary:
6464
base, MIT, (c) 2014 Max Brunsfeld) with (c) 2026 DeusData ArkTS additions;
6565
its grammar source lives in `tools/tree-sitter-arkts/`.
6666

67+
### tree-sitter-plsql
68+
69+
- **Project:** [AndreasMaierDe/tree-sitter-plsql](https://github.com/AndreasMaierDe/tree-sitter-plsql)
70+
- **License:** MIT
71+
- **Copyright:** (c) 2022 AndreasMaierDe
72+
- **Vendored at:** `internal/cbm/vendored/grammars/plsql/`
73+
- **Pinned commit:** `28aebef209be`
74+
- **Notes:** Community-maintained grammar for Oracle PL/SQL; not in the
75+
nvim-treesitter or Helix registries (`community-niche` in the manifest). No
76+
external scanner. One local patch: `parser.c`'s
77+
`#include <tree_sitter/parser.h>` is changed to the quoted form used by every
78+
other vendored grammar, as documented in
79+
`internal/cbm/vendored/grammars/MANIFEST.md`. PL/SQL support was originally
80+
contributed in PR #1033 by Oğuz (@ouzsrcm).
81+
6782
### tree-sitter-objectscript (UDL + routine)
6883

6984
- **Project:** [intersystems/tree-sitter-objectscript](https://github.com/intersystems/tree-sitter-objectscript)

‎docs/index.html‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>codebase-memory-mcp — Code Intelligence Knowledge Graph for AI Coding Agents</title>
7-
<meta name="description" content="codebase-memory-mcp is an open-source MCP server that indexes any codebase into a persistent knowledge graph so AI coding agents answer structural questions with ~120x fewer tokens. 158 languages, Hybrid LSP type resolution, local semantic vector search, code-clone detection, sub-1ms queries, Linux kernel indexed in 3 minutes. Native executable with verified assets and no language runtime. One command configures 43 automatic/conditional client surfaces.">
7+
<meta name="description" content="codebase-memory-mcp is an open-source MCP server that indexes any codebase into a persistent knowledge graph so AI coding agents answer structural questions with ~120x fewer tokens. 158 languages, Hybrid LSP type resolution, local semantic vector search, code-clone detection, sub-1ms queries, Linux kernel indexed in 3 minutes. Native executable with verified assets and no language runtime. One command configures 44 automatic/conditional client surfaces.">
88
<meta name="keywords" content="MCP server, code intelligence, knowledge graph, tree-sitter, Hybrid LSP, semantic code search, code embeddings, code clone detection, cross-repo analysis, data-flow analysis, Claude Code, Codex CLI, Gemini CLI, Cursor, Zed, code exploration, token reduction, call graph, dead code detection">
99
<meta name="author" content="DeusData">
1010
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
@@ -68,7 +68,7 @@
6868
"Infrastructure-as-code indexing for Dockerfiles, Kubernetes, and Kustomize",
6969
"Built-in 3D graph visualization UI",
7070
"Auto-sync background watcher for incremental re-indexing",
71-
"One command configures 43 automatic/conditional client surfaces"
71+
"One command configures 44 automatic/conditional client surfaces"
7272
],
7373
"author": {
7474
"@type": "Organization",
@@ -157,7 +157,7 @@
157157
"name": "Which AI coding agents work with codebase-memory-mcp?",
158158
"acceptedAnswer": {
159159
"@type": "Answer",
160-
"text": "A single install command configures 43 automatic/conditional client surfaces. The 37 detected surfaces are Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor, Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code, GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Qoder CLI, Kimi Code CLI, GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Amazon Q Developer IDE, CodeBuddy Code CLI, IBM Bob Shell, Pochi, and Pi. Continue / cn, Visual Studio, TRAE, Roo Code, IBM Bob IDE, and Sourcegraph Cody are conditional or explicit integrations. Qodo, Warp MCP, JetBrains AI/ACP, GitHub Copilot coding agent, Jules, CodeRabbit, Replit, BLACKBOX AI, Plandex, and SWE-agent require manual, UI, cloud, or repository-managed setup and are not counted among the 43."
160+
"text": "A single install command configures 44 automatic/conditional client surfaces. The 38 detected surfaces are Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor, Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code, GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Grok Build, Qoder CLI, Kimi Code CLI, GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Amazon Q Developer IDE, CodeBuddy Code CLI, IBM Bob Shell, Pochi, and Pi. Continue / cn, Visual Studio, TRAE, Roo Code, IBM Bob IDE, and Sourcegraph Cody are conditional or explicit integrations. Qodo, Warp MCP, JetBrains AI/ACP, GitHub Copilot coding agent, Jules, CodeRabbit, Replit, BLACKBOX AI, Plandex, and SWE-agent require manual, UI, cloud, or repository-managed setup and are not counted among the 43."
161161
}
162162
},
163163
{
@@ -527,10 +527,10 @@ <h2>How do I install codebase-memory-mcp?</h2>
527527
<span class="cmd">"Index this project"</span>
528528
</div>
529529
<p class="muted">
530-
One command configures 43 automatic/conditional client surfaces. <strong>Detected automatically (37):</strong>
530+
One command configures 44 automatic/conditional client surfaces. <strong>Detected automatically (38):</strong>
531531
Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor,
532532
Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code,
533-
GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Qoder CLI, Kimi Code CLI,
533+
GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Grok Build, Qoder CLI, Kimi Code CLI,
534534
GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Amazon Q Developer IDE,
535535
CodeBuddy Code CLI, IBM Bob Shell, Pochi, and Pi.
536536
</p>

‎docs/llms.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- Semantic & similarity edges: SEMANTICALLY_RELATED (vocabulary-mismatch matches) and SIMILAR_TO (MinHash + LSH near-clone / duplicate detection).
1313
- Cross-repo intelligence: CROSS_* edges link nodes across multiple repos indexed in one store; multi-galaxy 3D layout and cross-repo architecture summary.
1414
- Cross-service linking: HTTP route ↔ call-site matching, plus gRPC/GraphQL/tRPC detection and pub/sub channels (EMITS/LISTENS_ON for Socket.IO, EventEmitter, generic buses).
15-
- Supported agents: 43 automatic/conditional client surfaces (37 automatically detected + 6 conditional/explicit): Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor, Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code, GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Qoder CLI, Kimi Code CLI, GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Continue / cn, Visual Studio, TRAE, Roo Code, Amazon Q Developer IDE, CodeBuddy Code CLI, IBM Bob IDE, IBM Bob Shell, Pochi, Pi, and Sourcegraph Cody.
15+
- Supported agents: 44 automatic/conditional client surfaces (38 automatically detected + 6 conditional/explicit): Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor, Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code, GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Grok Build, Qoder CLI, Kimi Code CLI, GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Continue / cn, Visual Studio, TRAE, Roo Code, Amazon Q Developer IDE, CodeBuddy Code CLI, IBM Bob IDE, IBM Bob Shell, Pochi, Pi, and Sourcegraph Cody.
1616
- Agent profiles: documented custom-agent formats receive Scout (fast/provisional), Verify (default/task-directed), and Auditor (bounded/full verification) definitions. Every direct tier checks exact path/scope coverage with check_index_coverage and falls back to source for flagged gaps; unsafe child-MCP formats use explicit parent handoff. Kiro and Junie use positive-allowlist Scout/Analysis server profiles (7/11 tools); Qoder combines named-server selection with exact tier-specific MCP tool IDs, while Factory uses exact registered IDs without additive whole-server exposure. Foreign Junie aliases are preserved and force parent handoff.
1717
- Performance: Linux kernel (28M LOC, 75K files) full index in 3 minutes → 4.81M nodes, 7.72M edges; Cypher queries in under 1ms.
1818
- Distribution: verified runtime set (native executable plus authenticated release-owned assets); fully static Linux builds are available in the `-portable` archives. Also available through npm, PyPI, Homebrew, Scoop, Winget, Chocolatey, AUR, and `go install`.

‎internal/cbm/cbm.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ typedef enum {
175175
CBM_LANG_OBJECTSCRIPT_ROUTINE, // InterSystems ObjectScript routine (.mac/.int/.rtn/.inc)
176176
CBM_LANG_OBJECTSCRIPT_EXPORT, // InterSystems Studio Export XML (<Export generator="Cache">)
177177
CBM_LANG_ARKTS, // ArkTS (HarmonyOS/OpenHarmony .ets — TypeScript superset + ArkUI)
178+
CBM_LANG_PLSQL, // Oracle PL/SQL
178179
CBM_LANG_COUNT
179180
} CBMLanguage;
180181

‎internal/cbm/extract_calls.c‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,32 @@ static char *extract_ada_callee(CBMArena *a, TSNode node, const char *source, co
826826
return NULL;
827827
}
828828

829+
/* PL/SQL: ref_call → referenced_element. Package-qualified calls use
830+
* ref_name_parent.ref_name (e.g. UTIL_PKG.CALC_SALARY); bare calls use
831+
* ref_name alone. */
832+
static char *extract_plsql_callee(CBMArena *a, TSNode node, const char *source, const char *nk) {
833+
if (strcmp(nk, "ref_call") != 0) {
834+
return NULL;
835+
}
836+
TSNode ref = cbm_find_child_by_kind(node, "referenced_element");
837+
if (ts_node_is_null(ref)) {
838+
return NULL;
839+
}
840+
TSNode parent = ts_node_child_by_field_name(ref, TS_FIELD("ref_name_parent"));
841+
TSNode name = ts_node_child_by_field_name(ref, TS_FIELD("ref_name"));
842+
if (!ts_node_is_null(parent) && !ts_node_is_null(name)) {
843+
char *p = cbm_node_text(a, parent, source);
844+
char *n = cbm_node_text(a, name, source);
845+
if (p && n && p[0] && n[0]) {
846+
return cbm_arena_sprintf(a, "%s.%s", p, n);
847+
}
848+
}
849+
if (!ts_node_is_null(name)) {
850+
return cbm_node_text(a, name, source);
851+
}
852+
return cbm_node_text(a, ref, source);
853+
}
854+
829855
// Solidity: a call_expression's callee is on the `function` field, wrapped in an
830856
// `expression` node (call_expression -> function:expression -> identifier). Descend
831857
// left-most through expression wrappers until we reach the identifier/member.
@@ -1369,6 +1395,9 @@ static char *extract_callee_lang_specific(CBMArena *a, TSNode node, const char *
13691395
if (lang == CBM_LANG_ADA) {
13701396
return extract_ada_callee(a, node, source, nk);
13711397
}
1398+
if (lang == CBM_LANG_PLSQL) {
1399+
return extract_plsql_callee(a, node, source, nk);
1400+
}
13721401
if (lang == CBM_LANG_SOLIDITY) {
13731402
return extract_solidity_callee(a, node, source, nk);
13741403
}

0 commit comments

Comments
 (0)