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

Compare

+42 −0 in 1 place
new file, 42 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 } from "../types.ts";
6+import { SqlState } from "./storage-helper.ts";
7+
8+test("replacement membership distinguishes first, repeated and previous deletions", () => {
9+ const storage = new SqlState();
10+ try {
11+ const graph = new Graph({ storage });
12+ const oracle = new Graph();
13+ const base = buildBase({ "a.txt": "base" }, { author: "fixture", message: "base", time: 0 });
14+ graph.add(base);
15+ oracle.add(base);
16+ for (let seq = 1; seq <= 3; seq++) {
17+ const deleting = seq < 3;
18+ const atom: Atom = {
19+ id: `a${seq}`,
20+ seq,
21+ author: "fixture",
22+ message: "replacement",
23+ time: seq,
24+ inserts: [{ file: "a.txt", parent: "a0.0", lines: [`new ${seq}`] }],
25+ deletes: deleting ? ["a0.0"] : [],
26+ writes: deleting ? [lineKey("a0.0")] : [],
27+ reads: [],
28+ holds: [],
29+ needs: [],
30+ resolves: [],
31+ reasons: [],
32+ deps: [`a${seq - 1}`],
33+ };
34+ graph.add(atom);
35+ oracle.add(atom);
36+ assert.equal(graph.replaces(`a${seq}.0`), deleting);
37+ assert.equal(new Graph({ storage }).replaces(`a${seq}.0`), oracle.replaces(`a${seq}.0`));
38+ }
39+ } finally {
40+ storage.db.close();
41+ }
42+});
MCP
compare on this site's /mcp
CLI
abso diff 2 318 src/engine/test/graph-replacement-membership.test.ts --json
JSON
/christopher/abso-core/compare/2..318?file=src%2Fengine%2Ftest%2Fgraph-replacement-membership.test.ts&format=json