Fixed critical bug where BlobStorage hardcoded 'blob:' prefix in 10 locations,
ignoring the 'type' parameter passed to write operations. This caused:
- Commits stored as blob:${hash} instead of commit:${hash}
- Trees stored as blob:${hash} instead of tree:${hash}
- brain.getHistory() returning empty arrays
Changes:
- src/storage/cow/BlobStorage.ts: Implement type-aware prefixes in 10 methods
- write(), read(), has(), delete(), getMetadata(), listBlobs()
- writeMultipart(), incrementRefCount(), decrementRefCount()
- tests/integration/cow-commit-storage.test.ts: Add regression tests (6 tests)
Backward compatibility: read() auto-detects type by trying commit:, tree:, blob:
prefixes, allowing old blob:* files to be read.
Works for ALL storage adapters (filesystem, S3, Azure, GCS, R2, memory, OPFS).
Fixes: Workshop team bug report (getHistory returns empty despite commits)
Tests: 6/6 new tests pass, 6/6 existing COW tests pass (no regressions)
|
||
|---|---|---|
| .. | ||
| api | ||
| augmentations/intelligentImport | ||
| benchmarks | ||
| comprehensive | ||
| configs | ||
| fixtures/import | ||
| helpers | ||
| integration | ||
| manual | ||
| performance | ||
| scripts | ||
| unit | ||
| vfs | ||
| brainy-3.test.ts | ||
| critical-error-handling.test.ts | ||
| critical-neural-validation.test.ts | ||
| critical-performance-benchmark.test.ts | ||
| distributed-demo.test.ts | ||
| model-loading.test.ts | ||
| opfs-storage.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| setup-integration.ts | ||
| setup-unit.ts | ||
| setup.ts | ||
| streaming-pipeline.test.ts | ||
| type-utils.test.ts | ||
| typeAwareHNSWIndex.test.ts | ||
| typeAwareQueryPlanner.test.ts | ||