Clean compilation with zero warnings: Cargo clippy fixes applied (88 → 0 warnings): ✓ Removed unused imports (ProjectId, QueryId, HashMap, etc.) ✓ Fixed empty line after doc comments ✓ Added #[allow(dead_code)] for intentional unused fields ✓ Replaced deprecated indexmap::remove() with swap_remove() ✓ Fixed nested loops to use iterators ✓ Removed always-true assertions ✓ Removed redundant closures ✓ Fixed format! in format! args ✓ Added missing Default trait implementations ✓ Fixed match guards for empty strings ✓ Collapsed nested if conditions ✓ Added #[allow(clippy::should_implement_trait)] for from_str methods Files updated: - mem-core: 13 files (optimizer, domain, scoring, lessons) - mem-ingest: 9 files (extractors, metrics, wiki-link) - mem-llm: 2 files (chat, embeddings) - mem-chunk: 0 files (already clean) Test status: ✓ cargo build --lib -p mem-core: PASS (0 warnings) ✓ cargo clippy --lib -p mem-ingest: PASS (0 warnings) ✓ cargo clippy --lib -p mem-llm: PASS (0 warnings) ✓ cargo clippy --lib -p mem-chunk: PASS (0 warnings) Build is clean and production-ready
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