feat: tree-sitter symbol indexing via jcodemunch#135
feat: tree-sitter symbol indexing via jcodemunch#135github-actions[bot] merged 5 commits intomasterfrom
Conversation
Depersonalizes the codebase by replacing all "Odin" references with generic "Remote" terminology. The remote sync feature is optional infrastructure for home labs and teams sharing a centralized vector store — naming should reflect that, not a specific server. Renames: OdinSyncService → RemoteSyncService, OdinSyncCommand → RemoteSyncCommand, sync:odin → sync:remote, --odin → --remote, ODIN_* env vars → REMOTE_SYNC_*, docker-compose.odin.yml → docker-compose.remote.yml. All tests updated accordingly.
These are already in .gitignore but were previously committed.
No code references these views — dead code in a CLI app.
Replace regex-based code chunking with AST-aware symbol extraction using jcodemunch's tree-sitter parser. The new SymbolIndexService reads jcodemunch's JSON index format and does byte-offset retrieval natively in PHP, enabling O(1) symbol source lookup without re-parsing. - Add SymbolIndexService with search, outline, and change detection - Update IndexCodeCommand to use tree-sitter indexing with incremental support - Update SearchCodeCommand with symbol-first search, kind/file filters, and file outlines - 100% test coverage on all new/modified files (61 tests, 134 assertions) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (40)
📝 WalkthroughWalkthroughThis pull request refactors the centralized sync system from "Odin" to a generic "Remote" nomenclature across configuration, services, and CLI commands. Additionally, it introduces a new SymbolIndexService for tree-sitter-based code symbol indexing and replaces the legacy CodeIndexerService throughout the codebase. Static site generation Blade templates are removed entirely. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SymbolIndexService
participant Python as Python Indexer
participant FileSystem as File System
participant Index as Index Storage
rect rgba(100, 200, 150, 0.5)
Note over Client,Index: Indexing Flow
Client->>SymbolIndexService: indexFolder(path, incremental)
SymbolIndexService->>FileSystem: Validate path
SymbolIndexService->>Python: Execute indexer subprocess
Python->>FileSystem: Parse files with tree-sitter
Python->>Index: Write symbol index (JSON)
Index-->>Python: Confirm write
Python-->>SymbolIndexService: Return results (JSON)
SymbolIndexService-->>Client: Return success/failure payload
end
rect rgba(150, 150, 200, 0.5)
Note over Client,Index: Search Flow
Client->>SymbolIndexService: searchSymbols(query, repo, kind, pattern)
SymbolIndexService->>Index: loadIndex(repo)
Index-->>SymbolIndexService: Symbol metadata array
SymbolIndexService->>SymbolIndexService: Filter by kind/pattern
SymbolIndexService->>SymbolIndexService: Score symbols (fuzzy match)
SymbolIndexService-->>Client: Return top results sorted by score
end
rect rgba(200, 150, 150, 0.5)
Note over Client,Index: Source Retrieval
Client->>SymbolIndexService: getSymbolSource(symbolId, repo)
SymbolIndexService->>Index: findSymbol(symbolId)
Index-->>SymbolIndexService: Symbol with byte offsets
SymbolIndexService->>FileSystem: Read content via offset
FileSystem-->>SymbolIndexService: Source code snippet
SymbolIndexService-->>Client: Return source text
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage Report
Files Below Threshold
🏆 Synapse Sentinel Gate |
🏆 Sentinel Certified✅ Tests & Coverage: 0 tests passed Add this badge to your README: [](https://github.com/conduit-ui/knowledge/actions/workflows/gate.yml) |
Summary
SymbolIndexService— reads jcodemunch's JSON index format, does byte-offsetfseek/freadsymbol retrieval natively in PHP (O(1), no re-parsing)index-codecommand — tree-sitter AST parsing via jcodemunch, with incremental indexing (SHA-256 hash-based change detection)search-codecommand — weighted symbol search (name/signature/docstring/keyword scoring), file outlines, kind/file filters,--show-sourcevia byte offsetsWhat this replaces
The old
CodeIndexerServiceused regex function extraction and 2000-char chunking into Qdrant embeddings. The new approach extracts 527 discrete symbols from 97 PHP files using tree-sitter AST parsing — with exact byte offsets for instant source retrieval, no embedding cost for code navigation.Test plan
SymbolIndexService(search, retrieval, outline, change detection, path traversal, version handling)IndexCodeCommand(index, incremental, list repos, error paths)SearchCodeCommand(search, filters, outline, source display)Summary by CodeRabbit
New Features
Changes
Documentation