Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 48 --json
JSON
/christopher/abso-core/versions/48?format=json

publish --done: close the start note's issue only once the publish lands

of shared·pinch··Not checked

With 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.

Now --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."

Closing 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).

Version 47 · Files at version 48

2 files, 45 lines added, 5 removed.

--- a/client/src/publish-commands.ts
+++ b/client/src/publish-commands.ts
@@ -201,11 +201,17 @@
201201 `${checked ? "The check passed; " : ""}the publish may have reached the server before its answer was lost: abso status shows whether your draft was published.`,
202202 );
203203 const out = withLeftOut(reached, leftOut);
204− // --done: this publish finishes the work the start note named (#44): take the note back once it's published or queued.
205− const went =
206− (out.json as { version?: unknown; queued?: unknown }).version !== undefined ||
207− (out.json as { queued?: unknown }).queued !== undefined;
208− if (!bool(args, "done") || !went) return out;
204+ // --done: this publish finishes the work the start note named (#44): take the note back once it's published.
205+ // A publish still in the merge queue may yet be pulled, so its note and issue stay as they are until it lands.
206+ if (!bool(args, "done")) return out;
207+ const { version, queued, outcome } = out.json as { version?: unknown; queued?: unknown; outcome?: unknown };
208+ if (version === undefined) {
209+ if (queued === undefined || outcome === "pulled") return out;
210+ return {
211+ ...out,
212+ text: `${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.`,
213+ };
214+ }
209215 // done (#54): the work is finished, so an issue the note named is closed with this change.
210216 await api.starting(null, undefined, { done: true });
211217 return {
--- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -2187,6 +2187,40 @@
21872187 assert.equal((await avcs(folders.bob!, "status")).json.version, 1, "shared stayed at version 1");
21882188 });
21892189
2190+ it("--done takes the start note back only once the queued publish lands", async () => {
2191+ const { folders } = await project(files, "alice");
2192+ const noted = async () =>
2193+ /Starting on:/.test((await main(["where"], { cwd: folders.alice!, env: QENV, write: () => {} })).stdout);
2194+ assert.equal((await avcs(folders.alice!, "start", "Two", "other.txt")).exit, 0);
2195+ fake.queueHold = true;
2196+ try {
2197+ write(folders.alice!, { "other.txt": "two\n" });
2198+ const queued = await publish(folders.alice!, "-m", "two", "--no-wait", "--done");
2199+ assert.equal(queued.exit, 0, queued.stdout + queued.stderr);
2200+ assert.match(
2201+ queued.stdout,
2202+ /\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$/,
2203+ );
2204+ assert.equal(await noted(), true, "a queued publish may yet be pulled");
2205+ assert.equal((await main(["unqueue"], { cwd: folders.alice!, env: QENV, write: () => {} })).exit, 0);
2206+ } finally {
2207+ fake.queueHold = false;
2208+ }
2209+ write(folders.alice!, { "state.txt": "bad\n" });
2210+ const pulled = await publish(folders.alice!, "-m", "breaks it", "--done");
2211+ assert.equal(pulled.exit, 2, pulled.stdout + pulled.stderr);
2212+ assert.doesNotMatch(pulled.stdout, /start note/);
2213+ assert.equal(await noted(), true, "a pulled publish leaves the note");
2214+ write(folders.alice!, { "state.txt": "ok, fixed\n" });
2215+ const landed = await publish(folders.alice!, "-m", "fixed", "--done");
2216+ assert.equal(landed.exit, 0, landed.stdout + landed.stderr);
2217+ assert.match(
2218+ landed.stdout,
2219+ /\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$/,
2220+ );
2221+ assert.equal(await noted(), false);
2222+ });
21902224 it("--no-wait and --wait, status shows the queue, unqueue takes it back, and a collision names the queued publish", async () => {
21912225 const { folders } = await project(files, "alice", "bob");
21922226 fake.queueHold = true;