A logical snapshot restore could silently lose graph edges on a brain backed by a native provider: the graph adjacency keys on the shared id-mapper's interned ints (sourceInt/targetInt), which are derived + never persisted, and restore() never reloaded the mapper — so a native graph rebuild resolved verb endpoints against a stale/empty mapper and dropped edges. restore() now calls entityIdMapper.rebuild() — a new OPTIONAL method on the EntityIdMapperProvider contract — BEFORE rebuilding the indexes, so a native mapper reloads its int<->uuid from the restored binary KV first and the graph resolves endpoints correctly. The JS mapper deliberately has NO rebuild() and needs none: MetadataIndex.rebuild() re-derives it from the restored entities via append-only getOrAssign, consistently with the bitmaps it builds — forcing a reload there would blank a still-referenced mapping and break find() after a same-instance restore. Contract: graphIndex.rebuild() resolves sourceId/targetId -> ints through the shared mapper itself (brainy does not re-feed resolved endpoints); brainy's only job is to ensure the mapper is reloaded first. Test: relationships survive a snapshot round-trip (db-mvcc.test.ts). 84 generation/temporal/visibility tests green; tsc clean. |
||
|---|---|---|
| .. | ||
| roaring | ||
| adaptiveBackpressure.ts | ||
| BoundedRegistry.ts | ||
| brainyTypes.ts | ||
| callerLocation.ts | ||
| collation.ts | ||
| contentExtractor.ts | ||
| crypto.ts | ||
| deletedItemsIndex.ts | ||
| distance.ts | ||
| embedding.ts | ||
| ensureDeleted.ts | ||
| entityIdMapper.ts | ||
| environment.ts | ||
| fieldNameTracking.ts | ||
| fieldTypeInference.ts | ||
| idNormalization.ts | ||
| import-progress-tracker.ts | ||
| index.ts | ||
| jsonProcessing.ts | ||
| logger.ts | ||
| memoryDetection.ts | ||
| metadataFilter.ts | ||
| metadataIndex.ts | ||
| metadataIndexCache.ts | ||
| metadataIndexChunking.ts | ||
| metadataNamespace.ts | ||
| metadataWriteBuffer.ts | ||
| mutex.ts | ||
| operationUtils.ts | ||
| paramValidation.ts | ||
| performanceMonitor.ts | ||
| rebuildCounts.ts | ||
| recallPreset.ts | ||
| resultRanking.ts | ||
| statisticsCollector.ts | ||
| structuredLogger.ts | ||
| typeUtils.ts | ||
| typeValidation.ts | ||
| unifiedCache.ts | ||
| version.ts | ||
| writeBuffer.ts | ||