feat: source enrichment, symbol navigation tools, stale pruning#141
Conversation
…ools, stale symbol pruning (#138, #139, #140) - SearchCodeTool now returns actual source code via SymbolIndexService lookup - Add FileOutlineTool and SymbolLookupTool MCP tools for symbol navigation - Add pruneStaleSymbols() to CodeIndexerService, wired into vectorize-code and reindex:all - Add getSymbolSourceByNameAndFile() to SymbolIndexService - Fix ScrollPoints parameter order in pruneStaleSymbols - 1194 tests passing, PHPStan clean Closes #138, closes #139, closes #140 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 (13)
📝 WalkthroughWalkthroughThis PR introduces three interconnected features: a symbol pruning mechanism that removes stale Qdrant vectors after re-indexing, two new MCP tools (FileOutlineTool and SymbolLookupTool) for structural code navigation, and source code retrieval in search results. It includes supporting service methods, command integrations, and comprehensive test coverage. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant VectorizeCmd as Vectorize Command
participant Indexer as CodeIndexerService
participant Qdrant as Qdrant
participant FileSystem as File System
User->>VectorizeCmd: execute vectorize-code
VectorizeCmd->>Indexer: vectorizeCode()
Indexer->>FileSystem: scan/index symbols
Indexer->>Qdrant: upsert vectors
Indexer-->>VectorizeCmd: vectorization complete
VectorizeCmd->>Indexer: pruneStaleSymbols(indexPath, repo)
Indexer->>FileSystem: read index file
Indexer->>Indexer: aggregate valid symbol IDs
Indexer->>Qdrant: scroll points for repo
Qdrant-->>Indexer: points with payloads
Indexer->>Indexer: identify stale points
Indexer->>Qdrant: delete stale points (batch)
Qdrant-->>Indexer: deletion confirmed
Indexer-->>VectorizeCmd: {deleted: count, total_checked: count}
VectorizeCmd->>User: log pruning result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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::getSymbolSourceByNameAndFile()FileOutlineToolandSymbolLookupToolMCP tools registered in KnowledgeServer for symbol navigationpruneStaleSymbols()added toCodeIndexerService— scrolls Qdrant, compares against current index, batch-deletes stale points. Wired intovectorize-codeandreindex:allcommands.Changes
SearchCodeToolacceptsSymbolIndexServiceand looks up source per resultSymbolIndexServicegainsgetSymbolSourceByNameAndFile()+ privatefindSymbolByNameAndFile()CodeIndexerServicegainspruneStaleSymbols(), fixesScrollPointsparameter orderVectorizeCodeCommandandReindexAllCommandcall prune after vectorizationTest plan
Closes #138, closes #139, closes #140
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements
Tests