brainy/tests/unit/storage
David Snelling edff637bfa fix: getNouns().totalCount reports true total, not page size; quiet benign mmap-vector log
getNounsWithPagination returned collectedNouns.length as totalCount, but the
type-first shard scan early-terminates at offset+limit — so
getNouns({ pagination: { limit: 1 } }).totalCount was 1 for any non-empty brain.
The index-rebuild gate calls exactly that, so cold starts logged
"Small dataset (1 items) - rebuilding all indexes" and rebuilt from scratch
regardless of corpus size (a production deployment saw this for an ~8,800-entity
brain). Now reports the authoritative O(1) noun counter (maintained on add/delete,
rehydrated from counts.json on init) as the unfiltered total and derives hasMore
from it. Filtered scans unchanged. Layout-independent (branch/COW included).

Also downgrade the "mmap-vector backend not wired" console.log to prodLog.debug:
it is benign in the native-vector-index model (the native provider owns its own
vector storage and has no setVectorBackend hook), but it fired on every init and
was repeatedly mistaken for the cold-start cause.

Regression: tests/unit/storage/getNouns-totalCount.test.ts. Full unit suite green (1505).
2026-06-17 14:01:33 -07:00
..
cow feat: content-type-aware compression policy in COW BlobStorage (2.5.0 #32) 2026-05-28 11:55:10 -07:00
binaryBlob.test.ts feat(storage): add raw binary-blob primitive to every storage adapter 2026-05-27 11:50:04 -07:00
fileSystemStorage-rootDirectory.test.ts fix: query-cap memory misread (MemAvailable + floor) + rootDirectory getter for native mmap fast-path 2026-06-16 08:46:39 -07:00
getNouns-totalCount.test.ts fix: getNouns().totalCount reports true total, not page size; quiet benign mmap-vector log 2026-06-17 14:01:33 -07:00
vfs-mkdir-bug.test.ts fix(vfs): resolve two critical VFS bugs causing directory listing corruption 2025-12-04 11:22:30 -08:00