{"version":160,"agent":"speed","message":"A held push keeps its message, and why tells every settle: the refusal stores the push's message; why on a line kept by abso settle --yours, --theirs or --both names the collision it was kept from, and both kinds of settle list the settler's held push with its reason; the settle's news and the change page carry it too, and a lone push's change now lists the refusals on its way","time":1791922755559,"timeIso":"2026-10-13T20:19:15.559Z","changes":16,"change":2091,"files":["client/src/api-answers.ts","client/src/history-answers.ts","client/src/history.ts","client/src/review.ts","client/test/held-push.test.ts","worker/project/apply-entry.ts","worker/project/blame.ts","worker/project/change-records.ts","worker/project/markers.ts","worker/project/news.ts","worker/project/project-types.ts","worker/project/project.ts","worker/project/publish.ts","worker/project/queue.ts","worker/project/refuse.ts","worker/project/test/project.test.ts"],"draft":null,"diff":[{"path":"client/src/api-answers.ts","added":4,"removed":0,"diff":"--- a/client/src/api-answers.ts\n+++ b/client/src/api-answers.ts\n@@ -65,6 +65,8 @@\n \treadonly theirs: { readonly agent: string; readonly version: number };\n \t/** Lines both sides still had that the settled file no longer has (#37). */\n \treadonly lost?: readonly string[];\n+\t/** The message of the settler's push that was held for this collision. */\n+\treadonly held?: string;\n }\n export interface RecordAnswer {\n \treadonly ok: boolean;\n@@ -124,6 +126,8 @@\n \t\treadonly time: number;\n \t\treadonly kinds: readonly string[];\n \t\treadonly files: readonly string[];\n+\t\t/** A held push's message. */\n+\t\treadonly message?: string;\n \t}[];\n \treadonly notes?: readonly NoteAnswer[];\n \treadonly reviewers?: readonly { readonly agent: string; readonly files: readonly string[]; readonly read: boolean }[];"},{"path":"client/src/history-answers.ts","added":4,"removed":0,"diff":"--- a/client/src/history-answers.ts\n+++ b/client/src/history-answers.ts\n@@ -161,6 +161,10 @@\n \t\treadonly message: string;\n \t\treadonly publish: Publish | null;\n \t}[];\n+\t/** When the line's own change settled nothing: the settle that kept it from a marker block. */\n+\treadonly settledBy?: { readonly atom: string; readonly author: string; readonly publish: Publish | null };\n+\t/** The settler's push that was held for the collision, with its message: that side's reason. */\n+\treadonly held?: { readonly agent: string; readonly message: string; readonly time: number };\n }\n export interface WhereAnswer {\n \treadonly version: number;"},{"path":"client/src/history.ts","added":4,"removed":1,"diff":"--- a/client/src/history.ts\n+++ b/client/src/history.ts\n@@ -119,10 +119,13 @@\n \t\t...(w.change.message ? [`The change says: \"${w.change.message}\"`] : []),\n \t\t...(w.settled.length > 0\n \t\t\t? [\n-\t\t\t\t\t\"It settled a collision between:\",\n+\t\t\t\t\tw.settledBy\n+\t\t\t\t\t\t? `It was kept when ${w.settledBy.author} settled a collision between:`\n+\t\t\t\t\t\t: \"It settled a collision between:\",\n \t\t\t\t\t...w.settled.map(\n \t\t\t\t\t\t(s) => `  ${s.author}, ${published(s.publish)}${s.message ? ` (the change: \"${s.message}\")` : \"\"}`,\n \t\t\t\t\t),\n+\t\t\t\t\t...(w.held ? [`  ${w.held.agent}, a held push: \"${w.held.message}\"`] : []),\n \t\t\t\t]\n \t\t\t: []),\n \t\t...(w.reasons.length > 0"},{"path":"client/src/review.ts","added":1,"removed":1,"diff":"--- a/client/src/review.ts\n+++ b/client/src/review.ts\n@@ -111,7 +111,7 @@\n \t\t\t: []),\n \t\t...(c.refusals.length > 0\n \t\t\t? [\n-\t\t\t\t\t`Refused ${plural(c.refusals.length, \"time\")} on the way: ${c.refusals.map((r) => `${r.kinds.join(\", \")} (${r.files.join(\", \")})`).join(\"; \")}.`,\n+\t\t\t\t\t`Refused ${plural(c.refusals.length, \"time\")} on the way: ${c.refusals.map((r) => `${r.kinds.join(\", \")} (${r.files.join(\", \")})${r.message ? `: ${JSON.stringify(r.message)}` : \"\"}`).join(\"; \")}.`,\n \t\t\t\t]\n \t\t\t: []),\n \t\t...((c.reviewers ?? []).length > 0"},{"path":"client/test/held-push.test.ts","added":36,"removed":1,"diff":"--- a/client/test/held-push.test.ts\n+++ b/client/test/held-push.test.ts\n@@ -1,6 +1,6 @@\n // A held push from end to end, as two agents meet it: alice and bob change\n // the same line, bob's push is held, he pulls, settles and pushes again.\n-// What each step prints has to be true.\n+// What each step prints has to be true, and the record has to keep his reason.\n \n import assert from \"node:assert/strict\";\n import { mkdtempSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\n@@ -68,6 +68,41 @@\n \t\tassert.match(policy(bob), /^<<<<<<< yours \\(unpublished\\)$/m, \"the pull wrote a marker block\");\n \t});\n \n+\tfor (const how of [\"yours\", \"theirs\", \"both\"] as const) {\n+\t\tit(`why names the collision a line was kept from, settled --${how}`, async () => {\n+\t\t\tconst { alice, bob } = await held();\n+\t\t\tassert.equal((await run(bob, \"pull\")).exit, 0);\n+\t\t\tconst settled = await run(bob, \"settle\", \"store-policy.md\", `--${how}`);\n+\t\t\tassert.equal(settled.exit, 0, settled.out);\n+\t\t\tconst pushed = await run(bob, \"push\", \"-m\", `Settle: keep ${how}`);\n+\t\t\tassert.equal(pushed.exit, 0, pushed.out);\n+\t\t\tassert.equal((await run(alice, \"pull\")).exit, 0);\n+\t\t\tconst why = await run(alice, \"why\", \"store-policy.md:3\");\n+\t\t\tassert.equal(why.exit, 0, why.out);\n+\t\t\tassert.match(why.out, /It was kept when bob settled a collision between:\\n {2}alice, version 1 by alice/);\n+\t\t\tassert.match(why.out, new RegExp(`\\\\n {2}bob, a held push: \"${HELD.replace(/\\$/g, \"\\\\$\")}\"`));\n+\t\t});\n+\t}\n+\n+\tit(\"keeps its message: why on the settling line shows it, and so do the change page and the news\", async () => {\n+\t\tconst { alice, bob } = await held();\n+\t\tassert.equal((await run(bob, \"pull\")).exit, 0);\n+\t\twriteFileSync(join(bob, \"store-policy.md\"), POLICY.replace(\"$50\", \"$60\"));\n+\t\tconst pushed = await run(bob, \"push\", \"-m\", \"Settle with alice: meet at $60\");\n+\t\tassert.equal(pushed.exit, 0, pushed.out);\n+\t\tconst why = await run(bob, \"why\", \"store-policy.md:3\");\n+\t\tassert.match(\n+\t\t\twhy.out,\n+\t\t\t/It settled a collision between:\\n {2}alice, version 1 by alice[^\\n]*\\n {2}bob, a held push: \"/,\n+\t\t);\n+\t\tassert.ok(why.out.includes(HELD), why.out);\n+\t\tconst review = await run(alice, \"review\", \"bob\");\n+\t\tassert.match(review.out, /Settled: store-policy\\.md \\(rewrote both sides, against alice's version 1\\)\\./);\n+\t\tassert.ok(review.out.includes(`Refused 1 time on the way: lines (store-policy.md): \"${HELD}\"`), review.out);\n+\t\tconst news = await run(alice, \"news\");\n+\t\tassert.ok(news.out.includes(`Its held push said: \"${HELD}\"`), news.out);\n+\t});\n+\n \tit(\"the change page says what a settle kept in words that read for each choice\", async () => {\n \t\tfor (const [how, said] of [\n \t\t\t[\"yours\", \"kept bob's\"],"},{"path":"worker/project/apply-entry.ts","added":13,"removed":6,"diff":"--- a/worker/project/apply-entry.ts\n+++ b/worker/project/apply-entry.ts\n@@ -112,6 +112,7 @@\n \t\t\t}\n \t\t\thost.joinChange(agent, entry, at, space.name === SHARED ? null : space.name);\n \t\t\tagent.marked = agent.marked.filter((r) => r.space !== (entry.space ?? SHARED));\n+\t\t\tdelete agent.held;\n \t\t\tif (entry.queued !== undefined) host.setQueued(host.queued().filter((q) => q.id !== entry.queued));\n \t\t\tbreak;\n \t\t}\n@@ -243,23 +244,29 @@\n \t\t\t\tvia: entry.via,\n \t\t\t\ttime: entry.time,\n \t\t\t\tcollisions: entry.collisions.map((c) => ({ ...c })),\n+\t\t\t\t...(entry.message ? { message: entry.message } : {}),\n \t\t\t});\n \t\t\t{\n \t\t\t\t// On the change the agent was working on, when there is one (#44).\n \t\t\t\tconst agent = host.agentOf(entry.agent);\n \t\t\t\thost.active(agent, entry.time);\n \t\t\t\tconst id = host.currentChange(agent, entry.time);\n+\t\t\t\tconst refusal = {\n+\t\t\t\t\tat,\n+\t\t\t\t\ttime: entry.time,\n+\t\t\t\t\tkinds: [...new Set(entry.collisions.map((c) => c.kind))].sort(),\n+\t\t\t\t\tfiles: [...new Set(entry.collisions.map((c) => c.file))].sort(),\n+\t\t\t\t\t...(entry.message ? { message: entry.message } : {}),\n+\t\t\t\t};\n \t\t\t\tif (id !== undefined) {\n \t\t\t\t\tconst rec = host.changeRecord(id, agent, entry.time);\n-\t\t\t\t\trec.refusals.push({\n-\t\t\t\t\t\tat,\n-\t\t\t\t\t\ttime: entry.time,\n-\t\t\t\t\t\tkinds: [...new Set(entry.collisions.map((c) => c.kind))].sort(),\n-\t\t\t\t\t\tfiles: [...new Set(entry.collisions.map((c) => c.file))].sort(),\n-\t\t\t\t\t});\n+\t\t\t\t\trec.refusals.push({ ...refusal, files: [...refusal.files], kinds: [...refusal.kinds] });\n \t\t\t\t\trec.last = at;\n \t\t\t\t\thost.changes.set(id, rec);\n \t\t\t\t}\n+\t\t\t\t// Kept until it pushes: the settle tells the held push's reason, and its change lists the refusal.\n+\t\t\t\tif (entry.via === \"publish\")\n+\t\t\t\t\tagent.held = [...(agent.held ?? []), { ...refusal, ...(id !== undefined ? { change: id } : {}) }];\n \t\t\t}\n \t\t\tbreak;\n \t\tcase \"switch\": {"},{"path":"worker/project/blame.ts","added":64,"removed":4,"diff":"--- a/worker/project/blame.ts\n+++ b/worker/project/blame.ts\n@@ -3,7 +3,8 @@\n // that change's author and message, and the publish that brought it into\n // shared, with its message. Why adds the change's reasons, what it settled,\n // and the reasons other changes give that point at it.\n-import type { AtomId } from \"../../src/engine/index.ts\";\n+import { type Atom, type AtomId, type LineId, type ReadView, View } from \"../../src/engine/index.ts\";\n+import { blocksIn, isMarkerLine } from \"./markers.ts\";\n import { pathKey } from \"./pathkey.ts\";\n import type { Project } from \"./project.ts\";\n \n@@ -66,7 +67,7 @@\n \tconst { view, name } = viewOf(project, where);\n \tconst file = project.spellingIn(view, asked);\n \tif (!view.hasFile(file)) throw badRequest(`${asked} isn't in ${name}`);\n-\treturn { file, all: view.lines(file) };\n+\treturn { file, all: view.lines(file), view };\n }\n \n /**\n@@ -113,9 +114,59 @@\n \t};\n }\n \n+/**\n+ * The settle a line was kept through, when its own change settled nothing:\n+ * an edit that took out the markers of a block the line sat in (as yours or\n+ * theirs), as abso settle --yours, --theirs or --both makes. The earliest,\n+ * if several did.\n+ */\n+function keptThrough(project: Project, view: ReadView, file: string, line: LineId, author: Atom): Atom | undefined {\n+\tconst graph = project.graph;\n+\tconst set = view.set;\n+\tfor (const s of graph.atoms()) {\n+\t\tif (s.seq <= author.seq || s.resolves.length === 0 || !set.has(s.id)) continue;\n+\t\tconst marks = s.deletes.filter((id) => {\n+\t\t\tconst info = graph.line(id);\n+\t\t\treturn info !== undefined && info.file === file && isMarkerLine(info.text);\n+\t\t});\n+\t\tif (marks.length === 0) continue;\n+\t\t// The file just before the settle, markers and all.\n+\t\tconst before = new View(\n+\t\t\tgraph,\n+\t\t\tgraph\n+\t\t\t\t.atoms()\n+\t\t\t\t.slice(0, s.seq)\n+\t\t\t\t.filter((a) => set.has(a.id))\n+\t\t\t\t.map((a) => a.id),\n+\t\t);\n+\t\tif (!before.hasFile(file)) continue;\n+\t\tconst lines = before.lines(file);\n+\t\tconst at = lines.findIndex((l) => l.id === line);\n+\t\tif (at < 0) continue;\n+\t\tconst block = blocksIn(lines.map((l) => l.text)).find((b) => at > b.start && at < b.end);\n+\t\tif (block && marks.includes(lines[block.start]!.id)) return s;\n+\t}\n+\treturn undefined;\n+}\n+\n+/** The settler's push that was held for this collision, newest first: its message is that side's reason. */\n+function heldPush(project: Project, settle: Atom, file: string, after: number) {\n+\tconst held = project\n+\t\t.refusals({ agent: settle.author, limit: 1000 })\n+\t\t.refusals.find(\n+\t\t\t(r) =>\n+\t\t\t\tr.via === \"publish\" &&\n+\t\t\t\tr.message !== undefined &&\n+\t\t\t\tr.time <= settle.time &&\n+\t\t\t\tr.time >= after &&\n+\t\t\t\tr.collisions.some((c) => c.file === file),\n+\t\t);\n+\treturn held ? { agent: held.agent, message: held.message!, time: held.time } : undefined;\n+}\n+\n /** One line: the change that wrote it, the publish behind it, its reasons, and what it settled. */\n export function why(project: Project, asked: string, n: number, where: BlameWhere = {}) {\n-\tconst { file, all } = lines(project, asked, where);\n+\tconst { file, all, view } = lines(project, asked, where);\n \tconst line = all[n - 1];\n \tif (!line)\n \t\tthrow Object.assign(new Error(`${file} has ${all.length} lines; ask for one in 1-${all.length}`), {\n@@ -163,10 +214,17 @@\n \tbuiltOn.sort((a, b) =>\n \t\t(a.draft === undefined) !== (b.draft === undefined) ? (a.draft === undefined ? -1 : 1) : b.version - a.version,\n \t);\n-\tconst settled = atom.resolves.map((id) => {\n+\t// What it settled: its own change, or the settle that kept it (both sides of a block it sat in).\n+\tconst kept = atom.resolves.length === 0 ? keptThrough(project, view, file, line.id, atom) : undefined;\n+\tconst settle = kept ?? atom;\n+\tconst settled = settle.resolves.map((id) => {\n \t\tconst a = graph.atom(id);\n \t\treturn { atom: id, author: a.author, message: a.message, publish: publishOf(project, id) };\n \t});\n+\tconst held =\n+\t\tsettled.length > 0\n+\t\t\t? heldPush(project, settle, file, Math.max(0, ...settled.map((s) => s.publish?.time ?? 0)))\n+\t\t\t: undefined;\n \treturn {\n \t\tfile,\n \t\tline: n,\n@@ -184,6 +242,8 @@\n \t\treasons,\n \t\treasonsIn,\n \t\tsettled,\n+\t\t...(kept ? { settledBy: { atom: kept.id, author: kept.author, publish: publishOf(project, kept.id) } } : {}),\n+\t\t...(held ? { held } : {}),\n \t\tbuiltOn,\n \t};\n }"},{"path":"worker/project/change-records.ts","added":11,"removed":1,"diff":"--- a/worker/project/change-records.ts\n+++ b/worker/project/change-records.ts\n@@ -101,6 +101,11 @@\n \trec.versions.push({ version: entry.version, draft, message: entry.message, time: entry.time, at });\n \thost.versionChange.set(`${draft ?? \"\"} ${entry.version}`, id);\n \tif (entry.type === \"publish\") for (const s of entry.settled ?? []) rec.settled.push({ ...s, version: entry.version });\n+\t// Pushes held on the way, when no change was going to put them on: they belong to the push that follows.\n+\tif (entry.type === \"publish\")\n+\t\tfor (const { change: on, ...h } of agent.held ?? [])\n+\t\t\tif (on === undefined && !rec.refusals.some((r) => r.at === h.at))\n+\t\t\t\trec.refusals.push({ ...h, kinds: [...h.kinds], files: [...h.files] });\n \trec.last = at;\n \thost.changes.set(id, rec);\n \tif (old) {\n@@ -138,7 +143,12 @@\n \t\tversions,\n \t\tfiles: [...new Set(versions.flatMap((v) => v.files))].toSorted(),\n \t\tsettled: rec.settled.map((s) => ({ ...s })),\n-\t\trefusals: rec.refusals.map(({ time, kinds, files }) => ({ time, kinds: [...kinds], files: [...files] })),\n+\t\trefusals: rec.refusals.map(({ time, kinds, files, message }) => ({\n+\t\t\ttime,\n+\t\t\tkinds: [...kinds],\n+\t\t\tfiles: [...files],\n+\t\t\t...(message ? { message } : {}),\n+\t\t})),\n \t\tnotes: [...host.notes.values()].filter((n) => n.change === rec.id).map((n) => host.noteAnswer(n)),\n \t\treviewers: host.reviewersOf(\n \t\t\tversions.flatMap((v) => v.files),"},{"path":"worker/project/markers.ts","added":5,"removed":0,"diff":"--- a/worker/project/markers.ts\n+++ b/worker/project/markers.ts\n@@ -264,6 +264,11 @@\n \treturn y === \"nothing\" && t === \"nothing\" ? \"both\" : \"rewrote\";\n }\n \n+/** The message of the agent's newest held push that named `file`: its side's reason, for the settle to tell. */\n+export function heldMessage(agent: AgentState, file: string): string | undefined {\n+\treturn agent.held?.findLast((h) => h.message && h.files.includes(file))?.message;\n+}\n+\n /** What the marker reads need from a project. */\n export interface MarkerHost {\n \treadonly graph: Graph;"},{"path":"worker/project/news.ts","added":2,"removed":1,"diff":"--- a/worker/project/news.ts\n+++ b/worker/project/news.ts\n@@ -129,7 +129,7 @@\n \trewrote: \"it kept part of each side or rewrote them\",\n };\n \n-/** The other author of a marked collision a publish settled (#11): what was kept, and any lines lost. */\n+/** The other author of a marked collision a publish settled (#11): what was kept, any lines lost, and the settler's held reason. */\n export function settledItem(by: string, version: number, s: Settled): NewsItem {\n \treturn {\n \t\tkey: `settled ${by} ${version} ${s.file} ${s.theirs.version}`,\n@@ -138,6 +138,7 @@\n \t\t\t(s.lost\n \t\t\t\t? ` It also lost ${s.lost.length === 1 ? \"a line\" : `${s.lost.length} lines`} you both still had: ${s.lost.map((l) => `\"${clip(l)}\"`).join(\", \")}.`\n \t\t\t\t: \"\") +\n+\t\t\t(s.held ? ` Its held push said: \"${clip(s.held)}\".` : \"\") +\n \t\t\t` abso show ${version}:${s.file} shows the file.`,\n \t};\n }"},{"path":"worker/project/project-types.ts","added":14,"removed":2,"diff":"--- a/worker/project/project-types.ts\n+++ b/worker/project/project-types.ts\n@@ -166,6 +166,8 @@\n \t\t\treadonly space?: string;\n \t\t\treadonly via: \"publish\" | \"land\";\n \t\t\treadonly time: number;\n+\t\t\t/** The held push's message: its reason, which the settle that follows tells. */\n+\t\t\treadonly message?: string;\n \t\t\treadonly collisions: readonly {\n \t\t\t\treadonly kind: Collision[\"kind\"];\n \t\t\t\treadonly file: string;\n@@ -343,7 +345,7 @@\n \treadonly time: number;\n \treadonly versions: { version: number; draft: string | null; message: string; time: number; at: number }[];\n \treadonly settled: (Settled & { version: number })[];\n-\treadonly refusals: { at: number; time: number; kinds: string[]; files: string[] }[];\n+\treadonly refusals: { at: number; time: number; kinds: string[]; files: string[]; message?: string }[];\n \t/** The log position of its newest entry. */\n \tlast: number;\n }\n@@ -417,7 +419,7 @@\n \tversions: { version: number; draft: string | null; message: string; time: number; files: string[] }[];\n \tfiles: string[];\n \tsettled: (Settled & { version: number })[];\n-\trefusals: { time: number; kinds: string[]; files: string[] }[];\n+\trefusals: { time: number; kinds: string[]; files: string[]; message?: string }[];\n \t/** Its notes, replies included, oldest first. */\n \tnotes: NoteAnswer[];\n \t/** The reviewers whose areas (avcs.json's \"review\") its files fall in, and whether each has left a note on it. */\n@@ -448,6 +450,8 @@\n \ttheirs: { agent: string; version: number };\n \t/** Lines both sides still had that the settled file lost (#37): check them. */\n \tlost?: string[];\n+\t/** The message of the settler's push that was held for this collision: its side's reason. */\n+\theld?: string;\n }\n /** A line both sides changed that a sync merged word by word (#37): check it. */\n export interface MergedLine {\n@@ -550,6 +554,8 @@\n \tvia: \"publish\" | \"land\";\n \ttime: number;\n \tcollisions: { kind: Collision[\"kind\"]; file: string; name?: string }[];\n+\t/** The held push's message. */\n+\tmessage?: string;\n }\n /** One file before and after: text, or null where it doesn't exist. */\n export interface FileChange {\n@@ -727,6 +733,12 @@\n \tstarting?: Starting;\n \t/** Collisions a sync wrote markers for (#11), until it publishes in that space. */\n \tmarked: (MarkedRegion & { space: string })[];\n+\t/**\n+\t * Its pushes refused since it last pushed, with their messages, so the\n+\t * settle that follows can tell its reason; `change` is the change a\n+\t * refusal was put on, if one was going.\n+\t */\n+\theld?: { at: number; time: number; kinds: string[]; files: string[]; message?: string; change?: number }[];\n }\n \n /** Another agent with work on a file: unpublished changes, a starting note, or both. */"},{"path":"worker/project/project.ts","added":4,"removed":4,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -1928,8 +1928,8 @@\n \t\t\tcollision: (agent, pair) => this.#collision(agent, pair),\n \t\t\tdefinitionCollisions: (agent, newer) => this.#definitionCollisions(agent, newer),\n \t\t\tduplicates: (agent) => this.#duplicates(agent),\n-\t\t\trefuse: (agent, space, via, time, collisions, entries) =>\n-\t\t\t\tthis.#refuse(agent, space, via, time, collisions, entries),\n+\t\t\trefuse: (agent, space, via, time, collisions, entries, message) =>\n+\t\t\t\tthis.#refuse(agent, space, via, time, collisions, entries, message),\n \t\t\tmarkerCollisions: (agent) => this.#markerCollisions(agent),\n \t\t\tenqueue: (agent, message, time, draft, resolves, entries) =>\n \t\t\t\tthis.#enqueue(agent, message, time, draft, resolves, entries),\n@@ -1975,8 +1975,8 @@\n \t\t\tpairs: (draft, against, settled) => this.#pairs(draft, against, settled),\n \t\t\tdescribe: (pair, yoursView, theirsView, spaceName) => this.#describe(pair, yoursView, theirsView, spaceName),\n \t\t\ttouchedFiles: (ids, views) => this.#touchedFiles(ids, views),\n-\t\t\trefuse: (agent, space, via, time, collisions, entries) =>\n-\t\t\t\tthis.#refuse(agent, space, via, time, collisions, entries),\n+\t\t\trefuse: (agent, space, via, time, collisions, entries, message) =>\n+\t\t\t\tthis.#refuse(agent, space, via, time, collisions, entries, message),\n \t\t\tcurrentChange: (agent, time) => this.#currentChange(agent, time),\n \t\t\tnextAt: () => this.#nextAt,\n \t\t\tapply: (entry) => this.#apply(entry),"},{"path":"worker/project/publish.ts","added":5,"removed":2,"diff":"--- a/worker/project/publish.ts\n+++ b/worker/project/publish.ts\n@@ -5,7 +5,7 @@\n import { differenceSet, unionOverlay } from \"../../src/engine/state-source.ts\";\n import type { Pair } from \"./collisions.ts\";\n import type { DefinitionCollision } from \"./definition-rule.ts\";\n-import { keptOf, lostLines, settleLines } from \"./markers.ts\";\n+import { heldMessage, keptOf, lostLines, settleLines } from \"./markers.ts\";\n import { ProjectError } from \"./project-error.ts\";\n import type { AgentState, Collision, Entry, Meta, Mode, PublishAnswer, Settled } from \"./project-types.ts\";\n import { last, SHARED, type Space } from \"./spaces.ts\";\n@@ -48,6 +48,7 @@\n \t\ttime: number,\n \t\tcollisions: Collision[],\n \t\tentries: Entry[],\n+\t\tmessage?: string,\n \t): { ok: false; collisions: Collision[] };\n \tmarkerCollisions(agent: AgentState): Collision[];\n \tenqueue(\n@@ -135,7 +136,7 @@\n \t\t...host.definitionCollisions(agent, newer).map((d) => d.collision),\n \t\t...host.duplicates(agent),\n \t];\n-\tif (collisions.length > 0) return host.refuse(agent, space, \"publish\", time, collisions, entries);\n+\tif (collisions.length > 0) return host.refuse(agent, space, \"publish\", time, collisions, entries, message);\n \t// Settled means the markers are gone (#11): refused while the draft adds any.\n \tconst marked = host.markerCollisions(agent);\n \tif (marked.length > 0) return host.refuse(agent, space, \"publish\", time, marked, entries);\n@@ -173,11 +174,13 @@\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\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};\n \t\t});\n \tentries.push({"},{"path":"worker/project/queue.ts","added":5,"removed":2,"diff":"--- a/worker/project/queue.ts\n+++ b/worker/project/queue.ts\n@@ -4,7 +4,7 @@\n import { type AtomId, buildAtom, type Graph, type ReadView } from \"../../src/engine/index.ts\";\n import type { Pair } from \"./collisions.ts\";\n import { definedTwice } from \"./definitions.ts\";\n-import { keptOf, lostLines } from \"./markers.ts\";\n+import { heldMessage, keptOf, lostLines } from \"./markers.ts\";\n import { clip } from \"./news.ts\";\n import { ProjectError } from \"./project-error.ts\";\n import { projectFileIn } from \"./project-helpers.ts\";\n@@ -49,6 +49,7 @@\n \t\ttime: number,\n \t\tcollisions: Collision[],\n \t\tentries: Entry[],\n+\t\tmessage?: string,\n \t): { ok: false; collisions: Collision[] };\n \tcurrentChange(agent: AgentState, time: number): number | undefined;\n \tnextAt(): number;\n@@ -149,7 +150,7 @@\n \t\t\t\t});\n \t\t\t}\n \t\t}\n-\t\tif (collisions.length > 0) return host.refuse(agent, space, \"publish\", time, collisions, entries);\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 settled: Settled[] = agent.marked\n@@ -157,11 +158,13 @@\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\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};\n \t\t});\n \tconst id = host.queuedId() + 1;"},{"path":"worker/project/refuse.ts","added":4,"removed":1,"diff":"--- a/worker/project/refuse.ts\n+++ b/worker/project/refuse.ts\n@@ -11,7 +11,7 @@\n \treadonly refusals: readonly Refusal[];\n }\n \n-/** Answer a refusal, and log it (an entry that changes nothing but the counts). */\n+/** Answer a refusal, and log it (an entry that changes nothing but the counts, and keeps a push's message). */\n export function refuse(\n \thost: RefuseHost,\n \tagent: AgentState,\n@@ -20,6 +20,7 @@\n \ttime: number,\n \tcollisions: Collision[],\n \tentries: Entry[],\n+\tmessage?: string,\n ): { ok: false; collisions: Collision[] } {\n \tconst entry: Entry = {\n \t\ttype: \"refused\",\n@@ -32,6 +33,8 @@\n \t\t\tfile: c.file,\n \t\t\t...(c.name !== undefined ? { name: c.name } : {}),\n \t\t})),\n+\t\t// A held push keeps its message: the settle that follows tells it as this side's reason.\n+\t\t...(message ? { message } : {}),\n \t};\n \tentries.push(entry);\n \thost.apply(entry);"},{"path":"worker/project/test/project.test.ts","added":11,"removed":3,"diff":"--- a/worker/project/test/project.test.ts\n+++ b/worker/project/test/project.test.ts\n@@ -204,12 +204,13 @@\n \tassert.equal(folderB[\"notes.md\"], `one\\ntwo\\n${block}four\\nfive\\n`);\n \tassert.deepEqual(Object.keys(synced.files), [\"notes.md\"]); // b's own engine.ts edit was already in its folder\n \n-\t// b settles it with an edit that takes the markers out, and publish goes through, saying what b kept.\n+\t// b settles it with an edit that takes the markers out, and publish goes through, saying what b kept\n+\t// and what its held push said.\n \tproject.edit(\"b\", { file: \"notes.md\", old: block, new: \"three (a and b)\\n\" }, 7);\n \tconst settled = project.publish(\"b\", \"Settle three\", 8);\n \tassert.deepEqual(settled.ok && \"version\" in settled && [settled.version, settled.settled], [\n \t\t2,\n-\t\t[{ file: \"notes.md\", kept: \"rewrote\", theirs: { agent: \"a\", version: 1 } }],\n+\t\t[{ file: \"notes.md\", kept: \"rewrote\", theirs: { agent: \"a\", version: 1 }, held: \"Mark three for b\" }],\n \t]);\n \tassert.equal(project.files()[\"notes.md\"], \"one\\ntwo\\nthree (a and b)\\nfour\\nfive\\n\");\n \tassert.equal(project.files()[\"engine.ts\"], \"export function match(p, s) {\\n  return void 0;\\n}\\n\");\n@@ -357,7 +358,14 @@\n \tassert.equal(project.publish(\"bob\", \"c\", 3).ok, false);\n \tassert.deepEqual(project.status().refusals, { total: 1, lines: 1, definition: 0, attribute: 0, duplicate: 0 });\n \tassert.deepEqual(project.refusals().refusals, [\n-\t\t{ agent: \"bob\", draft: null, via: \"publish\", time: 3, collisions: [{ kind: \"lines\", file: \"a.txt\" }] },\n+\t\t{\n+\t\t\tagent: \"bob\",\n+\t\t\tdraft: null,\n+\t\t\tvia: \"publish\",\n+\t\t\ttime: 3,\n+\t\t\tcollisions: [{ kind: \"lines\", file: \"a.txt\" }],\n+\t\t\tmessage: \"c\",\n+\t\t},\n \t]);\n \tassert.deepEqual(Project.load(store.entries, new MemoryStore()).refusals(), project.refusals());\n });"}],"ci":null}