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

Compare

+38 −0 in 1 place
Lines 5–48 at 120 (were 5–10 at 119)
55import { lines, Repo } from "./helpers.ts";
66import { SqlState } from "./storage-helper.ts";
77
8+test("hot claim indexes stream bounded pages after reopening", (t) => {
9+ const oracle = Repo.init({ "a.txt": lines("one", "two") });
10+ const draft = oracle.draft({ edits: [{ file: "a.txt", old: "one", new: "ONE" }] });
11+ const source = new SqlState();
12+ try {
13+ const graph = new Graph({ storage: source });
14+ graph.add(oracle.graph.atom("a0"));
15+ for (let i = 0; i < 513; i++) {
16+ const atom = { ...draft, id: `a${i + 1}`, seq: i + 1 };
17+ graph.add(atom);
18+ oracle.graph.add(atom);
19+ }
20+ const reopened = new Graph({ storage: source });
21+ const read = source.read.bind(source);
22+ let pagesRead = 0;
23+ t.mock.method(source, "read", (collection: string, key: string) => {
24+ if (collection === "writers:pages") pagesRead++;
25+ return read(collection, key);
26+ });
27+ const iterator = reopened.eachWriterOf("L:a0.0");
28+ assert.equal(iterator.next().value, "a1");
29+ assert.equal(pagesRead, 1, "first claimant reads one claim page, not the entire hot-key history");
30+ assert.deepEqual(reopened.writersOf("L:a0.0"), oracle.graph.writersOf("L:a0.0"));
31+ for (const name of ["writers", "readers", "holders"]) {
32+ assert.equal([...source.entries(name)].length, 0, "no whole-list claim rows remain");
33+ for (const [, page] of source.entries(`${name}:pages`)) assert.ok((page as string[]).length <= 256);
34+ }
35+ const key = JSON.stringify(["number", 0]);
36+ source.write("legacy-claims", key, ["old"]);
37+ assert.throws(
38+ () => [...storedLists(source, "legacy-claims", (value) => value).values(key)],
39+ /canonical-log adoption/,
40+ );
41+ } finally {
42+ source.db.close();
43+ }
44+});
846test("per-file list pages append and reopen without reading the full historical list", () => {
947 const source = new SqlState();
1048 try {
MCP
compare on this site's /mcp
CLI
abso diff 119 120 src/engine/test/state-source.test.ts --json
JSON
/christopher/abso-core/compare/119..120?file=src%2Fengine%2Ftest%2Fstate-source.test.ts&format=json