From b3ae18be0048e671149f18d1cb4ecc1137859067 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Tue, 2 Dec 2025 11:22:04 -0800 Subject: [PATCH] fix(cow): asOf() fails with "COW not enabled" due to property name mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HistoricalStorageAdapter was looking for underscore-prefixed properties (_commitLog, _blobStorage, _treeObject) but BaseStorage sets them without underscores (commitLog, blobStorage). This caused all asOf() calls to fail. Changes: - Fix property access: use commitLog/blobStorage instead of _commitLog/_blobStorage - Remove unused treeObject property (TreeObject is dynamically imported) - Remove unused TreeObject static import Reported by: Soulcraft Workshop Team 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/storage/adapters/historicalStorageAdapter.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/storage/adapters/historicalStorageAdapter.ts b/src/storage/adapters/historicalStorageAdapter.ts index 17ecb1d9..150c7c5c 100644 --- a/src/storage/adapters/historicalStorageAdapter.ts +++ b/src/storage/adapters/historicalStorageAdapter.ts @@ -30,7 +30,6 @@ import { BaseStorage } from '../baseStorage.js' import { CommitLog } from '../cow/CommitLog.js' -import { TreeObject } from '../cow/TreeObject.js' import { BlobStorage } from '../cow/BlobStorage.js' import { HNSWNoun, @@ -127,7 +126,6 @@ export class HistoricalStorageAdapter extends BaseStorage { // Historical commit state (loaded lazily) - must match BaseStorage visibility public commitLog?: CommitLog - public treeObject?: TreeObject public blobStorage?: BlobStorage constructor(options: HistoricalStorageAdapterOptions) { @@ -146,11 +144,11 @@ export class HistoricalStorageAdapter extends BaseStorage { */ public async init(): Promise { // Get COW components from underlying storage - this.commitLog = (this.underlyingStorage as any)._commitLog - this.treeObject = (this.underlyingStorage as any)._treeObject - this.blobStorage = (this.underlyingStorage as any)._blobStorage + // v6.2.4: Fixed property names - use public properties without underscore prefix + this.commitLog = this.underlyingStorage.commitLog + this.blobStorage = this.underlyingStorage.blobStorage - if (!this.commitLog || !this.treeObject || !this.blobStorage) { + if (!this.commitLog || !this.blobStorage) { throw new Error( 'Historical storage requires underlying storage to have COW enabled. ' + 'Call brain.init() first to initialize COW.'