open-brainy/src
David Snelling 9d035aceee fix: metadata index corruption after restart — 6-point integrity fix
Root cause: metadata index failed to reconstruct after deploy restart
because the field registry file (__metadata_field_registry__) was lost
during an interrupted flush. init() silently assumed the workspace was
empty even though 5000+ entities existed on disk.

Fix 1 (root cause): init() now probes storage for entities when field
registry is missing. If entities exist, triggers rebuild instead of
silently skipping. Never trusts a missing registry as "empty."

Fix 2 (safety net): after rebuildIndexesIfNeeded(), verifies metadata
index entry count matches storage entity count. Forces second rebuild
if mismatch detected.

Fix 3 (prevention): flush() now always saves field registry and
EntityIdMapper, even when no dirty fields exist. These tiny files are
the critical link that init() needs to discover persisted indices.

Fix 5 (safe rebuild): rebuild() no longer deletes the field registry
file before rewriting. If rebuild fails partway, the registry survives
for the next init() to discover and re-trigger rebuild.

Fix 6 (collision guard): EntityIdMapper init() warns when mapper file
is missing but entities exist on disk, preventing silent ID collisions
from nextId starting at 1.
2026-03-24 12:57:11 -07:00
..
aggregation feat: add stddev/variance aggregation ops with Welford's online algorithm 2026-02-17 17:04:11 -08:00
api refactor: remove src/cortex/ directory and fix README claims 2026-02-01 11:07:26 -08:00
cli feat: harden plugin system wiring and add developer diagnostics 2026-02-01 13:03:15 -08:00
config fix: remove dead model config code for true zero-config 2025-12-18 10:31:02 -08:00
critical feat: replace transformers.js with direct ONNX WASM for Bun compatibility 2025-12-17 17:42:37 -08:00
data feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
distributed feat(v4.0.0): Complete metadata/vector separation architecture with Azure support 2025-10-17 12:29:27 -07:00
embeddings fix: suppress misleading 'Using Q8 WASM' log when Cortex native is active 2026-03-22 14:53:48 -07:00
errors feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
graph fix: replace require('crypto') with ESM import in SSTable 2026-02-24 12:25:26 -08:00
hnsw perf: defer HNSW persistence during addMany() batch operations 2026-03-22 14:53:11 -07:00
import fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
importers refactor: remove augmentation system and semantic type matching 2026-02-01 10:48:56 -08:00
integrations refactor: remove augmentation system and semantic type matching 2026-02-01 10:48:56 -08:00
interfaces fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
mcp refactor: remove augmentation system and semantic type matching 2026-02-01 10:48:56 -08:00
migration feat: add migration system with error handling, validation, and enterprise hardening 2026-02-09 16:13:14 -08:00
neural feat: enforce data/metadata separation, numeric range queries, improved docs 2026-02-09 12:07:54 -08:00
patterns 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
scripts feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
storage feat: add migration system with error handling, validation, and enterprise hardening 2026-02-09 16:13:14 -08:00
streaming feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
transaction fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
triple fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
types fix: add rootDirectory to BrainyConfig.storage type 2026-03-19 09:46:11 -07:00
universal fix: prevent fs adapter from throwing on import in browser 2025-09-17 16:22:02 -07:00
utils fix: metadata index corruption after restart — 6-point integrity fix 2026-03-24 12:57:11 -07:00
versioning fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
vfs fix: set verb.source/target to entity UUID instead of NounType 2026-02-02 09:20:38 -08:00
brainy.ts fix: metadata index corruption after restart — 6-point integrity fix 2026-03-24 12:57:11 -07:00
coreTypes.ts feat: enforce data/metadata separation, numeric range queries, improved docs 2026-02-09 12:07:54 -08:00
index.ts feat: add stddev/variance aggregation ops with Welford's online algorithm 2026-02-17 17:04:11 -08:00
internals.ts fix: flush all native providers on shutdown to prevent data loss 2026-02-01 16:23:49 -08:00
pipeline.ts refactor: remove augmentation system and semantic type matching 2026-02-01 10:48:56 -08:00
plugin.ts feat: add aggregation engine with incremental SUM/COUNT/AVG/MIN/MAX, GROUP BY, and time windows 2026-02-16 16:57:53 -08:00
setup.ts fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
unified.ts chore: enforce consistent coding style and semicolon removal 2025-09-29 09:50:59 -07:00
worker.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00