abso diff --agent <name>: review another agent's unpublished changes Version 52 of shared· pinch· Oct 9 (2026-10-09 21:34 UTC) · Not checked
Reviewing a teammate's work before it's published had no command: abso diff showed only your own draft, and abso status names files but not lines. Reviewers read the other agent's folder on disk, which only works on a shared machine and shows their disk, not what they recorded.
abso diff --agent alice now prints alice's recorded, unpublished changes line by line, the way abso diff prints yours: "alice's recorded, unpublished changes in shared (on version 12): 2 files, 5 lines added, 1 removed." Paths narrow it as usual. It reads what the server holds, the same route the website's drafts use, so it records nothing and changes nothing. An agent with no changes says so; a name the project doesn't know is refused by the server. --agent doesn't go with two versions or --draft.
The test server answers GET /p/:project/diff?agent= as the Worker does. Tested in client.test.ts.
Version 51 · Files at version 52
5 files, 62 lines added, 4 removed.
--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -846,6 +846,11 @@
846 846 return this.json("POST", this.agentPath("diff"), {}); 849 + /** Another agent's recorded, unpublished changes, file by file: read only, as the website's drafts show them. */ 850 + diffOf(agent: string): Promise<DiffAnswer> { 851 + return this.json("GET", `/diff?${query({ agent })}`); 849 854 /** Discard this agent's unpublished changes to `files` (null: all of them). */ 850 855 restore(files: readonly string[] | null): Promise<RestoreAnswer> { 851 856 return this.json("POST", this.agentPath("restore"), files === null ? { all: true } : { files }); --- a/client/src/changes.ts
+++ b/client/src/changes.ts
@@ -141,6 +141,25 @@
141 141 .filter((p) => only.length > 1 || !existsHere(root, p)) 142 142 .map((p) => nothingAt(root, p)); 144 + // --agent: someone else's draft, to review it. What they've recorded, not their folder; nothing here is recorded. 145 + const other = str(args, "agent"); 146 + if (other !== undefined) { 147 + if (between || str(args, "draft") !== undefined) 148 + throw new UsageError("--agent shows that agent's unpublished changes: abso diff [file...] --agent <name>"); 149 + const answer = await api.diffOf(other); 150 + const files = pick(answer.files); 151 + const d = diffs(files); 152 + const where = `${spaceName(answer.draft)}${answer.base === null ? "" : ` (on version ${answer.base})`}`; 155 + ? `${other} has no recorded, unpublished changes${inPaths(only, "to")} in ${where}.` 156 + : `${other}'s recorded, unpublished changes${inPaths(only, "to")} in ${where}: ${totals(files)}.`; 158 + text: [head, ...d.text].join("\n"), 159 + json: { agent: other, draft: answer.draft, base: answer.base, files: d.json, unmatched: unmatched(files) }, 145 164 const from = version(words[0]!); 146 165 const to = version(words[1]!); --- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -577,10 +577,10 @@
577 577 run: runDraftSync, 580 − flags: { draft: "string" },
581 − usage: "abso diff [file...] | abso diff <from> <to> [file...] [--draft <name>]",
580 + flags: { draft: "string", agent: "string" }, 581 + usage: "abso diff [file...] [--agent <name>] | abso diff <from> <to> [file...] [--draft <name>]", 583 − "Your unpublished changes, line by line, as git prints them (records first). With two versions: what changed between them in this space.",
583 + "Your unpublished changes, line by line, as git prints them (records first). --agent <name>: that agent's recorded, unpublished changes instead, to review them; it changes nothing. With two versions: what changed between them in this space.", --- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -4248,6 +4248,29 @@
4248 4248 /^Your unpublished changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt/, 4251 + // bob reviews alice's draft: what she recorded, read only. 4252 + const theirs = await main(["diff", "a.txt", "--agent", "alice"], { cwd: folders.bob!, env: ENV, write: () => {} }); 4253 + assert.equal(theirs.exit, 0, theirs.stderr); 4256 + /^alice's recorded, unpublished changes to a\.txt in shared \(on version 0\): 1 file, 1 line added, 1 removed\.\n--- a\/a\.txt\n\+\+\+ b\/a\.txt\n@@ -1,3 \+1,3 @@\n one\n-two\n\+TWO\n three/, 4258 + assert.deepEqual((await avcs(folders.bob!, "diff", "--agent", "alice")).json.files.map((f: any) => f.path).sort(), [ 4263 + (await main(["diff", "--agent", "bob"], { cwd: folders.bob!, env: ENV, write: () => {} })).stdout, 4264 + /^bob has no recorded, unpublished changes in shared/, 4266 + const nobody = await main(["diff", "--agent", "carol"], { cwd: folders.bob!, env: ENV, write: () => {} }); 4267 + assert.notEqual(nobody.exit, 0); 4268 + assert.match(nobody.stderr, /there is no agent "carol"/); 4270 + (await main(["diff", "0", "1", "--agent", "alice"], { cwd: folders.bob!, env: ENV, write: () => {} })).exit, 4251 4274 assert.equal((await avcs(alice, "publish", "-m", "alice: shout two, add c")).exit, 0); 4252 4275 await edit(folders.bob!, "b.txt", "b\n", "b from bob\n"); 4253 4276 assert.equal((await avcs(folders.bob!, "publish", "-m", "bob: change b")).exit, 0); --- a/client/test/fake-server.ts
+++ b/client/test/fake-server.ts
@@ -271,7 +271,7 @@
274 − /^\/p\/([^/]+)\/(init|status|queue|change\/\d+|changes|notes|ci\/revoke|ci|blame|why|where|labels|files|log|show|file|compare|a\/([^/]+)\/(edit|record|publish|sync|run|draft|land|draft-sync|diff|restore|announce|news|starting|reader|drop|pluck|amend|label|files|unqueue|note|note-close|move))$/.exec(
274 + /^\/p\/([^/]+)\/(init|status|queue|change\/\d+|changes|notes|ci\/revoke|ci|blame|why|where|labels|files|diff|log|show|file|compare|a\/([^/]+)\/(edit|record|publish|sync|run|draft|land|draft-sync|diff|restore|announce|news|starting|reader|drop|pluck|amend|label|files|unqueue|note|note-close|move))$/.exec( 277 277 if (!m) return send(res, 404, { error: "no such route; see docs/v2-slice1.md" }); @@ -405,6 +405,17 @@
406 406 if (op === "where") return send(res, 200, where(hosted.project)); 407 407 if (op === "labels") return send(res, 200, hosted.project.labels()); 408 + if (op === "diff" && agent === undefined) { 409 + // Another agent's draft, read only (abso diff --agent), as the Worker answers GET /p/:project/diff?agent=. 410 + const of = url.searchParams.get("agent"); 411 + if (!of) return send(res, 400, { error: "diff needs ?agent=<name>" }); 413 + return send(res, 200, hosted.project.diffOf(of)); 415 + const code = (e as { code?: string }).code; 416 + return send(res, code === "not-found" ? 404 : 500, { error: e instanceof Error ? e.message : String(e) }); 408 419 if (op === "files" && agent === undefined) { 409 420 const q = Object.fromEntries(url.searchParams) as Record<string, string | undefined>;