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 124 to 125

Compare

+11 −2 in 4 places
Lines 83–89 at 125 (were 83–88 at 124)
8383const MAP_ENTRY_BYTES = 40;
8484const SET_ENTRY_BYTES = 32;
8585const REFERENCE_BYTES = 8;
86+const FILE_LOCATION_MEMO_ENTRIES = 256;
8687
8788/**
8889 * The projection of a closed set. Construct once, then ask for files, lines
Lines 111–117 at 125 (were 110–115 at 124)
110111 #relocs: Map<LineId, RelocationInfo> | undefined;
111112 /** The same, by n, with the new parent's code. */
112113 #relocsN: Map<number, { readonly r: RelocationInfo; readonly parent: number }> | undefined;
114+ /** Bounded memo: ancestry can span the entire history even for one visible line. */
113115 #fileOf = new Map<number, string>();
114116 /** The latest records asked for: one file's lines, one file's sequence, one file's text. */
115117 #linesCache: { path: string; lines: readonly VisibleLine[] } | undefined;
Lines 288–297 at 125 (were 286–292 at 124)
286288 const graph = this.graph;
287289 if (!this.#hasMoves) return graph.writtenIn(n);
288290 const relocs = this.#relocationsN();
291+ // Keep only a fixed tail of the walk for path compression. The selected
292+ // relocation graph is acyclic, so traversal needs no history-sized stack.
289293 const path: number[] = [];
294+ let visited = 0;
290295 let cur = n;
291296 let file: string | undefined;
292297 while (file === undefined) {
Lines 299–314 at 125 (were 294–305 at 124)
294299 else {
295300 file = this.#fileOf.get(cur);
296301 if (file === undefined) {
297− path.push(cur);
302+ path[visited++ % FILE_LOCATION_MEMO_ENTRIES] = cur;
298303 cur = relocs.get(cur)?.parent ?? graph.parentCodeOf(cur);
299304 }
300305 }
301306 }
302− for (const l of path) this.#fileOf.set(l, file);
307+ for (const l of path) {
308+ if (!this.#fileOf.has(l) && this.#fileOf.size >= FILE_LOCATION_MEMO_ENTRIES)
309+ this.#fileOf.delete(this.#fileOf.keys().next().value!);
310+ this.#fileOf.set(l, file);
311+ }
303312 return file;
304313 }
305314
MCP
compare on this site's /mcp
CLI
abso diff 124 125 src/engine/view.ts --json
JSON
/christopher/abso-core/compare/124..125?file=src%2Fengine%2Fview.ts&format=json