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 18 to 318

Compare

+24 −0 in 1 place
new file, 24 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { buildBase, Graph } from "../index.ts";
4+import { SqlState } from "./storage-helper.ts";
5+
6+test("many insertion runs reopen without fetching every run", (t) => {
7+ const storage = new SqlState();
8+ t.after(() => storage.db.close());
9+ const files = Object.fromEntries(Array.from({ length: 257 }, (_, i) => [`file-${i}.txt`, `value ${i}`]));
10+ const atom = buildBase(files, { author: "fixture", message: "many files", time: 0 });
11+ new Graph({ storage }).add(atom);
12+ assert.ok(JSON.stringify(storage.read("atoms", "0")).length < 2048);
13+ const read = storage.read.bind(storage);
14+ let runs = 0;
15+ storage.read = (collection, key) => {
16+ if (collection === "atom-inserts:0") runs++;
17+ return read(collection, key);
18+ };
19+ const saved = new Graph({ storage }).atom("a0");
20+ assert.equal(saved.inserts.length, atom.inserts.length);
21+ assert.equal(runs, 0);
22+ assert.deepEqual([...saved.inserts[256]!.lines], atom.inserts[256]!.lines);
23+ assert.equal(runs, 1);
24+});
MCP
compare on this site's /mcp
CLI
abso diff 18 318 src/engine/test/graph-insertion-runs.test.ts --json
JSON
/christopher/abso-core/compare/18..318?file=src%2Fengine%2Ftest%2Fgraph-insertion-runs.test.ts&format=json