refactor(codegraph): make the code graph a fully native engine (no external tool)#94
Merged
Conversation
…rnal tool) Replace the external-MCP wrapper with a zero-dependency TypeScript code-graph engine: scan a project, extract symbols + imports per language (regex, 12 languages), resolve intra-project import edges, count cross-file references, and answer architecture / search / schema queries in-process. Verified on enigma's own src (173 files, 2421 symbols, 606 import edges). - Expose it through enigma's own MCP server (enigma_codegraph_index/projects/ search/architecture), gated by codeGraph; fold codeGraph into mcpEnabled(). - Revert the second-managed-server generalization in mcp-deploy.ts (unused now). - Dashboard: real sliding switch (data-kind=bool, not a text button), an "Index a project" action, native rendering; the toggle now hits enigma's own backend so the previous "Could not reach the server" is gone. - CLI: enigma codegraph <status|on|off|index|projects|arch|search>. - Rewrite tests for the native engine; update docs + CLAUDE.md. No external binary, npx, or third-party package - and no upstream project name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #91. That PR shipped codebase memory as a wrapper around an external MCP; this replaces it with a fully native, zero-dependency engine, as requested - no external binary, no npx, no third-party package, and no upstream project name anywhere.
What
src/codegraph.tsis now an in-process TypeScript code-graph engine:~/.enigma/codegraph.src: 173 files, 2421 symbols, 606 import edges.Integration
enigma_codegraph_index/projects/search/architecture), gated bycodeGraph; folded intomcpEnabled(). Reverted the second-managed-server generalization inmcp-deploy.ts(unused now).data-kind="bool", not a text button), an "Index a project" action, native rendering. The toggle hits enigma's own backend, so the previous "Could not reach the server" is gone.enigma codegraph <status|on|off|index|projects|arch|search>.Verified
npm run verifyclean;codegraph.test.ts5/5;mcp.test.ts7/7; headless dashboard smoke (switch renders as a switch, no JS errors).Opt-in, default off.