{"draft":null,"from":138,"to":139,"files":[{"path":"src/engine/graph.ts","added":26,"removed":0,"diff":"--- a/src/engine/graph.ts\n+++ b/src/engine/graph.ts\n@@ -947,6 +947,32 @@\n \t */\n \t#reaches(from: Iterable<AtomId>, target: AtomId): boolean {\n \t\tconst floor = this.#lamport[this.#seq(target)]!;\n+\t\tif (this.#storage) {\n+\t\t\t// Roots belong to the current atom's dependency list, not its history.\n+\t\t\tconst roots = [...from];\n+\t\t\tif (roots.includes(target)) return true;\n+\t\t\tif (roots.every((id) => this.#lamport[this.#seq(id)]! <= floor)) return false;\n+\t\t\treturn this.withProjectionScratch((scratch) => {\n+\t\t\t\tlet length = 0;\n+\t\t\t\tconst push = (id: AtomId): void => {\n+\t\t\t\t\tif (scratch.read(\"seen\", id)) return;\n+\t\t\t\t\tscratch.write(\"seen\", id, true);\n+\t\t\t\t\tscratch.write(\"stack\", String(length++), id);\n+\t\t\t\t};\n+\t\t\t\tfor (const id of roots) push(id);\n+\t\t\t\twhile (length > 0) {\n+\t\t\t\t\tconst key = String(--length);\n+\t\t\t\t\tconst current = scratch.read(\"stack\", key) as AtomId;\n+\t\t\t\t\tscratch.remove(\"stack\", key);\n+\t\t\t\t\tif (this.#lamport[this.#seq(current)]! <= floor) continue;\n+\t\t\t\t\tfor (const dependency of this.atom(current).deps) {\n+\t\t\t\t\t\tif (dependency === target) return true;\n+\t\t\t\t\t\tpush(dependency);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\treturn false;\n+\t\t\t});\n+\t\t}\n \t\tconst seen = new Set<AtomId>();\n \t\tconst stack = [...from];\n \t\twhile (stack.length > 0) {"}],"unmatched":[]}