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) Version 313 of shared· capacity· Oct 17 (2026-10-17 02:57 UTC) · 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 @@
155 155 refusals(agent?: string, limit?: number): unknown; 156 156 /** A file as it was at a version (#27). */ 157 157 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; 158 160 /** Every file that differs between two versions (#27). */ 159 161 compare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean): unknown; 160 162 /** 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 @@
222 222 compare as versionCompare, 223 223 compareSummary as versionCompareSummary, 224 224 fileAt as versionFileAt, 225 + fileExactAt as versionFileExactAt, 225 226 log as versionLog, 226 227 ribbon as versionRibbon, 227 228 show as versionShow, @@ -2008,6 +2009,11 @@
2008 2009 return versionFileAt(this.#logHost, ...args); 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); 2011 2017 /** Every file that differs between two versions of shared (or a named draft) (version-log.ts). */ 2012 2018 compare(...args: Tail<Parameters<typeof versionCompare>>): ReturnType<typeof versionCompare> { 2013 2019 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. 5 + import assert from "node:assert/strict"; 6 + import { test } from "node:test"; 7 + import { MemoryStore, Project } from "../project.ts"; 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); 34 + test("fileExactAt answers what fileAt answers for the same spelling, at every version", () => { 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}`); 42 + test("a name nothing ever wrote is null, and another spelling is that spelling, not the stored one", () => { 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 }); --- a/worker/project/version-log.ts
+++ b/worker/project/version-log.ts
@@ -244,6 +244,35 @@
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. 253 + export function fileExactAt( 257 + options: { draft?: string | null; agent?: string } = {}, 258 + ): { path: string; version: number; text: string | null; blob?: string } { 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; 271 + text: exists ? view.text(path) : null, 272 + ...(attrs.blob !== null ? { blob: attrs.blob } : {}), 247 276 /** The files that may differ between two versions, and both views: compare's and compareSummary's ground. */