{"draft":null,"from":163,"to":318,"files":[{"path":"worker/project/queue.ts","added":10,"removed":3,"diff":"--- a/worker/project/queue.ts\n+++ b/worker/project/queue.ts\n@@ -3,6 +3,7 @@\n \n import { type AtomId, buildAtom, type Graph, type ReadView } from \"../../src/engine/index.ts\";\n import { unionOverlay } from \"../../src/engine/state-source.ts\";\n+import { autoSettledOf } from \"./autosettle.ts\";\n import type { Pair } from \"./collisions.ts\";\n import { definedTwice } from \"./definitions.ts\";\n import { heldMessage, keptOf, lostLines } from \"./markers.ts\";\n@@ -158,18 +159,21 @@\n \t\tif (collisions.length > 0) return host.refuse(agent, space, \"publish\", time, collisions, entries, message);\n \t}\n \tconst view = host.agentView(agent);\n+\tconst auto = autoSettledOf(message);\n \tconst settled: Settled[] = agent.marked\n \t\t.filter((r) => r.space === SHARED)\n \t\t.map((r) => {\n \t\t\tconst lines = view.hasFile(r.file) ? view.lines(r.file).map((l) => l.text) : [];\n \t\t\tconst lost = lostLines(lines, r);\n \t\t\tconst held = heldMessage(agent, r.file);\n+\t\t\tconst by = auto.get(r.file);\n \t\t\treturn {\n \t\t\t\tfile: r.file,\n \t\t\t\tkept: keptOf(lines, r),\n \t\t\t\ttheirs: { agent: r.agent, version: r.version },\n \t\t\t\t...(lost.length > 0 ? { lost } : {}),\n \t\t\t\t...(held ? { held } : {}),\n+\t\t\t\t...(by ? { auto: by } : {}),\n \t\t\t};\n \t\t});\n \tconst id = host.queuedId() + 1;\n@@ -237,9 +241,12 @@\n \thost.needInit();\n \tconst items = host.queued().slice(0, Math.max(0, n));\n \tconst changes = items.flatMap((q) => q.changes);\n-\tconst view = host.sharedOverlay\n-\t\t? host.sharedOverlay(changes)\n-\t\t: host.view(unionOverlay(host.setOf(host.shared()), changes));\n+\tconst view =\n+\t\tchanges.length === 0\n+\t\t\t? host.sharedView()\n+\t\t\t: host.sharedOverlay\n+\t\t\t\t? host.sharedOverlay(changes)\n+\t\t\t\t: host.view(unionOverlay(host.setOf(host.shared()), changes));\n \tconst files = view.files();\n \tconst modes = modesOf(view);\n \tconst blobs = view.blobs();"}],"unmatched":[]}