{"draft":null,"from":131,"to":132,"files":[{"path":"src/engine/graph.ts","added":14,"removed":0,"diff":"--- a/src/engine/graph.ts\n+++ b/src/engine/graph.ts\n@@ -16,6 +16,7 @@\n \tstartNode,\n } from \"./keys.ts\";\n import { OrderedIndex, orderedChildKey } from \"./ordered-index.ts\";\n+import { withProjectionScratch } from \"./projection-scratch.ts\";\n import {\n \ttype GraphStateStorage,\n \ttype StateMap,\n@@ -635,6 +636,19 @@\n \tget hasOrderedChildren(): boolean {\n \t\treturn this.#storage !== undefined;\n \t}\n+\t/** Synchronous derived work against one graph identity. Scratch never commits. */\n+\twithProjectionScratch<T>(operation: (scratch: GraphStateStorage) => T): T {\n+\t\tif (!this.#storage) throw new Error(\"projection scratch requires persistent graph storage\");\n+\t\tconst size = this.size;\n+\t\tconst lines = this.lineCount;\n+\t\treturn withProjectionScratch(\n+\t\t\tthis.#storage,\n+\t\t\t() => {\n+\t\t\t\tif (this.size !== size || this.lineCount !== lines) throw new Error(\"projection graph identity changed\");\n+\t\t\t},\n+\t\t\toperation,\n+\t\t);\n+\t}\n \t#childPriority(n: number): string {\n \t\tconst seq = this.writerSeqOf(n);\n \t\treturn orderedChildKey({"}],"unmatched":[]}