brainy/tests/unit
David Snelling 8e7b52bda9 fix: correct cache eviction formula to prioritize high-value items
Fixed inverted eviction scoring formula in UnifiedCache that was causing
metadata (cheap to rebuild) to be retained while HNSW vectors (expensive,
frequently accessed) were evicted. This was causing OOM crashes during
large Excel imports with relationship extraction.

Changes:
- evictLowestValue(): Changed accessScore / rebuildCost to accessScore * rebuildCost
- evictForSize(): Changed accessScore / rebuildCost to accessScore * rebuildCost
- evictType(): Changed accessScore / rebuildCost to accessScore * rebuildCost

With the corrected formula, items with higher access counts AND higher
rebuild costs get higher scores and are protected from eviction.

Test coverage: Added comprehensive eviction scoring tests

Fixes: Type metadata hogging 99.7% of cache with only 3.7% access rate
2025-10-13 11:21:19 -07:00
..
augmentations feat: add distributed architecture with sharding and coordination 2025-09-22 15:45:35 -07:00
brainy test: skip flaky delete cache invalidation test (see 8476047, c64967d) 2025-10-10 14:26:56 -07:00
neural test: adjust type-matching tests for real embeddings (v3.33.0) 2025-10-09 18:32:14 -07:00
utils fix: correct cache eviction formula to prioritize high-value items 2025-10-13 11:21:19 -07:00
brainy-core.unit.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
type-matching.unit.test.ts test: adjust type-matching tests for real embeddings (v3.33.0) 2025-10-09 18:32:14 -07:00