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 115 to 116

Compare

+26 −0 in 2 places
Lines 8–28 at 116 (were 8–13 at 115)
88import { lines, Repo } from "./helpers.ts";
99
1010describe("View", () => {
11+ it("reuses indexed membership across a long run of lines without a history-sized memo", () => {
12+ const repo = Repo.init({ "long.txt": "line\n".repeat(1000) });
13+ class CountingSet extends StableOverlaySet<AtomId> {
14+ calls = 0;
15+ override has(id: AtomId): boolean {
16+ this.calls++;
17+ return super.has(id);
18+ }
19+ }
20+ const set = new CountingSet(["a0"]);
21+ const view = new View(repo.graph, set);
22+ set.calls = 0;
23+ assert.equal(view.text("long.txt"), "line\n".repeat(1000));
24+ assert.ok(set.calls <= 2, `membership was queried ${set.calls} times for one atom`);
25+ });
1126 it("immutable indexed membership avoids a history-sized bitmap and remains a snapshot", () => {
1227 class RangeMembership extends StableSet<AtomId> {
1328 readonly retainedBytes = 64;
Lines 56–72 at 116 (were 41–46 at 115)
4156 assert.equal(first.set.has("a80"), false);
4257 assert.throws(() => new View(repo.graph, new StableOverlaySet<AtomId>(["a1"])), /not closed/);
4358 });
59+ it("membership memo collisions preserve both included and excluded historical atoms", () => {
60+ const repo = Repo.init({ "f.txt": "0\n" });
61+ for (let i = 1; i <= 257; i++) repo.edit({ edits: [{ file: "f.txt", old: `${i - 1}\n`, new: `${i}\n` }] });
62+ const old = new View(repo.graph, new StableOverlaySet<AtomId>(["a0"]));
63+ assert.equal(old.text("f.txt"), "0\n");
64+ assert.deepEqual(
65+ old.sequence("f.txt").map((line) => line.text),
66+ ["0"],
67+ );
68+ assert.equal(repo.view().text("f.txt"), "257\n");
69+ });
4470 it("keeps deleted lines as tombstones in the full sequence", () => {
4571 const repo = Repo.init({ "f.txt": lines("one", "two", "three") });
4672 const del = repo.edit({ edits: [{ file: "f.txt", old: "two\n", new: "" }] });
MCP
compare on this site's /mcp
CLI
abso diff 115 116 src/engine/test/view.test.ts --json
JSON
/christopher/abso-core/compare/115..116?file=src%2Fengine%2Ftest%2Fview.test.ts&format=json