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 164 to 165

Compare

+22 −0 in 1 place
Lines 6–33 at 165 (were 6–11 at 164)
66import { Repo } from "./helpers.ts";
77import { SqlState } from "./storage-helper.ts";
88
9+test("projection apply and removal compare atom contents without whole-atom JSON", (t) => {
10+ const storage = new SqlState();
11+ t.after(() => storage.db.close());
12+ const repo = Repo.init({ "f.txt": `${"x".repeat(40000)}\n` });
13+ const atom = repo.graph.atom("a0");
14+ const projection = new MarkerProjection(storage, repo.graph, "f.txt", "streamed-comparison");
15+ const stringify = JSON.stringify;
16+ t.mock.method(JSON, "stringify", (...args: Parameters<typeof JSON.stringify>) => {
17+ assert.notEqual(args[0], atom, "projection validation must not serialize the full atom");
18+ return stringify(...args);
19+ });
20+ const state = projection.apply(projection.empty(), atom);
21+ const before = storage.writes;
22+ const altered = { ...atom, message: "forged" };
23+ assert.throws(() => projection.apply(state, altered), /canonical atom mismatch/);
24+ assert.throws(() => projection.removeAtom(state, altered), /canonical atom mismatch/);
25+ assert.equal(storage.writes, before);
26+ const removed = projection.removeAtom(state, atom);
27+ assert.deepEqual(projection.lines(removed, "f.txt"), []);
28+ assert.equal(projection.lines(state, "f.txt").length, 1);
29+});
931test("typed marker projection matches mixed multi-file edits and reverse removals", () => {
1032 const db = new SqlState();
1133 try {
MCP
compare on this site's /mcp
CLI
abso diff 164 165 src/engine/test/projection-marker.test.ts --json
JSON
/christopher/abso-core/compare/164..165?file=src%2Fengine%2Ftest%2Fprojection-marker.test.ts&format=json