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 165 to 166

Compare

+22 −0 in 1 place
Lines 4–31 at 166 (were 4–9 at 165)
44import { Graph } from "../graph.ts";
55import { SqlState } from "./storage-helper.ts";
66
7+test("large insertion text stays lazy even when the run has few lines", (t) => {
8+ const storage = new SqlState();
9+ t.after(() => storage.db.close());
10+ const memory = new MemoryStore();
11+ const line = "x".repeat(100000);
12+ new Project(memory).init({ "a.txt": `${line}\n${line}\n${line}\n` }, 0);
13+ const entry = memory.entries[0]!;
14+ if (entry.type !== "init") throw Error("expected init");
15+ new Graph({ storage }).add(entry.atom);
16+ const read = storage.read.bind(storage);
17+ let textReads = 0;
18+ t.mock.method(storage, "read", (collection: string, key: string) => {
19+ if (collection === "atom-text:long:chunks") textReads++;
20+ return read(collection, key);
21+ });
22+ const atom = new Graph({ storage }).atom("a0");
23+ assert.equal(atom.inserts[0]!.lines.length, 3);
24+ assert.equal(textReads, 0, "reading line count must not decode the complete run");
25+ assert.equal(atom.inserts[0]!.lines[1], line);
26+ assert.equal(textReads, Math.ceil(line.length / 16384), "an indexed read decodes only the selected line");
27+});
729test("persistent graph stores long lines in chunks and reopens exact text", () => {
830 const storage = new SqlState();
931 try {
MCP
compare on this site's /mcp
CLI
abso diff 165 166 src/engine/test/graph-long-text.test.ts --json
JSON
/christopher/abso-core/compare/165..166?file=src%2Fengine%2Ftest%2Fgraph-long-text.test.ts&format=json