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 217 --json
JSON
/christopher/abso-core/versions/217?format=json

tree lists a version's files from the kept shapes, as pathsAt does since 216 (disk-first 2; abso Capacity). The tree at a version laid out every file only to list them. Not for an agent's tree, whose view has its draft on top. On abso's export the tree at head went from over 60 s to 225 ms (replay takes 41 s), and the tree at 612 takes 156 ms, both matching Project.load. version-files.test.ts now also checks the tree at every version against the in-memory project. Named tests: version-files, files-reads, project, draft-reads-stored, named-drafts (38 of 38); tsc clean.

of shared·capacity··Not checked

tree lists a version's files from the kept shapes, as pathsAt does since 216 (disk-first 2; abso Capacity). The tree at a version laid out every file only to list them. Not for an agent's tree, whose view has its draft on top.

On abso's export the tree at head went from over 60 s to 225 ms (replay takes 41 s), and the tree at 612 takes 156 ms, both matching Project.load. version-files.test.ts now also checks the tree at every version against the in-memory project. Named tests: version-files, files-reads, project, draft-reads-stored, named-drafts (38 of 38); tsc clean.

Version 216 · Files at version 217

3 files, 13 lines added, 4 removed.

--- a/worker/project/history.ts
+++ b/worker/project/history.ts
@@ -16,6 +16,8 @@
1616 spaceNamed(name: string | null): Space;
1717 checkVersion(space: Space, version: number): void;
1818 viewAt(space: Space, version: number): ReadView;
19+ /** A version's file list from kept version shapes, when every version up to it has one (pathindex.ts). */
20+ keptPaths?(space: Space, version: number): string[] | undefined;
1921 agentView(agent: { readonly name: string; readonly space: string; readonly base: number }): ReadView;
2022 spellingIn(view: ReadView, asked: string): string;
2123 pathsOf(space: Space): Map<string, PathLifeRecord>;
@@ -118,7 +120,8 @@
118120 );
119121 return e;
120122 };
121− for (const path of view.paths()) {
123+ const paths = (agent ? undefined : h.keptPaths?.(space, version)) ?? view.paths();
124+ for (const path of paths) {
122125 const e = entryOf(path);
123126 if (!e) continue;
124127 e.files++;
--- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -1767,6 +1767,7 @@
17671767 spaceNamed: (name) => this.#spaceNamed(name),
17681768 checkVersion: (space, version) => this.#checkVersion(space, version),
17691769 viewAt: (space, version) => this.#viewAt(space, version),
1770+ keptPaths: (space, version) => this.#keptPaths(space, version),
17701771 agentView: (agent) => this.#agentView(agent as AgentState),
17711772 spellingIn: (view, asked) => this.spellingIn(view, asked),
17721773 pathsOf: (space) => this.#paths.pathsOf(space),
@@ -1777,6 +1778,11 @@
17771778 return this.#host;
17781779 }
17791780
1781+ /** Shared's file list from kept shapes on a stored writer, where a version's layout reads its files from disk. */
1782+ #keptPaths(space: Space, version: number): string[] | undefined {
1783+ return this.#writerStorage && space.name === SHARED ? this.#paths.keptPaths(space, version) : undefined;
1784+ }
17801786 /** One folder at a version (history.ts). */
17811787 tree(...args: Tail<Parameters<typeof historyTree>>): ReturnType<typeof historyTree> {
17821788 return historyTree(this.#history, ...args);
@@ -2643,9 +2649,7 @@
26432649 spaceNamed: (name) => this.#spaceNamed(name),
26442650 checkVersion: (space, version) => this.#checkVersion(space, version),
26452651 viewAt: (space, version) => this.#viewAt(space, version),
2646− // Shared's lists from kept shapes on a stored writer, where a version's layout reads its files from disk.
2647− keptPaths: (space, version) =>
2648− this.#writerStorage && space.name === SHARED ? this.#paths.keptPaths(space, version) : undefined,
2652+ keptPaths: (space, version) => this.#keptPaths(space, version),
26492653 agentView: (agent) => this.#agentView(agent),
26502654 version: () => this.version,
26512655 projectFile: () => (this.initialized ? projectFileIn(this.#sharedView()) : undefined),
--- a/worker/project/test/version-files.test.ts
+++ b/worker/project/test/version-files.test.ts
@@ -55,6 +55,8 @@
5555 // The file list at each version, folded from the kept shapes' files made and taken out: newest first, then from 0.
5656 assert.deepEqual(project.pathsAt(oracle.version), oracle.pathsAt(oracle.version));
5757 for (let v = 0; v <= oracle.version; v++) assert.deepEqual(project.pathsAt(v), oracle.pathsAt(v), `paths at ${v}`);
58+ for (let v = 0; v <= oracle.version; v++)
59+ assert.deepEqual(project.tree("", { version: v }), oracle.tree("", { version: v }), `tree at ${v}`);
5860 // A compare reads the kept lists for the versions between (version-log.ts): both ways, and across the drop.
5961 for (const [from, to] of [
6062 [0, oracle.version],