brainy/tests/unit
David Snelling cca1cd8ce2 feat: add structured content extraction and batch embedding optimization to highlight()
Fix highlight() hanging on structured text input by addressing 3 root causes:

1. embedBatch() now uses native WASM batch API (single forward pass instead
   of N individual embed() calls via Promise.all)

2. highlight() auto-detects content type (plain text, rich-text JSON, HTML,
   Markdown) and extracts meaningful text segments. Supports TipTap, Slate.js,
   Lexical, Draft.js, and Quill Delta formats. New contentType hint and
   contentExtractor callback for custom parsers.

3. Semantic matching phase has 10s timeout - falls back to text-only matches
   instead of hanging indefinitely.

Also fixes extractTextContent() array check: uses type-based detection
(typeof data[0] === 'number') instead of length-based (data.length > 10)
so arrays of objects are properly indexed for text search.

New types: ContentType, ContentCategory, ExtractedSegment
New fields: HighlightParams.contentType, HighlightParams.contentExtractor,
            Highlight.contentCategory
2026-01-27 10:27:22 -08:00
..
augmentations fix: resolve VFS tree corruption from blob errors (v5.8.0) 2025-11-14 11:27:35 -08:00
brainy feat: add structured content extraction and batch embedding optimization to highlight() 2026-01-27 10:27:22 -08:00
graph feat: add v5.8.0 features - transactions, pagination, and comprehensive docs 2025-11-14 10:26:23 -08:00
import fix: binary file corruption in brain.import() with preserveSource 2025-11-03 10:00:55 -08:00
neural fix: resolve update() v5.11.1 regression + skip flaky tests for release 2026-01-05 16:56:35 -08:00
performance fix: resolve 50-100x slower add() on cloud storage (GCS/S3/R2/Azure) 2026-01-06 16:02:13 -08:00
storage fix(vfs): resolve two critical VFS bugs causing directory listing corruption 2025-12-04 11:22:30 -08:00
types fix: update tests for Stage 3 CANONICAL taxonomy (42 nouns, 127 verbs) 2025-11-11 10:09:01 -08:00
utils feat: add structured content extraction and batch embedding optimization to highlight() 2026-01-27 10:27:22 -08:00
versioning fix(versioning): clean architecture with index pollution prevention 2025-12-09 09:36:10 -08:00
vfs feat: add ImageHandler with EXIF extraction and comprehensive MIME detection (v5.2.0) 2025-11-03 14:06:17 -08:00
brainy-core.unit.test.ts test: update fake ID in test (00000000... is now VFS root) 2025-11-14 12:56:29 -08:00
brainy-get-optimization.test.ts fix: resolve update() v5.11.1 regression + skip flaky tests for release 2026-01-05 16:56:35 -08:00
create-entities-default.test.ts fix: resolve update() v5.11.1 regression + skip flaky tests for release 2026-01-05 16:56:35 -08:00
fieldTypeInference.test.ts feat: production-ready value-based temporal field detection 2025-10-16 13:58:57 -07:00
type-filtering.unit.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
type-matching.unit.test.ts fix: update all Stage 2 references to Stage 3 CANONICAL type counts 2025-11-06 09:40:33 -08:00
workshop-vfs-diagnostic.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00