-
v5.1.1 - Critical Bug Fixes Stable
released this
2025-11-03 16:59:04 +01:00 | 630 commits to main since this release🐛 Critical Bug Fixes
update() Method - Entities Disappeared on Type Change
Fixed two critical bugs that caused entities to become unfindable after updating their type:
Bug #1: Index Type Mismatch
- Issue: When re-adding to TypeAwareHNSWIndex after type change, code used
existing.typeinstead ofnewType - Impact: Entities were indexed under the wrong type, making them completely unfindable
- Fix: Use
newTypewhen callingindex.addItem()(src/brainy.ts:643)
Bug #2: Metadata/Vector Save Order
- Issue:
saveNoun()was called beforesaveNounMetadata(), so the type cache wasn't updated - Impact: TypeAwareStorage saved entities to the wrong type shard (e.g., saved to
thing/but cache pointed todocument/), causing complete data loss - Fix: Call
saveNounMetadata()FIRST to update type cache before saving vector (src/brainy.ts:676-688)
Severity: Both bugs caused complete data loss when changing entity types via
update(). This is a critical fix for anyone using theupdate()method with type changes.
✅ Test Suite Improvements
Achieved 100% test pass rate (1030/1030 tests passing):
Fixed Test Issues:
- 3 augmentation tests - Updated for v5.1.0 stricter UUID validation API
- 3 add tests - Replaced invalid UUID test data with valid format
- 1 batch operations test - Increased timeout from 5000ms to 6000ms
- 3 neural tests - Added proper memory storage configuration
Results:
- Before: 1020/1051 passing (97.0%)
- After: 1030/1030 passing (100%) ✅
- All critical systems verified: VFS, COW, Core APIs, Batch Operations, Neural
📦 Files Changed
Source Code: 1 file
src/brainy.ts- Fixed 2 critical bugs inupdate()method
Tests: 4 files
tests/unit/augmentations/augmentations-simplified.test.tstests/unit/brainy/add.test.tstests/unit/brainy/batch-operations.test.tstests/unit/neural/neural-simplified.test.ts
🚀 Upgrade
npm install @soulcraft/brainy@5.1.1Highly recommended for anyone using
update()to change entity types.Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
1 download
- Issue: When re-adding to TypeAwareHNSWIndex after type change, code used