brainy/src
David Snelling a0fe8f00d2 fix: add atomic writes to ALL file operations to prevent concurrent write corruption
CRITICAL FIX v4.10.3: The v4.10.2 release only fixed VFS initialization but missed the
underlying file corruption bug. During concurrent bulk imports, files were being truncated
because writes were not atomic.

Changes:
1. saveNode() - Added atomic temp+rename pattern for HNSW JSON files (line 252)
2. writeObjectToPath() - Added atomic temp+rename for compressed/uncompressed metadata (line 654)
3. saveEdge() - Added atomic temp+rename for verb JSON files (line 461)

This prevents the Workshop team's reported errors:
- SyntaxError: Unexpected end of JSON input (HNSW files truncated)
- Error: unexpected end of file (compressed metadata truncated)

All file write operations now use atomic temp file + rename sequence:
1. Write to temp file with unique timestamp + random suffix
2. Atomic rename temp → final (OS-level atomicity guarantee)
3. Clean up temp file on error

This matches the atomic pattern already added to saveHNSWData() in v4.10.1,
but now applied consistently across ALL file write operations.
2025-10-29 19:31:00 -07:00
..
api fix(storage): v4.8.0 metadata architecture refactoring - FIXES VFS bug 2025-10-27 15:43:49 -07:00
augmentations feat: comprehensive import progress tracking for all 7 formats 2025-10-24 14:45:46 -07:00
cli feat(vfs): fix VFS visibility by removing broken filtering 2025-10-27 10:44:06 -07:00
config fix: enable GCS native storage with Application Default Credentials 2025-10-09 10:39:54 -07:00
cortex feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
critical feat: add browser environment compatibility support 2025-09-17 15:48:02 -07:00
data feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
distributed feat(v4.0.0): Complete metadata/vector separation architecture with Azure support 2025-10-17 12:29:27 -07:00
embeddings feat(v4.0.0): Complete metadata/vector separation architecture with Azure support 2025-10-17 12:29:27 -07:00
errors feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
graph fix(storage): v4.8.0 metadata architecture refactoring - FIXES VFS bug 2025-10-27 15:43:49 -07:00
hnsw perf: 48-64× faster HNSW bulk imports via concurrent neighbor updates 2025-10-29 16:10:40 -07:00
import fix: resolve HNSW concurrency race condition across all storage adapters 2025-10-29 15:24:20 -07:00
importers fix: VFS not initialized during Excel import, causing 0 files accessible 2025-10-29 19:13:04 -07:00
interfaces feat: implement always-adaptive caching with getCacheStats monitoring 2025-10-10 14:09:30 -07:00
mcp refactor: streamline core API surface 2025-10-04 08:52:06 -07:00
neural fix(storage): v4.8.0 metadata architecture refactoring - FIXES VFS bug 2025-10-27 15:43:49 -07:00
patterns 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
query feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
scripts feat: add node: protocol to all Node.js built-in imports for bundler compatibility 2025-09-17 14:20:21 -07:00
shared refactor: remove deprecated BrainyData class completely 2025-09-30 16:04:00 -07:00
storage fix: add atomic writes to ALL file operations to prevent concurrent write corruption 2025-10-29 19:31:00 -07:00
streaming feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
triple feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
types fix(storage): v4.8.0 metadata architecture refactoring - FIXES VFS bug 2025-10-27 15:43:49 -07:00
universal fix: prevent fs adapter from throwing on import in browser 2025-09-17 16:22:02 -07:00
utils fix: v4.8.1 critical bug fixes for update() and clustering 2025-10-27 17:01:37 -07:00
vfs fix: resolve HNSW concurrency race condition across all storage adapters 2025-10-29 15:24:20 -07:00
augmentationManager.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
augmentationPipeline.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
brainy.ts fix: per-sheet column detection in Excel importer 2025-10-28 14:30:31 -07:00
coreTypes.ts perf: 48-64× faster HNSW bulk imports via concurrent neighbor updates 2025-10-29 16:10:40 -07:00
cortex.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
index.ts feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
pipeline.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
setup.ts chore: enforce consistent coding style and semicolon removal 2025-09-29 09:50:59 -07:00
unified.ts chore: enforce consistent coding style and semicolon removal 2025-09-29 09:50:59 -07:00
worker.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00