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 275 to 276

Compare

+89 −17 in 13 places
Lines 64–75 at 276 (were 64–70 at 275)
6464 sameText(path: string, other: ReadView): boolean;
6565};
6666
67−const NO_ATTRS: FileAttrs = { exists: false, exec: false, link: null, blob: null };
67+const NO_ATTRS: FileAttrs = {
68+ exists: false,
69+ exec: false,
70+ link: null,
71+ blob: null,
72+};
6873
6974/**
7075 * A file layout's bytes, less its lookup indexes, worked out once per layout (abso Capacity): a layout never changes
Lines 128–140 at 276 (were 123–129 at 275)
123128}
124129
125130const EMPTY_INTS = new Int32Array(0);
126−const NO_FILE: FileState = { attrs: NO_ATTRS, complete: true, seq: EMPTY_INTS, vis: EMPTY_INTS, deletedBy: new Map() };
131+const NO_FILE: FileState = {
132+ attrs: NO_ATTRS,
133+ complete: true,
134+ seq: EMPTY_INTS,
135+ vis: EMPTY_INTS,
136+ deletedBy: new Map(),
137+};
127138
128139/** A count of file uses shared by every view, so a cache can tell which layout across its views was used longest ago. */
129140let fileUses = 0;
Lines 184–193 at 276 (were 173–179 at 275)
173184 readonly #graph: Graph;
174185 #seen = 0;
175186 /** Movers in seq order, with the numbers of the lines each moves, in its moves' order. */
176− readonly movers: { readonly seq: number; readonly lines: readonly number[] }[] = [];
187+ readonly movers: {
188+ readonly seq: number;
189+ readonly lines: readonly number[];
190+ }[] = [];
177191 /** Every relocation of each moved line, by the line's number, in seq order. */
178192 readonly byLine = new Map<number, MoveEntry[]>();
179193 readonly #climbed = new Map<number, number>();
Lines 211–222 at 276 (were 197–203 at 275)
197211 const lines: number[] = [];
198212 graph.atom(id).moves!.forEach((m, k) => {
199213 const n = graph.lineN(m.line);
200− const r: RelocationInfo = Object.freeze({ atom: id, line: m.line, parent: m.parent, k });
214+ const r: RelocationInfo = Object.freeze({
215+ atom: id,
216+ line: m.line,
217+ parent: m.parent,
218+ k,
219+ });
201220 const entry: MoveEntry = { n, r, parent: graph.codeOf(m.parent)! };
202221 const list = this.byLine.get(n);
203222 if (list) list.push(entry);
Lines 544–553 at 276 (were 525–531 at 275)
525544 if (this.#relocsN) return this.#relocsN;
526545 const out = new Map<number, { readonly r: RelocationInfo; readonly parent: number }>();
527546 for (const [line, r] of this.#relocations())
528− out.set(this.graph.lineN(line), { r, parent: this.graph.codeOf(r.parent)! });
547+ out.set(this.graph.lineN(line), {
548+ r,
549+ parent: this.graph.codeOf(r.parent)!,
550+ });
529551 this.#relocsN = out;
530552 return out;
531553 }
Lines 649–661 at 276 (were 627–633 at 275)
627649 for (const n of graph.eachChildN(code)) {
628650 const seq = graph.writerSeqOf(n);
629651 if (!this.#has(seq) || relocs?.has(n)) continue;
630− out.push({ n, replaces: graph.replacesN(n) ? 1 : 0, lamport: graph.lamportOfSeq(seq), seq, k: graph.kOf(n) });
652+ out.push({
653+ n,
654+ replaces: graph.replacesN(n) ? 1 : 0,
655+ lamport: graph.lamportOfSeq(seq),
656+ seq,
657+ k: graph.kOf(n),
658+ });
631659 }
632660 if (relocs) {
633661 // The lines this set's moves put under each node, from the moves it already resolved: no row read per node
Lines 671–683 at 276 (were 643–649 at 275)
643671 for (const n of this.#movedInto.get(code) ?? NO_LINES) {
644672 const r = relocs.get(n)!.r;
645673 const seq = graph.atom(r.atom).seq;
646− out.push({ n, replaces: 0, lamport: graph.lamportOfSeq(seq), seq, k: r.k });
674+ out.push({
675+ n,
676+ replaces: 0,
677+ lamport: graph.lamportOfSeq(seq),
678+ seq,
679+ k: r.k,
680+ });
647681 }
648682 }
649683 // A line's replacements (runs of atoms that deleted it) first, then the
Lines 785–798 at 276 (were 751–757 at 275)
751785 const graph = this.graph;
752786 const attrs = this.#attributes(path);
753787 const start = graph.startCodeOf(path);
754− if (start === undefined) return { attrs, complete, seq: EMPTY_INTS, vis: EMPTY_INTS, deletedBy: new Map() };
788+ if (start === undefined)
789+ return {
790+ attrs,
791+ complete,
792+ seq: EMPTY_INTS,
793+ vis: EMPTY_INTS,
794+ deletedBy: new Map(),
795+ };
755796 const relocs = this.#hasMoves ? this.#relocationsN() : undefined;
756797 const files = new Set<number>([-1 - start, ...(this.#movedInFrom().get(path) ?? [])]);
757798 const children = new Map<number, Child[]>();
Lines 815–842 at 276 (were 774–789 at 275)
774815 return lamport;
775816 };
776817 for (const file of files) {
777− let place = -1;
778− for (const [n, parent, seq, k, replaces] of graph.packedLines(file)) {
779− place++;
818+ // The file's history decoded once and kept by the graph (abso Capacity): each view of it read every page again.
819+ const history = graph.packedHistory(file);
820+ const lines = history.lines;
821+ for (let i = 0, place = 0; i < lines.length; i += 5, place++) {
822+ const n = lines[i]!;
823+ const parent = lines[i + 1]!;
824+ const seq = lines[i + 2]!;
825+ const k = lines[i + 3]!;
826+ const replaces = lines[i + 4]!;
780827 if (!this.#has(seq)) continue;
781828 const moved = relocs?.get(n);
782829 let at = parent;
783830 let child: Child = { n, replaces, lamport: lamportOf(seq), seq, k };
784831 if (moved) {
785832 const mover = graph.atom(moved.r.atom).seq;
786− child = { n, replaces: 0, lamport: lamportOf(mover), seq: mover, k: moved.r.k };
833+ child = {
834+ n,
835+ replaces: 0,
836+ lamport: lamportOf(mover),
837+ seq: mover,
838+ k: moved.r.k,
839+ };
787840 at = moved.parent;
788841 }
789842 const list = children.get(at);
Lines 847–864 at 276 (were 794–807 at 275)
794847 writers.set(n, seq);
795848 places.set(n, k);
796849 }
797− for (const [n, deleter] of graph.packedDeletes(file)) {
850+ const dels = history.deletes;
851+ for (let at = 0; at < dels.length; at += 2) {
852+ const n = dels[at]!;
853+ const deleter = dels[at + 1]!;
798854 if (!this.#has(deleter)) continue;
799855 const by = deleters.get(n);
800856 if (by) by.push(deleter);
801857 else deleters.set(n, [deleter]);
802858 }
803859 // Runs written elsewhere under this file's lines follow them; the loop reads their files too.
804− for (const [parent, into] of graph.packedCrossings(file)) if (writers.has(parent)) files.add(into);
860+ const crossings = history.crossings;
861+ for (let at = 0; at < crossings.length; at += 2) if (writers.has(crossings[at]!)) files.add(crossings[at + 1]!);
805862 }
806863 const order = (a: Child, b: Child) =>
807864 b.replaces - a.replaces || b.lamport - a.lamport || b.seq - a.seq || a.k - b.k;
Lines 982–994 at 276 (were 925–931 at 275)
925982 if (complete) seq.push(n);
926983 }
927984
928− return { attrs, complete, seq: Int32Array.from(seq), vis: Int32Array.from(vis), deletedBy };
985+ return {
986+ attrs,
987+ complete,
988+ seq: Int32Array.from(seq),
989+ vis: Int32Array.from(vis),
990+ deletedBy,
991+ };
929992 }
930993
931994 get #known(): string[] {
Lines 1102–1112 at 276 (were 1039–1045 at 275)
10391102 *visibleLines(path: string): IterableIterator<VisibleLine> {
10401103 const graph = this.graph;
10411104 for (const n of this.#file(path).vis)
1042− yield { id: graph.lineIdOf(n), text: graph.textOf(n), atom: graph.idOfSeq(graph.writerSeqOf(n)) };
1105+ yield {
1106+ id: graph.lineIdOf(n),
1107+ text: graph.textOf(n),
1108+ atom: graph.idOfSeq(graph.writerSeqOf(n)),
1109+ };
10431110 }
10441111
10451112 /** Atom-building line handles; text is loaded only when requested. */
Lines 1325–1336 at 276 (were 1258–1264 at 275)
12581325 * Each laid-out file: its layout, when it was last used (a count shared by every view) and what it holds, for a
12591326 * cache that trims the least recently used layouts across its views before whole views (views.ts, abso Capacity).
12601327 */
1261− *laidOut(): IterableIterator<{ path: string; layout: object; used: number; bytes: number }> {
1328+ *laidOut(): IterableIterator<{
1329+ path: string;
1330+ layout: object;
1331+ used: number;
1332+ bytes: number;
1333+ }> {
12621334 for (const [path, f] of this.#files) {
12631335 if (f === NO_FILE) continue;
12641336 let bytes = 2 * MAP_ENTRY_BYTES + layoutBytes(f);
MCP
compare on this site's /mcp
CLI
abso diff 275 276 src/engine/view.ts --json
JSON
/christopher/abso-core/compare/275..276?file=src%2Fengine%2Fview.ts&format=json