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. |
||
|---|---|---|
| .. | ||
| api | ||
| benchmarks | ||
| comprehensive | ||
| configs | ||
| fixtures/import | ||
| helpers | ||
| integration | ||
| integrations | ||
| performance | ||
| regression | ||
| scripts | ||
| transaction | ||
| unit | ||
| vfs | ||
| brainy-3.test.ts | ||
| critical-error-handling.test.ts | ||
| critical-neural-validation.test.ts | ||
| critical-performance-benchmark.test.ts | ||
| model-loading.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| setup-integration.ts | ||
| setup-semantic.ts | ||
| setup-unit.ts | ||
| setup.ts | ||
| streaming-pipeline.test.ts | ||
| type-utils.test.ts | ||