brainy/src/import
David Snelling 6e19ec8566 fix: resolve v5.7.3 race condition by persisting write-through cache (v5.7.4)
Root cause: v5.7.3 cleared write-through cache in brain.flush(), which happens
BETWEEN addMany() and relateMany() in ImportCoordinator - exactly when cache is
needed most.

Changes:
- Remove premature cache.clear() from brain.flush() (brainy.ts:3690-3697)
- Remove unnecessary type cache warming from addMany() (brainy.ts:1859-1877)
- Remove explicit flush() call from ImportCoordinator (ImportCoordinator.ts:1051-1054)

Cache now persists indefinitely, providing safety net for:
- Cloud storage eventual consistency (S3, GCS, Azure, R2)
- Filesystem buffer cache timing
- Type cache warming period (nounTypeCache population)

Cache entries are only removed when explicitly deleted (deleteObjectFromBranch),
not during flush operations. Memory footprint is negligible (<10MB for 100k entities).

This is the correct, ultra-simple fix that v5.7.2 and v5.7.3 were attempting to achieve.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 13:18:53 -08:00
..
BackgroundDeduplicator.ts perf: optimize imports with background deduplication (12-24x speedup) 2025-11-11 14:10:14 -08:00
EntityDeduplicator.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
FormatDetector.ts feat: add ImageHandler with EXIF extraction and comprehensive MIME detection (v5.2.0) 2025-11-03 14:06:17 -08:00
ImportCoordinator.ts fix: resolve v5.7.3 race condition by persisting write-through cache (v5.7.4) 2025-11-12 13:18:53 -08:00
ImportHistory.ts feat: v5.1.0 - VFS auto-initialization and complete API documentation 2025-11-02 10:58:52 -08:00
index.ts perf: optimize imports with background deduplication (12-24x speedup) 2025-11-11 14:10:14 -08:00
InstancePool.ts feat: implement progressive flush intervals for streaming imports 2025-10-22 17:36:27 -07:00