{"draft":null,"from":7,"to":318,"files":[{"path":"worker/project/changes-since.ts","added":8,"removed":9,"diff":"--- a/worker/project/changes-since.ts\n+++ b/worker/project/changes-since.ts\n@@ -1,7 +1,7 @@\n // The files whose text in the agent's view differs from before, and its open\n // collisions. Reads go through ChangesSinceHost; today the host is Project.\n \n-import type { AtomId, View } from \"../../src/engine/index.ts\";\n+import type { AtomId, ReadView } from \"../../src/engine/index.ts\";\n import type { Pair } from \"./collisions.ts\";\n import { sortKeys } from \"./project-helpers.ts\";\n import type { AgentState, Blobs, Collision, Files, Modes, SyncAnswer } from \"./project-types.ts\";\n@@ -9,8 +9,8 @@\n \n /** What a changes-since read needs from a project. */\n export interface ChangesSinceHost {\n-\tagentView(agent: AgentState): View;\n-\ttouchedFiles(ids: Iterable<AtomId>, views: readonly View[]): Set<string>;\n+\tagentView(agent: AgentState): ReadView;\n+\ttouchedFiles(ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string>;\n \topenPairs(agent: AgentState): Pair[];\n \tcollision(agent: AgentState, pair: Pair): Collision;\n \tduplicates(agent: AgentState): Collision[];\n@@ -18,7 +18,7 @@\n }\n \n /** The files whose text in the agent's view differs from `before`, and its open collisions. */\n-export function changesSince(host: ChangesSinceHost, agent: AgentState, before: View): SyncAnswer {\n+export function changesSince(host: ChangesSinceHost, agent: AgentState, before: ReadView): SyncAnswer {\n \tconst after = host.agentView(agent);\n \t// Only files that an atom in one view but not the other touches can differ.\n \tconst touched = new Set<string>();\n@@ -26,11 +26,10 @@\n \t\t[before.set, after.set],\n \t\t[after.set, before.set],\n \t] as const) {\n-\t\tfor (const file of host.touchedFiles(\n-\t\t\t[...a].filter((id) => !b.has(id)),\n-\t\t\t[before, after],\n-\t\t))\n-\t\t\ttouched.add(file);\n+\t\tconst changed = function* () {\n+\t\t\tfor (const id of a) if (!b.has(id)) yield id;\n+\t\t};\n+\t\tfor (const file of host.touchedFiles(changed(), [before, after])) touched.add(file);\n \t}\n \tconst files: Files = {};\n \tconst modes: Modes = {};"}],"unmatched":[]}