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

Compare

+25 −0 in 1 place
Lines 47–74 at 318 (were 47–49 at 160)
4747 storage.db.close();
4848 }
4949});
51+test("sequence batches match individual updates and retry after rollback", () => {
52+ const storage = new SqlState();
53+ try {
54+ const sequence = new ProjectionSequence(storage, "batch-cache");
55+ let state = sequence.empty();
56+ for (let i = 0; i < 48; i++) state = sequence.update(state, { kind: "insert", rank: i, text: String(i) });
57+ const before = state;
58+ const operations = Array.from({ length: 16 }, (_, i) => ({ kind: "visibility" as const, id: i, delta: 1 }));
59+ const rows = () => JSON.stringify(storage.db.prepare("SELECT * FROM state ORDER BY collection,key").all());
60+ const original = rows();
61+ storage.failWrite = storage.writes + 3;
62+ assert.throws(() => sequence.updateMany(before, operations), /injected/);
63+ assert.equal(rows(), original);
64+ storage.failWrite = Infinity;
65+ const batch = sequence.updateMany(before, operations);
66+ let individual = before;
67+ for (const operation of operations) individual = sequence.update(individual, operation);
68+ assert.deepEqual([...sequence.values(batch)], [...sequence.values(individual)]);
69+ assert.equal([...sequence.values(before)].length, 48);
70+ assert.equal([...sequence.values(batch)].length, 32);
71+ } finally {
72+ storage.db.close();
73+ }
74+});
MCP
compare on this site's /mcp
CLI
abso diff 160 318 src/engine/test/projection-sequence.test.ts --json
JSON
/christopher/abso-core/compare/160..318?file=src%2Fengine%2Ftest%2Fprojection-sequence.test.ts&format=json