Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 243 to 318

Compare

+65 −15 in 4 places
Lines 66–83 at 318 (were 66–77 at 243)
6666 const p = space.versions[v]!;
6767 if (![...p.atoms, ...(p.dropped ?? [])].some((id) => g.filesOf(id).some((f) => sources.has(f)))) continue;
6868 }
69+ // With a path: only the versions that changed that file (its history), under its name then. Their files first, and
70+ // the whole entry (every atom of the version read) only for those (abso Capacity): a file's history read every
71+ // version's atoms down to its twentieth change.
72+ if (path !== undefined && !host.paths.versionFiles(space, v, views).includes(nameAt(v))) {
73+ views.delete(v + 1);
74+ continue;
75+ }
6976 const entry = logEntry(host, space, v, views);
7077 // The walk goes down: a view above this version won't be needed again (#46).
7178 views.delete(v + 1);
72− // With a path: only the versions that changed that file (its history), under its name then.
7379 if (path === undefined) versions.push(entry);
74− else if (entry.files.includes(nameAt(v))) versions.push(nameAt(v) === path ? entry : { ...entry, path: nameAt(v) });
80+ else versions.push(nameAt(v) === path ? entry : { ...entry, path: nameAt(v) });
7581 }
7682 const next = v >= 0 && versions.length > 0 ? versions[versions.length - 1]!.version : undefined;
7783 const movedFrom = names.slice(0, -1).map((n, i) => ({ path: names[i + 1]!.path, version: n.since }));
Lines 244–285 at 318 (were 238–252 at 243)
238244 };
239245}
240246
241−/** Every file that differs between two versions of shared (or a named draft), before (at `from`) and after (at `to`). */
242−export function compare(
247+/**
248+ * fileAt for exactly this spelling, from the file's own lines (abso Capacity, 2026-10-17): no spelling lookup and no
249+ * list of the version's files. fileAt's hasFile answers from the version's whole path list, folded from version 0
250+ * when nothing's kept, and a spelling it doesn't find reads every known path. A name nothing ever wrote is one read.
251+ * The pipeline's project files (abso.yml and the like) are read this way on every tick.
252+ */
253+export function fileExactAt(
243254 host: LogHost,
255+ path: string,
256+ version: number,
257+ options: { draft?: string | null; agent?: string } = {},
258+): { path: string; version: number; text: string | null; blob?: string } {
259+ host.needInit();
260+ checkReadPath(path);
261+ const space = host.spaceFor(options);
262+ host.checkVersion(space, version);
263+ if (!host.graph.hasAtomsIn(path)) return { path, version, text: null };
264+ const view = host.viewAt(space, version);
265+ const attrs = view.attrs(path);
266+ // hasFile's own test, without its path list: kept while empty, a link, a binary, or a visible line.
267+ const exists = attrs.exists || attrs.link !== null || attrs.blob !== null || view.lines(path).length > 0;
268+ return {
269+ path,
270+ version,
271+ text: exists ? view.text(path) : null,
272+ ...(attrs.blob !== null ? { blob: attrs.blob } : {}),
273+ };
274+}
276+/** The files that may differ between two versions, and both views: compare's and compareSummary's ground. */
277+function compared(
278+ host: LogHost,
244279 from: number,
245280 to: number,
246− options: { draft?: string | null; agent?: string; summary?: boolean } = {},
247−):
248− | { from: number; to: number; files: FileChange[] }
249− | { from: number; to: number; summary: true; files: ReturnType<typeof summariesBetween> } {
281+ options: { draft?: string | null; agent?: string },
282+): { before: ReadView; after: ReadView; files: Set<string> } {
250283 host.needInit();
251284 const space = host.spaceFor(options);
252285 host.checkVersion(space, from);
Lines 287–299 at 318 (were 254–271 at 243)
254287 const before = host.viewAt(space, from);
255288 const after = host.viewAt(space, to);
256289 const files = new Set<string>();
257− // With summary, each file's size and SHA-256 instead of its texts (abso issue 680).
258− const answer = (paths: Iterable<string>) =>
259− options.summary
260− ? { from, to, summary: true as const, files: summariesBetween(before, after, paths) }
261− : { from, to, files: changesBetween(before, after, paths) };
262290 // A stored writer keeps each shared version's changed files (version-files.ts, abso Capacity): every file that
263291 // differs between two versions changed in one between them, so those lists are the candidates, not every atom
264292 // either set holds.
265293 if (space.name === SHARED && host.graph.packedFiles) {
266294 for (let v = Math.min(from, to) + 1; v <= Math.max(from, to); v++)
267295 for (const file of host.paths.versionFiles(space, v)) files.add(file);
268− return answer(files);
296+ return { before, after, files };
269297 }
270298 const a = host.at(space, from);
271299 const b = host.at(space, to);
Lines 309–339 at 318 (were 281–289 at 243)
281309 ))
282310 files.add(file);
283311 }
284− return answer(files);
312+ return { before, after, files };
285313}
286314
315+/** Every file that differs between two versions of shared (or a named draft), before (at `from`) and after (at `to`). */
316+export function compare(
317+ host: LogHost,
318+ from: number,
319+ to: number,
320+ options: { draft?: string | null; agent?: string } = {},
321+): { from: number; to: number; files: FileChange[] } {
322+ const { before, after, files } = compared(host, from, to, options);
323+ return { from, to, files: changesBetween(before, after, files) };
324+}
326+/** compare's files as each one's size and SHA-256 before and after, not its texts (abso issue 680). */
327+export function compareSummary(
328+ host: LogHost,
329+ from: number,
330+ to: number,
331+ options: { draft?: string | null; agent?: string } = {},
332+): { from: number; to: number; summary: true; files: ReturnType<typeof summariesBetween> } {
333+ const { before, after, files } = compared(host, from, to, options);
334+ return { from, to, summary: true, files: summariesBetween(before, after, files) };
335+}
287337/** A version of shared (or of a named draft) as a ReadView, for reading lines (blame at a version). */
288338export function viewAt(
289339 host: LogHost,
MCP
compare on this site's /mcp
CLI
abso diff 243 318 worker/project/version-log.ts --json
JSON
/christopher/abso-core/compare/243..318?file=worker%2Fproject%2Fversion-log.ts&format=json