brainy/src/storage
David Snelling e6cc12b64e fix: resolve clear() not deleting COW data and counters
Fixes critical bug where brain.clear() did not fully clear storage:

Root causes:
1. _cow/ directory contents deleted but directory not removed
2. In-memory counters (totalNounCount, totalVerbCount) not reset
3. COW could auto-reinitialize on next operation

Fixes applied:
- FileSystemStorage: Delete entire _cow/ directory with fs.rm()
- OPFSStorage: Delete _cow/ with removeEntry({recursive: true})
- S3CompatibleStorage: Reset counters after clear
- BaseStorage: Guard initializeCOW() against reinit when cowEnabled=false
- All adapters: Reset totalNounCount and totalVerbCount to 0

Impact: Resolves Workshop bug report - storage now properly clears from
103MB to 0 bytes, entity counts correctly return to 0.

GCSStorage, R2Storage, AzureBlobStorage already had correct implementations.
2025-11-11 09:04:56 -08:00
..
adapters fix: resolve clear() not deleting COW data and counters 2025-11-11 09:04:56 -08:00
cow fix: resolve BlobStorage metadata prefix inconsistency 2025-11-05 09:16:26 -08:00
backwardCompatibility.ts fix(storage): clean directory architecture - FileSystemStorage uses entities/nouns/hnsw and entities/verbs/hnsw 2025-10-27 12:23:00 -07:00
baseStorage.ts fix: resolve clear() not deleting COW data and counters 2025-11-11 09:04:56 -08:00
cacheManager.ts feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
enhancedCacheManager.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
enhancedClearOperations.ts feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
readOnlyOptimizations.ts feat: add distributed architecture with sharding and coordination 2025-09-22 15:45:35 -07:00
sharding.ts fix: implement unified UUID-based sharding for metadata across all storage adapters 2025-10-08 13:26:35 -07:00
storageFactory.ts fix: resolve HNSW race condition and verb weight extraction (v5.4.0) 2025-11-05 17:05:07 -08:00