{"draft":null,"from":4,"to":318,"files":[{"path":"worker/project/version-log.ts","added":94,"removed":20,"diff":"--- a/worker/project/version-log.ts\n+++ b/worker/project/version-log.ts\n@@ -1,14 +1,15 @@\n+import { View } from \"../../src/engine/index.ts\";\n // The version list reads: log (versions newest first, or one file's history), ribbon (who published each version),\n // show (one version's changes), fileAt, compare and viewAt. They read through LogHost; today the host is the project\n // in memory.\n \n-import { type AtomId, type Graph, View } from \"../../src/engine/index.ts\";\n+import type { AtomId, Graph, ReadView } from \"../../src/engine/index.ts\";\n import { checkReadPath } from \"./path-rules.ts\";\n import type { PathIndex } from \"./pathindex.ts\";\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@@ -19,12 +20,12 @@\n \tneedInit(): void;\n \tspaceFor(options: { draft?: string | null; agent?: string }): Space;\n \tcheckVersion(space: Space, version: number): void;\n-\tviewAt(space: Space, version: number): View;\n-\tview(set: ReadonlySet<AtomId>): View;\n+\tviewAt(space: Space, version: number): ReadView;\n+\tview(set: ReadonlySet<AtomId>): ReadView;\n \tat(space: Space, version: number): ReadonlySet<AtomId>;\n-\tspellingIn(view: View, path: string): string;\n+\tspellingIn(view: ReadView, path: string): string;\n \tversionChange(space: Space, version: number): number | undefined;\n-\ttouchedFiles(ids: Iterable<AtomId>, views: readonly View[]): Set<string>;\n+\ttouchedFiles(ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string>;\n }\n \n /**\n@@ -59,18 +60,24 @@\n \t// A file's history (#43): only versions whose changes name the file, or a file moves can carry lines from, can have changed it.\n \tconst sources = path === undefined ? undefined : new Set(names.flatMap((n) => [...moveSources(host.graph, n.path)]));\n \tconst g = host.graph;\n-\tconst views = new Map<number, View>();\n+\tconst views = new Map<number, ReadView>();\n \tfor (; v >= 0 && versions.length < limit; v--) {\n \t\tif (sources && !host.paths.knowsFiles(space, v)) {\n \t\t\tconst p = space.versions[v]!;\n \t\t\tif (![...p.atoms, ...(p.dropped ?? [])].some((id) => g.filesOf(id).some((f) => sources.has(f)))) continue;\n \t\t}\n+\t\t// With a path: only the versions that changed that file (its history), under its name then. Their files first, and\n+\t\t// the whole entry (every atom of the version read) only for those (abso Capacity): a file's history read every\n+\t\t// version's atoms down to its twentieth change.\n+\t\tif (path !== undefined && !host.paths.versionFiles(space, v, views).includes(nameAt(v))) {\n+\t\t\tviews.delete(v + 1);\n+\t\t\tcontinue;\n+\t\t}\n \t\tconst entry = logEntry(host, space, v, views);\n \t\t// The walk goes down: a view above this version won't be needed again (#46).\n \t\tviews.delete(v + 1);\n-\t\t// With a path: only the versions that changed that file (its history), under its name then.\n \t\tif (path === undefined) versions.push(entry);\n-\t\telse if (entry.files.includes(nameAt(v))) versions.push(nameAt(v) === path ? entry : { ...entry, path: nameAt(v) });\n+\t\telse versions.push(nameAt(v) === path ? entry : { ...entry, path: nameAt(v) });\n \t}\n \tconst next = v >= 0 && versions.length > 0 ? versions[versions.length - 1]!.version : undefined;\n \tconst movedFrom = names.slice(0, -1).map((n, i) => ({ path: names[i + 1]!.path, version: n.since }));\n@@ -179,7 +186,7 @@\n \t};\n }\n \n-function logEntry(host: LogHost, space: Space, version: number, views?: Map<number, View>): LogEntry {\n+function logEntry(host: LogHost, space: Space, version: number, views?: Map<number, ReadView>): LogEntry {\n \tconst p = space.versions[version]!;\n \tlet changes = 0;\n \tfor (const id of p.atoms) {\n@@ -237,35 +244,102 @@\n \t};\n }\n \n-/** Every file that differs between two versions of shared (or a named draft), before (at `from`) and after (at `to`). */\n-export function compare(\n+/**\n+ * fileAt for exactly this spelling, from the file's own lines (abso Capacity, 2026-10-17): no spelling lookup and no\n+ * list of the version's files. fileAt's hasFile answers from the version's whole path list, folded from version 0\n+ * when nothing's kept, and a spelling it doesn't find reads every known path. A name nothing ever wrote is one read.\n+ * The pipeline's project files (abso.yml and the like) are read this way on every tick.\n+ */\n+export function fileExactAt(\n \thost: LogHost,\n+\tpath: string,\n+\tversion: number,\n+\toptions: { draft?: string | null; agent?: string } = {},\n+): { path: string; version: number; text: string | null; blob?: string } {\n+\thost.needInit();\n+\tcheckReadPath(path);\n+\tconst space = host.spaceFor(options);\n+\thost.checkVersion(space, version);\n+\tif (!host.graph.hasAtomsIn(path)) return { path, version, text: null };\n+\tconst view = host.viewAt(space, version);\n+\tconst attrs = view.attrs(path);\n+\t// hasFile's own test, without its path list: kept while empty, a link, a binary, or a visible line.\n+\tconst exists = attrs.exists || attrs.link !== null || attrs.blob !== null || view.lines(path).length > 0;\n+\treturn {\n+\t\tpath,\n+\t\tversion,\n+\t\ttext: exists ? view.text(path) : null,\n+\t\t...(attrs.blob !== null ? { blob: attrs.blob } : {}),\n+\t};\n+}\n+\n+/** The files that may differ between two versions, and both views: compare's and compareSummary's ground. */\n+function compared(\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 },\n+): { before: ReadView; after: ReadView; files: Set<string> } {\n \thost.needInit();\n \tconst space = host.spaceFor(options);\n \thost.checkVersion(space, from);\n \thost.checkVersion(space, to);\n+\tconst before = host.viewAt(space, from);\n+\tconst after = host.viewAt(space, to);\n+\tconst files = new Set<string>();\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 { before, after, files };\n+\t}\n \tconst a = host.at(space, from);\n \tconst b = host.at(space, to);\n-\tconst files = new Set<string>();\n \tfor (const [x, y] of [\n \t\t[a, b],\n \t\t[b, a],\n \t] as const) {\n \t\tfor (const file of host.touchedFiles(\n-\t\t\t[...x].filter((id) => !y.has(id)),\n-\t\t\t[host.view(a), host.view(b)],\n+\t\t\t(function* () {\n+\t\t\t\tfor (const id of x) if (!y.has(id)) yield id;\n+\t\t\t})(),\n+\t\t\t[before, after],\n \t\t))\n \t\t\tfiles.add(file);\n \t}\n-\treturn { from, to, files: changesBetween(host.view(a), host.view(b), files) };\n+\treturn { before, after, files };\n }\n \n-/** A version of shared (or of a named draft) as a View, for reading lines (blame at a version). */\n-export function viewAt(host: LogHost, version: number, options: { draft?: string | null; agent?: string } = {}): View {\n+/** Every file that differs between two versions of shared (or a named draft), before (at `from`) and after (at `to`). */\n+export function compare(\n+\thost: LogHost,\n+\tfrom: number,\n+\tto: number,\n+\toptions: { draft?: string | null; agent?: string } = {},\n+): { from: number; to: number; files: FileChange[] } {\n+\tconst { before, after, files } = compared(host, from, to, options);\n+\treturn { from, to, files: changesBetween(before, after, files) };\n+}\n+\n+/** compare's files as each one's size and SHA-256 before and after, not its texts (abso issue 680). */\n+export function compareSummary(\n+\thost: LogHost,\n+\tfrom: number,\n+\tto: number,\n+\toptions: { draft?: string | null; agent?: string } = {},\n+): { from: number; to: number; summary: true; files: ReturnType<typeof summariesBetween> } {\n+\tconst { before, after, files } = compared(host, from, to, options);\n+\treturn { from, to, summary: true, files: summariesBetween(before, after, files) };\n+}\n+\n+/** A version of shared (or of a named draft) as a ReadView, for reading lines (blame at a version). */\n+export function viewAt(\n+\thost: LogHost,\n+\tversion: number,\n+\toptions: { draft?: string | null; agent?: string } = {},\n+): ReadView {\n \thost.needInit();\n \tconst space = host.spaceFor(options);\n \thost.checkVersion(space, version);"}],"unmatched":[]}