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

Compare

+57 −0 in 1 place
Lines 362–421 at 130 (were 362–364 at 129)
362362 storage.db.close();
363363 }
364364});
366+test("child indexes stream bounded pages before filtering historical siblings", () => {
367+ class ObservedStorage extends SqlState {
368+ pageReads = 0;
369+ largestPage = 0;
370+ override read(collection: string, key: string): unknown {
371+ if (collection === "run-starts:pages") this.pageReads++;
372+ return super.read(collection, key);
373+ }
374+ override write(collection: string, key: string, value: unknown): void {
375+ if (collection === "run-starts:pages") {
376+ assert.ok(Array.isArray(value));
377+ this.largestPage = Math.max(this.largestPage, value.length);
378+ }
379+ super.write(collection, key, value);
380+ }
381+ }
382+ const storage = new ObservedStorage();
383+ try {
384+ const oracle = Repo.init({ "a.txt": "one\ntwo\n" });
385+ const draft = oracle.draft({ edits: [{ file: "a.txt", old: "one", new: "ONE" }] });
386+ const graph = new Graph({ storage });
387+ graph.add(oracle.graph.atom("a0"));
388+ for (let seq = 1; seq <= 513; seq++) {
389+ const atom = { ...draft, id: `a${seq}`, seq };
390+ graph.add(atom);
391+ oracle.graph.add(atom);
392+ }
393+ const reopened = new Graph({ storage });
394+ const parent = draft.inserts[0]!.parent;
395+ const code = reopened.codeOf(parent)!;
396+ storage.pageReads = 0;
397+ const iterator = reopened.eachChildN(code);
398+ const first = iterator.next().value!;
399+ assert.equal(first, reopened.lineN(oracle.graph.childrenOf(parent)[0]!));
400+ assert.ok(storage.pageReads <= 1);
401+ if (storage.pageReads === 0) {
402+ iterator.next();
403+ assert.equal(storage.pageReads, 1, "the implicit child needs no page; the next sibling needs one");
404+ }
405+ assert.deepEqual(reopened.childrenOf(parent), oracle.graph.childrenOf(parent));
406+ assert.deepEqual(
407+ reopened.childrenOf("a0.0"),
408+ oracle.graph.childrenOf("a0.0"),
409+ "implicit same-run child order is retained",
410+ );
411+ assert.equal(storage.largestPage, 256);
412+ const membership = new StableOverlaySet(["a0"]);
413+ assert.equal(new View(reopened, membership).text("a.txt"), "one\ntwo\n");
414+ assert.deepEqual(
415+ new View(reopened, membership).sequence("a.txt"),
416+ new View(oracle.graph, membership).sequence("a.txt"),
417+ );
418+ } finally {
419+ storage.db.close();
420+ }
421+});
MCP
compare on this site's /mcp
CLI
abso diff 129 130 src/engine/test/state-source.test.ts --json
JSON
/christopher/abso-core/compare/129..130?file=src%2Fengine%2Ftest%2Fstate-source.test.ts&format=json