brainy/tests
David Snelling 2ba69eccdc fix(vfs): resolve two critical VFS bugs causing directory listing corruption
Bug 1: verbCountsByType optimization skipping requested verb types
- After restart, stale statistics could cause VerbType.Contains to be skipped
- readdir() would return empty/incomplete results
- Fixed by never skipping verb types explicitly requested in filter
- Added fast path for sourceId + verbType combo (common VFS pattern)
- Save statistics on first entity of each type (not just every 100th)

Bug 2: UnifiedCache not invalidated on path deletion
- rmdir() cleared local caches but NOT the global UnifiedCache
- When folder recreated, resolve() returned stale entity ID
- Caused "Source entity not found" errors
- Fixed by adding deleteByPrefix() to UnifiedCache
- Fixed invalidatePath() to also clear UnifiedCache entries

Files modified:
- src/storage/baseStorage.ts (verbCountsByType fix + fast path)
- src/utils/unifiedCache.ts (deleteByPrefix method)
- src/vfs/PathResolver.ts (cache invalidation fix)

Tests added:
- tests/unit/storage/vfs-mkdir-bug.test.ts (7 tests)

Reported by: Soulcraft Workshop team

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 11:22:30 -08:00
..
api feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
augmentations/intelligentImport feat: add intelligent import for CSV, Excel, and PDF files 2025-10-01 16:51:03 -07:00
benchmarks feat: remove legacy ImportManager, standardize getStats() API 2025-10-09 11:40:31 -07:00
comprehensive feat: Stage 3 CANONICAL taxonomy with 169 types (v5.5.0) 2025-11-06 09:02:23 -08:00
configs feat: ID-first storage architecture + remove memory-unsafe APIs (v6.0.0) 2025-11-19 16:46:11 -08:00
fixtures/import feat: add intelligent import for CSV, Excel, and PDF files 2025-10-01 16:51:03 -07:00
helpers perf: eliminate N+1 patterns across all APIs for 10-20x faster cloud storage 2025-11-20 15:18:26 -08:00
integration feat: add storage-level batch operations to eliminate N+1 query patterns 2025-11-19 08:59:11 -08:00
manual fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
performance fix: update all Stage 2 references to Stage 3 CANONICAL type counts 2025-11-06 09:40:33 -08:00
regression fix: resolve v5.7.0 deadlock by restoring storage layer separation (v5.7.1) 2025-11-11 15:24:43 -08:00
scripts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
transaction feat: add v5.8.0 features - transactions, pagination, and comprehensive docs 2025-11-14 10:26:23 -08:00
unit fix(vfs): resolve two critical VFS bugs causing directory listing corruption 2025-12-04 11:22:30 -08:00
vfs feat: ID-first storage architecture + remove memory-unsafe APIs (v6.0.0) 2025-11-19 16:46:11 -08:00
brainy-3.test.ts feat: brain.get() metadata-only optimization - Phase 2 (testing) 2025-11-18 15:41:57 -08:00
critical-error-handling.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
critical-neural-validation.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
critical-performance-benchmark.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
distributed-demo.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
model-loading.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
opfs-storage.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
package-size-breakdown.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
package-size-limit.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup-integration.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup-unit.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
streaming-pipeline.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
type-utils.test.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
typeAwareHNSWIndex.test.ts feat: Phase 2 Type-Aware HNSW - 87% memory reduction @ billion scale 2025-10-15 15:39:28 -07:00
typeAwareQueryPlanner.test.ts fix: update all Stage 2 references to Stage 3 CANONICAL type counts 2025-11-06 09:40:33 -08:00