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

Compare

+22 −4 in 3 places
Lines 5–17 at 318 (were 5–15 at 41)
55
66import assert from "node:assert/strict";
77import { describe, it } from "node:test";
8−import { type Atom, type AtomId, conflicts } from "../index.ts";
8+import { type Atom, type AtomId, conflicts, Graph, View } from "../index.ts";
9+import { StableOverlaySet } from "../state-source.ts";
910import { lines, Repo, Rng } from "./helpers.ts";
11+import { SqlState } from "./storage-helper.ts";
1012
11−const BASE_SEED = Number(process.env["PROP_SEED"] ?? 20261004);
12−const CASES = Number(process.env["PROP_CASES"] ?? 200);
13+const BASE_SEED = Number(process.env.PROP_SEED ?? 20261004);
14+const CASES = Number(process.env.PROP_CASES ?? 200);
1315
1416const FN = ["function area(r) {", " const pi = 3.14;", " return pi * r * r;", "}"];
1517const START = {
Lines 135–141 at 318 (were 133–139 at 41)
133135 const repo = Repo.init(START);
134136 concurrently(
135137 repo,
136− (base) => repo.draft({ edits: [{ file: "shapes.js", old: FN.join("\n") + "\n", new: "" }] }, base),
138+ (base) => repo.draft({ edits: [{ file: "shapes.js", old: `${FN.join("\n")}\n`, new: "" }] }, base),
137139 (base) => moveArea(repo, base),
138140 );
139141 assert.deepEqual(conflicts(repo.graph, repo.shared), []);
Lines 245–266 at 318 (were 243–248 at 41)
243245 accept(repo, mk("a0.2", "a0.0"));
244246 const text = repo.text("f.txt");
245247 assert.deepEqual(text.split("\n").filter(Boolean).sort(), ["m", "n", "x", "y"]);
248+ class BoundedReads extends SqlState {
249+ override read(collection: string, key: string): unknown {
250+ if (this.reads > 10_000) throw new Error("relocation cycle did not terminate");
251+ return super.read(collection, key);
252+ }
253+ }
254+ const storage = new BoundedReads();
255+ try {
256+ const stored = new Graph({ storage });
257+ for (let seq = 0; seq < repo.graph.size; seq++) stored.add(repo.graph.atom(repo.graph.idOfSeq(seq)));
258+ const reopened = new Graph({ storage });
259+ assert.equal(new View(reopened, repo.shared).text("f.txt"), text);
260+ assert.equal(new View(reopened, new StableOverlaySet(repo.shared)).text("f.txt"), text);
261+ } finally {
262+ storage.db.close();
263+ }
246264 });
247265
248266 it("rejects a move onto itself or out of range", () => {
MCP
compare on this site's /mcp
CLI
abso diff 41 318 src/engine/test/moves.test.ts --json
JSON
/christopher/abso-core/compare/41..318?file=src%2Fengine%2Ftest%2Fmoves.test.ts&format=json