@startuml Enhanced Dispatcher Component
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title Enhanced Dispatcher - Component Diagram (With Performance Test Findings)
Container_Boundary(dispatcher, "Enhanced Dispatcher") {
Component(router, "Plugin Router", "Python", "Routes requests to appropriate plugins with advanced features")
Component(factory, "Plugin Factory", "Python", "Dynamically creates language plugins on demand")
Component(registry, "Language Registry", "Python", "Stores configuration for 48+ languages")
Component(cache, "Query Cache", "Python", "Caches parsed tree-sitter queries")
Component(aggregator, "Result Aggregator", "Python", "Aggregates search results from multiple plugins")
Component(stats, "Statistics Tracker", "Python", "Tracks operations and performance metrics")
Component(multiRepo, "Multi-Repo Manager", "Python", "Manages indexes across multiple repositories")
Component(memoryMgr, "Memory Manager", "Python", "Memory-aware plugin lifecycle management")
Component(timeout, "Timeout Protection", "Python", "5-second timeout on plugin operations")
Component(bypass, "BM25 Bypass", "Python", "Direct SQLite search when plugins unavailable")
Component(indexDiscovery, "Index Discovery", "Python", "Multi-path index location resolver (needs fixes)")
Component(pathTranslator, "Path Translator", "Python", "Docker ↔ Native path conversion")
Rel(router, factory, "Requests plugins")
Rel(factory, registry, "Reads language configs")
Rel(factory, cache, "Uses cached queries")
Rel(router, aggregator, "Sends results")
Rel(router, stats, "Records metrics")
Rel(router, multiRepo, "Queries repos")
Rel(factory, memoryMgr, "Checks memory")
Rel(router, timeout, "Protected by")
Rel(router, bypass, "Falls back to")
Rel(router, indexDiscovery, "Uses for index location")
Rel(indexDiscovery, pathTranslator, "Converts paths")
Rel(multiRepo, indexDiscovery, "Finds repo indexes")
}
Component_Ext(plugins, "Language Plugins", "Python", "48 languages: 13 specialized + 35 generic")
Component_Ext(storage, "SQLite Store", "SQLite", "Persistent storage for indexed data")
Rel(router, plugins, "Dispatches to")
Rel(plugins, storage, "Stores/retrieves data")
Rel(factory, plugins, "Creates instances")
Rel(indexDiscovery, storage, "Locates DB files")
note right of indexDiscovery #FF6666
**Current Issues (Test Results):**
- Only checks .indexes/ path
- Misses test_indexes/ repos
- No Docker path translation
- Causes 0% success for Rust
end note
note bottom of bypass #66FF66
**Performance Stats:**
- BM25 Bypass: <50ms
- With Plugins: ~1000ms
- Timeout Protection: 5s max
- Success when used: 100%
end note
@enduml