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 130 to 131

Compare

+70 −0 in 1 place
Lines 419–491 at 131 (were 419–421 at 130)
419419 storage.db.close();
420420 }
421421});
423+test("persistent layout uses ordered successors without retaining deep or wide history frontiers", () => {
424+ for (const shape of ["deep", "wide"] as const) {
425+ const storage = new SqlState();
426+ try {
427+ const oracle = Repo.init({
428+ "a.txt": shape === "deep" ? Array.from({ length: 1024 }, (_, n) => `line ${n}\n`).join("") : "base\n",
429+ });
430+ if (shape === "wide") {
431+ const draft = oracle.draft({ edits: [{ file: "a.txt", old: "base", new: "branch" }] });
432+ for (let seq = 1; seq <= 256; seq++) {
433+ const atom = { ...draft, id: `a${seq}`, seq };
434+ oracle.graph.add(atom);
435+ oracle.shared.add(atom.id);
436+ }
437+ }
438+ const before = oracle.view().text("a.txt");
439+ oracle.edit({ edits: [{ file: "a.txt", old: before, new: "live\n" }] });
440+ const graph = new Graph({ storage });
441+ for (const id of oracle.shared) graph.add(oracle.graph.atom(id));
442+ const reopened = new Graph({ storage });
443+ reopened.eachChildN = () => {
444+ throw Error("unordered child collection forbidden");
445+ };
446+ reopened.childrenN = () => {
447+ throw Error("materialized child collection forbidden");
448+ };
449+ const original = reopened.orderedChildrenN.bind(reopened);
450+ let active = 0,
451+ maximum = 0;
452+ reopened.orderedChildrenN = function* (parent: number, after?: number) {
453+ active++;
454+ maximum = Math.max(maximum, active);
455+ try {
456+ yield* original(parent, after);
457+ } finally {
458+ active--;
459+ }
460+ };
461+ const view = new View(reopened, new StableOverlaySet(oracle.shared));
462+ assert.equal(view.text("a.txt"), "live\n");
463+ assert.equal(active, 0);
464+ assert.equal(maximum, 1, "no ordered iterator retained per historical ancestor");
465+ assert.deepEqual(view.sequence("a.txt"), oracle.view().sequence("a.txt"));
466+ } finally {
467+ storage.db.close();
468+ }
469+ }
470+});
472+test("ordered layout refuses missing format or child metadata instead of dropping history", () => {
473+ const storage = new SqlState();
474+ try {
475+ const oracle = Repo.init({ "a.txt": "one\n" });
476+ const graph = new Graph({ storage });
477+ graph.add(oracle.graph.atom("a0"));
478+ storage.remove("ordered-children", "format");
479+ assert.throws(() => new View(new Graph({ storage }), new StableOverlaySet(["a0"])).text("a.txt"), /fresh adoption/);
480+ assert.throws(
481+ () => new Graph({ storage }).add(oracle.draft({ edits: [{ file: "a.txt", old: "one", new: "two" }] })),
482+ /fresh adoption/,
483+ );
484+ storage.write("ordered-children", "format", 1);
485+ const parent = graph.startCodeOf("a.txt")!;
486+ storage.remove("ordered-children", JSON.stringify([String(parent), "meta"]));
487+ assert.throws(() => [...graph.orderedChildrenN(parent)], /missing ordered index metadata/);
488+ } finally {
489+ storage.db.close();
490+ }
491+});
MCP
compare on this site's /mcp
CLI
abso diff 130 131 src/engine/test/state-source.test.ts --json
JSON
/christopher/abso-core/compare/130..131?file=src%2Fengine%2Ftest%2Fstate-source.test.ts&format=json