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

+47 −0 in 1 place
Lines 118–167 at 162 (were 118–120 at 161)
118118 storage.db.close();
119119 }
120120});
122+test("visibility batches roll back earlier batches and retry with exact line parity", (t) => {
123+ const db = new SqlState();
124+ t.after(() => db.db.close());
125+ const text = Array.from({ length: 35 }, (_, n) => `line ${n}\n`).join("");
126+ const repo = Repo.init({ "f.txt": text });
127+ const graph = new Graph({ storage: new CachedStateStorage(db) });
128+ graph.add(repo.graph.atom("a0"));
129+ const p = new MarkerProjection(db, graph, "f.txt", "batch-failure");
130+ const initial = p.apply(p.empty(), repo.graph.atom("a0"));
131+ const originalLines = p.lines(initial, "f.txt");
132+ const atom = repo.edit({ edits: [{ file: "f.txt", old: text, new: "" }] });
133+ graph.add(atom);
134+ const rows = () => db.db.prepare("SELECT * FROM state ORDER BY collection,key").all();
135+ const before = rows();
136+ const original = p.sequence.updateMany.bind(p.sequence);
137+ const sizes: number[] = [];
138+ let fail = true;
139+ t.mock.method(
140+ p.sequence,
141+ "updateMany",
142+ (state: Parameters<typeof original>[0], operations: Parameters<typeof original>[1]) => {
143+ const next = original(state, operations);
144+ if (operations.every((op) => op.kind === "visibility")) {
145+ sizes.push(operations.length);
146+ if (fail && sizes.length === 2) throw Error("second visibility batch failure");
147+ }
148+ return next;
149+ },
150+ );
151+ assert.throws(() => p.apply(initial, atom), /second visibility batch/);
152+ assert.deepEqual(sizes, [16, 16]);
153+ assert.deepEqual(rows(), before);
154+ assert.deepEqual(p.lines(initial, "f.txt"), originalLines);
155+ fail = false;
156+ sizes.length = 0;
157+ const next = p.apply(initial, atom);
158+ assert.deepEqual(sizes, [16, 16, 3]);
159+ assert.deepEqual(
160+ p.lines(next, "f.txt"),
161+ repo
162+ .view()
163+ .lines("f.txt")
164+ .map((line) => line.id),
165+ );
166+ assert.deepEqual(p.lines(initial, "f.txt"), originalLines);
167+});
MCP
compare on this site's /mcp
CLI
abso diff 161 162 src/engine/test/projection-marker.test.ts --json
JSON
/christopher/abso-core/compare/161..162?file=src%2Fengine%2Ftest%2Fprojection-marker.test.ts&format=json