• v5.10.1 9a8b7a6cd4

    dpsifr released this 2025-11-15 00:31:13 +01:00 | 547 commits to main since this release

    🚨 CRITICAL HOTFIX - Blob Integrity Regression

    v5.10.0 regressed the v5.7.2 blob integrity bug, causing 100% VFS file read failure. This hotfix restores functionality with defense-in-depth architecture.

    Problem Fixed

    • Symptom: Blob integrity check failed: <hash> errors on every VFS file read
    • Root Cause: Missing defense-in-depth unwrap verification in BlobStorage.read()
    • Impact: 100% failure rate for VFS file operations in Workshop application

    The Solution (v5.10.1)

    1. Defense-in-Depth Architecture

    • Unwrap at BOTH layers: adapter (v5.7.5) AND blob layer (v5.10.1)
    • Works even if adapter fails to unwrap or is buggy
    • Metadata also unwrapped before parsing

    2. DRY Principle - Single Source of Truth

    • Created binaryDataCodec.ts as single source of truth
    • All wrap/unwrap operations use shared utilities
    • Works across ALL 8 storage adapters

    3. Comprehensive Testing

    • Created TestWrappingAdapter.ts that actually wraps data like production
    • Added 3 regression tests that would have caught this bug
    • All tests pass ✓

    Files Modified

    NEW:

    • src/storage/cow/binaryDataCodec.ts - Single source of truth for binary encoding/decoding
    • tests/helpers/TestWrappingAdapter.ts - Real wrapping adapter for testing

    FIXED:

    • src/storage/cow/BlobStorage.ts:314,342 - Defense-in-depth unwrap for metadata & data
    • src/storage/baseStorage.ts:332,340 - Uses shared binaryDataCodec utilities
    • tests/unit/storage/cow/BlobStorage.test.ts:513-610 - 3 regression tests

    Architecture Improvements

    • Defense-in-Depth: Unwrap at BOTH adapter and blob layers
    • DRY Principle: All wrap/unwrap operations use shared binaryDataCodec.ts
    • Works Across ALL 8 Storage Adapters: FileSystem, Memory, S3, GCS, Azure, R2, OPFS, Historical
    • Prevents Future Regressions: Real wrapping tests catch this bug class
    • v5.7.2: Original blob integrity bug - hashed wrapper instead of content
    • v5.7.5: First fix - added unwrap to COW adapter (necessary but insufficient)
    • v5.10.0: Regression - missing defense-in-depth in BlobStorage layer
    • v5.10.1: Complete fix - defense-in-depth + DRY architecture + comprehensive tests

    Installation

    npm install @soulcraft/brainy@5.10.1
    

    Verification

    • Build: Zero TypeScript errors
    • Tests: All 3 regression tests pass
    • Architecture: DRY, defense-in-depth, works across all adapters
    Downloads