• v3.43.2 f0d2f473c8

    dpsifr released this 2025-10-14 22:07:31 +02:00 | 782 commits to main since this release

    Critical Bug Fixes

    This release addresses two P0 critical bugs reported by the Soulcraft Studio team that caused complete data loss after server restarts.

    Bug #1: Import Infinite Loop (CRITICAL)

    Fixed placeholder entity infinite loop in ImportCoordinator that prevented imports from completing:

    • 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()
    • Imports now complete successfully without creating infinite duplicate relationships

    Bug #2: Index Rebuild File Discovery (CRITICAL)

    Fixed fileSystemStorage to properly discover files in 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
    • Index rebuild now discovers all entities instead of showing 0

    Additional Improvements

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

    Impact

    These fixes restore data persistence across server restarts and allow imports to complete successfully. All imported data now survives restarts and is properly accessible.

    For the Soulcraft Studio team: Please test with your 567-row Excel import and verify that:

    1. Import completes successfully (no infinite loop)
    2. After server restart, all 4000+ entities are discovered and accessible
    3. Data persists correctly to disk

    Files Modified

    • src/storage/adapters/fileSystemStorage.ts
    • src/import/ImportCoordinator.ts
    • src/brainy.ts
    • src/graph/graphAdjacencyIndex.ts
    • tests/unit/brainy/relate.test.ts
    Downloads