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

Compare

+25 −10 in 3 places
Lines 1–7 at 318 (were 1–6 at 147)
11import assert from "node:assert/strict";
22import { test } from "node:test";
33import { ProjectionAtomAdoption } from "../experimental/projection-atom-adoption.ts";
4+import { indexAcceptedProjectionAtom, ProjectionAtomIndex } from "../experimental/projection-atom-index.ts";
45import { ExperimentalMarkerProjection as MarkerProjection } from "../experimental/projection-marker.ts";
56import { Graph } from "../graph.ts";
67import { CachedStateStorage } from "../state-source.ts";
Lines 9–23 at 318 (were 8–19 at 147)
89import { Repo, Rng } from "./helpers.ts";
910import { SqlState } from "./storage-helper.ts";
1011
11−for (const paged of [false, true])
12+for (const paged of [false, true, "indexed"] as const)
1213 test(`typed marker projection matches competing cyclic moves and removals (paged=${paged})`, () => {
1314 const db = new SqlState();
1415 try {
1516 const repo = Repo.init({ "f.txt": Array.from({ length: 12 }, (_, n) => `${n}\n`).join("") }),
16− graph = new Graph({ storage: new CachedStateStorage(db) }),
17+ graph = new Graph({
18+ storage: new CachedStateStorage(db),
19+ indexAcceptedAtom: paged === "indexed" ? indexAcceptedProjectionAtom : undefined,
20+ }),
1721 rng = new Rng(45131);
1822 graph.add(repo.graph.atom("a0"));
1923 const p = new MarkerProjection(db, graph, "f.txt", "typed-" + "cycle");
Lines 30–54 at 318 (were 26–39 at 147)
2630 const job = new ProjectionAtomAdoption(p, String(task++));
2731 const previous = state;
2832 for (let pages = 0; pages < 10000; pages++) {
29− const result = job.page({
30− previous,
31− atom,
32− remove,
33− source: "c".repeat(64),
34− maxSteps: 3,
35− validateSource: () => {},
36− });
33+ const read = db.read.bind(db);
34+ if (paged === "indexed")
35+ db.read = (collection, key) => {
36+ if (collection === "atoms") throw Error("full atom read forbidden");
37+ return read(collection, key);
38+ };
39+ let result;
40+ try {
41+ result = job.page({
42+ previous,
43+ atom: paged === "indexed" ? new ProjectionAtomIndex(db).openAccepted(atom.id) : atom,
44+ remove,
45+ source: "c".repeat(64),
46+ maxSteps: 3,
47+ validateSource: () => {},
48+ });
49+ } finally {
50+ db.read = read;
51+ }
3752 assert.ok(result.steps <= 3);
3853 assert.equal(result.atomicMoveWork, false);
3954 if (result.done) return result.state;
MCP
compare on this site's /mcp
CLI
abso diff 147 318 src/engine/test/projection-marker-cycle.test.ts --json
JSON
/christopher/abso-core/compare/147..318?file=src%2Fengine%2Ftest%2Fprojection-marker-cycle.test.ts&format=json