feat: M3.8.1 phase 3 — CacheAligner + CCR Store (18 tests)
CacheAligner (180 LOC, 8 tests): - Detects dynamic patterns: timestamps, UUIDs, session IDs, temp paths, SHAs - Uses once_cell Lazy statics + Regex for pattern matching - Separates stable prefix (cache-able) from dynamic tail (varies) - Reports drift metrics (0.0-1.0 ratio of dynamic content) - Preserves identical prefixes across calls for KV cache hits CcrStore (170 LOC, 10 tests): - LRU cache with IndexMap (preserves insertion order) - SHA256 hashing for content identification - TTL-based expiry (default 1hr, configurable) - Thread-safe (Mutex-wrapped) - Supports large content (tested 100KB+) ContextOptimizer integration (2 tests): - Wired CCR store into optimizer - Stores originals when compression occurs + CCR enabled - Returns hash for retrieval hints 50 optimizer tests total: Phase 1 (17) + Phase 2 (15) + Phase 3 (18) = 50 passing
This commit is contained in:
@@ -20,4 +20,4 @@ pub use lesson::{
|
||||
pub use query::{Query, QuerySet, SynthesisQuery};
|
||||
pub use prompt::{PromptBuilder, PromptMessages};
|
||||
pub use symptom_projection::{project_symptom, SymptomVector};
|
||||
pub use optimizer::{ContextOptimizer, ContextOptimizerConfig, ContentType, OptimizedChunk};
|
||||
pub use optimizer::{ContextOptimizer, ContextOptimizerConfig, ContentType, OptimizedChunk, CacheAligner, AlignedContent, CcrStore};
|
||||
|
||||
Reference in New Issue
Block a user