{"draft":null,"from":234,"to":235,"files":[{"path":"src/engine/view.ts","added":25,"removed":2,"diff":"--- a/src/engine/view.ts\n+++ b/src/engine/view.ts\n@@ -49,7 +49,7 @@\n /** Structural read boundary shared by historical and transaction-bound projections. */\n export type ReadView = Omit<\n \tPick<View, keyof View>,\n-\t\"sameText\" | \"visibleCount\" | \"shareMoves\" | \"fileOfNumber\" | \"lineNumberOf\" | \"visibleWriters\"\n+\t\"sameText\" | \"visibleCount\" | \"shareMoves\" | \"shareFiles\" | \"fileOfNumber\" | \"lineNumberOf\" | \"visibleWriters\"\n > & {\n \tsameText(path: string, other: ReadView): boolean;\n };\n@@ -389,6 +389,27 @@\n \t\tthis.#movesFrom = from;\n \t}\n \n+\t/**\n+\t * Files laid out as another view lays them out (abso Capacity): a draft's view over its base's, for every file the\n+\t * draft doesn't touch. The caller knows what the draft is; `except` is asked once, when a file is first needed, for\n+\t * the files the draft touches, or undefined when nothing can be shared (a draft that moves lines). Without it, an\n+\t * agent's tree, files and blame laid out every file of the project again for each agent.\n+\t */\n+\tshareFiles(from: View, except: () => ReadonlySet<string> | undefined): void {\n+\t\tif (from.graph !== this.graph || from === this || this.#filesFrom !== undefined) return;\n+\t\tthis.#filesFrom = { from, except };\n+\t}\n+\t#filesFrom: { from: View; except: () => ReadonlySet<string> | undefined } | null | undefined;\n+\t#filesShared: { from: View; except: ReadonlySet<string> } | null | undefined;\n+\t#sharedFiles(): { from: View; except: ReadonlySet<string> } | null {\n+\t\tif (this.#filesShared === undefined) {\n+\t\t\tconst share = this.#filesFrom;\n+\t\t\tconst except = share ? share.except() : undefined;\n+\t\t\tthis.#filesShared = share && except ? { from: share.from, except } : null;\n+\t\t}\n+\t\treturn this.#filesShared;\n+\t}\n+\n \t#takeShared(): void {\n \t\tconst from = this.#movesFrom;\n \t\tif (!from) return;\n@@ -1104,7 +1125,9 @@\n \t#file(path: string, complete = false): FileState {\n \t\tlet state = this.#files.get(path);\n \t\tif (!state || (complete && !state.complete)) {\n-\t\t\tstate = this.graph.hasAtomsIn(path) ? this.#layout(path, complete) : NO_FILE;\n+\t\t\tconst shared = this.#filesFrom === undefined ? null : this.#sharedFiles();\n+\t\t\tif (shared && !shared.except.has(path)) state = shared.from.#file(path, complete);\n+\t\t\telse state = this.graph.hasAtomsIn(path) ? this.#layout(path, complete) : NO_FILE;\n \t\t\tthis.#files.set(path, state);\n \t\t}\n \t\treturn state;"}],"unmatched":[]}