{"version":281,"agent":"pinch","message":"Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file\n\n- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.\n- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.\n- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.\n- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.\n- reply takes --file <path> or --file - (stdin), like ask and answer.\n- The mod-behind tests no longer depend on which mods the machine has.\n\nTests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.","time":1792114518416,"timeIso":"2026-10-16T01:35:18.416Z","changes":19,"change":4438,"files":["client/src/body-files.ts","client/src/doctor.ts","client/src/install.ts","client/src/join-commands.ts","client/src/main.ts","client/src/serve-commands.ts","client/test/body-files.test.ts","client/test/doctor.test.ts","client/test/failed-start.test.ts","client/test/install.test.ts"],"draft":null,"diff":[{"path":"client/src/body-files.ts","added":3,"removed":3,"diff":"--- a/client/src/body-files.ts\n+++ b/client/src/body-files.ts\n@@ -2,7 +2,7 @@\n // passes a native command's argument badly, so a multi-line --comment,\n // --description or answer reached the server cut to its first line, and nobody\n // knew. Any text flag also takes --<flag>-file <path>, and the commands whose\n-// text is their words (ask, answer, announce) take --file <path>. A path of -\n+// text is their words (ask, answer, reply, announce) take --file <path>. A path of -\n // reads stdin. The file's text arrives whole on any shell.\n \n import { readFileSync } from \"node:fs\";\n@@ -12,7 +12,7 @@\n /** The text flags a command may take from a file instead. */\n const BODY_FLAGS = [\"message\", \"comment\", \"object\", \"description\", \"note\"] as const;\n /** Commands whose text is their last words: --file gives those words. */\n-const WORDS_FROM_FILE = new Set([\"ask\", \"answer\", \"announce\"]);\n+const WORDS_FROM_FILE = new Set([\"ask\", \"answer\", \"reply\", \"announce\"]);\n \n /** The command's flags, plus a -file twin for each text flag it takes, and --file where its words are its text. */\n export function withBodyFiles(command: string, spec: FlagSpec): FlagSpec {\n@@ -75,7 +75,7 @@\n \t}\n \tconst path = flags.get(\"file\");\n \tif (WORDS_FROM_FILE.has(command) && typeof path === \"string\") {\n-\t\t// ask <who> and answer <ask> keep their first word; announce's words are all text.\n+\t\t// ask <who>, answer <ask> and reply <ask> keep their first word; announce's words are all text.\n \t\tconst keep = command === \"announce\" ? 0 : 1;\n \t\tif (positionals.length > keep)\n \t\t\tthrow new UsageError(`--file gives ${command}'s text, so leave the words off the command line`);"},{"path":"client/src/doctor.ts","added":4,"removed":4,"diff":"--- a/client/src/doctor.ts\n+++ b/client/src/doctor.ts\n@@ -327,13 +327,13 @@\n \n /**\n  * The commonest failures in plain words, with the next step: no credential, a credential the server refuses, and a\n- * server that can't be reached. Anything else is left as it was. `signedIn` is whether the call carried a key or token.\n+ * server that can't be reached. Anything else is left as it was. `sent` names the key or token the call carried, if any.\n  */\n-export function plainError(err: unknown, signedIn: boolean, tokenFileUnasked = false): string | undefined {\n+export function plainError(err: unknown, sent: string | undefined, tokenFileUnasked = false): string | undefined {\n \tif (!(err instanceof ApiError)) return undefined;\n \tif (err.status === 401)\n-\t\treturn signedIn\n-\t\t\t? `The server didn't accept this folder's key: it may be revoked or expired. abso doctor checks it. (${err.message})`\n+\t\treturn sent !== undefined\n+\t\t\t? `The server didn't accept ${sent}: it may be revoked or expired. abso doctor checks it. (${err.message})`\n \t\t\t: `You're not signed in. Run abso login, then abso join <project>.${tokenFileUnasked ? \" ~/.abso/token is used only with --token-file.\" : \"\"}`;\n \tif (err.status === undefined && err.message.startsWith(\"could not reach \")) {\n \t\tconst said = err.message.replace(/^could not reach /, \"Can't reach \");"},{"path":"client/src/install.ts","added":15,"removed":4,"diff":"--- a/client/src/install.ts\n+++ b/client/src/install.ts\n@@ -517,7 +517,18 @@\n \treadonly current: string;\n }\n \n-/** `avcs --version`: this client, and the mods installed on this machine, compared with this client's. */\n+/**\n+ * The command that runs one of this client's installers (client/install-mod.ts or install-view.ts), by its full\n+ * path. They are .ts files, which Node runs itself from 22.18, so on an older Node it says which one it needs.\n+ */\n+export function installerCommand(installer: string): string {\n+\tconst command = `node ${join(CLIENT_DIR, installer)}`;\n+\treturn (process.features as { typescript?: unknown }).typescript\n+\t\t? command\n+\t\t: `${command} (with Node 22.18 or later, which runs .ts files; this is Node ${process.versions.node})`;\n+}\n+\n+/** `abso --version`: this client, and the mods installed on this machine, compared with this client's. */\n export function versionReport(env: Readonly<Record<string, string | undefined>>): {\n \ttext: string;\n \tjson: Record<string, unknown>;\n@@ -554,14 +565,14 @@\n \t\tmods.push(m);\n \t\t// A built copy has no mod files to compare with or install from: it reports what is installed.\n \t\tif (m.version === undefined) {\n-\t\t\tlines.push(`the ${m.name} mod: not installed${builtCopy() ? \"\" : ` (node client/${installer})`}`);\n+\t\t\tlines.push(`the ${m.name} mod: not installed${builtCopy() ? \"\" : ` (${installerCommand(installer)})`}`);\n \t\t\tcontinue;\n \t\t}\n \t\tconst when = m.at ? `, installed ${m.at.slice(0, 16).replace(\"T\", \" \")} UTC` : \"\";\n \t\tconst behind =\n \t\t\tbuiltCopy() || m.version === m.current\n \t\t\t\t? \"\"\n-\t\t\t\t: `; this client has ${m.current}: node client/${installer} installs it`;\n+\t\t\t\t: `; this client has ${m.current}: ${installerCommand(installer)} installs it`;\n \t\tlines.push(`the ${m.name} mod: ${m.version} in ${m.folder}${when}${behind}`);\n \t}\n \treturn { text: lines.join(\"\\n\"), json: { client, folder: CLIENT_DIR, mods } };\n@@ -579,6 +590,6 @@\n \t\t.filter((m) => m.version?.includes(\"+\") && /\\+[0-9a-f]{7}$/.test(m.current) && m.version !== m.current)\n \t\t.map(\n \t\t\t(m) =>\n-\t\t\t\t`The ${m.name} mod installed on this machine is ${m.version}, and this client has ${m.current}: node client/${installers[m.name]} installs it (new chats load it).`,\n+\t\t\t\t`The ${m.name} mod installed on this machine is ${m.version}, and this client has ${m.current}: ${installerCommand(installers[m.name]!)} installs it (new chats load it).`,\n \t\t);\n }"},{"path":"client/src/join-commands.ts","added":46,"removed":17,"diff":"--- a/client/src/join-commands.ts\n+++ b/client/src/join-commands.ts\n@@ -3,7 +3,7 @@\n import { randomUUID } from \"node:crypto\";\n import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from \"node:fs\";\n import { join, relative, resolve } from \"node:path\";\n-import { Api, ApiError } from \"./api.ts\";\n+import { Api, ApiError, type SyncAnswer } from \"./api.ts\";\n import { bool, type Parsed, str, UsageError } from \"./args.ts\";\n import { writeKnownBlobs } from \"./blobs.ts\";\n import {\n@@ -16,9 +16,9 @@\n \treadBox,\n } from \"./box.ts\";\n import { STARTING_ABSOIGNORE } from \"./check-ignore.ts\";\n-import { CLIENT_DIR } from \"./client-version.ts\";\n+import { builtCopy } from \"./client-version.ts\";\n import { type Env, type Output, plural } from \"./command-env.ts\";\n-import { leftOutText, syncFolder, uploadBlobs } from \"./commands.ts\";\n+import { applyAnswer, leftOutText, pullAnswer, pullWritten, syncFolder, uploadBlobs } from \"./commands.ts\";\n import {\n \tfindRoot,\n \tinstallKey,\n@@ -32,7 +32,7 @@\n import { elsewhereText } from \"./doctor.ts\";\n import { fromEnv } from \"./env-names.ts\";\n import { clearKnown, loadIgnore, readFolder, writeKnown } from \"./folder.ts\";\n-import { modInstalled } from \"./install.ts\";\n+import { installerCommand, modInstalled } from \"./install.ts\";\n import { type FullMode, foldModes, writeKnownModes } from \"./modes.ts\";\n import { initInOrg, siteOf } from \"./orgs.ts\";\n import { projectFileName, readProjectFile, startingProjectFileText, writeStartingProjectFile } from \"./project-file.ts\";\n@@ -141,12 +141,20 @@\n \tsay(`Signing in with ${credential?.words ?? `no credential: nothing here signs in to ${server}`}.\n `);\n \tconst api = new Api({ ...config, ...(token ? { token } : {}) });\n-\tawait uploadBlobs(api, blobs);\n-\tconst answer = await api.init(\n-\t\tObject.fromEntries(files),\n-\t\tmodes,\n-\t\tObject.fromEntries([...blobs].map(([rel, b]) => [rel, b.sha])),\n-\t);\n+\tlet answer: Awaited<ReturnType<Api[\"init\"]>>;\n+\ttry {\n+\t\tawait uploadBlobs(api, blobs);\n+\t\tanswer = await api.init(\n+\t\t\tObject.fromEntries(files),\n+\t\t\tmodes,\n+\t\t\tObject.fromEntries([...blobs].map(([rel, b]) => [rel, b.sha])),\n+\t\t);\n+\t} catch (error) {\n+\t\t// No project was made: the starting files init wrote go too, so the folder is as it was.\n+\t\tif (wroteIgnore) rmSync(absoignore, { force: true });\n+\t\tif (typeof wroteProject !== \"string\") rmSync(join(root, projectFileName(root)), { force: true });\n+\t\tthrow error;\n+\t}\n \twriteConfig(root, config);\n \tclearKnown(root);\n \tfor (const [rel, text] of files) writeKnown(root, rel, text);\n@@ -351,6 +359,16 @@\n \t};\n }\n \n+/** A join that failed before writing files: its state goes, but a key (already here, or made for it) stays for the next try. */\n+function takeBackJoin(root: string): void {\n+\tconst dir = stateDir(root);\n+\tif (!existsSync(join(dir, \"key\"))) {\n+\t\trmSync(dir, { recursive: true, force: true });\n+\t\treturn;\n+\t}\n+\tfor (const entry of readdirSync(dir)) if (entry !== \"key\") rmSync(join(dir, entry), { recursive: true, force: true });\n+}\n+\n export async function runJoin(args: Parsed, env: Env): Promise<Output> {\n \tif (args.positionals.length !== 1) throw new UsageError(\"join takes the project name: abso join <project>\");\n \tconst project = args.positionals[0]!;\n@@ -399,25 +417,34 @@\n \tclearKnown(root);\n \tif (minted) installKey(root, JSON.stringify(minted));\n \t// The token file only with --token-file: readConfig reads it otherwise.\n-\tconst read = readConfig(root, env.env, false);\n+\tlet read: ReturnType<typeof readConfig>;\n+\ttry {\n+\t\tread = readConfig(root, env.env, false);\n+\t} catch (error) {\n+\t\ttakeBackJoin(root);\n+\t\tthrow error;\n+\t}\n \tconst settings = tokenFileAsked ? { ...read, token: credential?.token } : read;\n \t(env.writeErr ?? env.write)(\n \t\t`Signing in with ${minted && box ? `a new key from this box's sign-in, ${box.id}` : hasKey ? \"this folder's key\" : (credential?.words ?? `no credential: nothing here signs in to ${server}`)}.\n `,\n \t);\n \tconst api = new Api(settings);\n-\tlet synced: Awaited<ReturnType<typeof syncFolder>>;\n+\tlet answer: SyncAnswer;\n \ttry {\n \t\t// Before the sync, so the server never takes a record from this folder.\n \t\tif (reader) await api.reader(true);\n \t\t// Every file, even when the server has seen this agent sync before: its plain sync answer would hold only what changed since (#37).\n-\t\tsynced = await syncFolder(root, api, true);\n+\t\tanswer = await pullAnswer(root, api, true);\n \t} catch (error) {\n+\t\t// Nothing is written yet: take back what join wrote so it can run again here.\n+\t\ttakeBackJoin(root);\n \t\tif (!(error instanceof ApiError && error.status === 401 && !box && !settings.token)) throw error;\n-\t\trmSync(stateDir(root), { recursive: true, force: true });\n \t\tconst why = await signedOut(config.server, project);\n \t\tthrow new UsageError(!tokenFileAsked && tokenFile() !== undefined ? `${why} ${TOKEN_FILE_ASKED}` : why);\n \t}\n+\tconst synced = await applyAnswer(root, api, answer);\n+\tpullWritten(root);\n \treturn {\n \t\ttext: [\n \t\t\t`Joined ${project} as ${config.agent} at version ${synced.version}: wrote ${plural(synced.written.length, \"file\")} into ${root}.${reader ? \" It is a reader: status, pull, log, show, files and export work, and nothing it does is recorded or pushed.\" : \"\"}${minted ? ` It signs in with its own key, ${minted.id}, made from this box's sign-in.` : \"\"}`,\n@@ -454,7 +481,9 @@\n }\n \n function hookHint(env: Readonly<Record<string, string | undefined>>): string {\n-\treturn modInstalled(env)\n-\t\t? \"Edits made by Claude Code here are recorded by the abso mod on this machine, signed in as this folder. Anything else: abso record.\"\n-\t\t: `Edits made by Claude Code reach the server through the abso mod, which isn't on this machine yet: node ${join(CLIENT_DIR, \"install-mod.ts\")} installs it, and new chats load it. Anything else: abso record.`;\n+\tif (modInstalled(env))\n+\t\treturn \"Edits made by Claude Code here are recorded by the abso mod on this machine, signed in as this folder. Anything else: abso record.\";\n+\t// A built copy (the npm package) has no installer to point at (abso-core 18).\n+\tif (builtCopy()) return \"abso record sends the edits made here, whoever made them.\";\n+\treturn `Edits made by Claude Code reach the server through the abso mod, which isn't on this machine yet: ${installerCommand(\"install-mod.ts\")} installs it, and new chats load it. Anything else: abso record.`;\n }"},{"path":"client/src/main.ts","added":19,"removed":16,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -1,8 +1,8 @@\n // The command table and the dispatcher. main() returns what to print and the\n // exit code instead of printing, so tests can call it directly.\n \n-import { readFileSync } from \"node:fs\";\n-import { resolve } from \"node:path\";\n+import { existsSync, readFileSync } from \"node:fs\";\n+import { join, resolve } from \"node:path\";\n import { runAnnounce, runNews, runStart } from \"./announce.ts\";\n import { ApiError } from \"./api.ts\";\n import { bool, type FlagSpec, type Parsed, parseArgs, str, UsageError } from \"./args.ts\";\n@@ -38,7 +38,7 @@\n \trunSync,\n \ttakeNews,\n } from \"./commands.ts\";\n-import { configPath, findRoot, installKey, isVisitor, readConfig, tokenFile } from \"./config.ts\";\n+import { configPath, findRoot, installKey, isVisitor, readConfig, runKey, tokenFile } from \"./config.ts\";\n import { newsBlockLines, newsShown } from \"./core.ts\";\n import { doctor, doctorText, plainError, realProbe, whoami } from \"./doctor.ts\";\n import { runDraftSync, runLand, runSwitch } from \"./drafts.ts\";\n@@ -73,6 +73,7 @@\n \tserverUse,\n } from \"./server-choice.ts\";\n import { installSkill, SKILL, skillPath } from \"./skill.ts\";\n+import { stateDir } from \"./state-dir.ts\";\n import { colorsPass, terminalText } from \"./terminal-text.ts\";\n import { runAmend, runDrop, runFollow, runLabel, runLabels, runPluck } from \"./versions.ts\";\n import { runVisibility } from \"./visibility-commands.ts\";\n@@ -124,7 +125,7 @@\n \t\tusage:\n \t\t\t\"abso init [folder] --project <name> [--agent <name>] [--as-is] [--org <org>] [--public|--private] [--token-file]\",\n \t\tabout:\n-\t\t\t\"Create a project on the server from a folder's text files The folder becomes that agent's folder. It writes a starting .absoignore, and, when the folder has no avcs.json and package.json gives a check or a build to guess, an avcs.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import). On a server this box is signed in to (abso login, approving all your projects), the project is made as you, the way the website's New project makes it: you own it, it's private unless you say --public, and the folder joins it at once with its own key (--agent names it; else the box's name). --org <org> makes it that organization's project. Elsewhere it needs --agent and a token: ABSO_TOKEN, or with --token-file this machine's ~/.abso/token, which is never used unasked. Before it makes anything, it says what it signs in with.\",\n+\t\t\t\"Create a project on the server from a folder's text files. The folder becomes that agent's folder. It writes a starting .absoignore, and, when the folder has no abso.json and package.json gives a check or a build to guess, an abso.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import). On a server this box is signed in to (abso login, approving all your projects), the project is made as you, the way the website's New project makes it: you own it, it's private unless you say --public, and the folder joins it at once with its own key (--agent names it; else the box's name). --org <org> makes it that organization's project. Elsewhere it needs --agent and a token: ABSO_TOKEN, or with --token-file this machine's ~/.abso/token, which is never used unasked. Before it makes anything, it says what it signs in with.\",\n \t\trun: (args, env) => runInit(args, env),\n \t},\n \tkey: {\n@@ -140,7 +141,7 @@\n \t\tusage:\n \t\t\t\"abso key install [--server <url> [--dir <folder>]] | abso key new <agent> [--server <url> [--dir <folder>]] [--project <name>] [--expires <Nd>] [--role owner|writer|reader] [--print] | abso key list [--agent <name>] [--project <name>] | abso key revoke <id> [--project <name>]\",\n \t\tabout:\n-\t\t\t\"install reads {key, id} from stdin into .abso/key. With --server, it writes it into a folder not joined yet, so abso join there signs in with the key. new writes the key into that folder and prints only the id; its role is writer unless --role says otherwise (a reader only reads; a writer writes on its own agent's routes; an owner also skips or revokes CI, resumes the queue, syncs git and exports); --print writes the key to stdout instead. list and revoke never print a key. These three read the admin token from AVCS_ADMIN_TOKEN or ~/.abso/admin-token and send it only to a server named in AVCS_ADMIN_SERVERS. An agent does not run them unless a person on the project says so.\",\n+\t\t\t\"install reads {key, id} from stdin into .abso/key. With --server, it writes it into a folder not joined yet, so abso join there signs in with the key. new writes the key into that folder and prints only the id; its role is writer unless --role says otherwise (a reader only reads; a writer writes on its own agent's routes; an owner also skips or revokes CI, resumes the queue, syncs git and exports); --print writes the key to stdout instead. list and revoke never print a key. These three read the admin token from ABSO_ADMIN_TOKEN or ~/.abso/admin-token and send it only to a server named in ABSO_ADMIN_SERVERS. An agent does not run them unless a person on the project says so.\",\n \t\trun: async (args, env) => {\n \t\t\tconst sub = args.positionals[0];\n \t\t\tif (sub === \"install\" && args.positionals.length === 1) return runKeyInstall(args, env);\n@@ -352,7 +353,7 @@\n \t\t},\n \t\tusage: 'abso push -m \"<why>\" [--as-is] [--check [\"<command>\"]] [--wait <seconds> | --no-wait] [--done]',\n \t\tabout:\n-\t\t\t'Record, then add your draft to shared. Refused when it collides with work pushed since your last pull, or when lines a pull showed changed on both sides are still untouched (--as-is pushes both sides\\' lines anyway). --check \"<command>\" (e.g. --check \"npm run typecheck\") first pulls, then runs the command in your box on your draft with newest shared, and pushes only if it exits 0, so two changes that each pass alone can\\'t turn shared red. --check alone runs the \"build\" and then the \"check\" in the project\\'s avcs.json (your draft\\'s copy), as the server does on each new version. With the merge queue on (\"queue\": true in avcs.json), a push to shared is queued and lands only once the project\\'s check passes on shared with it on top: push waits up to 100 s for that (--wait <seconds> changes it, --no-wait returns at once), then says it landed (exit 0), was turned back with the check\\'s output (exit 2, its changes still in your draft), or is still queued (exit 3; the outcome comes as news). --check alone is skipped then, since the queue runs the check. --done takes your start note back once it\\'s pushed: this push finishes that work.',\n+\t\t\t'Record, then add your draft to shared. Refused when it collides with work pushed since your last pull, or when lines a pull showed changed on both sides are still untouched (--as-is pushes both sides\\' lines anyway). --check \"<command>\" (e.g. --check \"npm run typecheck\") first pulls, then runs the command in your box on your draft with newest shared, and pushes only if it exits 0, so two changes that each pass alone can\\'t turn shared red. --check alone runs the \"build\" and then the \"check\" in the project\\'s abso.json (your draft\\'s copy), as the server does on each new version. With the merge queue on (\"queue\": true in abso.json), a push to shared is queued and lands only once the project\\'s check passes on shared with it on top: push waits up to 100 s for that (--wait <seconds> changes it, --no-wait returns at once), then says it landed (exit 0), was turned back with the check\\'s output (exit 2, its changes still in your draft), or is still queued (exit 3; the outcome comes as news). --check alone is skipped then, since the queue runs the check. --done takes your start note back once it\\'s pushed: this push finishes that work.',\n \t\trun: runPublish,\n \t},\n \tbisect: {\n@@ -400,7 +401,7 @@\n \t\tusage:\n \t\t\t'abso run [--detach] [--replace] [--fresh] [--box <name>] [--at <version> [--files <glob>]] <command...> | abso run ... -- <program> <arg...> | abso run --parallel \"<command>\" \"<command>\"...',\n \t\tabout:\n-\t\t\t\"Send the folder to this agent's box, run the command there, and stream its output back. Exits with the command's code. After --, each word goes to the program exactly as typed (quotes, backslashes, regex text); without --, the words are one shell command. The box's stderr comes out on stderr. --detach starts it and prints its id without waiting. While a run is still going in the box, a new one is refused (409, naming it), since it would replace the files under it; --replace stops the old one first. --parallel runs each quoted command at once in the box (one upload), labels each line [1], [2], ..., ends with each one's exit code, and exits with the worst. --at <version> runs that version of the folder's space instead of the folder (for bisecting); with --files <glob>, only the matching files are taken from that version. The folder is never touched. --fetch <glob>[,<glob>...] brings matching files from the box's /w back after the run (see abso fetch); several globs go in one argument, comma-separated (--fetch 'shots/*.png,out/*.json'), as for --files and --with. The box's /w is replaced by your folder on every run; the rest of the box (/tmp, ~/.cache, /w/node_modules) lasts between runs until the box stops (idle 30 minutes, or restarted). abso's own notices go to stderr, apart from the command's output; --quiet drops them (the command's own stderr still comes through). --with <box path>=<local path>[,...] adds files (or a folder's files) for this run only: they go to the box and are never written to your folder or recorded, for an A/B run that leaves the project alone. --box <name> (or AVCS_BOX=<name>) runs in another box of yours, with its own /w and state, so a subagent's runs and yours don't wait on each other; logs and fetch take --box too. After abso prep, a fresh box starts from the prep; --fresh starts this run from the plain image instead.\",\n+\t\t\t\"Send the folder to this agent's box, run the command there, and stream its output back. Exits with the command's code. After --, each word goes to the program exactly as typed (quotes, backslashes, regex text); without --, the words are one shell command. The box's stderr comes out on stderr. --detach starts it and prints its id without waiting. While a run is still going in the box, a new one is refused (409, naming it), since it would replace the files under it; --replace stops the old one first. --parallel runs each quoted command at once in the box (one upload), labels each line [1], [2], ..., ends with each one's exit code, and exits with the worst. --at <version> runs that version of the folder's space instead of the folder (for bisecting); with --files <glob>, only the matching files are taken from that version. The folder is never touched. --fetch <glob>[,<glob>...] brings matching files from the box's /w back after the run (see abso fetch); several globs go in one argument, comma-separated (--fetch 'shots/*.png,out/*.json'), as for --files and --with. The box's /w is replaced by your folder on every run; the rest of the box (/tmp, ~/.cache, /w/node_modules) lasts between runs until the box stops (idle 30 minutes, or restarted). abso's own notices go to stderr, apart from the command's output; --quiet drops them (the command's own stderr still comes through). --with <box path>=<local path>[,...] adds files (or a folder's files) for this run only: they go to the box and are never written to your folder or recorded, for an A/B run that leaves the project alone. --box <name> (or ABSO_BOX=<name>) runs in another box of yours, with its own /w and state, so a subagent's runs and yours don't wait on each other; logs and fetch take --box too. After abso prep, a fresh box starts from the prep; --fresh starts this run from the plain image instead.\",\n \t\trest: true,\n \t\trun: runRun,\n \t},\n@@ -615,7 +616,7 @@\n \t\tflags: { version: \"string\", revoke: \"boolean\" },\n \t\tusage: \"abso ci [<version>] | abso ci --revoke\",\n \t\tabout:\n-\t\t\t\"The project's CI: the server runs avcs.json's setup, build and check on each new version of shared, one job at a time on the newest. abso ci says whether shared is green or red (and since which version, by whom, once a bisect finds it), what is being checked, and the preview link of the newest passing build, which needs no token. abso ci <version> shows that version's job: which step failed, its exit code, and the end of its output. status says the same in a line, and log marks each version of shared. --revoke ends every preview link handed out so far and makes a new one.\",\n+\t\t\t\"The project's CI: the server runs abso.json's setup, build and check on each new version of shared, one job at a time on the newest. abso ci says whether shared is green or red (and since which version, by whom, once a bisect finds it), what is being checked, and the preview link of the newest passing build, which needs no token. abso ci <version> shows that version's job: which step failed, its exit code, and the end of its output. status says the same in a line, and log marks each version of shared. --revoke ends every preview link handed out so far and makes a new one.\",\n \t\trun: runCi,\n \t},\n \tshot: {\n@@ -641,7 +642,7 @@\n \t\tusage:\n \t\t\t'abso shot [\"/<path>?<query>\"] [--scale 0.1-1] [--region x0,y0,x1,y1] [--text] [--tree [--interactive] [--depth N]] [--find \"<text>\"] [--max-chars N] [--image] [--at <version>] [--eval \"<js>\"] [--click \"x,y[@ms];ref_N[@ms]\"] [--mouse x,y|ref_N] [--out <file.png>] [--wait <ms>] [--size <w>x<h>]',\n \t\tabout:\n-\t\t\t\"A look at your folder's game, taken in your box: it runs the project's vite dev server and Playwright on that page (default /, a 1280x720 page). Images cost tokens, so read without one when you can: --text prints the page's visible text, --tree its elements (role, name, a ref like ref_12, and its box in page pixels; --interactive only what can be clicked or typed in; --depth N levels), and --find \\\"<text>\\\" the elements matching some text; each is capped at --max-chars (default 5000). With none of those, or with --image, it writes a PNG to .avcs/shots/ (never recorded) or --out, and prints its pixel size and about how many tokens reading it costs (width x height / 750). --scale 0.5 halves the width and height (a quarter of the tokens); --region x0,y0,x1,y1 takes part of the page at full detail; they combine. Coordinates are always the page's, whatever the scale or region. To set up a state first, --eval runs JavaScript in the page and --click clicks points (x,y or ref_N; several separated by ;; @ms waits first), in that order, a second after load and two frames after the eval; --mouse x,y or ref_N leaves the pointer there (for hover cards); then it waits --wait ms (default 3000) and looks. It prints --eval's result, page errors and the first 30 console messages. Refs come from --tree or --find on the same page in the same state. --at <version> looks at that version of your folder's space instead of the folder (as abso run --at). Needs vite and playwright in the project's devDependencies; abso prep with npx --no-install playwright install chromium makes it fast.\",\n+\t\t\t\"A look at your folder's game, taken in your box: it runs the project's vite dev server and Playwright on that page (default /, a 1280x720 page). Images cost tokens, so read without one when you can: --text prints the page's visible text, --tree its elements (role, name, a ref like ref_12, and its box in page pixels; --interactive only what can be clicked or typed in; --depth N levels), and --find \\\"<text>\\\" the elements matching some text; each is capped at --max-chars (default 5000). With none of those, or with --image, it writes a PNG to .abso/shots/ (never recorded) or --out, and prints its pixel size and about how many tokens reading it costs (width x height / 750). --scale 0.5 halves the width and height (a quarter of the tokens); --region x0,y0,x1,y1 takes part of the page at full detail; they combine. Coordinates are always the page's, whatever the scale or region. To set up a state first, --eval runs JavaScript in the page and --click clicks points (x,y or ref_N; several separated by ;; @ms waits first), in that order, a second after load and two frames after the eval; --mouse x,y or ref_N leaves the pointer there (for hover cards); then it waits --wait ms (default 3000) and looks. It prints --eval's result, page errors and the first 30 console messages. Refs come from --tree or --find on the same page in the same state. --at <version> looks at that version of your folder's space instead of the folder (as abso run --at). Needs vite and playwright in the project's devDependencies; abso prep with npx --no-install playwright install chromium makes it fast.\",\n \t\trun: runShot,\n \t},\n \tprep: {\n@@ -857,7 +858,7 @@\n \t\tusage:\n \t\t\t\"abso pipeline check [file] [--on push|draft|green|land|hand|schedule [--space <name>] [--pipeline <name>] [--every <when>]] | abso pipeline runs [<run>] [--log <pipeline.job>]\",\n \t\tabout:\n-\t\t\t\"Read the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. With --on, it says which pipelines that event starts (in shared, or --space), with their jobs in waves that can run side by side, and why each other pipeline doesn't start. It reads only the file. abso pipeline runs asks the server what the project's pipelines did: the runs, newest first; with a run's number, its jobs (state, why, exit, time, an npm or deploy job's phase); with --log <pipeline.job>, that job's output.\",\n+\t\t\t\"Read the folder's pipeline file (abso.yml, abso.yaml or abso.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. With --on, it says which pipelines that event starts (in shared, or --space), with their jobs in waves that can run side by side, and why each other pipeline doesn't start. It reads only the file. abso pipeline runs asks the server what the project's pipelines did: the runs, newest first; with a run's number, its jobs (state, why, exit, time, an npm or deploy job's phase); with --log <pipeline.job>, that job's output.\",\n \t\t// Loaded only here, so the yaml package it needs can't stop every other command\n \t\t// when a checkout lacks it (abso issue 168).\n \t\trun: async (args, env) => {\n@@ -962,14 +963,16 @@\n }\n \n /** Whether this folder's calls carry a key or token, for how a refusal is worded. False when that can't be told. */\n-function carriesCredential(env: Env, tokenFileAsked: boolean): boolean {\n+function credentialSent(env: Env, tokenFileAsked: boolean): string | undefined {\n \ttry {\n \t\tconst root = findRoot(env.cwd);\n-\t\treturn root\n-\t\t\t? readConfig(root, env.env, tokenFileAsked).token !== undefined\n-\t\t\t: (fromEnv(env.env, \"TOKEN\") ?? (tokenFileAsked ? tokenFile() : undefined)) !== undefined;\n+\t\tif (root && readConfig(root, env.env, tokenFileAsked).token === undefined) return undefined;\n+\t\tif (root && existsSync(join(stateDir(root), \"key\"))) return \"this folder's key\";\n+\t\tif (fromEnv(env.env, \"TOKEN\")?.trim()) return \"ABSO_TOKEN\";\n+\t\tif (root && runKey(env.env)) return \"this pipeline run's key\";\n+\t\treturn tokenFileAsked && tokenFile() !== undefined ? \"the token file, ~/.abso/token\" : undefined;\n \t} catch {\n-\t\treturn false;\n+\t\treturn undefined;\n \t}\n }\n \n@@ -1079,7 +1082,7 @@\n \t\tconst e = err as Error;\n \t\tconst code = err instanceof UsageError ? \"usage\" : err instanceof ApiError ? \"server\" : \"error\";\n \t\tconst message =\n-\t\t\tplainError(err, carriesCredential(env, asked), !asked && tokenFile() !== undefined) ??\n+\t\t\tplainError(err, credentialSent(env, asked), !asked && tokenFile() !== undefined) ??\n \t\t\t(err instanceof UsageError || err instanceof ApiError\n \t\t\t\t? e.message\n \t\t\t\t: `${e.message}${e.stack ? `\\n${e.stack}` : \"\"}`);"},{"path":"client/src/serve-commands.ts","added":4,"removed":2,"diff":"--- a/client/src/serve-commands.ts\n+++ b/client/src/serve-commands.ts\n@@ -6,6 +6,7 @@\n import { boxOf, runRun, shellWord, undoGitBashPaths } from \"./box-commands.ts\";\n import { type Env, EXIT, type Output, open } from \"./command-env.ts\";\n import { fetchedText, fetchFromBox } from \"./fetch.ts\";\n+import { stateDir } from \"./state-dir.ts\";\n import { untarGz } from \"./tar.ts\";\n \n /** abso serve [--version N]: a preview of one version of shared at a stable URL, built once on the server (#37). */\n@@ -329,14 +330,15 @@\n \tif (image) {\n \t\tconst info = lines.find((l) => l.startsWith(\"ABSO_SHOT_IMAGE \"));\n \t\tconst { root, api } = open(env);\n-\t\tvoid root;\n \t\tapi.box = boxOf(args, env);\n \t\tconst gz = await api.boxFiles(`.abso-shot/${name}`);\n \t\tconst png = gz === null ? undefined : untarGz(gz).find((e) => e.path === `.abso-shot/${name}`);\n \t\tif (!png || !info)\n \t\t\treturn { exit: EXIT.error, text: \"The screenshot ran but its file was not in the box.\", json: { notes } };\n \t\tconst { w, h } = JSON.parse(info.slice(\"ABSO_SHOT_IMAGE \".length)) as { w: number; h: number };\n-\t\tconst path = resolve(env.cwd, str(args, \"out\") ?? join(\".avcs\", \"shots\", name));\n+\t\t// In the folder's own state folder (.abso/, or .avcs/ in an older folder), which abso never records.\n+\t\tconst path =\n+\t\t\tstr(args, \"out\") !== undefined ? resolve(env.cwd, str(args, \"out\")!) : join(stateDir(root), \"shots\", name);\n \t\tmkdirSync(join(path, \"..\"), { recursive: true });\n \t\twriteFileSync(path, png.data);\n \t\tshot = { path, w, h, bytes: png.data.length, tokens: imageTokens(w, h) };"},{"path":"client/test/body-files.test.ts","added":8,"removed":1,"diff":"--- a/client/test/body-files.test.ts\n+++ b/client/test/body-files.test.ts\n@@ -15,6 +15,9 @@\n // Written with one Windows line ending inside, which arrives as LF.\n writeFileSync(join(dir, \"body.md\"), `${BODY.replace(\"- two\\n\", \"- two\\r\\n\")}\\r\\n`);\n writeFileSync(join(dir, \"empty.md\"), \"\\n  \\n\");\n+// A reply as agents write them: prose, a code block and a Windows path, which no shell quoting mangles here.\n+const REPLY = 'Checked it:\\n\\n```ts\\nconst x = \"a\\\\tb\";\\n```\\n\\nThe log is in C:\\\\Users\\\\me\\\\repo\\\\out.txt.';\n+writeFileSync(join(dir, \"reply.md\"), `${REPLY}\\n`);\n \n const ISSUE = { comment: \"string\", description: \"string\", title: \"string\", drop: \"boolean\" } as const;\n const parse = (command: string, spec: Record<string, \"string\" | \"boolean\">, words: string[], stdin?: string) =>\n@@ -40,10 +43,14 @@\n \t\t);\n \t});\n \n-\tit(\"--file gives ask's question, answer's words and announce's text\", () => {\n+\tit(\"--file gives ask's question, answer's and reply's words, and announce's text\", () => {\n \t\tassert.deepEqual(parse(\"ask\", { issue: \"string\" }, [\"alice\", \"--file\", \"body.md\"]).positionals, [\"alice\", BODY]);\n \t\tassert.deepEqual(parse(\"answer\", { note: \"string\" }, [\"12\", \"--file\", \"body.md\"]).positionals, [\"12\", BODY]);\n \t\tassert.deepEqual(parse(\"announce\", { to: \"string\" }, [\"--file\", \"body.md\"]).positionals, [BODY]);\n+\t\tconst reply = parse(\"reply\", { question: \"boolean\" }, [\"648\", \"--file\", \"reply.md\", \"--question\"]);\n+\t\tassert.deepEqual(reply.positionals, [\"648\", REPLY]);\n+\t\tassert.equal(reply.flags.get(\"question\"), true);\n+\t\tassert.match(bodyFilesHelp(\"reply\", { question: \"boolean\" })!, /--file <path>/);\n \t\tassert.throws(\n \t\t\t() => parse(\"answer\", { note: \"string\" }, [\"12\", \"words\", \"--file\", \"body.md\"]),\n \t\t\t/--file gives answer's text, so leave the words off the command line/,"},{"path":"client/test/doctor.test.ts","added":10,"removed":6,"diff":"--- a/client/test/doctor.test.ts\n+++ b/client/test/doctor.test.ts\n@@ -211,21 +211,25 @@\n \n test(\"plainError words a refusal by whether a credential went, and a server that can't be reached\", () => {\n \tconst refused = new ApiError(\"GET /status answered 401: missing or wrong token\", 401);\n-\tassert.equal(plainError(refused, false), \"You're not signed in. Run abso login, then abso join <project>.\");\n-\tassert.match(plainError(refused, true)!, /^The server didn't accept this folder's key.*abso doctor checks it/);\n+\tassert.equal(plainError(refused, undefined), \"You're not signed in. Run abso login, then abso join <project>.\");\n+\tassert.match(\n+\t\tplainError(refused, \"this folder's key\")!,\n+\t\t/^The server didn't accept this folder's key.*abso doctor checks it/,\n+\t);\n+\tassert.match(plainError(refused, \"ABSO_TOKEN\")!, /^The server didn't accept ABSO_TOKEN: /);\n \tassert.equal(\n-\t\tplainError(new ApiError(\"could not reach https://api.abso.dev: connect ECONNREFUSED\"), true),\n+\t\tplainError(new ApiError(\"could not reach https://api.abso.dev: connect ECONNREFUSED\"), \"this folder's key\"),\n \t\t\"Can't reach https://api.abso.dev: connect ECONNREFUSED. Check your connection; abso doctor checks the rest.\",\n \t);\n \tassert.equal(\n \t\tplainError(\n \t\t\tnew ApiError(\"could not reach http://x: refused. Nothing was pushed. Run the same command again.\"),\n-\t\t\ttrue,\n+\t\t\t\"this folder's key\",\n \t\t),\n \t\t\"Can't reach http://x: refused. Nothing was pushed. Run the same command again.\",\n \t);\n-\tassert.equal(plainError(new ApiError(\"GET /log answered 500: boom\", 500), true), undefined);\n-\tassert.equal(plainError(new Error(\"anything else\"), true), undefined);\n+\tassert.equal(plainError(new ApiError(\"GET /log answered 500: boom\", 500), \"this folder's key\"), undefined);\n+\tassert.equal(plainError(new Error(\"anything else\"), \"this folder's key\"), undefined);\n });\n \n test(\"whoami with nothing named shows prod, and names the other servers this box is signed in to\", async () => {"},{"path":"client/test/failed-start.test.ts","added":60,"removed":0,"diff":"--- /dev/null\n+++ b/client/test/failed-start.test.ts\n@@ -0,0 +1,60 @@\n+// An init or join that fails against the server leaves the folder as it was, so the same command can run again:\n+// no starting .absoignore or abso.json from init, no .abso/ from join (but a key already here stays).\n+\n+import assert from \"node:assert/strict\";\n+import { existsSync, mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from \"node:fs\";\n+import { tmpdir } from \"node:os\";\n+import { join } from \"node:path\";\n+import { after, describe, it } from \"node:test\";\n+import { main } from \"../src/main.ts\";\n+\n+// Nothing listens on port 1, so every call fails to connect.\n+const DOWN = \"http://127.0.0.1:1\";\n+const ENV = { ABSO_TOKEN: \"test-token-not-secret\", ABSO_SERVERS_FILE: \"no-servers.json\" };\n+\n+const dirs: string[] = [];\n+after(() => {\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-failed-start-\"));\n+\tdirs.push(d);\n+\treturn d;\n+}\n+\n+async function run(cwd: string, ...argv: string[]): Promise<number> {\n+\treturn (await main(argv, { cwd, env: ENV, write: () => {} })).exit;\n+}\n+\n+describe(\"a failed start\", () => {\n+\tit(\"init takes back the .absoignore and abso.json it wrote\", async () => {\n+\t\tconst dir = temp();\n+\t\twriteFileSync(join(dir, \"package.json\"), `${JSON.stringify({ scripts: { test: \"node --test\" } })}\\n`);\n+\t\tassert.notEqual(await run(dir, \"init\", \"--server\", DOWN, \"--project\", \"p\", \"--agent\", \"a\"), 0);\n+\t\tassert.deepEqual(readdirSync(dir), [\"package.json\"]);\n+\t});\n+\n+\tit(\"join leaves no .abso folder\", async () => {\n+\t\tconst dir = temp();\n+\t\tassert.notEqual(await run(dir, \"join\", \"p\", \"--server\", DOWN, \"--agent\", \"a\", \"--dir\", dir), 0);\n+\t\tassert.equal(existsSync(join(dir, \".abso\")), false);\n+\t});\n+\n+\tit(\"join keeps a key that was already here\", async () => {\n+\t\tconst dir = temp();\n+\t\tmkdirSync(join(dir, \".abso\"));\n+\t\tconst key = { server: DOWN, key: \"abso_sk_not-a-real-key\", id: \"k_0123abcd\" };\n+\t\twriteFileSync(join(dir, \".abso\", \"key\"), `${JSON.stringify(key)}\\n`);\n+\t\tassert.notEqual(await run(dir, \"join\", \"p\", \"--server\", DOWN, \"--agent\", \"a\", \"--dir\", dir), 0);\n+\t\tassert.deepEqual(readdirSync(join(dir, \".abso\")), [\"key\"]);\n+\t});\n+\n+\tit(\"join with a key it can't read leaves only that key\", async () => {\n+\t\tconst dir = temp();\n+\t\tmkdirSync(join(dir, \".abso\"));\n+\t\twriteFileSync(join(dir, \".abso\", \"key\"), \"{}\\n\");\n+\t\tassert.notEqual(await run(dir, \"join\", \"p\", \"--server\", DOWN, \"--agent\", \"a\", \"--dir\", dir), 0);\n+\t\tassert.deepEqual(readdirSync(join(dir, \".abso\")), [\"key\"]);\n+\t});\n+});"},{"path":"client/test/install.test.ts","added":5,"removed":3,"diff":"--- a/client/test/install.test.ts\n+++ b/client/test/install.test.ts\n@@ -26,6 +26,7 @@\n import { clientVersion, headCommit } from \"../src/client-version.ts\";\n import {\n \tAVCS_MOD,\n+\tinstallerCommand,\n \tinstallMod,\n \tkeptModCommit,\n \ttype ModSpec,\n@@ -427,9 +428,10 @@\n \t\tassert.equal(client, `abso ${clientVersion()} (${dirname(import.meta.dirname)})`);\n \t\tassert.match(\n \t\t\tmod!,\n-\t\t\t/^the abso-hooks mod: 0\\.1\\.0\\+aaaaaaa in .*skills[\\\\/]abso-hooks, installed 2026-10-05 04:30 UTC; this client has 0.2.0(\\+[0-9a-f]{7}(\\.dirty)?)?: node client\\/install-mod\\.ts installs it$/,\n+\t\t\t/^the abso-hooks mod: 0\\.1\\.0\\+aaaaaaa in .*skills[\\\\/]abso-hooks, installed 2026-10-05 04:30 UTC; this client has 0.2.0(\\+[0-9a-f]{7}(\\.dirty)?)?: /,\n \t\t);\n-\t\tassert.equal(view, \"the abso-view mod: not installed (node client/install-view.ts)\");\n+\t\tassert.ok(mod!.endsWith(`: ${installerCommand(\"install-mod.ts\")} installs it`), mod);\n+\t\tassert.equal(view, `the abso-view mod: not installed (${installerCommand(\"install-view.ts\")})`);\n \t\tconst json = JSON.parse(\n \t\t\t(await main([\"--version\", \"--json\"], { cwd: config, env: { CLAUDE_CONFIG_DIR: config }, write: () => {} }))\n \t\t\t\t.stdout,\n@@ -474,7 +476,7 @@\n \t\tconst current = (versionReport(env).json.mods as { current: string }[])[0]!.current;\n \t\tif (/\\+[0-9a-f]{7}$/.test(current))\n \t\t\tassert.deepEqual(modsBehindText(env), [\n-\t\t\t\t`The avcs mod installed on this machine is 0.1.0+aaaaaaa, and this client has ${current}: node client/install-mod.ts installs it (new chats load it).`,\n+\t\t\t\t`The ${AVCS_MOD.name} mod installed on this machine is 0.1.0+aaaaaaa, and this client has ${current}: ${installerCommand(\"install-mod.ts\")} installs it (new chats load it).`,\n \t\t\t]);\n \t\t// A client outside git (an abso folder, a box) can't tell, so it says nothing.\n \t\telse assert.deepEqual(modsBehindText(env), []);"}],"ci":null}