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 161 to 162

Compare

+41 −0 in 1 place
new file, 41 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { buildBase, Graph } from "../index.ts";
4+import { gapKey, posKey } from "../keys.ts";
5+import type { Atom } from "../types.ts";
6+import { SqlState } from "./storage-helper.ts";
7+
8+test("move validation uses indexed write membership without rescanning the write list", () => {
9+ const storage = new SqlState();
10+ try {
11+ const graph = new Graph({ storage });
12+ graph.add(buildBase({ "a.txt": "one\ntwo" }, { author: "fixture", message: "base", time: 0 }));
13+ const writes = [posKey("a0.1"), gapKey("a0.0")];
14+ writes.includes = () => {
15+ throw Error("whole write list scan forbidden");
16+ };
17+ const atom: Atom = {
18+ id: "a1",
19+ seq: 1,
20+ author: "fixture",
21+ message: "move",
22+ time: 1,
23+ inserts: [],
24+ deletes: [],
25+ writes,
26+ reads: [],
27+ holds: [],
28+ needs: [],
29+ resolves: [],
30+ reasons: [],
31+ deps: ["a0"],
32+ moves: [{ line: "a0.1", parent: "a0.0" }],
33+ };
34+ graph.add(atom);
35+ assert.equal(new Graph({ storage }).size, 2);
36+ assert.throws(() => graph.add({ ...atom, id: "a2", seq: 2, writes: [posKey("a0.1")] }), /without writing/);
37+ assert.equal(graph.size, 2);
38+ } finally {
39+ storage.db.close();
40+ }
41+});
MCP
compare on this site's /mcp
CLI
abso diff 161 162 src/engine/test/graph-move-write-membership.test.ts --json
JSON
/christopher/abso-core/compare/161..162?file=src%2Fengine%2Ftest%2Fgraph-move-write-membership.test.ts&format=json