open-brainy/src/import
David Snelling dcf20ffa1d fix: resolve import hang and index rebuild data loss bugs
Critical Bug Fixes (v3.43.2):

Bug #1 - Import Infinite Loop:
- Fix placeholder entity infinite loop in ImportCoordinator
- Use exact matching instead of fuzzy .includes() for entity names
- Search entities array (not rows) for existing placeholders
- Add duplicate relationship prevention in brain.relate()

Bug #2 - Index Rebuild File Discovery:
- Fix fileSystemStorage to scan sharded subdirectories
- Update getAllNodes() to use getAllShardedFiles()
- Update getAllEdges() to use getAllShardedFiles()
- Update getNodesByNounType() to use getAllShardedFiles()
- Fix getStorageStatus() to use O(1) persisted counts

Additional Improvements:
- Add brain.flush() API for explicit index persistence
- Make GraphAdjacencyIndex.flush() public
- Add auto-flush at end of import pipeline
- Update duplicate relationship test to expect deduplication

Files Modified:
- src/storage/adapters/fileSystemStorage.ts
- src/import/ImportCoordinator.ts
- src/brainy.ts
- src/graph/graphAdjacencyIndex.ts
- tests/unit/brainy/relate.test.ts
2025-10-14 13:06:32 -07: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 unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
ImportCoordinator.ts fix: resolve import hang and index rebuild data loss bugs 2025-10-14 13:06:32 -07:00
ImportHistory.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
index.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00