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 118 to 119

Compare

+34 −1 in 1 place
Lines 1–43 at 119 (were 1–10 at 118)
11import assert from "node:assert/strict";
22import { test } from "node:test";
33import { checkDraft, Graph, View } from "../index.ts";
4−import { CachedStateStorage, storedNumbers } from "../state-source.ts";
4+import { CachedStateStorage, storedLists, storedNumbers } from "../state-source.ts";
55import { lines, Repo } from "./helpers.ts";
66import { SqlState } from "./storage-helper.ts";
77
8+test("per-file list pages append and reopen without reading the full historical list", () => {
9+ const source = new SqlState();
10+ try {
11+ const storage = new CachedStateStorage(source);
12+ const lists = storedLists<string>(storage, "files");
13+ for (let i = 0; i < 1025; i++) storage.transaction(() => lists.append("a.txt", `a${i}`));
14+ assert.equal(lists.length("a.txt"), 1025);
15+ assert.deepEqual([...lists.keys()], ["a.txt"]);
16+ storage.clear();
17+ const before = source.reads;
18+ storage.transaction(() => lists.append("a.txt", "a1025"));
19+ assert.ok(source.reads - before <= 2, "append reads only one page and its length");
20+ assert.throws(
21+ () =>
22+ storage.transaction(() => {
23+ lists.append("a.txt", "rolled-back");
24+ throw new Error("rollback");
25+ }),
26+ /rollback/,
27+ );
28+ const reopened = storedLists<string>(new CachedStateStorage(source), "files");
29+ assert.deepEqual(
30+ [...reopened.values("a.txt")],
31+ Array.from({ length: 1026 }, (_, i) => `a${i}`),
32+ );
33+ for (const [, page] of source.entries("files:pages")) assert.ok((page as string[]).length <= 256);
34+ source.write("legacy", "a.txt", ["a0"]);
35+ assert.throws(() => [...storedLists(source, "legacy").keys()], /canonical-log adoption/);
36+ } finally {
37+ source.db.close();
38+ }
39+});
841test("numeric pages cross boundaries, reopen, mutate and roll back without retaining history", () => {
942 const source = new SqlState();
1043 const storage = new CachedStateStorage(source);
MCP
compare on this site's /mcp
CLI
abso diff 118 119 src/engine/test/state-source.test.ts --json
JSON
/christopher/abso-core/compare/118..119?file=src%2Fengine%2Ftest%2Fstate-source.test.ts&format=json