{"version":48,"agent":"pinch","message":"publish --done: close the start note's issue only once the publish lands\n\nWith the merge queue on, publish --done took the start note back, and closed the issue it named, as soon as the publish was queued. If the queue then pulled the publish, nothing had reached shared but the issue still read Done. The same happened with --no-wait and when the wait ran out.\n\nNow --done acts only when the publish has a version: published directly, or landed from the queue while publish waited. A pulled publish leaves the note and its issue as they were. A publish still queued says so: \"Your start note stays (--done): publish N hasn't landed yet. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names.\"\n\nClosing on landing when nobody is waiting would need the queue to remember --done; that's a server change, left for its own round. Tested in client.test.ts (queued, pulled, then landed, in one project).","time":1791579649679,"timeIso":"2026-10-09T21:00:49.679Z","changes":2,"change":585,"files":["client/src/publish-commands.ts","client/test/client.test.ts"],"draft":null,"diff":[{"path":"client/src/publish-commands.ts","added":11,"removed":5,"diff":"--- a/client/src/publish-commands.ts\n+++ b/client/src/publish-commands.ts\n@@ -201,11 +201,17 @@\n \t\t`${checked ? \"The check passed; \" : \"\"}the publish may have reached the server before its answer was lost: abso status shows whether your draft was published.`,\n \t);\n \tconst out = withLeftOut(reached, leftOut);\n-\t// --done: this publish finishes the work the start note named (#44): take the note back once it's published or queued.\n-\tconst went =\n-\t\t(out.json as { version?: unknown; queued?: unknown }).version !== undefined ||\n-\t\t(out.json as { queued?: unknown }).queued !== undefined;\n-\tif (!bool(args, \"done\") || !went) return out;\n+\t// --done: this publish finishes the work the start note named (#44): take the note back once it's published.\n+\t// A publish still in the merge queue may yet be pulled, so its note and issue stay as they are until it lands.\n+\tif (!bool(args, \"done\")) return out;\n+\tconst { version, queued, outcome } = out.json as { version?: unknown; queued?: unknown; outcome?: unknown };\n+\tif (version === undefined) {\n+\t\tif (queued === undefined || outcome === \"pulled\") return out;\n+\t\treturn {\n+\t\t\t...out,\n+\t\t\ttext: `${out.text}\\nYour start note stays (--done): publish ${queued} hasn't landed yet. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names.`,\n+\t\t};\n+\t}\n \t// done (#54): the work is finished, so an issue the note named is closed with this change.\n \tawait api.starting(null, undefined, { done: true });\n \treturn {"},{"path":"client/test/client.test.ts","added":34,"removed":0,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -2187,6 +2187,40 @@\n \t\tassert.equal((await avcs(folders.bob!, \"status\")).json.version, 1, \"shared stayed at version 1\");\n \t});\n \n+\tit(\"--done takes the start note back only once the queued publish lands\", async () => {\n+\t\tconst { folders } = await project(files, \"alice\");\n+\t\tconst noted = async () =>\n+\t\t\t/Starting on:/.test((await main([\"where\"], { cwd: folders.alice!, env: QENV, write: () => {} })).stdout);\n+\t\tassert.equal((await avcs(folders.alice!, \"start\", \"Two\", \"other.txt\")).exit, 0);\n+\t\tfake.queueHold = true;\n+\t\ttry {\n+\t\t\twrite(folders.alice!, { \"other.txt\": \"two\\n\" });\n+\t\t\tconst queued = await publish(folders.alice!, \"-m\", \"two\", \"--no-wait\", \"--done\");\n+\t\t\tassert.equal(queued.exit, 0, queued.stdout + queued.stderr);\n+\t\t\tassert.match(\n+\t\t\t\tqueued.stdout,\n+\t\t\t\t/\\nYour start note stays \\(--done\\): publish 1 hasn't landed yet\\. Once it has, abso start --done takes the note back and abso issue <N> --done closes the issue it names\\.\\n$/,\n+\t\t\t);\n+\t\t\tassert.equal(await noted(), true, \"a queued publish may yet be pulled\");\n+\t\t\tassert.equal((await main([\"unqueue\"], { cwd: folders.alice!, env: QENV, write: () => {} })).exit, 0);\n+\t\t} finally {\n+\t\t\tfake.queueHold = false;\n+\t\t}\n+\t\twrite(folders.alice!, { \"state.txt\": \"bad\\n\" });\n+\t\tconst pulled = await publish(folders.alice!, \"-m\", \"breaks it\", \"--done\");\n+\t\tassert.equal(pulled.exit, 2, pulled.stdout + pulled.stderr);\n+\t\tassert.doesNotMatch(pulled.stdout, /start note/);\n+\t\tassert.equal(await noted(), true, \"a pulled publish leaves the note\");\n+\t\twrite(folders.alice!, { \"state.txt\": \"ok, fixed\\n\" });\n+\t\tconst landed = await publish(folders.alice!, \"-m\", \"fixed\", \"--done\");\n+\t\tassert.equal(landed.exit, 0, landed.stdout + landed.stderr);\n+\t\tassert.match(\n+\t\t\tlanded.stdout,\n+\t\t\t/\\nPublished version 1: it passed the project's check in the merge queue\\.\\nYour start note is taken back \\(--done\\): this work is finished\\.\\n$/,\n+\t\t);\n+\t\tassert.equal(await noted(), false);\n+\t});\n+\n \tit(\"--no-wait and --wait, status shows the queue, unqueue takes it back, and a collision names the queued publish\", async () => {\n \t\tconst { folders } = await project(files, \"alice\", \"bob\");\n \t\tfake.queueHold = true;"}],"ci":null}