{"version":159,"agent":"speed","message":"Settles say what they kept in plain words: a held push's hint says the pull writes a marker block, the change page reads \"kept bob's\" or \"rewrote both sides\" rather than \"kept rewrote\", and a line rewritten longer no longer counts as lost","time":1791921932752,"timeIso":"2026-10-13T20:05:32.752Z","changes":6,"change":2070,"files":["client/src/publish-commands.ts","client/src/review.ts","client/test/held-push.test.ts","worker/project/markers.ts","worker/project/test/markers.test.ts"],"draft":null,"diff":[{"path":"client/src/publish-commands.ts","added":1,"removed":1,"diff":"--- a/client/src/publish-commands.ts\n+++ b/client/src/publish-commands.ts\n@@ -476,7 +476,7 @@\n \t\t\t\t\t]\n \t\t\t\t: []),\n \t\t\tnewer.length > 0\n-\t\t\t\t? `Run abso pull: each of those files comes back holding both sides' lines, with no markers. Edit it to what it should be${twice.length > 0 ? \", keep one definition of each name defined twice\" : \"\"}, then push again.`\n+\t\t\t\t? `Run abso pull: each of those files comes back holding both sides' lines, in a marker block where you both changed the same lines. Settle each as the pull says${twice.length > 0 ? \", keep one definition of each name defined twice\" : \"\"}, then push again.`\n \t\t\t\t: twice.length > 0\n \t\t\t\t\t? \"Keep one definition of each name defined twice (delete yours, or theirs), then push again.\"\n \t\t\t\t\t: \"Run abso pull, then push again.\","},{"path":"client/src/review.ts","added":8,"removed":1,"diff":"--- a/client/src/review.ts\n+++ b/client/src/review.ts\n@@ -83,6 +83,13 @@\n \treturn `  ${c.id}  ${c.agent}, ${titleLine(c.title)}${c.open ? \" (still going)\" : \"\"}: ${versionsText(c)}${files}${open > 0 ? `; ${plural(open, \"open objection\")}` : \"\"}`;\n }\n \n+/** What a settle kept, read from outside: whose lines, not \"yours\" or \"theirs\". */\n+function keptText(s: ChangeAnswer[\"settled\"][number], settler: string): string {\n+\tif (s.kept === \"yours\") return `kept ${settler}'s`;\n+\tif (s.kept === \"theirs\") return `kept ${s.theirs.agent}'s`;\n+\treturn s.kept === \"both\" ? \"kept both\" : \"rewrote both sides\";\n+}\n+\n /** The change page, as text. */\n export function changePage(c: ChangeAnswer): string[] {\n \tconst out = [\n@@ -99,7 +106,7 @@\n \t\t),\n \t\t...(c.settled.length > 0\n \t\t\t? [\n-\t\t\t\t\t`Settled: ${c.settled.map((s) => `${s.file} (kept ${s.kept}, against ${s.theirs.agent}'s version ${s.theirs.version})`).join(\"; \")}.`,\n+\t\t\t\t\t`Settled: ${c.settled.map((s) => `${s.file} (${keptText(s, c.agent)}, against ${s.theirs.agent}'s version ${s.theirs.version})`).join(\"; \")}.`,\n \t\t\t\t]\n \t\t\t: []),\n \t\t...(c.refusals.length > 0"},{"path":"client/test/held-push.test.ts","added":85,"removed":0,"diff":"--- /dev/null\n+++ b/client/test/held-push.test.ts\n@@ -0,0 +1,85 @@\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+\n+import assert from \"node:assert/strict\";\n+import { mkdtempSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\n+import { tmpdir } from \"node:os\";\n+import { join } from \"node:path\";\n+import { after, before, describe, it } from \"node:test\";\n+import { main } from \"../src/main.ts\";\n+import { type Fake, startFake } from \"./fake-server.ts\";\n+\n+const TOKEN = \"test-token-not-secret\";\n+const ENV = { AVCS_TOKEN: TOKEN, AVCS_HOOK_FORCE: \"1\", AVCS_SERVERS_FILE: \"no-servers.json\" };\n+const POLICY = \"# Store policy\\n\\nFree shipping on orders over $50.\\nReturns accepted within 30 days.\\n\";\n+const HELD = \"Lower free shipping to $35: half of abandoned carts were between $35 and $50\";\n+\n+let fake: Fake;\n+const dirs: string[] = [];\n+before(async () => {\n+\tfake = await startFake(0, TOKEN);\n+});\n+after(async () => {\n+\tawait fake.close();\n+\tfor (const d of dirs) rmSync(d, { recursive: true, force: true, maxRetries: 5 });\n+});\n+\n+function temp(): string {\n+\tconst d = mkdtempSync(join(tmpdir(), \"abso-held-\"));\n+\tdirs.push(d);\n+\treturn d;\n+}\n+\n+async function run(cwd: string, ...argv: string[]): Promise<{ exit: number; out: string }> {\n+\tconst r = await main(argv, { cwd, env: ENV, write: () => {} });\n+\treturn { exit: r.exit, out: r.stdout + r.stderr };\n+}\n+\n+let projects = 0;\n+/** alice pushes $75; bob's $35 push is held. Answers both folders and bob's held push. */\n+async function held(): Promise<{ alice: string; bob: string; refused: string }> {\n+\tconst name = `held${++projects}`;\n+\tconst alice = temp();\n+\twriteFileSync(join(alice, \"store-policy.md\"), POLICY);\n+\tassert.equal(\n+\t\t(await run(alice, \"init\", \"--server\", fake.url, \"--project\", name, \"--agent\", \"alice\", \"--as-is\")).exit,\n+\t\t0,\n+\t);\n+\tconst bob = temp();\n+\tassert.equal((await run(bob, \"join\", name, \"--agent\", \"bob\", \"--server\", fake.url)).exit, 0);\n+\twriteFileSync(join(alice, \"store-policy.md\"), POLICY.replace(\"$50\", \"$75\"));\n+\twriteFileSync(join(bob, \"store-policy.md\"), POLICY.replace(\"$50\", \"$35\"));\n+\tconst pushed = await run(alice, \"push\", \"-m\", \"Raise free shipping to $75: shipping costs rose\");\n+\tassert.equal(pushed.exit, 0, pushed.out);\n+\tconst refused = await run(bob, \"push\", \"-m\", HELD);\n+\tassert.equal(refused.exit, 2, refused.out);\n+\treturn { alice, bob, refused: refused.out };\n+}\n+\n+const policy = (dir: string) => readFileSync(join(dir, \"store-policy.md\"), \"utf8\");\n+\n+describe(\"a held push\", () => {\n+\tit(\"says what the pull really writes: a marker block where both changed the same lines\", async () => {\n+\t\tconst { bob, refused } = await held();\n+\t\tassert.doesNotMatch(refused, /no markers/);\n+\t\tassert.match(refused, /Run abso pull: each of those files comes back holding both sides' lines/);\n+\t\tassert.equal((await run(bob, \"pull\")).exit, 0);\n+\t\tassert.match(policy(bob), /^<<<<<<< yours \\(unpublished\\)$/m, \"the pull wrote a marker block\");\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\"],\n+\t\t\t[\"theirs\", \"kept alice's\"],\n+\t\t\t[\"both\", \"kept both\"],\n+\t\t] as const) {\n+\t\t\tconst { alice, bob } = await held();\n+\t\t\tassert.equal((await run(bob, \"pull\")).exit, 0);\n+\t\t\tassert.equal((await run(bob, \"settle\", \"store-policy.md\", `--${how}`)).exit, 0);\n+\t\t\tassert.equal((await run(bob, \"push\", \"-m\", `Settle: keep ${how}`)).exit, 0);\n+\t\t\tconst review = await run(alice, \"review\", \"bob\");\n+\t\t\tassert.ok(review.out.includes(`Settled: store-policy.md (${said}, against alice's version 1).`), review.out);\n+\t\t}\n+\t});\n+});"},{"path":"worker/project/markers.ts","added":6,"removed":2,"diff":"--- a/worker/project/markers.ts\n+++ b/worker/project/markers.ts\n@@ -181,7 +181,11 @@\n \t);\n }\n \n-/** Whether `b` reads as `a` reworded: at least half their words in common. */\n+/**\n+ * Whether `b` reads as `a` reworded: at least half of `a`'s words are still\n+ * in it. Counted against `a` alone, so a rewording that keeps the line and\n+ * adds to it (a reason, the other side's number) still reads as the line.\n+ */\n function alike(a: string, b: string): boolean {\n \tif (a === b) return true;\n \tconst x = words(a);\n@@ -189,7 +193,7 @@\n \tif (x.size === 0 || y.size === 0) return false;\n \tlet both = 0;\n \tfor (const w of x) if (y.has(w)) both++;\n-\treturn both / (x.size + y.size - both) >= 0.5;\n+\treturn both / x.size >= 0.5;\n }\n \n /**"},{"path":"worker/project/test/markers.test.ts","added":19,"removed":0,"diff":"--- a/worker/project/test/markers.test.ts\n+++ b/worker/project/test/markers.test.ts\n@@ -244,6 +244,25 @@\n \tassert.deepEqual(lostLines([\"  rate. *B5: worth +N coin*\"], region), [\"- [x] **Gauge shows coin**\"]);\n });\n \n+test(\"lostLines: a line rewritten longer, keeping its words and adding a reason, is not a loss\", () => {\n+\tconst region = {\n+\t\tfile: \"store-policy.md\",\n+\t\tyours: [\"Free shipping on orders over $35.\"],\n+\t\tbase: [\"Free shipping on orders over $50.\"],\n+\t\ttheirs: [\"Free shipping on orders over $75.\"],\n+\t\tagent: \"alice\",\n+\t\tversion: 1,\n+\t\tmessage: \"m\",\n+\t};\n+\tconst settled = (line: string) => [\"# Store policy\", \"\", line, \"Returns accepted within 30 days.\"];\n+\tassert.deepEqual(\n+\t\tlostLines(settled(\"Free shipping on orders over $50 (alice wants $75, bob wants $35: decided by Friday).\"), region),\n+\t\t[],\n+\t);\n+\tassert.deepEqual(lostLines(settled(\"Free shipping on orders over $60.\"), region), []);\n+\tassert.deepEqual(lostLines(settled(\"Shipping is free.\"), region), [\"Free shipping on orders over $35.\"]);\n+});\n+\n test(\"markers.ts: blocks round-trip, settle, and say what was kept\", () => {\n \tconst who = { agent: \"a\", version: 3, message: 'Line one\\nline two \"quoted\"' };\n \tconst block = markerBlock([\"y1\", \"y2\"], [\"b\"], 2, [\"t1\"], who);"}],"ci":null}