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
show on this site's /mcp
CLI
abso show 313 --json
JSON
/christopher/abso-core/versions/313?format=json

fileExactAt: a file at a version by exactly its spelling, from its own lines, without the version's list of files (for abso's pipelines step)

of shared·capacity··Not checked

  • version-log.ts fileExactAt(path, version): what fileAt answers for that same spelling, with no spelling lookup and no path list. Existence comes from hasFile's own test on the file itself: kept while empty, a link, a binary, or a visible line. A name nothing ever wrote is one hasAtomsIn read.
  • Why: fileAt's hasFile answers from the version's whole list of files (the kept path set, folded from version 0 when nothing nearby is kept), and a spelling it doesn't find reads every known path (filesOf over every atom). abso reads its project files (abso.yml and the like) for each green ready marker on every tick, and that grew with history: 2–5 s a tick on prod.
  • Project.fileExactAt; and ProjectHistory.fileExactAt, optional, so abso's pin compiles before its engine passes it through.
  • Test: worker/project/test/file-exact-at.test.ts. fileExactAt equals fileAt at every version for nine paths (added, edited, emptied, binary, removed, never written), and another spelling isn't resolved to the stored one.

Checks: tsc clean; Biome clean; core tests (worker/project and src) 767 of 768 passed, 1 skipped, none failed.

Version 312 · Files at version 313

4 files, 86 lines added, 0 removed.

--- a/worker/project/project-api.ts
+++ b/worker/project/project-api.ts
@@ -155,6 +155,8 @@
155155 refusals(agent?: string, limit?: number): unknown;
156156 /** A file as it was at a version (#27). */
157157 fileAt(path: string, version: number, draft: string | null, agent?: string): unknown;
158+ /** fileAt for exactly this spelling, without the version's list of files (version-log.ts fileExactAt). */
159+ fileExactAt?(path: string, version: number, draft: string | null): unknown;
158160 /** Every file that differs between two versions (#27). */
159161 compare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean): unknown;
160162 /** Version `version` of shared without the versions in `versions` (without.ts). */
--- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -222,6 +222,7 @@
222222 compare as versionCompare,
223223 compareSummary as versionCompareSummary,
224224 fileAt as versionFileAt,
225+ fileExactAt as versionFileExactAt,
225226 log as versionLog,
226227 ribbon as versionRibbon,
227228 show as versionShow,
@@ -2008,6 +2009,11 @@
20082009 return versionFileAt(this.#logHost, ...args);
20092010 }
20102011
2012+ /** fileAt for exactly this spelling, from the file's own lines: no list of the version's files (version-log.ts). */
2013+ fileExactAt(...args: Tail<Parameters<typeof versionFileExactAt>>): ReturnType<typeof versionFileExactAt> {
2014+ return versionFileExactAt(this.#logHost, ...args);
2015+ }
20112017 /** Every file that differs between two versions of shared (or a named draft) (version-log.ts). */
20122018 compare(...args: Tail<Parameters<typeof versionCompare>>): ReturnType<typeof versionCompare> {
20132019 return versionCompare(this.#logHost, ...args);
--- /dev/null
+++ b/worker/project/test/file-exact-at.test.ts
@@ -0,0 +1,49 @@
1+// fileExactAt (version-log.ts, abso Capacity, 2026-10-17): the same answer as fileAt for exactly that spelling, at
2+// every version, read from the file's own lines without the version's list of files. abso's worker/test/
3+// project-files.test.ts checks it on the disk engine, where the list is what costs.
4+
5+import assert from "node:assert/strict";
6+import { test } from "node:test";
7+import { MemoryStore, Project } from "../project.ts";
8+
9+/** Files added, edited, emptied, made binary and taken out, beside others, over six versions. */
10+function history(): Project {
11+ const p = new Project(new MemoryStore(), { hasBlob: () => true });
12+ p.init({ "README.md": "hi\n", "abso.json": '{ "check": "true" }\n', "src/a.ts": "a\n" }, 0);
13+ p.record("ann", { "abso.yml": "pipelines:\n ci:\n on: [push]\n", "docs/abso.yml": "not this one\n" }, 1);
14+ p.publish("ann", "a pipeline", 2);
15+ p.record("ann", { "abso.json": '{ "check": "false" }\n', "empty.txt": "" }, 3, {}, { "abso.yaml": "b".repeat(64) });
16+ p.publish("ann", "a binary, and an empty file", 4);
17+ p.record("ann", { "abso.yml": null, "avcs.json": "{}\n", "src/a.ts": "" }, 5);
18+ p.publish("ann", "the pipeline gone, a file emptied", 6);
19+ return p;
20+}
22+const PATHS = [
23+ "abso.yml",
24+ "abso.yaml",
25+ "abso.json",
26+ "avcs.json",
27+ "docs/abso.yml",
28+ "empty.txt",
29+ "src/a.ts",
30+ "README.md",
31+ "never.txt",
32+];
34+test("fileExactAt answers what fileAt answers for the same spelling, at every version", () => {
35+ const p = history();
36+ const last = p.version;
37+ assert.ok(last >= 3);
38+ for (let v = 0; v <= last; v++)
39+ for (const path of PATHS) assert.deepEqual(p.fileExactAt(path, v), p.fileAt(path, v), `${path} at ${v}`);
40+});
42+test("a name nothing ever wrote is null, and another spelling is that spelling, not the stored one", () => {
43+ const p = history();
44+ const last = p.version;
45+ assert.deepEqual(p.fileExactAt("never.txt", last), { path: "never.txt", version: last, text: null });
46+ // fileAt reads the stored spelling for any spelling (#41); fileExactAt reads only the one asked.
47+ assert.equal((p.fileAt("ABSO.json", last) as { text: string | null }).text, '{ "check": "false" }\n');
48+ assert.deepEqual(p.fileExactAt("ABSO.json", last), { path: "ABSO.json", version: last, text: null });
49+});
--- a/worker/project/version-log.ts
+++ b/worker/project/version-log.ts
@@ -244,6 +244,35 @@
244244 };
245245}
246246
247+/**
248+ * fileAt for exactly this spelling, from the file's own lines (abso Capacity, 2026-10-17): no spelling lookup and no
249+ * list of the version's files. fileAt's hasFile answers from the version's whole path list, folded from version 0
250+ * when nothing's kept, and a spelling it doesn't find reads every known path. A name nothing ever wrote is one read.
251+ * The pipeline's project files (abso.yml and the like) are read this way on every tick.
252+ */
253+export function fileExactAt(
254+ host: LogHost,
255+ path: string,
256+ version: number,
257+ options: { draft?: string | null; agent?: string } = {},
258+): { path: string; version: number; text: string | null; blob?: string } {
259+ host.needInit();
260+ checkReadPath(path);
261+ const space = host.spaceFor(options);
262+ host.checkVersion(space, version);
263+ if (!host.graph.hasAtomsIn(path)) return { path, version, text: null };
264+ const view = host.viewAt(space, version);
265+ const attrs = view.attrs(path);
266+ // hasFile's own test, without its path list: kept while empty, a link, a binary, or a visible line.
267+ const exists = attrs.exists || attrs.link !== null || attrs.blob !== null || view.lines(path).length > 0;
268+ return {
269+ path,
270+ version,
271+ text: exists ? view.text(path) : null,
272+ ...(attrs.blob !== null ? { blob: attrs.blob } : {}),
273+ };
274+}
247276/** The files that may differ between two versions, and both views: compare's and compareSummary's ground. */
248277function compared(
249278 host: LogHost,