{"version":266,"agent":"capacity","message":"A draft that moves lines shares its base's layouts too (abso Capacity, issue 664).\n\ntouchedBeyond gave up on any draft with moves, so such an agent's view shared nothing with its base: it laid out every file, took no author totals, compared every file to mark what it changed, and its file list walked every file the graph ever had, laying each out (and, dropping the absent ones again, re-laying them on every call). View.placedDifferently now says where the two views place a moved line differently (a different relocation wins, or a different parent), in either view; besides the files the draft's atoms name, those are the only files its moves can change, since a line's descendants follow it. touchedBeyond adds them, and gives up only when a view resolves its moves in scratch.\n\nOn typescript-rs (Testing's fresh 262 adoption, cloud-ts-01, a draft with two moving atoms; my machine): the draft now touches 3 files. Agent tree with authors 432 ms first and 19 ms again (2.7 s and 579 ms before); agent folder blame 388 ms and 14 ms (1.7 s and 525 ms); agent files 374 ms and 0 ms (1.5 s and 350 ms).\n\nExactness: the tests with drafts that move lines (agent-views-shared's fay, author-totals' fay, known-paths' dee, moves, touched-beyond) compare every read against the in-memory project. All of src/engine/test (294) and worker/project/test (354) pass.","time":1792098679168,"timeIso":"2026-10-15T21:11:19.168Z","changes":3,"change":4057,"files":["src/engine/view.ts","worker/project/collisions.ts","worker/project/project.ts"],"draft":null,"diff":[{"path":"src/engine/view.ts","added":24,"removed":0,"diff":"--- a/src/engine/view.ts\n+++ b/src/engine/view.ts\n@@ -56,6 +56,7 @@\n \t| \"knowPaths\"\n \t| \"laidOut\"\n \t| \"forget\"\n+\t| \"placedDifferently\"\n \t| \"fileOfNumber\"\n \t| \"lineNumberOf\"\n \t| \"visibleWriters\"\n@@ -543,6 +544,29 @@\n \t\treturn parent;\n \t}\n \n+\t/**\n+\t * The files where a moved line sits, in this view or in `other`, when the two place it differently: a different\n+\t * relocation wins, or a different parent (abso Capacity). Besides the files a draft's atoms name, these are the only\n+\t * ones a draft's moves can lay out differently from its base, since a line's descendants follow it. Undefined when\n+\t * either view resolves its moves in scratch, which keeps no map of them to compare.\n+\t */\n+\tplacedDifferently(other: View): Set<string> | undefined {\n+\t\tif (this.#scratchMoves() || other.#scratchMoves()) return undefined;\n+\t\tconst here = this.#hasMoves ? this.#relocationsN() : undefined;\n+\t\tconst there = other.#hasMoves ? other.#relocationsN() : undefined;\n+\t\tconst files = new Set<string>();\n+\t\tconst add = (n: number) => {\n+\t\t\tfiles.add(this.#fileOfN(n));\n+\t\t\tfiles.add(other.#fileOfN(n));\n+\t\t};\n+\t\tfor (const [n, x] of here ?? []) {\n+\t\t\tconst y = there?.get(n);\n+\t\t\tif (!y || y.parent !== x.parent || y.r.atom !== x.r.atom) add(n);\n+\t\t}\n+\t\tfor (const n of there?.keys() ?? []) if (!here?.has(n)) add(n);\n+\t\treturn files;\n+\t}\n+\n \t/** Whether any atom in the set moves lines. */\n \thasMoves(): boolean {\n \t\treturn this.#hasMoves;"},{"path":"worker/project/collisions.ts","added":11,"removed":3,"diff":"--- a/worker/project/collisions.ts\n+++ b/worker/project/collisions.ts\n@@ -302,7 +302,7 @@\n \n /**\n  * The files a view over `below` plus `mine` can lay out differently from `below` (abso Capacity, View.shareFiles), or\n- * undefined when any of it moves lines. A view's set is closed under dependencies, so it holds `mine` and whatever\n+ * undefined when any of it moves lines and `placedDifferently` can't say where those land differently. A view's set is closed under dependencies, so it holds `mine` and whatever\n  * `mine` depends on that `below` lacks; each of those can change a file, so all of them count. Counting `mine` alone\n  * missed the files of work the draft depends on (Testing's typescript-rs diff for cloud-ts-01, core 235).\n  */\n@@ -311,6 +311,7 @@\n \tbelow: ReadonlySet<AtomId>,\n \tmine: Iterable<AtomId>,\n \tviews: readonly ReadView[],\n+\tplacedDifferently?: () => ReadonlySet<string> | undefined,\n ): Set<string> | undefined {\n \tconst beyond = new Set<AtomId>();\n \tconst stack = [...mine];\n@@ -320,8 +321,15 @@\n \t\tbeyond.add(id);\n \t\tfor (const dep of g.atom(id).deps) if (!beyond.has(dep) && !below.has(dep)) stack.push(dep);\n \t}\n-\tfor (const id of beyond) if ((g.atom(id).moves?.length ?? 0) > 0) return undefined;\n-\treturn touchedFiles(g, beyond, views);\n+\tconst files = touchedFiles(g, beyond, views);\n+\t// Moves change more than the files their atoms name only where a moved line lands differently (View.placedDifferently,\n+\t// abso Capacity); without that comparison, a draft that moves lines shares nothing.\n+\tif ([...beyond].some((id) => (g.atom(id).moves?.length ?? 0) > 0)) {\n+\t\tconst placed = placedDifferently?.();\n+\t\tif (!placed) return undefined;\n+\t\tfor (const file of placed) files.add(file);\n+\t}\n+\treturn files;\n }\n \n /** The atom's visible lines in a file of a view, or where it acted when none are left. */"},{"path":"worker/project/project.ts","added":13,"removed":3,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -281,6 +281,11 @@\n \treturn \"json\" in frame ? (JSON.parse(frame.json) as Entry) : frame.entry;\n }\n \n+/** Where a view and its base place moved lines differently (View.placedDifferently), when both are Views. */\n+function placedBetween(view: ReadView, base: ReadView): ReadonlySet<string> | undefined {\n+\treturn view instanceof View && base instanceof View ? view.placedDifferently(base) : undefined;\n+}\n+\n export class Project {\n \treadonly #store: ProjectStore;\n \treadonly #writerStorage?: GraphStateStorage;\n@@ -1841,7 +1846,8 @@\n \t#agentTouched(agent: AgentState): ReadonlySet<string> | undefined {\n \t\tif (agent.mine.length === 0) return new Set();\n \t\tconst base = this.#viewAt(this.#spaceOf(agent), agent.base);\n-\t\treturn touchedBeyond(this.#graph, base.set, agent.mine, [base, this.#agentView(agent)]);\n+\t\tconst view = this.#agentView(agent);\n+\t\treturn touchedBeyond(this.#graph, base.set, agent.mine, [base, view], () => placedBetween(view, base));\n \t}\n \n \t/**\n@@ -1992,7 +1998,9 @@\n \t\t);\n \t\tif (this.#writerStorage && mine.length > 0 && view instanceof View && base instanceof View) {\n \t\t\tview.shareMoves(base);\n-\t\t\tview.shareFiles(base, () => touchedBeyond(this.#graph, base.set, mine, [base, view]));\n+\t\t\tview.shareFiles(base, () =>\n+\t\t\t\ttouchedBeyond(this.#graph, base.set, mine, [base, view], () => placedBetween(view, base)),\n+\t\t\t);\n \t\t}\n \t\treturn view;\n \t}\n@@ -2852,7 +2860,9 @@\n \t\t\t\t// view holds beyond its base is the draft and whatever the draft depends on that the base lacks (the view's\n \t\t\t\t// set is closed): each of those can change a file, so all of them count.\n \t\t\t\tconst mine = agent.mine;\n-\t\t\t\tview.shareFiles(base, () => touchedBeyond(this.#graph, base.set, mine, [base, view]));\n+\t\t\t\tview.shareFiles(base, () =>\n+\t\t\t\t\ttouchedBeyond(this.#graph, base.set, mine, [base, view], () => placedBetween(view, base)),\n+\t\t\t\t);\n \t\t\t}\n \t\t}\n \t\treturn view;"}],"ci":null}