{"version":11,"agent":"review","message":"Exit 1 when a file is left out for size: record and publish say so and still send the rest. Measured on abso 156: both exited 0 with a 21 MB file missing, so a script or CI read success. withLeftOut in commands.ts, used by record and publish; the existing blobs test now expects exit 1 and the left-out line and JSON (client suite: 170 pass). init is unchanged (its exit stays 0).","time":1791513140032,"timeIso":"2026-10-09T02:32:20.032Z","changes":3,"change":68,"files":["client/src/commands.ts","client/src/publish-commands.ts","client/test/client.test.ts"],"draft":null,"diff":[{"path":"client/src/commands.ts","added":27,"removed":9,"diff":"--- a/client/src/commands.ts\n+++ b/client/src/commands.ts\n@@ -120,6 +120,21 @@\n \t];\n }\n \n+/**\n+ * A command that left files out for size did not do everything it was asked: say so in the exit code too, so\n+ * a script, CI or an agent cannot read \"ok\" while a file is missing. Other exits (refused, queued) stay as they are.\n+ */\n+export function withLeftOut(out: Output, leftOut: readonly LeftOut[]): Output {\n+\tif (leftOut.length === 0) return out;\n+\tconst text = out.text.includes(\"Left out,\") ? out.text : [out.text, ...leftOutText(leftOut)].join(\"\\n\");\n+\treturn {\n+\t\t...out,\n+\t\ttext: `${text}\\nExit ${EXIT.error}: ${leftOut.length} file${leftOut.length === 1 ? \" was\" : \"s were\"} not sent.`,\n+\t\tjson: { ...out.json, leftOut },\n+\t\texit: out.exit === undefined || out.exit === EXIT.ok ? EXIT.error : out.exit,\n+\t};\n+}\n+\n /** Upload binary files' bytes before the record or init that names them, each hash once. */\n export async function uploadBlobs(api: Api, blobs: ReadonlyMap<string, BlobToSend>): Promise<void> {\n \tconst seen = new Set<string>();\n@@ -290,16 +305,19 @@\n \t\tr.sent === 0\n \t\t\t? \"Nothing to record: the folder matches what the server has.\"\n \t\t\t: `Recorded ${recordedList(r)}${changed === undefined ? \"\" : `; ${changed} changed on the server`}.`;\n-\treturn {\n-\t\ttext: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join(\"\\n\"),\n-\t\tjson: {\n-\t\t\tsent: r.sent,\n-\t\t\tchanged: r.changed ?? null,\n-\t\t\tnews: newsLines(r.news),\n-\t\t\tleftOut: r.leftOut,\n-\t\t\tturnedBinary: r.turnedBinary,\n+\treturn withLeftOut(\n+\t\t{\n+\t\t\ttext: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join(\"\\n\"),\n+\t\t\tjson: {\n+\t\t\t\tsent: r.sent,\n+\t\t\t\tchanged: r.changed ?? null,\n+\t\t\t\tnews: newsLines(r.news),\n+\t\t\t\tleftOut: r.leftOut,\n+\t\t\t\tturnedBinary: r.turnedBinary,\n+\t\t\t},\n \t\t},\n-\t};\n+\t\tr.leftOut,\n+\t);\n }\n \n // --- writing answers into the folder ---"},{"path":"client/src/publish-commands.ts","added":8,"removed":3,"diff":"--- a/client/src/publish-commands.ts\n+++ b/client/src/publish-commands.ts\n@@ -18,10 +18,11 @@\n \tsyncFolder,\n \tturnedBinaryText,\n \tunwrittenText,\n+\twithLeftOut,\n } from \"./commands.ts\";\n import { type Config, isReader } from \"./config.ts\";\n import { ignoredHere } from \"./fetch.ts\";\n-import { absolute, forgetKnown, isLocalOnly, loadIgnore, readText, writeFileAtomic } from \"./folder.ts\";\n+import { absolute, forgetKnown, isLocalOnly, type LeftOut, loadIgnore, readText, writeFileAtomic } from \"./folder.ts\";\n import { PROJECT_FILE, readProjectFile } from \"./project-file.ts\";\n import { pulledText, STILL_QUEUED, standing, WAIT_SECONDS, waitForQueued } from \"./queue.ts\";\n import { type Refused, refusedText, unsafePath } from \"./safety.ts\";\n@@ -186,15 +187,17 @@\n \t\tsay(\"avcs: the check passed; publishing.\\n\");\n \t}\n \tconst checked = check !== undefined;\n-\tconst steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck);\n+\tconst leftOut: LeftOut[] = [];\n+\tconst steps = publishSteps(args, env, root, config, api, message, checked, waitSeconds, skippedCheck, leftOut);\n \t// Say how far it got when the server can't be reached (#37, GAME - UI/UX: did the check run? did the draft go up?).\n-\tconst out = await unreached(\n+\tconst reached = await unreached(\n \t\tsteps,\n \t\tchecked\n \t\t\t? \"The check passed, but the publish never reached the server: nothing was published.\"\n \t\t\t: \"Nothing was published.\",\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@@ -282,8 +285,10 @@\n \tchecked: boolean,\n \twaitSeconds: number,\n \tskippedCheck: boolean,\n+\tleftOut: LeftOut[],\n ): Promise<Output> {\n \tconst recorded = await recordFolder(root, api, false, meantBinary(args));\n+\tleftOut.push(...recorded.leftOut);\n \tconst pre = [...recordedFirst(recorded), ...droppedIgnoredText(await dropIgnoredFromDraft(root, api))];\n \tif (recorded.turnedBinary.length > 0) {\n \t\t// Publishing now would leave the others on the file's old text without anyone noticing (#25)."},{"path":"client/test/client.test.ts","added":12,"removed":2,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -232,7 +232,12 @@\n \t\tassert.deepEqual(init.json.leftOut, [{ path: \"huge.bin\", reason: \"too big\" }]);\n \t\tconst hosted = fake.projects.get(\"blobs\")!;\n \t\tassert.deepEqual(Object.keys(hosted.project.blobs()).sort(), [\"big.txt\", \"pic.bin\"]);\n-\t\tassert.equal((await avcs(dir, \"record\")).json.sent, 0, \"the known blobs match\");\n+\t\tconst again = await avcs(dir, \"record\");\n+\t\tassert.equal(again.json.sent, 0, \"the known blobs match\");\n+\t\tassert.equal(again.exit, 1, \"a file left out for size is not a success\");\n+\t\tconst saidSo = await main([\"record\"], { cwd: dir, env: ENV, write: () => {} });\n+\t\tassert.match(saidSo.stdout, /Left out, over the server's 20 MB limit.*huge\\.bin/);\n+\t\tassert.match(saidSo.stdout, /Exit 1: 1 file was not sent\\./);\n \n \t\t// Another agent gets the bytes.\n \t\tconst bob = temp();\n@@ -251,7 +256,12 @@\n \t\t\trefused.stdout,\n \t\t\t/NOT SENT: b\\.txt was text and now has a NUL byte at line 1 \\(byte 0\\)\\..*pass --binary b\\.txt\\.\\nNot published\\./,\n \t\t);\n-\t\tassert.equal((await avcs(dir, \"publish\", \"-m\", \"new picture, b is binary now\", \"--binary\", \"b.txt\")).exit, 0);\n+\t\t// The publish goes through, and still says the huge file was left out, with a non-zero exit.\n+\t\tconst published = await avcs(dir, \"publish\", \"-m\", \"new picture, b is binary now\", \"--binary\", \"b.txt\");\n+\t\tassert.equal(published.exit, 1, published.out);\n+\t\tassert.ok(published.json.version !== undefined, \"the rest was published\");\n+\t\tassert.deepEqual(published.json.leftOut, [{ path: \"huge.bin\", reason: \"too big\" }]);\n+\t\trmSync(join(dir, \"huge.bin\")); // the rest of the test is about the files that do go\n \t\tassert.equal(\"b.txt\" in shared(\"blobs\"), false);\n \t\tassert.ok(\"b.txt\" in hosted.project.blobs());\n \t\tassert.equal((await avcs(bob, \"sync\")).exit, 0);"}],"ci":null}