open-brainy/tests/unit/brainy
David Snelling fd699d0e07 fix: never serve a silent [] from find({connected}) on a cold-loaded graph
On a cold process start of a large brain (above the eager index-rebuild
threshold), a native graph adjacency can report size()>0 — its membership set
reloaded — while the source->target edges did NOT load, so find({connected}),
neighbors() and related() returned [] for edges that are persisted on disk. A
database returning empty for data that exists, based purely on warm/cold state,
is a correctness bug; it hit a production deployment after every deploy.

Refactor the cold-load guard into verifyGraphAdjacencyLive(), which gates its
heal/throw decision on a GLOBAL known-edge sample (a persisted verb's source,
which by definition has an outgoing edge) rather than the queried anchor: a
stale adjacency is rebuilt from storage, an unrecoverable one throws
GraphIndexNotReadyError instead of serving [], and a genuinely edgeless anchor
still returns [] with no spurious rebuild. executeGraphSearch re-verifies before
trusting an empty connected result and re-collects after a heal. Adds a 5-case
integration test (self-heal / loud-throw / edgeless-no-false-positive / healthy
/ re-collect) plus updated unit coverage.
2026-06-29 16:40:02 -07:00
..
add.test.ts fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
batch-operations.test.ts fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
counts-by-type-fix.test.ts fix: recalibrate find({ limit }) cap + two-tier enforcement + caller location 2026-06-08 12:49:43 -07:00
find-index-integrity-guard.test.ts fix: re-validate find() results against the predicate (index-integrity guard) 2026-06-24 16:36:50 -07:00
find.test.ts fix: resolve 19 critical test failures for production readiness 2025-10-09 16:58:53 -07:00
get.test.ts feat: brain.get() metadata-only optimization - Phase 2 (testing) 2025-11-18 15:41:57 -08:00
graph-adjacency-cold-load.test.ts fix: never serve a silent [] from find({connected}) on a cold-loaded graph 2026-06-29 16:40:02 -07:00
hybrid-search.test.ts feat: expand ContentCategory to universal 6-category set for highlight() 2026-01-27 13:44:58 -08:00
relate-duplicate-optimization.test.ts feat: add v5.8.0 features - transactions, pagination, and comprehensive docs 2025-11-14 10:26:23 -08:00
relate.test.ts fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
update-reserved-metadata-remap.test.ts fix: remap reserved fields from update() metadata patches to their canonical location 2026-06-11 10:35:08 -07:00
update.test.ts fix: resolve update() v5.11.1 regression + skip flaky tests for release 2026-01-05 16:56:35 -08:00
visibility.test.ts feat: visibility tier (public/internal/system) on nouns + verbs 2026-06-19 16:40:35 -07:00