• v5.7.8 4c1b60e2b1

    dpsifr released this 2025-11-13 19:46:11 +01:00 | 572 commits to main since this release

    v5.7.8: CRITICAL HOTFIX - HNSW Connections Deserialization

    Critical Bug Fixed

    Fixed "noun.connections.entries is not a function" error reported by Workshop team when using v5.7.7 with lazy loading.

    Root Cause

    When HNSW data was loaded from JSON storage via getNounsWithPagination(), the connections field (which should be Map<number, Set<string>>) was deserialized as a plain JavaScript object {}. Subsequent code that expected a Map with .entries() method would crash.

    The Fix

    Added defensive deserialization in baseStorage.ts:1156-1168 to reconstruct the Map and Sets from plain objects when loading from storage:

    // v5.7.8: Convert connections from plain object to Map (JSON deserialization fix)
    const connections = new Map<number, Set<string>>()
    if (noun.connections && typeof noun.connections === 'object') {
      for (const [levelStr, ids] of Object.entries(noun.connections)) {
        if (Array.isArray(ids)) {
          connections.set(parseInt(levelStr, 10), new Set<string>(ids))
        }
      }
    }
    

    Impact

    • Fixes HNSW index rebuild failures
    • Workshop team can now use v5.7.7+ lazy loading without crashes
    • All existing data formats supported (defensive checks)
    • No data migration required

    Upgrade

    npm install @soulcraft/brainy@5.7.8
    

    No code changes needed - existing applications work automatically.

    For Workshop Team

    This fixes the blocking issue you reported. The lazy loading feature from v5.7.7 will now work correctly with your existing data.

    Testing:

    • Build: PASS
    • Unit tests: PASS (1,032/1,032 tests)
    • Published: npm @soulcraft/brainy@5.7.8

    Full Changelog: https://github.com/soulcraftlabs/brainy/compare/v5.7.7...v5.7.8

    Downloads