open-brainy/tests/vfs
David Snelling 258e9042af fix(add): empty string is real data, not a missing field
validateAddParams() treated '' as falsy and rejected it with "Missing
required field 'data'" — so a legitimate empty file's first write always
failed. Only null/undefined data (with no vector either) is genuinely
absent; '' is real content. Fixed the check, plus the identical bug in
validateUpdateParams() (truncating a file to empty via overwrite hit the
same falsy check) and in update()/transact()'s update planner, where a
plain `Boolean(params.data)`/truthy check on the resolved vector would have
silently skipped both the deferred-embed marker and the eager re-embed for
an emptied value — a stale vector with no path to ever correct itself.

Verified end-to-end: vfs.writeFile('/empty.txt', '') now succeeds,
readFile() returns '', the file lists, and stat() reports size 0; the
existing "should reject empty string as data" tests (unit + integration)
asserted the old buggy behavior and are updated to assert the fixed
contract instead.
2026-08-25 10:10:19 -07:00
..
semantic feat: add neural extraction APIs with NounType taxonomy 2025-09-29 13:51:47 -07:00
tree-operations.unit.test.ts test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00
vfs-bug-fixes.unit.test.ts feat(8.0)!: flip requireSubtype default to true (BRAINY-8.0-SUBTYPE-CONTRACT § C-1) 2026-06-09 14:58:25 -07:00
vfs-bulkwrite-race.unit.test.ts test(8.0): re-home orphaned test files into the gate + guard against recurrence 2026-06-29 11:47:18 -07:00
vfs-initialization.unit.test.ts refactor(8.0): remove dead, unreachable, and unwired modules 2026-06-24 15:18:40 -07:00
vfs.unit.test.ts fix(add): empty string is real data, not a missing field 2026-08-25 10:10:19 -07:00