lazyLoadCounts() read the `__sparse_index__noun` blob, but the sparse-index WRITE path was removed in 7.20.0 — new workspaces persist the 'noun' field ONLY to the column store. So on close()+reopen the sparse load found nothing and left every per-type count at 0: counts.byType / byTypeEnum / topTypes / allNounTypeCounts all read empty, while find() / getNounCount() (different sources) stayed correct. Rehydrate from the column store's 'noun' field instead. Its per-value cardinality matches the warm updateTypeFieldAffinity counts exactly because both are driven from the same addToIndex field set, in lockstep, with no visibility gate on either — so syncTypeCountsToFixed (called right after in init) reproduces the warm fixed-array values precisely. Legacy chunked sparse index kept as a fallback for pre-7.20.0 workspaces. Ground-truth verified: 12 Person + 5 Document → cold reopen now reports person:12 / document:5 (was 0), topTypes [person, document, collection]. Tests: un-skipped the intentionally-failing phase1c "warm cache on init" reopen test and strengthened it to exact persisted counts; added a warm==cold element-for-element equality test. 1464 unit + count-sync/multi-process/ clear-persistence integration green. |
||
|---|---|---|
| .. | ||
| advanced-apis-regression.test.ts | ||
| aggregation.test.ts | ||
| all-apis-comprehensive.test.ts | ||
| api-parameter-validation.test.ts | ||
| batchImportWithRelations.test.ts | ||
| brainy-complete.integration.test.ts | ||
| brainy-core.integration.test.ts | ||
| brainy-phase1c-integration.test.ts | ||
| bun-compile-test.ts | ||
| clear-persistence.test.ts | ||
| clear-vfs.test.ts | ||
| cortex-compat.test.ts | ||
| count-synchronization.test.ts | ||
| db-mvcc.test.ts | ||
| entity-confidence-weight.test.ts | ||
| find-limits.test.ts | ||
| find-triple-composition.test.ts | ||
| find-unified-integration.test.ts | ||
| find-where-zero.test.ts | ||
| get-relations-fix.test.ts | ||
| graphIndex-pagination.test.ts | ||
| hnsw-rebuild.test.ts | ||
| hybrid-search-vfs.test.ts | ||
| memory-enhancements-v5.11.0.test.ts | ||
| metadata-only-comprehensive.test.ts | ||
| metadata-vector-exclusion.test.ts | ||
| migration.test.ts | ||
| multi-process-safety.test.ts | ||
| orderby-sort-bug.test.ts | ||
| readAfterWrite.test.ts | ||
| relationship-intelligence.test.ts | ||
| remaining-apis.test.ts | ||
| rev-and-ifabsent.test.ts | ||
| savebinaryblob-concurrent-rename.test.ts | ||
| smart-import.test.ts | ||
| storage-batch-operations.test.ts | ||
| strict-mode-self-test.test.ts | ||
| subtype-and-facets.test.ts | ||
| update-asymmetry.test.ts | ||
| vector-recall.test.ts | ||
| verb-subtype-and-enforcement.test.ts | ||
| vfs-and-graph-entities.test.ts | ||
| vfs-api-wiring.test.ts | ||
| vfs-debug.test.ts | ||
| vfs-import-verification.test.ts | ||
| vfs-knowledge-separation.test.ts | ||
| vfs-performance-v5.11.1.test.ts | ||
| wasm-embeddings.test.ts | ||