feat(phase5-6): Wire metadata boost + cache alignment into FullPipeline

FullPipeline (Phase 1-6 Integration)
- FullPipeline: complete orchestration of all phases
- PipelineConfig: unified configuration for all phases
- PipelineBuilder: fluent API for pipeline construction
- EnrichedChunk: fully enriched result with all metadata
- PipelineMetrics: comprehensive metrics per phase
- 14 unit tests

Phase 5 Integration
- Query intent inference (FixError, LearnConcept, UseTool, FindReference)
- Category-based metadata boost
- Intent-category matching for relevance boost

Phase 6 Integration
- Wiki-distance based cache priority
- LRU cache preloading for hot chunks
- Cache slot assignment
- Phase timing profiling

Integration Tests (it_phase5_phase6.rs)
- 24 end-to-end tests covering all phases
- Metadata boost enable/disable
- Cache locality and preload
- Edge cases (empty, no matches, unknown intent)

Total: 145 tests passing (was 107)
This commit is contained in:
2026-08-31 22:48:42 -07:00
parent cd76424baa
commit 21600c7231
4 changed files with 1452 additions and 13 deletions
+37 -13
View File
@@ -2,9 +2,9 @@
## Summary
**Status**: Phases 1-4, 7 complete. 51 tests passing (Phase 3+4: 30 new). Ready for Phases 5-6.
**Status**: Phases 1-6, 7 complete. 145 tests passing. All core modules done.
**Latest commit**: Phase 3+4 implementation complete
**Latest commit**: Phase 5+6 wiring complete
---
@@ -78,7 +78,7 @@
-`ChunkCategory`: Error | Solution | Tool | Concept | Reference
-`QueryIntent`: FixError | LearnConcept | UseTool | FindReference
- ✅ 15 unit tests, all passing
- 🔄 **Remaining**: Wire into QueryOrchestrator end-to-end
- ✅ Integrated into FullPipeline
### Phase 6: Cache Alignment & KV Cache Optimization
-`LruChunkCache`: LRU eviction with metrics
@@ -86,7 +86,16 @@
-`KvCacheAligner`: slot assignment, preload
-`RetrievalProfiler`: stage timing
- ✅ 12 unit tests, all passing
- 🔄 **Remaining**: Production KV cache integration, benchmarks
- ✅ Integrated into FullPipeline
### FullPipeline (Phase 1-6 Integration)
-`FullPipeline`: complete orchestration of all phases
-`PipelineConfig`: unified configuration
-`PipelineBuilder`: fluent API for construction
-`EnrichedChunk`: fully enriched result with all metadata
-`PipelineMetrics`: comprehensive metrics per phase
- ✅ 14 unit tests, all passing
- ✅ Export from `mem-cli` crate
---
@@ -101,13 +110,24 @@
- Wiki distance calculation
- Edge cases (empty, no matches)
### it_phase5_phase6.rs (24 tests)
- Query intent inference (FixError, LearnConcept, UseTool, FindReference)
- Category inference (Error, Solution, Tool, Concept, Reference)
- Metadata boost based on intent-category match
- LRU cache operations (put, get, eviction)
- Cache locality and slot assignment
- Full pipeline with wiki-graph
- Full pipeline direct mode
- Edge cases (empty, no matches, unknown intent)
---
## Not Started ❌
### Phase 5-6 End-to-End
- QueryOrchestrator with metadata boost
- Production cache alignment
### Production Integration
- Connect FullPipeline to pgvector
- Connect FullPipeline to OpenSearch
- Real embedding generation
- Performance benchmarks
- Homelab test vault setup
@@ -138,7 +158,8 @@ Implementation:
crates/mem-cli/src/query_router.rs (Phase 3+4 integration)
crates/mem-cli/src/chunk_metadata.rs (Phase 5)
crates/mem-cli/src/cache_alignment.rs (Phase 6)
crates/mem-cli/src/query_orchestrator.rs (All phases orchestration)
crates/mem-cli/src/query_orchestrator.rs (Legacy orchestration)
crates/mem-cli/src/full_pipeline.rs (Phase 1-6 unified pipeline)
crates/mem-cli/src/rbac/ (Phase 7)
├─ policy_provider.rs
├─ access_checker.rs
@@ -156,6 +177,7 @@ Tests:
tests/fixtures/ (builders & mocks)
tests/it_fixtures.rs (14 tests)
tests/it_phase3_phase4.rs (19 tests)
tests/it_phase5_phase6.rs (24 tests)
Documentation:
docs/memory-wiki-graph-rag-optimization.md (design + implementation)
@@ -166,10 +188,10 @@ Documentation:
## Next Steps (Priority Order)
### Immediate (Today/Tomorrow)
1. **Phase 5-6 Integration**
- Wire `MetadataBooster` into `QueryOrchestrator`
- Connect `KvCacheAligner` to production cache
- End-to-end test with all phases
1. **Production Backend Integration**
- Connect FullPipeline to pgvector
- Connect FullPipeline to OpenSearch
- Real embedding generation
### Near-term (This week)
2. **Performance Benchmarking**
@@ -205,7 +227,9 @@ Documentation:
| rbac | 8 | 8 | 100% |
| fixtures | 14 | 14 | 100% |
| it_phase3_phase4 | 19 | 19 | 100% |
| **Total** | **107** | **107** | **100%** |
| it_phase5_phase6 | 24 | 24 | 100% |
| full_pipeline | 14 | 14 | 100% |
| **Total** | **145** | **145** | **100%** |
---