{"version":243,"agent":"capacity","message":"compare's summary: each changed file's size and SHA-256 instead of its texts (abso issue 680; disk-first 2; abso Capacity).\n\ncompare 612 to 1224 on abso answers 13.2 MB: the full before and after text of about 3,000 changed files. Read Speed's shape lets the site ask for a summary and fetch a file's texts when it opens it.\n\n- view-changes.ts summariesBetween: the files changesBetween would list, each side as {size, sha256} for text (UTF-8 bytes, SHA-256 of the text), {blob} for a binary file (its hash; the Worker adds its size from the blob store), or null when absent; mode and blob as in the full answer. Each text is read, summed up and let go.\n- version-log compare takes summary and answers {from, to, summary: true, files}. ProjectHistory.compare and both engine-project.ts implementations take a fifth argument, summary; http.ts passes ?summary=1. The full answer is unchanged.\n\nOn abso adopted fresh: the summary for 612 to 1224 is 174 KB instead of 13.2 MB, with heap after at 38 MB. The time is the same (about 20 s cold): it still lays the files out to hash them. Stored per-version sizes and hashes would remove that; they're proposed with the author totals table.\n\nNew test compare-summary: on an in-memory and a writer-backed project, the summary lists the files the full compare does, with sizes and SHA-256s of its texts, blob hashes for a binary file, and no text. Every engine test (292 of 292), every worker/project test (342 of 342); tsc (worker and server) and biome clean.","time":1792072854373,"timeIso":"2026-10-15T14:00:54.373Z","changes":7,"change":3752,"files":["server/src/engine-project.ts","worker/project/http.ts","worker/project/project-api.ts","worker/project/test/compare-summary.test.ts","worker/project/version-log.ts","worker/project/view-changes.ts"],"draft":null,"diff":[{"path":"server/src/engine-project.ts","added":2,"removed":2,"diff":"--- a/server/src/engine-project.ts\n+++ b/server/src/engine-project.ts\n@@ -523,8 +523,8 @@\n \tfileAt(path: string, version: number, draft: string | null, agent?: string) {\n \t\treturn this.project.fileAt(path, version, { draft, ...(agent ? { agent } : {}) });\n \t}\n-\tcompare(from: number, to: number, draft: string | null, agent?: string) {\n-\t\treturn this.project.compare(from, to, { draft, ...(agent ? { agent } : {}) });\n+\tcompare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean) {\n+\t\treturn this.project.compare(from, to, { draft, ...(agent ? { agent } : {}), ...(summary ? { summary } : {}) });\n \t}\n \twithout(version: number, versions: readonly number[]) {\n \t\treturn this.project.without(version, versions);"},{"path":"worker/project/http.ts","added":2,"removed":1,"diff":"--- a/worker/project/http.ts\n+++ b/worker/project/http.ts\n@@ -392,7 +392,8 @@\n \t\t\t\tconst from = int(q.from);\n \t\t\t\tconst to = int(q.to);\n \t\t\t\tif (from === undefined || to === undefined) return fail(400, \"compare needs ?from=<number>&to=<number>\");\n-\t\t\t\treturn { status: 200, body: history.compare(from, to, draft, who) };\n+\t\t\t\t// summary=1: each file's size and SHA-256, not its texts (abso issue 680).\n+\t\t\t\treturn { status: 200, body: history.compare(from, to, draft, who, q.summary === \"1\") };\n \t\t\t}\n \t\t\tconst version = Number(q.version);\n \t\t\tif (q.version === undefined || !Number.isInteger(version)) return fail(400, \"show needs ?version=<number>\");"},{"path":"worker/project/project-api.ts","added":1,"removed":1,"diff":"--- a/worker/project/project-api.ts\n+++ b/worker/project/project-api.ts\n@@ -156,7 +156,7 @@\n \t/** A file as it was at a version (#27). */\n \tfileAt(path: string, version: number, draft: string | null, agent?: string): unknown;\n \t/** Every file that differs between two versions (#27). */\n-\tcompare(from: number, to: number, draft: string | null, agent?: string): unknown;\n+\tcompare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean): unknown;\n \t/** Version `version` of shared without the versions in `versions` (without.ts). */\n \twithout(version: number, versions: readonly number[]): unknown;\n \t/** One version: who, why, and each file before and after (#27). */"},{"path":"worker/project/test/compare-summary.test.ts","added":72,"removed":0,"diff":"--- /dev/null\n+++ b/worker/project/test/compare-summary.test.ts\n@@ -0,0 +1,72 @@\n+// compare's summary (abso issue 680): every file a full compare lists, with its size in UTF-8 bytes and SHA-256 before\n+// and after instead of its texts, or its blob's hash for a binary file. The same on a writer-backed project as in\n+// memory.\n+\n+import assert from \"node:assert/strict\";\n+import { createHash } from \"node:crypto\";\n+import { test } from \"node:test\";\n+import { storedArray } from \"../../../src/engine/state-source.ts\";\n+import { SqlState } from \"../../../src/engine/test/storage-helper.ts\";\n+import { MemoryStore, Project } from \"../project.ts\";\n+import type { Entry, ProjectStore } from \"../project-types.ts\";\n+\n+const A = \"a\".repeat(64);\n+const B = \"b\".repeat(64);\n+const held = (sha: string) => sha === A || sha === B;\n+\n+function writer() {\n+\tconst storage = new SqlState();\n+\tconst entries = storedArray<Entry>(storage, \"canonical-log\");\n+\tconst store: ProjectStore = {\n+\t\tappend(batch) {\n+\t\t\tfor (const entry of batch) entries.push(entry);\n+\t\t},\n+\t};\n+\treturn new Project(store, { writerStorage: storage, hasBlob: held });\n+}\n+\n+function history(project: Project) {\n+\tproject.init(\n+\t\t{ \"keep.txt\": \"same\\n\", \"edit.txt\": \"one\\n\", \"gone.txt\": \"bye\\n\", \"run.sh\": \"echo\\n\" },\n+\t\t0,\n+\t\t{},\n+\t\t{ \"logo.png\": A },\n+\t);\n+\tproject.record(\n+\t\t\"ann\",\n+\t\t{ \"edit.txt\": \"one\\nzwei ü\\n\", \"gone.txt\": null, \"new.txt\": \"hello\\n\" },\n+\t\t1,\n+\t\t{ \"run.sh\": { exec: true } },\n+\t\t{ \"logo.png\": B },\n+\t);\n+\tassert.equal(project.publish(\"ann\", \"Changes\", 2).ok, true);\n+}\n+\n+const sha = (text: string) => createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\");\n+\n+test(\"compare's summary lists what compare does, as sizes and SHA-256s\", () => {\n+\tfor (const project of [new Project(new MemoryStore(), { hasBlob: held }), writer()]) {\n+\t\thistory(project);\n+\t\tconst full = project.compare(0, 1);\n+\t\tconst summary = project.compare(0, 1, { summary: true });\n+\t\tif (\"summary\" in full || !(\"summary\" in summary)) throw Error(\"compare answered the wrong shape\");\n+\t\tassert.deepEqual(\n+\t\t\tsummary.files.map((f) => f.path),\n+\t\t\tfull.files.map((f) => f.path),\n+\t\t);\n+\t\tfor (const f of full.files) {\n+\t\t\tconst s: (typeof summary.files)[number] = summary.files.find((x) => x.path === f.path)!;\n+\t\t\tconst sum = (text: string | null, blob: string | null | undefined) =>\n+\t\t\t\ttext === null ? null : blob ? { blob } : { size: Buffer.byteLength(text, \"utf8\"), sha256: sha(text) };\n+\t\t\tassert.deepEqual(s.before, sum(f.before, f.blob?.before ?? null), `${f.path} before`);\n+\t\t\tassert.deepEqual(s.after, sum(f.after, f.blob?.after ?? null), `${f.path} after`);\n+\t\t\tassert.deepEqual(s.mode, f.mode);\n+\t\t\tassert.deepEqual(s.blob, f.blob);\n+\t\t}\n+\t\tconst edited = summary.files.find((f) => f.path === \"edit.txt\")!;\n+\t\tassert.deepEqual(edited.after, { size: Buffer.byteLength(\"one\\nzwei ü\\n\", \"utf8\"), sha256: sha(\"one\\nzwei ü\\n\") });\n+\t\tassert.equal(summary.files.find((f) => f.path === \"gone.txt\")!.after, null);\n+\t\tassert.deepEqual(summary.files.find((f) => f.path === \"logo.png\")!.after, { blob: B });\n+\t\tassert.ok(!JSON.stringify(summary).includes(\"zwei\"), \"no texts\");\n+\t}\n+});"},{"path":"worker/project/version-log.ts","added":12,"removed":5,"diff":"--- a/worker/project/version-log.ts\n+++ b/worker/project/version-log.ts\n@@ -9,7 +9,7 @@\n import { ProjectError } from \"./project-error.ts\";\n import type { FileChange, LogAnswer, LogEntry, ShowAnswer } from \"./project-types.ts\";\n import { last, SHARED, type Space } from \"./spaces.ts\";\n-import { changesBetween } from \"./view-changes.ts\";\n+import { changesBetween, summariesBetween } from \"./view-changes.ts\";\n \n /** What the version list reads need from a project. */\n export interface LogHost {\n@@ -243,8 +243,10 @@\n \thost: LogHost,\n \tfrom: number,\n \tto: number,\n-\toptions: { draft?: string | null; agent?: string } = {},\n-): { from: number; to: number; files: FileChange[] } {\n+\toptions: { draft?: string | null; agent?: string; summary?: boolean } = {},\n+):\n+\t| { from: number; to: number; files: FileChange[] }\n+\t| { from: number; to: number; summary: true; files: ReturnType<typeof summariesBetween> } {\n \thost.needInit();\n \tconst space = host.spaceFor(options);\n \thost.checkVersion(space, from);\n@@ -252,13 +254,18 @@\n \tconst before = host.viewAt(space, from);\n \tconst after = host.viewAt(space, to);\n \tconst files = new Set<string>();\n+\t// With summary, each file's size and SHA-256 instead of its texts (abso issue 680).\n+\tconst answer = (paths: Iterable<string>) =>\n+\t\toptions.summary\n+\t\t\t? { from, to, summary: true as const, files: summariesBetween(before, after, paths) }\n+\t\t\t: { from, to, files: changesBetween(before, after, paths) };\n \t// A stored writer keeps each shared version's changed files (version-files.ts, abso Capacity): every file that\n \t// differs between two versions changed in one between them, so those lists are the candidates, not every atom\n \t// either set holds.\n \tif (space.name === SHARED && host.graph.packedFiles) {\n \t\tfor (let v = Math.min(from, to) + 1; v <= Math.max(from, to); v++)\n \t\t\tfor (const file of host.paths.versionFiles(space, v)) files.add(file);\n-\t\treturn { from, to, files: changesBetween(before, after, files) };\n+\t\treturn answer(files);\n \t}\n \tconst a = host.at(space, from);\n \tconst b = host.at(space, to);\n@@ -274,7 +281,7 @@\n \t\t))\n \t\t\tfiles.add(file);\n \t}\n-\treturn { from, to, files: changesBetween(before, after, files) };\n+\treturn answer(files);\n }\n \n /** A version of shared (or of a named draft) as a ReadView, for reading lines (blame at a version). */"},{"path":"worker/project/view-changes.ts","added":44,"removed":0,"diff":"--- a/worker/project/view-changes.ts\n+++ b/worker/project/view-changes.ts\n@@ -1,3 +1,4 @@\n+import { createHash } from \"node:crypto\";\n import type { ReadView } from \"../../src/engine/index.ts\";\n import { ProjectError } from \"./project-error.ts\";\n import type { FileChange, Mode, Modes } from \"./project-types.ts\";\n@@ -18,6 +19,49 @@\n \treturn out;\n }\n \n+/** A changed file's text or blob, summed up: its size in UTF-8 bytes and its SHA-256, or a blob's hash. */\n+export type FileSummary = { size: number; sha256: string } | { blob: string };\n+\n+/**\n+ * changesBetween without the texts (abso issue 680, compare's summary): each changed file before and after as its size\n+ * and SHA-256, or its blob's hash for a binary file. Each text is read, summed up and let go, so a compare of thousands\n+ * of files never holds them all.\n+ */\n+export function summariesBetween(\n+\tbefore: ReadView,\n+\tafter: ReadView,\n+\tfiles: Iterable<string>,\n+): {\n+\tpath: string;\n+\tbefore: FileSummary | null;\n+\tafter: FileSummary | null;\n+\tmode?: { before: Mode; after: Mode };\n+\tblob?: { before: string | null; after: string | null };\n+}[] {\n+\tconst sum = (view: ReadView, path: string): FileSummary | null => {\n+\t\tif (!view.hasFile(path)) return null;\n+\t\tconst blob = view.attrs(path).blob;\n+\t\tif (blob !== null) return { blob };\n+\t\tconst text = view.text(path);\n+\t\treturn { size: Buffer.byteLength(text, \"utf8\"), sha256: createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\") };\n+\t};\n+\tconst out: ReturnType<typeof summariesBetween> = [];\n+\tfor (const path of [...new Set(files)].toSorted()) {\n+\t\tif (!differs(before, after, path)) continue;\n+\t\tconst mode = modeChange(before, after, path);\n+\t\tconst bb = before.attrs(path).blob;\n+\t\tconst ab = after.attrs(path).blob;\n+\t\tout.push({\n+\t\t\tpath,\n+\t\t\tbefore: sum(before, path),\n+\t\t\tafter: sum(after, path),\n+\t\t\t...(mode ? { mode } : {}),\n+\t\t\t...(bb !== ab ? { blob: { before: bb, after: ab } } : {}),\n+\t\t});\n+\t}\n+\treturn out;\n+}\n+\n /** Whether a file differs between two views: its text, its mode, or its blob (what changesBetween lists). */\n export function differs(before: ReadView, after: ReadView, path: string): boolean {\n \tconst had = before.hasFile(path);"}],"ci":null}