The JS fallback EntityIdMapper caps at u32::MAX to match the metadata index's Roaring32 bitmap width. Before this guard, a brain past 4.29 B entities would silently widen `nextId` into JS's safe-integer range, truncating ints inside the bitmaps and zeroing query results — the same silent under-count cortex 3.0's Piece 10 just closed on the native path. Brainy 8.0 surfaces the overflow loudly instead. When `nextId` would exceed `U32_ENTITY_ID_MAX`, `getOrAssign` throws `EntityIdSpaceExceeded` with a message pointing at the cortex 3.0 binary mapper's `idSpace: 'u64'` mode as the migration path (mmap- backed extendible-hash KV, persists the full u64 range losslessly). The existing-UUID lookup path bypasses the guard — only fresh allocations can overflow. Surfaces via `@soulcraft/brainy/internals`: - `EntityIdMapper` (already exported, behavior gated) - `EntityIdSpaceExceeded` (new) - `U32_ENTITY_ID_MAX` (new constant, = 0xFFFF_FFFF) This is the lockstep half of cortex 3.0 / Piece 10 / Step 15. Cortex's `NativeBinaryEntityIdMapperWrapper` ships the U64 binary mapper that takes over above this ceiling; brainy ships the bright-line failure that points consumers at it. New test: tests/unit/utils/entity-id-mapper-u32-ceiling.test.ts (6 assertions covering the constant, the error shape, normal allocations, the boundary case at exactly u32::MAX, the overflow throw, and the existing-uuid lookup bypass). |
||
|---|---|---|
| .. | ||
| api | ||
| benchmarks | ||
| comprehensive | ||
| configs | ||
| fixtures/import | ||
| helpers | ||
| integration | ||
| integrations | ||
| manual | ||
| 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 | ||
| distributed-demo.test.ts | ||
| model-loading.test.ts | ||
| opfs-storage.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| setup-integration.ts | ||
| setup-unit.ts | ||
| setup.ts | ||
| streaming-pipeline.test.ts | ||
| type-utils.test.ts | ||
| typeAwareHNSWIndex.test.ts | ||