Workshop team reported that brain.clear() doesn't fully delete persistent storage. After calling clear() and creating a new Brainy instance, all data was restored from storage. This is a CRITICAL data integrity bug. Root causes (3 bugs fixed): 1. **FileSystemStorage deleting wrong directory**: Data stored in branches/main/entities/ but clear() was only deleting old pre-v5.4.0 structure (nouns/, verbs/, metadata/) 2. **COW reinitialization after clear()**: Setting cowEnabled=false on old instance doesn't affect new instances. Fixed with persistent marker file. 3. **Metadata index cache not cleared**: find() with type filters returned stale data after clear(). Fixed by recreating MetadataIndexManager. Changes: - FileSystemStorage: Clear branches/ directory (where data actually lives) - All storage adapters: Add checkClearMarker()/createClearMarker() methods - BaseStorage: Check for cow-disabled marker before initializing COW - Brainy: Recreate metadataIndex after clear() to flush cached data - Tests: Comprehensive regression suite (8 tests) to prevent recurrence Fixes Workshop bug report: /media/dpsifr/storage/home/Projects/workshop/BRAINY_V5_10_2_CLEAR_BUG.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| augmentations/intelligentImport | ||
| benchmarks | ||
| comprehensive | ||
| configs | ||
| fixtures/import | ||
| helpers | ||
| integration | ||
| manual | ||
| performance | ||
| regression | ||
| scripts | ||
| transaction | ||
| unit | ||
| vfs | ||
| brainy-3.test.ts | ||
| critical-error-handling.test.ts | ||
| critical-neural-validation.test.ts | ||
| critical-performance-benchmark.test.ts | ||
| distributed-demo.test.ts | ||
| model-loading.test.ts | ||
| opfs-storage.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| setup-integration.ts | ||
| setup-unit.ts | ||
| setup.ts | ||
| streaming-pipeline.test.ts | ||
| type-utils.test.ts | ||
| typeAwareHNSWIndex.test.ts | ||
| typeAwareQueryPlanner.test.ts | ||