{"version":52,"agent":"pinch","message":"abso diff --agent <name>: review another agent's unpublished changes\n\nReviewing 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.\n\nabso 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.\n\nThe test server answers GET /p/:project/diff?agent= as the Worker does. Tested in client.test.ts.","time":1791581673467,"timeIso":"2026-10-09T21:34:33.467Z","changes":7,"change":621,"files":["client/src/api.ts","client/src/changes.ts","client/src/main.ts","client/test/client.test.ts","client/test/fake-server.ts"],"draft":null,"diff":[{"path":"client/src/api.ts","added":5,"removed":0,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -846,6 +846,11 @@\n \t\treturn this.json(\"POST\", this.agentPath(\"diff\"), {});\n \t}\n \n+\t/** Another agent's recorded, unpublished changes, file by file: read only, as the website's drafts show them. */\n+\tdiffOf(agent: string): Promise<DiffAnswer> {\n+\t\treturn this.json(\"GET\", `/diff?${query({ agent })}`);\n+\t}\n+\n \t/** Discard this agent's unpublished changes to `files` (null: all of them). */\n \trestore(files: readonly string[] | null): Promise<RestoreAnswer> {\n \t\treturn this.json(\"POST\", this.agentPath(\"restore\"), files === null ? { all: true } : { files });"},{"path":"client/src/changes.ts","added":19,"removed":0,"diff":"--- a/client/src/changes.ts\n+++ b/client/src/changes.ts\n@@ -141,6 +141,25 @@\n \t\t\t.filter((p) => only.length > 1 || !existsHere(root, p))\n \t\t\t.map((p) => nothingAt(root, p));\n \n+\t// --agent: someone else's draft, to review it. What they've recorded, not their folder; nothing here is recorded.\n+\tconst other = str(args, \"agent\");\n+\tif (other !== undefined) {\n+\t\tif (between || str(args, \"draft\") !== undefined)\n+\t\t\tthrow new UsageError(\"--agent shows that agent's unpublished changes: abso diff [file...] --agent <name>\");\n+\t\tconst answer = await api.diffOf(other);\n+\t\tconst files = pick(answer.files);\n+\t\tconst d = diffs(files);\n+\t\tconst where = `${spaceName(answer.draft)}${answer.base === null ? \"\" : ` (on version ${answer.base})`}`;\n+\t\tconst head =\n+\t\t\tfiles.length === 0\n+\t\t\t\t? `${other} has no recorded, unpublished changes${inPaths(only, \"to\")} in ${where}.`\n+\t\t\t\t: `${other}'s recorded, unpublished changes${inPaths(only, \"to\")} in ${where}: ${totals(files)}.`;\n+\t\treturn {\n+\t\t\ttext: [head, ...d.text].join(\"\\n\"),\n+\t\t\tjson: { agent: other, draft: answer.draft, base: answer.base, files: d.json, unmatched: unmatched(files) },\n+\t\t};\n+\t}\n+\n \tif (between) {\n \t\tconst from = version(words[0]!);\n \t\tconst to = version(words[1]!);"},{"path":"client/src/main.ts","added":3,"removed":3,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -577,10 +577,10 @@\n \t\trun: runDraftSync,\n \t},\n \tdiff: {\n-\t\tflags: { draft: \"string\" },\n-\t\tusage: \"abso diff [file...] | abso diff <from> <to> [file...] [--draft <name>]\",\n+\t\tflags: { draft: \"string\", agent: \"string\" },\n+\t\tusage: \"abso diff [file...] [--agent <name>] | abso diff <from> <to> [file...] [--draft <name>]\",\n \t\tabout:\n-\t\t\t\"Your unpublished changes, line by line, as git prints them (records first). With two versions: what changed between them in this space.\",\n+\t\t\t\"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.\",\n \t\trun: runDiff,\n \t},\n \trestore: {"},{"path":"client/test/client.test.ts","added":23,"removed":0,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -4248,6 +4248,29 @@\n \t\t\t/^Your unpublished changes to a\\.txt in shared \\(on version 0\\): 1 file, 1 line added, 1 removed\\.\\n--- a\\/a\\.txt/,\n \t\t);\n \n+\t\t// bob reviews alice's draft: what she recorded, read only.\n+\t\tconst theirs = await main([\"diff\", \"a.txt\", \"--agent\", \"alice\"], { cwd: folders.bob!, env: ENV, write: () => {} });\n+\t\tassert.equal(theirs.exit, 0, theirs.stderr);\n+\t\tassert.match(\n+\t\t\ttheirs.stdout,\n+\t\t\t/^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/,\n+\t\t);\n+\t\tassert.deepEqual((await avcs(folders.bob!, \"diff\", \"--agent\", \"alice\")).json.files.map((f: any) => f.path).sort(), [\n+\t\t\t\"a.txt\",\n+\t\t\t\"c.txt\",\n+\t\t]);\n+\t\tassert.match(\n+\t\t\t(await main([\"diff\", \"--agent\", \"bob\"], { cwd: folders.bob!, env: ENV, write: () => {} })).stdout,\n+\t\t\t/^bob has no recorded, unpublished changes in shared/,\n+\t\t);\n+\t\tconst nobody = await main([\"diff\", \"--agent\", \"carol\"], { cwd: folders.bob!, env: ENV, write: () => {} });\n+\t\tassert.notEqual(nobody.exit, 0);\n+\t\tassert.match(nobody.stderr, /there is no agent \"carol\"/);\n+\t\tassert.equal(\n+\t\t\t(await main([\"diff\", \"0\", \"1\", \"--agent\", \"alice\"], { cwd: folders.bob!, env: ENV, write: () => {} })).exit,\n+\t\t\t1,\n+\t\t);\n+\n \t\tassert.equal((await avcs(alice, \"publish\", \"-m\", \"alice: shout two, add c\")).exit, 0);\n \t\tawait edit(folders.bob!, \"b.txt\", \"b\\n\", \"b from bob\\n\");\n \t\tassert.equal((await avcs(folders.bob!, \"publish\", \"-m\", \"bob: change b\")).exit, 0);"},{"path":"client/test/fake-server.ts","added":12,"removed":1,"diff":"--- a/client/test/fake-server.ts\n+++ b/client/test/fake-server.ts\n@@ -271,7 +271,7 @@\n \t\t\treturn;\n \t\t}\n \t\tconst m =\n-\t\t\t/^\\/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(\n+\t\t\t/^\\/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(\n \t\t\t\turl.pathname,\n \t\t\t);\n \t\tif (!m) return send(res, 404, { error: \"no such route; see docs/v2-slice1.md\" });\n@@ -405,6 +405,17 @@\n \t\t}\n \t\tif (op === \"where\") return send(res, 200, where(hosted.project));\n \t\tif (op === \"labels\") return send(res, 200, hosted.project.labels());\n+\t\tif (op === \"diff\" && agent === undefined) {\n+\t\t\t// Another agent's draft, read only (abso diff --agent), as the Worker answers GET /p/:project/diff?agent=.\n+\t\t\tconst of = url.searchParams.get(\"agent\");\n+\t\t\tif (!of) return send(res, 400, { error: \"diff needs ?agent=<name>\" });\n+\t\t\ttry {\n+\t\t\t\treturn send(res, 200, hosted.project.diffOf(of));\n+\t\t\t} catch (e) {\n+\t\t\t\tconst code = (e as { code?: string }).code;\n+\t\t\t\treturn send(res, code === \"not-found\" ? 404 : 500, { error: e instanceof Error ? e.message : String(e) });\n+\t\t\t}\n+\t\t}\n \t\tif (op === \"files\" && agent === undefined) {\n \t\t\tconst q = Object.fromEntries(url.searchParams) as Record<string, string | undefined>;\n \t\t\ttry {"}],"ci":null}