brainy/tests/unit/vfs
David Snelling ac29b0e650 fix: vfs.rename() issues a metadata-only update + rollback of fresh adds removes them
Two fixes reported/found by downstream consumers:

(1) vfs.rename() spread the entire fetched entity into brain.update(),
forwarding a vector field that failed the 384-dimension validation when the
entity was fetched without vectors — every rename threw. A rename is a
path/metadata change, never a content change: the update is now metadata-only
(no vector touched, no re-embedding). Regression test covers the verbatim
consumer repro plus cross-directory moves and EEXIST.

(2) AddToHNSWOperation.itemExists() probed an optional getItem capability
with `await (index as any).getItem?.(id)` — `await undefined` resolves
without throwing, so every item was reported as pre-existing and rollback of
fresh adds never removed them, leaving phantom index entries after a failed
transaction. The probe now feature-detects the method and defaults to false
when absent; update flows pair this op with RemoveFromHNSWOperation whose own
rollback restores the prior vector, so reverse-order rollback reconstructs
the original state either way.

1479/1479 unit suite passing.
2026-06-11 14:59:40 -07:00
..
blob-storage-integration.test.ts feat: add ImageHandler with EXIF extraction and comprehensive MIME detection (v5.2.0) 2025-11-03 14:06:17 -08:00
mime-type-detection.test.ts feat: add ImageHandler with EXIF extraction and comprehensive MIME detection (v5.2.0) 2025-11-03 14:06:17 -08:00
vfs-rename-metadata-only.test.ts fix: vfs.rename() issues a metadata-only update + rollback of fresh adds removes them 2026-06-11 14:59:40 -07:00