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

Compare

+49 −0 in 1 place
new file, 49 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { buildBase, Graph } from "../index.ts";
4+import { lineKey } from "../keys.ts";
5+import type { Atom, LineId } from "../types.ts";
6+import { SqlState } from "./storage-helper.ts";
7+
8+test("persistent delete counts do not load the atom's deleted-line payload", () => {
9+ const storage = new SqlState();
10+ try {
11+ const graph = new Graph({ storage });
12+ graph.add(
13+ buildBase(
14+ { "a.txt": Array.from({ length: 300 }, (_, i) => `line ${i}`).join("\n") },
15+ { author: "fixture", message: "base", time: 0 },
16+ ),
17+ );
18+ const deletes = Array.from({ length: 300 }, (_, i) => `a0.${i}` as LineId);
19+ const atom: Atom = {
20+ id: "a1",
21+ seq: 1,
22+ author: "fixture",
23+ message: "delete",
24+ time: 1,
25+ inserts: [],
26+ deletes,
27+ writes: deletes.map(lineKey),
28+ reads: [],
29+ holds: [],
30+ needs: [],
31+ resolves: [],
32+ reasons: [],
33+ deps: ["a0"],
34+ };
35+ graph.add(atom);
36+ const reopened = new Graph({ storage });
37+ const read = storage.read.bind(storage);
38+ storage.read = (collection, key) => {
39+ assert.notEqual(collection, "atom-deletes", "count decoded the full deletion list");
40+ assert.notEqual(collection, "atom-deletes:pages", "count read deletion payload pages");
41+ return read(collection, key);
42+ };
43+ assert.equal(reopened.deleteCount("a1"), 300);
44+ storage.read = read;
45+ assert.deepEqual(reopened.deletedLines("a1"), deletes);
46+ } finally {
47+ storage.db.close();
48+ }
49+});
MCP
compare on this site's /mcp
CLI
abso diff 48 318 src/engine/test/graph-deletion-pages.test.ts --json
JSON
/christopher/abso-core/compare/48..318?file=src%2Fengine%2Ftest%2Fgraph-deletion-pages.test.ts&format=json