@soulcraft/brainy 5.7.7 → 5.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [5.7.8](https://github.com/soulcraftlabs/brainy/compare/v5.7.7...v5.7.8) (2025-11-13)
6
+
7
+ - fix: reconstruct Map from JSON for HNSW connections (v5.7.8 hotfix) (f6f2717)
8
+
9
+
5
10
  ### [5.7.7](https://github.com/soulcraftlabs/brainy/compare/v5.7.6...v5.7.7) (2025-11-13)
6
11
 
7
12
  - docs: update index architecture documentation for v5.7.7 lazy loading (67039fc)
@@ -925,9 +925,24 @@ export class BaseStorage extends BaseStorageAdapter {
925
925
  continue;
926
926
  }
927
927
  }
928
+ // v5.7.8: Convert connections from plain object to Map (JSON deserialization fix)
929
+ // When loaded from JSON, Map becomes plain object - must reconstruct
930
+ const connections = new Map();
931
+ if (noun.connections && typeof noun.connections === 'object') {
932
+ for (const [levelStr, ids] of Object.entries(noun.connections)) {
933
+ if (Array.isArray(ids)) {
934
+ connections.set(parseInt(levelStr, 10), new Set(ids));
935
+ }
936
+ else if (ids && typeof ids === 'object') {
937
+ // Handle if it's already an array-like or Set-like object
938
+ connections.set(parseInt(levelStr, 10), new Set(Object.values(ids)));
939
+ }
940
+ }
941
+ }
928
942
  // Combine noun + metadata (v5.4.0: Extract standard fields to top-level)
929
943
  collectedNouns.push({
930
944
  ...noun,
945
+ connections, // Use reconstructed Map instead of plain object
931
946
  type: metadata.noun || type, // Required: Extract type from metadata
932
947
  confidence: metadata.confidence,
933
948
  weight: metadata.weight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "5.7.7",
3
+ "version": "5.7.8",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. Stage 3 CANONICAL: 42 nouns × 127 verbs covering 96-97% of all human knowledge.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",