brainy/tests/unit
David Snelling e600865d96 fix: metadata explosion bug - 69K files reduced to ~1K
Critical fix for metadata indexing that was creating 60+ chunk files per entity.

Root cause: Vector embeddings (384-dimensional arrays) were being indexed in
metadata, causing each dimension to create a separate chunk file with numeric
field names ("0", "1", "2", etc.).

Changes:
- Modified extractIndexableFields() to exclude vector/embedding fields
- Added NEVER_INDEX set: ['vector', 'embedding', 'embeddings', 'connections']
- Added safety check to skip arrays > 10 elements
- Preserves small array indexing (tags, categories, roles)

Impact:
- Reduces metadata files from 69,429 → ~1,200 (58x reduction)
- Fixes server initialization hangs
- Fixes metadata batch loading stalling at batch 23
- Fixes VFS getDescendants() hanging with large datasets
- Fixes Graph View UI not loading

Test Results:
- 7/7 integration tests passing
- Verified: 6 chunk files for 10 entities (was 7,210 before fix)
- 611/622 unit tests passing

Files Modified:
- src/utils/metadataIndex.ts - Core fix
- src/coreTypes.ts - HNSWVerb type enforcement with VerbType enum
- src/storage/adapters/* - Include core relational fields in HNSWVerb
- src/storage/adapters/baseStorageAdapter.ts - Type enforcement (HNSWNoun, GraphVerb)
- tests/integration/metadata-vector-exclusion.test.ts - Comprehensive test coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 16:10:31 -07:00
..
augmentations feat: add distributed architecture with sharding and coordination 2025-09-22 15:45:35 -07:00
brainy fix: resolve import hang and index rebuild data loss bugs 2025-10-14 13:06:32 -07:00
neural test: skip failing domain-time-clustering tests temporarily 2025-10-13 13:52:35 -07:00
storage fix: metadata explosion bug - 69K files reduced to ~1K 2025-10-16 16:10:31 -07:00
types feat(types): Phase 0 - Type System Foundation for billion-scale optimization 2025-10-15 12:26:25 -07:00
utils feat(metadata): Phase 1b - TypeFirstMetadataIndex with fixed-size type tracking 2025-10-15 13:52:21 -07:00
brainy-core.unit.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
fieldTypeInference.test.ts feat: production-ready value-based temporal field detection 2025-10-16 13:58:57 -07:00
type-matching.unit.test.ts test: adjust type-matching tests for real embeddings (v3.33.0) 2025-10-09 18:32:14 -07:00