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
MCP
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/src/engine/test/projection-reader-integrity.test.ts?format=json
29 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 164, 1 version changed it
1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { ExperimentalMarkerProjection } from "../experimental/projection-marker.ts";
4import { ProjectionReader } from "../experimental/projection-reader.ts";
5import { Graph } from "../graph.ts";
6import { Repo } from "./helpers.ts";
7import { SqlState } from "./storage-helper.ts";
8
9test("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});