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

Compare

+29 −0 in 1 place
new file, 29 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { ExperimentalMarkerProjection } from "../experimental/projection-marker.ts";
4+import { ProjectionReader } from "../experimental/projection-reader.ts";
5+import { Graph } from "../graph.ts";
6+import { Repo } from "./helpers.ts";
7+import { SqlState } from "./storage-helper.ts";
8+
9+test("file lookup rejects a missing marker for an included writer instead of following ancestry", (t) => {
10+ const storage = new SqlState();
11+ t.after(() => storage.db.close());
12+ const repo = Repo.init({ "f.txt": "one\ntwo\n" });
13+ const graph = new Graph({ storage });
14+ graph.add(repo.graph.atom("a0"));
15+ const adapter = new ExperimentalMarkerProjection(storage, graph, "f.txt", "included-marker");
16+ const state = adapter.apply(adapter.empty(), graph.atom("a0"));
17+ const reader = new ProjectionReader(adapter, state, () => {});
18+ const line = [...adapter.lineIds(state, "f.txt")][0]!;
19+ assert.equal(reader.fileOf(line), "f.txt");
20+ const markerKey = graph.lineN(line) + 1;
21+ const get = adapter.markers.get.bind(adapter.markers);
22+ t.mock.method(adapter.markers, "get", (root: Parameters<typeof get>[0], key: number) =>
23+ key === markerKey ? undefined : get(root, key),
24+ );
25+ t.mock.method(graph, "lineParent", () => {
26+ throw Error("included writer must not use ancestry fallback");
27+ });
28+ assert.throws(() => reader.fileOf(line), /missing projected line/);
29+});
MCP
compare on this site's /mcp
CLI
abso diff 68 318 src/engine/test/projection-reader-integrity.test.ts --json
JSON
/christopher/abso-core/compare/68..318?file=src%2Fengine%2Ftest%2Fprojection-reader-integrity.test.ts&format=json