{"draft":null,"from":245,"to":246,"files":[{"path":"worker/project/draft-collisions.ts","added":7,"removed":13,"diff":"--- a/worker/project/draft-collisions.ts\n+++ b/worker/project/draft-collisions.ts\n@@ -2,7 +2,7 @@\n // is the project in memory.\n \n import { type AtomId, type Graph, parseKey, type ReadView } from \"../../src/engine/index.ts\";\n-import { StableSet, unionOverlay } from \"../../src/engine/state-source.ts\";\n+import { StableSet } from \"../../src/engine/state-source.ts\";\n import { claimantsAmong, describeSide, fileOfKey, pairsFrom } from \"./collisions.ts\";\n import type { DefinitionRule } from \"./definition-rule.ts\";\n import { type Definition, definedTwice } from \"./definitions.ts\";\n@@ -25,7 +25,8 @@\n \tdefinitionRule(): DefinitionRule;\n \tdraft(agent: Agent): AtomId[];\n \tagentView(agent: Agent): ReadView;\n-\tview(set: ReadonlySet<AtomId>): ReadView;\n+\t/** Shared now with these agents' drafts on top. */\n+\tdraftsView(agents: readonly Agent[]): ReadView;\n \ttouchedFiles(ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string>;\n }\n \n@@ -95,16 +96,9 @@\n \t\tif (!set) draftSets.set(agent, (set = new Set(host.draft(agent))));\n \t\treturn set;\n \t};\n-\t// Shared now with each agent's draft on top, once per agent. Over shared's view's own set (abso Capacity): a view's set\n-\t// is closed under dependencies anyway, so shared's closed set and the drafts lay out what shared's atoms and the drafts\n-\t// do, and only the drafts' atoms are walked to close it.\n-\tconst withDraftsView = (...drafts: readonly AtomId[][]) => host.view(unionOverlay(sharedView.set, drafts.flat()));\n-\tconst nowViews = new Map<Agent, ReadView>();\n-\tconst nowViewOf = (agent: Agent) => {\n-\t\tlet view = nowViews.get(agent);\n-\t\tif (!view) nowViews.set(agent, (view = withDraftsView(host.draft(agent))));\n-\t\treturn view;\n-\t};\n+\t// Shared now with each agent's draft on top (project.ts, draftsView): kept between calls while shared and the\n+\t// draft stay the same, and laid out as shared is for every file the draft doesn't touch (abso Capacity).\n+\tconst nowViewOf = (agent: Agent) => host.draftsView([agent]);\n \t// Each agent's touched files once, not once per pair (abso Capacity).\n \tconst touched = new Map<Agent, Set<string>>();\n \tconst touchedBy = (agent: Agent) => {\n@@ -161,7 +155,7 @@\n \t\t\t\tconst mineB = new Set(draftB);\n \t\t\t\tconst filesA = touchedBy(a);\n \t\t\t\tfor (const file of [...touchedBy(b)].filter((f) => filesA.has(f)).toSorted()) {\n-\t\t\t\t\tboth ??= withDraftsView(draftA, draftB);\n+\t\t\t\t\tboth ??= host.draftsView([a, b]);\n \t\t\t\t\tif (!both.hasFile(file)) continue;\n \t\t\t\t\tfor (const [name, defs] of definedTwice(both, file)) {\n \t\t\t\t\t\tconst by = (mine: Set<AtomId>) => defs.find((d) => d.lines.some((l) => mine.has(host.graph.lineAtom(l)!)));"}],"unmatched":[]}