brainy/src/vfs/index.ts
David Snelling 364360d447 fix: exclude __words__ keyword index from corruption detection and getStats()
The __words__ keyword index stores 50-5000 entries per entity (one per
word), which inflated avg entries/entity well above the corruption
threshold of 100. This caused:

1. validateConsistency() to falsely detect corruption on every startup,
   triggering unnecessary clearAllIndexData() + rebuild() cycles
2. getStats() to log false "Metadata index may be corrupted" warnings
   and report inflated totalEntries/totalIds stats

Both methods now skip __words__ when counting, so stats and health
checks reflect metadata fields only (noun, type, createdAt, etc.).
Keyword search is unaffected since the __words__ field index itself
is not modified.
2026-01-27 15:38:21 -08:00

27 lines
No EOL
809 B
TypeScript

/**
* Brainy Virtual Filesystem
*
* A simplified fs-compatible filesystem that stores data in Brainy
* Works across all storage adapters and scales to millions of files
*/
// Core VFS
export { VirtualFileSystem } from './VirtualFileSystem.js'
export { PathResolver } from './PathResolver.js'
export * from './types.js'
// MIME Type Detection
export { MimeTypeDetector, mimeDetector } from './MimeTypeDetector.js'
// fs compatibility layer
export { FSCompat, createFS } from './FSCompat.js'
// Directory import
export { DirectoryImporter } from './importers/DirectoryImporter.js'
// Streaming
export { VFSReadStream } from './streams/VFSReadStream.js'
export { VFSWriteStream } from './streams/VFSWriteStream.js'
// Convenience alias
export { VirtualFileSystem as VFS } from './VirtualFileSystem.js'