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

Compare

+28 −0 in 1 place
Lines 54–84 at 318 (were 54–56 at 248)
5454 storage.db.close();
5555 }
5656});
58+test("a file's decoded history is kept between views and let go when an atom is added", () => {
59+ const oracle = Repo.init({ "a.txt": lines("one", "two", "three"), "b.txt": lines("bee") });
60+ const storage = new SqlState();
61+ try {
62+ const graph = new Graph({ storage });
63+ for (const atom of oracle.graph.atoms()) graph.add(atom);
64+ const first = new View(graph, new StableOverlaySet(oracle.shared));
65+ assert.equal(first.text("a.txt"), "one\ntwo\nthree\n");
66+ assert.ok(graph.historyBytes > 0, "the first layout keeps a.txt's history");
67+ // Another view of the same file reads only what its membership needs, not the history's pages again.
68+ const before = storage.reads;
69+ assert.equal(new View(graph, new StableOverlaySet(oracle.shared)).sequence("a.txt").length, 3);
70+ const pages = storage.reads - before;
71+ const cold = new Graph({ storage });
72+ const coldBefore = storage.reads;
73+ new View(cold, new StableOverlaySet(oracle.shared)).sequence("a.txt");
74+ assert.ok(pages < storage.reads - coldBefore, "the kept history saved reads");
75+ // A new atom lets every kept history go; the next layout sees its lines.
76+ oracle.edit({ edits: [{ file: "a.txt", old: "two", new: "TWO" }] });
77+ graph.add(oracle.graph.atom([...oracle.shared].at(-1)!));
78+ assert.equal(graph.historyBytes, 0);
79+ const after = new View(graph, new StableOverlaySet(oracle.shared));
80+ assert.equal(after.text("a.txt"), new View(oracle.graph, oracle.shared).text("a.txt"));
81+ } finally {
82+ storage.db.close();
83+ }
84+});
MCP
compare on this site's /mcp
CLI
abso diff 248 318 src/engine/test/packed-files.test.ts --json
JSON
/christopher/abso-core/compare/248..318?file=src%2Fengine%2Ftest%2Fpacked-files.test.ts&format=json