brainy/tests/integration
David Snelling bb4c0bfb99 fix: add NULL hash guards to prevent v5.3.3 regression
Fixed critical bug where CommitObject.walk() didn't guard against NULL parent
hash, causing "Blob metadata not found: 0000...0000" error when calling
getHistory() on fresh databases.

This is a SYSTEMATIC fix, not just a patch:

Infrastructure:
- src/storage/cow/constants.ts: NEW - NULL_HASH constant and utilities
- Prevents hardcoding errors
- Provides isNullHash() for semantic checks

Bug Fixes:
- src/storage/cow/CommitObject.ts: Guard NULL parent in walk()
- src/storage/cow/BlobStorage.ts: Defensive check rejects NULL hash reads
- src/storage/baseStorage.ts: Use NULL_HASH constant (not hardcoded)
- src/brainy.ts: Use NULL_HASH constant (not hardcoded)

Testing:
- tests/integration/initial-commit-null-parent.test.ts: 5 regression tests
- All 17 tests pass (5 new + 12 existing COW tests)
- Zero regressions

This fix addresses the root cause of 4 consecutive bugs (v5.3.0-v5.3.3):
missing defensive programming for sentinel values in COW storage.

Fixes: Workshop team bug report (v5.3.3 regression)
Tests: 17/17 pass (5 new regression + 12 existing COW)
Build: SUCCESSFUL (zero errors)
2025-11-04 15:39:58 -08:00
..
all-apis-comprehensive.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
api-parameter-validation.test.ts fix: resolve 10 test failures across clustering, metadata, and deletion 2025-10-09 16:33:08 -07:00
azure-storage.test.ts chore(release): 4.0.0 2025-10-17 14:48:34 -07:00
brainy-complete.integration.test.ts fix: resolve 10 test failures across clustering, metadata, and deletion 2025-10-09 16:33:08 -07:00
brainy-core.integration.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
brainy-phase1c-integration.test.ts test: complete Phase 1c integration tests for type-aware API 2025-10-15 14:26:17 -07:00
commit-ref-bug.test.ts feat: add entity versioning system with critical bug fixes (v5.3.0) 2025-11-04 11:19:02 -08:00
count-synchronization.test.ts fix(storage): resolve count synchronization race condition across all storage adapters 2025-10-21 11:19:08 -07:00
cow-commit-storage.test.ts fix: implement type-aware storage prefixes for commits and trees 2025-11-04 15:03:05 -08:00
cow-full-integration.test.ts feat: implement complete v5.0.0 Git-style fork/merge/commit workflow 2025-11-01 11:56:11 -07:00
empty-tree-bug.test.ts fix: create proper initial commit instead of using tree hash for main branch 2025-11-04 13:34:51 -08:00
entity-confidence-weight.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
find-unified-integration.test.ts fix: resolve 10 test failures across clustering, metadata, and deletion 2025-10-09 16:33:08 -07:00
gcs-native-storage.test.ts feat: simplify GCS storage naming and add Cloud Run deployment options 2025-10-20 11:12:32 -07:00
gcs-persistence-fix.test.ts fix: implement unified UUID-based sharding for metadata across all storage adapters 2025-10-08 13:26:35 -07:00
get-relations-fix.test.ts fix: resolve getRelations() empty array bug and add string ID shorthand 2025-10-21 13:10:34 -07:00
history-ref-resolution-bug.test.ts fix: resolve critical COW ref resolution and versioning bugs 2025-11-04 13:05:59 -08:00
hnsw-rebuild.test.ts fix: correct test assertions for addMany return value and use valid VerbType 2025-10-10 14:23:24 -07:00
image-import.test.ts feat: add ImageHandler with EXIF extraction and comprehensive MIME detection (v5.2.0) 2025-11-03 14:06:17 -08:00
initial-commit-null-parent.test.ts fix: add NULL hash guards to prevent v5.3.3 regression 2025-11-04 15:39:58 -08:00
metadata-vector-exclusion.test.ts fix: v3.50.2 emergency hotfix - exclude numeric field names from metadata indexing 2025-10-16 16:31:06 -07:00
phase3TypeFirstQuery.integration.test.ts feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
relationship-intelligence.test.ts fix: createEntities defaults to true, enable AI features by default 2025-10-23 16:54:40 -07:00
remaining-apis.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
s3-storage.test.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
smart-import.test.ts feat: implement progressive flush intervals for streaming imports 2025-10-22 17:36:27 -07:00
typeAwareHNSW.integration.test.ts feat: Phase 2 Type-Aware HNSW - 87% memory reduction @ billion scale 2025-10-15 15:39:28 -07:00
typeInference.hybrid.integration.test.ts feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
typeInference.integration.test.ts feat: Phase 3 - Unified Semantic Type Inference (Nouns + Verbs) 2025-10-16 10:59:26 -07:00
versioning.test.ts feat: add entity versioning system with critical bug fixes (v5.3.0) 2025-11-04 11:19:02 -08:00
vfs-and-graph-entities.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
vfs-api-wiring.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
vfs-debug.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
vfs-import-verification.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00
vfs-knowledge-separation.test.ts fix: update tests for v5.1.0 API changes (VFS auto-init + property access) 2025-11-02 11:38:12 -08:00