{"draft":null,"from":110,"to":111,"files":[{"path":"worker/project/project.ts","added":6,"removed":5,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -14,6 +14,7 @@\n \n import { type Atom, type AtomId, EngineError, Graph, type LineId, type View } from \"../../src/engine/index.ts\";\n import {\n+\tCachedStateStorage,\n \ttype GraphStateStorage,\n \tStableOverlaySet,\n \tStableSet,\n@@ -346,9 +347,9 @@\n \n \tconstructor(store: ProjectStore, options: ProjectOptions = {}, checkpoint?: typeof WRITER_REOPEN) {\n \t\tthis.#store = store;\n-\t\tthis.#writerStorage = options.writerStorage;\n-\t\tif (options.writerStorage) {\n-\t\t\tconst storage = options.writerStorage;\n+\t\tthis.#writerStorage = options.writerStorage ? new CachedStateStorage(options.writerStorage) : undefined;\n+\t\tif (this.#writerStorage) {\n+\t\t\tconst storage = this.#writerStorage;\n \t\t\t// A stored Graph cannot be replayed over itself. Check before any\n \t\t\t// constructor writes so an accidental reopen preserves the namespace.\n \t\t\tif (\n@@ -398,8 +399,8 @@\n \t\t\tthrow new Error(`log entry ${at} holds no atom ${seq}`);\n \t\t};\n \t\t// Line text and each atom's deletes and claim keys stay in the log (#46), read back when asked for.\n-\t\tthis.#graph = options.writerStorage\n-\t\t\t? new Graph({ storage: options.writerStorage })\n+\t\tthis.#graph = this.#writerStorage\n+\t\t\t? new Graph({ storage: this.#writerStorage })\n \t\t\t: entryAt\n \t\t\t\t? new Graph({ texts: (seq) => stored(seq).inserts.map((r) => r.lines), lists: (seq) => stored(seq) })\n \t\t\t\t: new Graph();"}],"unmatched":[]}