{"version":26,"agent":"pinch","message":"Publish and log fixes, and a flaky test removed.\n\n- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.\n- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.\n- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).\n\nCheck: 722 pass, 0 fail.","time":1791533012122,"timeIso":"2026-10-09T08:03:32.122Z","changes":7,"change":287,"files":["client/src/api.ts","client/src/changes.ts","client/src/history-answers.ts","client/src/main.ts","client/test/client.test.ts","client/test/fake-server.ts"],"draft":null,"diff":[{"path":"client/src/api.ts","added":50,"removed":6,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -85,6 +85,17 @@\n \treturn sent === undefined ? baseMs : baseMs + Math.floor(Buffer.byteLength(sent) / 100_000) * 1000;\n }\n \n+/**\n+ * How long a publish or a land may take before the client stops waiting: the\n+ * server gives one request up to 2 minutes of work, so a small body can still\n+ * take that long (a large merge). Waiting less reported publishes as failed\n+ * that went on to land.\n+ */\n+export const PUBLISH_TIMEOUT_MS = 150_000;\n+\n+/** The most versions the server's log sends at once. */\n+export const LOG_PAGE = 200;\n+\n /** A query string from the values that are set (null and undefined are left out). */\n function query(values: Record<string, string | number | null | undefined>): URLSearchParams {\n \tconst q = new URLSearchParams();\n@@ -168,10 +179,16 @@\n \t\t};\n \t}\n \n-\tasync json<T>(method: \"GET\" | \"POST\", path: string, body?: unknown, server = this.config.server): Promise<T> {\n+\tasync json<T>(\n+\t\tmethod: \"GET\" | \"POST\",\n+\t\tpath: string,\n+\t\tbody?: unknown,\n+\t\tserver = this.config.server,\n+\t\tatLeastMs = 0,\n+\t): Promise<T> {\n \t\tlet res: Response | undefined;\n \t\tconst sent = body === undefined ? undefined : JSON.stringify(body);\n-\t\tconst timeoutMs = timeoutFor(this.timeoutMs, sent);\n+\t\tconst timeoutMs = Math.max(atLeastMs, timeoutFor(this.timeoutMs, sent));\n \t\t// A connection that never opened is tried once more, IPv4 first (#37, GAME - UI/UX: one IPv6\n \t\t// address timed out, and the same command went through seconds later). Nothing went out, so\n \t\t// a POST is as safe to send again as a GET.\n@@ -375,7 +392,13 @@\n \t}\n \n \tpublish(message: string, asIs = false): Promise<PublishAnswer> {\n-\t\treturn this.json(\"POST\", this.agentPath(\"publish\"), { message, ...(asIs ? { asIs: true } : {}) });\n+\t\treturn this.json(\n+\t\t\t\"POST\",\n+\t\t\tthis.agentPath(\"publish\"),\n+\t\t\t{ message, ...(asIs ? { asIs: true } : {}) },\n+\t\t\tundefined,\n+\t\t\tPUBLISH_TIMEOUT_MS,\n+\t\t);\n \t}\n \n \t/** One change (#44). */\n@@ -709,7 +732,7 @@\n \n \t/** Land never queues: with the merge queue on, the server refuses it (#39). */\n \tland(message: string): Promise<Exclude<PublishAnswer, { queued: number }>> {\n-\t\treturn this.json(\"POST\", this.agentPath(\"land\"), { message });\n+\t\treturn this.json(\"POST\", this.agentPath(\"land\"), { message }, undefined, PUBLISH_TIMEOUT_MS);\n \t}\n \n \tdraftSync(): Promise<DraftSyncAnswer> {\n@@ -731,10 +754,31 @@\n \t}\n \n \t/** The versions of a space, newest first; with `path`, only those that changed it. */\n-\tlog(where: Where, limit?: number, path?: string): Promise<LogAnswer> {\n-\t\treturn this.json(\"GET\", `/log?${query({ ...where, limit, path })}`);\n+\t/**\n+\t * The versions newest first, below `before` when it's given. The server\n+\t * sends at most LOG_PAGE at a time, so a longer log is read page by page,\n+\t * following each page's next. `next` on the answer says older ones are left.\n+\t */\n+\tasync log(where: Where, limit?: number, path?: string, before?: number): Promise<LogAnswer> {\n+\t\tlet page = await this.#logPage(where, limit === undefined ? undefined : Math.min(limit, LOG_PAGE), path, before);\n+\t\tconst versions = [...page.versions];\n+\t\twhile (limit !== undefined && versions.length < limit && page.next !== undefined) {\n+\t\t\tpage = await this.#logPage(where, Math.min(limit - versions.length, LOG_PAGE), path, page.next);\n+\t\t\tversions.push(...page.versions);\n+\t\t}\n+\t\tconst { next, ...rest } = page;\n+\t\treturn { ...rest, versions, ...(next !== undefined ? { next } : {}) };\n \t}\n \n+\t#logPage(\n+\t\twhere: Where,\n+\t\tlimit: number | undefined,\n+\t\tpath: string | undefined,\n+\t\tbefore: number | undefined,\n+\t): Promise<LogAnswer> {\n+\t\treturn this.json(\"GET\", `/log?${query({ ...where, limit, path, before })}`);\n+\t}\n+\n \tshow(version: number, where: Where): Promise<ShowAnswer> {\n \t\treturn this.json(\"GET\", `/show?${query({ version, ...where })}`);\n \t}"},{"path":"client/src/changes.ts","added":10,"removed":2,"diff":"--- a/client/src/changes.ts\n+++ b/client/src/changes.ts\n@@ -311,6 +311,8 @@\n \tconst rawLimit = str(args, \"limit\");\n \tconst limit = rawLimit === undefined ? undefined : version(rawLimit, \"-n\");\n \tif (limit === 0) throw new UsageError(\"-n is how many versions to show; give 1 or more\");\n+\tconst rawBefore = str(args, \"before\");\n+\tconst before = rawBefore === undefined ? undefined : version(rawBefore, \"--before\");\n \t// The server filters by one file; a folder (or the whole folder) is filtered here, from a longer log.\n \tconst folder = path !== undefined && (path === \"\" || /[/]$/.test(typed!) || isFolder(root, path));\n \t// --since, --by and --count (#37, Reporter's progress reports) filter here, from a longer log.\n@@ -332,6 +334,7 @@\n \t\tspace(args, config.agent),\n \t\tfolder || filtering ? FOLDER_LOG : limit,\n \t\tfolder ? undefined : path,\n+\t\tbefore,\n \t);\n \tconst found = folder\n \t\t? {\n@@ -392,9 +395,14 @@\n \t\t]),\n \t];\n \tconst oldest = answer.versions[answer.versions.length - 1];\n-\tif (path === undefined && !filtering && oldest !== undefined && oldest.version > 0)\n-\t\tlines.push(`Older versions: abso log -n ${answer.versions.length + 50}`);\n+\tif (!filtering && !folder && raw.next !== undefined && oldest !== undefined)\n+\t\tlines.push(`Older versions: abso log${typed === undefined ? \"\" : ` ${typed}`} --before ${oldest.version}`);\n \tif (filtering && answer.versions.length === 0) lines.push(\"No version matches.\");\n+\t// A filter or a folder reads the newest FOLDER_LOG versions; say so when older ones were left unread.\n+\tif ((filtering || folder) && raw.next !== undefined)\n+\t\tlines.push(\n+\t\t\t`Only the newest ${FOLDER_LOG} versions${before === undefined ? \"\" : ` below ${before}`} were read; --before ${raw.next} reads older ones.`,\n+\t\t);\n \treturn { text: lines.join(\"\\n\"), json: { ...answer } };\n }\n "},{"path":"client/src/history-answers.ts","added":2,"removed":0,"diff":"--- a/client/src/history-answers.ts\n+++ b/client/src/history-answers.ts\n@@ -82,6 +82,8 @@\n \treadonly draft: string | null;\n \treadonly version: number;\n \treadonly versions: readonly LogEntry[];\n+\t/** When older versions are left: the version to read below (log --before) for the next ones. */\n+\treadonly next?: number;\n }\n export interface ShowAnswer extends LogEntry {\n \treadonly draft: string | null;"},{"path":"client/src/main.ts","added":3,"removed":3,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -573,11 +573,11 @@\n \t\trun: runFiles,\n \t},\n \tlog: {\n-\t\tflags: { limit: \"string\", draft: \"string\", since: \"string\", by: \"string\", count: \"boolean\" },\n+\t\tflags: { limit: \"string\", before: \"string\", draft: \"string\", since: \"string\", by: \"string\", count: \"boolean\" },\n \t\tusage:\n-\t\t\t\"abso log [file] [-n <count>] [--draft <name>] [--since <version|30m|2h|1d|date>] [--by <agent,...>] [--count]\",\n+\t\t\t\"abso log [file] [-n <count>] [--before <version>] [--draft <name>] [--since <version|30m|2h|1d|date>] [--by <agent,...>] [--count]\",\n \t\tabout:\n-\t\t\t\"The published versions of this folder's space (shared or a named draft), newest first: who, when, why and which files, and for shared, whether the version passed CI's check (abso ci). With a file: only the versions that changed it. --since takes a version (the versions after it), a span back from now (30m, 2h, 1d), a clock time today (20:00) or a date and time; --by keeps one agent's versions (or several, comma-separated); --count prints versions and files per agent instead of the list.\",\n+\t\t\t\"The published versions of this folder's space (shared or a named draft), newest first: who, when, why and which files, and for shared, whether the version passed CI's check (abso ci). With a file: only the versions that changed it. --before <version> starts below that version, so any stretch of history can be listed; the end of the list names the --before for the next older ones. --since takes a version (the versions after it), a span back from now (30m, 2h, 1d), a clock time today (20:00) or a date and time; --by keeps one agent's versions (or several, comma-separated); --count prints versions and files per agent instead of the list.\",\n \t\trun: runLog,\n \t},\n \tshow: {"},{"path":"client/test/client.test.ts","added":58,"removed":23,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -20,12 +20,13 @@\n \tutimesSync,\n \twriteFileSync,\n } from \"node:fs\";\n+import { createServer as createHttpServer } from \"node:http\";\n import { type AddressInfo, createServer as createTcpServer } from \"node:net\";\n import { tmpdir } from \"node:os\";\n import { dirname, join, relative, sep } from \"node:path\";\n import { after, before, describe, it } from \"node:test\";\n import { fileURLToPath } from \"node:url\";\n-import { timeoutFor } from \"../src/api.ts\";\n+import { Api, LOG_PAGE, PUBLISH_TIMEOUT_MS, timeoutFor } from \"../src/api.ts\";\n import { parseArgs } from \"../src/args.ts\";\n import { globTest } from \"../src/at.ts\";\n import { forgetBox, readBox, writeBox } from \"../src/box.ts\";\n@@ -1299,27 +1300,6 @@\n \t\t);\n \t\tassert.equal(sh.status, 137);\n \t});\n-\n-\tit(\"sends one run, and takes each command as one quoted word\", async () => {\n-\t\tconst { folders } = await project({ \"a.txt\": \"a\\n\" }, \"alice\");\n-\t\tconst before = fake.runStarts.length;\n-\t\tawait main([\"run\", \"--parallel\", \"npm test\", \"node bench.js\"], {\n-\t\t\tcwd: folders.alice!,\n-\t\t\tenv: ENV,\n-\t\t\twrite: () => {},\n-\t\t\twriteErr: () => {},\n-\t\t});\n-\t\tconst sent = fake.runStarts.slice(before);\n-\t\tassert.equal(sent.length, 1);\n-\t\tassert.ok(sent[0]!.cmd.endsWith(parallelScript([\"npm test\", \"node bench.js\"])), sent[0]!.cmd);\n-\t\tconst bad = await main([\"run\", \"--parallel\", \"--\", \"npm\", \"test\"], {\n-\t\t\tcwd: folders.alice!,\n-\t\t\tenv: ENV,\n-\t\t\twrite: () => {},\n-\t\t});\n-\t\tassert.equal(bad.exit, 1);\n-\t\tassert.match(bad.stderr, /--parallel takes each command as one quoted word/);\n-\t});\n });\n \n describe(\"paths from the server never leave the folder (Security)\", () => {\n@@ -2490,6 +2470,61 @@\n \t\tassert.equal(timeoutFor(30_000, \"x\".repeat(3_000_000)), 60_000);\n \t});\n \n+\tit(\"reads a log longer than the server's page by following next, and starts below --before\", async () => {\n+\t\t// A stand-in for the server's log: versions 0-449, newest first, at most LOG_PAGE a page, as version-log.ts pages.\n+\t\tconst asked: string[] = [];\n+\t\tconst paged = createHttpServer((req, res) => {\n+\t\t\tconst q = new URL(req.url ?? \"\", \"http://x\").searchParams;\n+\t\t\tasked.push(`${q.get(\"limit\")} ${q.get(\"before\") ?? \"-\"}`);\n+\t\t\tconst limit = Math.min(Number(q.get(\"limit\") ?? 50), LOG_PAGE);\n+\t\t\tlet v = Math.min(449, Number(q.get(\"before\") ?? 450) - 1);\n+\t\t\tconst versions = [];\n+\t\t\tfor (; v >= 0 && versions.length < limit; v--)\n+\t\t\t\tversions.push({ version: v, agent: \"a\", message: `v${v}`, time: 0, files: [] });\n+\t\t\tconst next = v >= 0 && versions.length > 0 ? versions[versions.length - 1]!.version : undefined;\n+\t\t\tres.writeHead(200, { \"content-type\": \"application/json\" });\n+\t\t\tres.end(JSON.stringify({ draft: null, version: 449, versions, ...(next !== undefined ? { next } : {}) }));\n+\t\t});\n+\t\tawait new Promise<void>((ok) => paged.listen(0, \"127.0.0.1\", ok));\n+\t\ttry {\n+\t\t\tconst server = `http://127.0.0.1:${(paged.address() as AddressInfo).port}`;\n+\t\t\tconst api = new Api({ server, project: \"p\", agent: \"a\", token: \"t\" } as ConstructorParameters<typeof Api>[0]);\n+\t\t\tconst all = await api.log({ draft: null }, 2000);\n+\t\t\tassert.equal(all.versions.length, 450);\n+\t\t\tassert.deepEqual([all.versions[0]!.version, all.versions[449]!.version], [449, 0]);\n+\t\t\tassert.equal(all.next, undefined, \"nothing older is left\");\n+\t\t\tassert.deepEqual(asked, [\"200 -\", \"200 250\", \"200 50\"]);\n+\t\t\tconst some = await api.log({ draft: null }, 250, undefined, 300);\n+\t\t\tassert.deepEqual([some.versions[0]!.version, some.versions.at(-1)!.version, some.next], [299, 50, 50]);\n+\t\t\tassert.equal((await api.log({ draft: null })).versions.length, 50, \"no -n: the server's own default, one page\");\n+\t\t} finally {\n+\t\t\tpaged.closeAllConnections();\n+\t\t\tawait new Promise((ok) => paged.close(ok));\n+\t\t}\n+\t});\n+\n+\tit(\"waits for a publish and a land as long as the server may work on them, past the base timeout\", async () => {\n+\t\tassert.ok(PUBLISH_TIMEOUT_MS > 120_000, \"longer than the server's 2 minutes for one request\");\n+\t\t// Every answer comes after 300 ms; the client's base timeout here is 100 ms.\n+\t\tconst slow = createHttpServer((_req, res) => {\n+\t\t\tsetTimeout(() => res.writeHead(200, { \"content-type\": \"application/json\" }).end('{\"version\": 7}'), 300);\n+\t\t});\n+\t\tawait new Promise<void>((ok) => slow.listen(0, \"127.0.0.1\", ok));\n+\t\ttry {\n+\t\t\tconst server = `http://127.0.0.1:${(slow.address() as AddressInfo).port}`;\n+\t\t\tconst api = new Api(\n+\t\t\t\t{ server, project: \"p\", agent: \"a\", token: \"t\" } as ConstructorParameters<typeof Api>[0],\n+\t\t\t\t100,\n+\t\t\t);\n+\t\t\tassert.deepEqual(await api.publish(\"slow\"), { version: 7 });\n+\t\t\tassert.deepEqual(await api.land(\"slow\"), { version: 7 });\n+\t\t\tawait assert.rejects(api.json(\"GET\", \"/status\"), /no answer within 100 ms/);\n+\t\t} finally {\n+\t\t\tslow.closeAllConnections();\n+\t\t\tawait new Promise((ok) => slow.close(ok));\n+\t\t}\n+\t});\n+\n \tit(\"lists a change by its message's first line, and an import's commit as a short hash (#43, Git Lessons)\", () => {\n \t\tconst imported =\n \t\t\t\"Issues' own Worker: the skeleton\\n\\nA long body\\nover lines.\\n\\ngit ad107af03b56, Alex Rivera, 2026-10-07T14:00:00-05:00\";\n@@ -4086,7 +4121,7 @@\n \t\tconst logText = await main([\"log\", \"-n\", \"1\"], { cwd: alice, env: ENV, write: () => {} });\n \t\tassert.match(\n \t\t\tlogText.stdout,\n-\t\t\t/^shared is at version 2\\.\\nversion 2 by bob, .* UTC: bob: change b\\n {2}1 file: b\\.txt\\nOlder versions: abso log -n 51\\n$/,\n+\t\t\t/^shared is at version 2\\.\\nversion 2 by bob, .* UTC: bob: change b\\n {2}1 file: b\\.txt\\nOlder versions: abso log --before 2\\n$/,\n \t\t);\n \n \t\tconst show = await avcs(alice, \"show\", \"1\");"},{"path":"client/test/fake-server.ts","added":3,"removed":0,"diff":"--- a/client/test/fake-server.ts\n+++ b/client/test/fake-server.ts\n@@ -726,6 +726,9 @@\n \t\t\telse res.end();\n \t\t});\n \t});\n+\t// Never close an idle kept-alive connection: on Windows, under load, the client could reuse one in the moment\n+\t// the server closed it, and the next call failed with ECONNRESET. close() below drops every connection.\n+\tserver.keepAliveTimeout = 0;\n \tawait new Promise<void>((ok) => server.listen(port, \"127.0.0.1\", ok));\n \tconst address = server.address() as AddressInfo;\n \treturn Object.assign(fake, {"}],"ci":null}