Problem
The tree indexer only parses markdown headings. For a "context engineering IDE", not understanding code is a gaping hole. The existing codeIndexer.ts does basic regex but misses: modules, exports, classes, function signatures, type definitions, and import relationships.
Success criteria
A .ts or .py file indexed produces a hierarchical TreeNode with: modules → exports → classes → methods/functions → parameters + types. Import/export relations extracted accurately. False positive calls edges reduced by 5x.
Non-goals
No Tree-sitter/full AST. Regex + heuristics but much more precise. Optional LLM summary in pass 2.
Implementation
- Enrich
src/utils/codeIndexer.ts: TS/JS parser (import, export, class, function, interface, type, const), Python parser (import, from, class, def, decorators)
- Enrich
src/graph/extractors/code.ts: extract real imports, filter false positives via scope analysis
- Extend COMMON_IDENTIFIERS with top 50 JS/TS built-in names
Test plan
Unit test: index 5 known files from the repo itself. Measure calls edge count before/after (target: < 200 vs ~1000+).
Problem
The tree indexer only parses markdown headings. For a "context engineering IDE", not understanding code is a gaping hole. The existing
codeIndexer.tsdoes basic regex but misses: modules, exports, classes, function signatures, type definitions, and import relationships.Success criteria
A
.tsor.pyfile indexed produces a hierarchical TreeNode with: modules → exports → classes → methods/functions → parameters + types. Import/export relations extracted accurately. False positivecallsedges reduced by 5x.Non-goals
No Tree-sitter/full AST. Regex + heuristics but much more precise. Optional LLM summary in pass 2.
Implementation
src/utils/codeIndexer.ts: TS/JS parser (import, export, class, function, interface, type, const), Python parser (import, from, class, def, decorators)src/graph/extractors/code.ts: extract real imports, filter false positives via scope analysisTest plan
Unit test: index 5 known files from the repo itself. Measure
callsedge count before/after (target: < 200 vs ~1000+).