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

Client: tests no longer read this machine's Claude folder (setup.ts), a mod folder with no readable install record counts as old, import-git keeps .abso (Pinch's review of 28, abso 253)

of shared·review··Not checked

Version 31 · Files at version 32

5 files, 34 lines added, 6 removed.

--- a/client/scripts/import-git.ts
+++ b/client/scripts/import-git.ts
@@ -60,7 +60,11 @@
6060const dir = values.dir ? resolve(values.dir) : mkdtempSync(join(tmpdir(), "avcs-import-"));
6161mkdirSync(dir, { recursive: true });
6262if (after === undefined && readdirSync(dir).length > 0) fail(`${dir} isn't empty`);
63−if (after !== undefined && !existsSync(join(dir, ".avcs", "config.json")))
63+if (
64+ after !== undefined &&
65+ !existsSync(join(dir, ".abso", "config.json")) &&
66+ !existsSync(join(dir, ".avcs", "config.json"))
67+)
6468 fail(`${dir} isn't an abso folder; --after goes on in an earlier run's folder`);
6569
6670// The last commit first: nothing is created unless it passes.
@@ -140,15 +144,16 @@
140144 }
141145}
142146
143−/** The commit's tree in `dir`, replacing everything but .avcs; its files, folder-relative. */
147+/** The commit's tree in `dir`, replacing everything but .avcs and .abso; its files, folder-relative. */
144148function extract(sha: string, into: string): string[] {
145− for (const e of readdirSync(into)) if (e !== ".avcs") rmSync(join(into, e), { recursive: true, force: true });
149+ for (const e of readdirSync(into))
150+ if (e !== ".avcs" && e !== ".abso") rmSync(join(into, e), { recursive: true, force: true });
146151 // Piped, with tar in the folder: no path for tar to misread (GNU tar takes "C:" for a remote host).
147152 const archive = spawnSync("git", ["archive", "--format=tar", sha], { maxBuffer: 1 << 30 });
148153 if (archive.status !== 0) fail(`git archive: ${archive.stderr.toString().trim()}`);
149154 const untar = spawnSync("tar", ["-xf", "-"], { cwd: into, input: archive.stdout, encoding: "utf8" });
150155 if (untar.status !== 0) fail(`tar couldn't unpack ${sha}: ${untar.stderr}`);
151− return walk(into).filter((rel) => !rel.startsWith(".avcs/"));
156+ return walk(into).filter((rel) => !rel.startsWith(".avcs/") && !rel.startsWith(".abso/"));
152157}
153158
154159/** Why abso would store these bytes differently from git, or undefined. Binary files (NUL, or not UTF-8) go up byte for byte. */
--- a/client/src/state-dir.ts
+++ b/client/src/state-dir.ts
@@ -39,12 +39,13 @@
3939export function newFolderDir(env: Readonly<Record<string, string | undefined>> = process.env): string {
4040 const skills = join(env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude"), "skills");
4141 for (const name of MOD_NAMES) {
42+ if (!existsSync(join(skills, name))) continue; // not installed
4243 let version: unknown;
4344 try {
4445 version = (JSON.parse(readFileSync(join(skills, name, ".avcs-install.json"), "utf8")) as { version?: unknown })
4546 .version;
4647 } catch {
47− continue; // not installed, or no readable record
48+ return OLD_STATE_DIR; // installed, but no readable record: count it as old
4849 }
4950 if (typeof version !== "string" || !versionAtLeast(version, MOD_KNOWS_ABSO)) return OLD_STATE_DIR;
5051 }
--- a/client/test/new-folder-dir.test.ts
+++ b/client/test/new-folder-dir.test.ts
@@ -27,3 +27,12 @@
2727 assert.equal(newFolderDir(claudeWith({ avcs: "0.2.0", "avcs-view": "0.1.0" })), ".avcs");
2828 assert.equal(newFolderDir(claudeWith({ avcs: "unreadable" })), ".avcs");
2929});
31+test("a mod folder with no readable install record counts as old", () => {
32+ const env = claudeWith({});
33+ const mod = join(env.CLAUDE_CONFIG_DIR, "skills", "avcs");
34+ mkdirSync(mod, { recursive: true }); // copied in by hand: no .avcs-install.json
35+ assert.equal(newFolderDir(env), ".avcs");
36+ writeFileSync(join(mod, ".avcs-install.json"), "not json");
37+ assert.equal(newFolderDir(env), ".avcs");
38+});
--- /dev/null
+++ b/client/test/setup.ts
@@ -0,0 +1,13 @@
1+// Loaded before every test file (npm test: node --import). New folders are made as .abso or .avcs by what mods
2+// are installed (state-dir.ts newFolderDir), so a test must not read this machine's ~/.claude: it gets a Claude
3+// folder with one mod from before the rename installed, which keeps new folders on .avcs. The tests of that
4+// choice (new-folder-dir.test.ts) pass their own folders.
5+import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
6+import { tmpdir } from "node:os";
7+import { join } from "node:path";
8+
9+const claude = mkdtempSync(join(tmpdir(), "abso-test-claude-"));
10+const mod = join(claude, "skills", "avcs");
11+mkdirSync(mod, { recursive: true });
12+writeFileSync(join(mod, ".avcs-install.json"), JSON.stringify({ mod: "avcs", version: "0.1.0+0000000" }));
13+process.env.CLAUDE_CONFIG_DIR = claude;
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
99 "node": ">=24"
1010 },
1111 "scripts": {
12− "test": "node --test \"src/**/*.test.ts\" \"worker/project/**/*.test.ts\" \"client/test/**/*.test.ts\"",
12+ "test": "node --import ./client/test/setup.ts --test \"src/**/*.test.ts\" \"worker/project/**/*.test.ts\" \"client/test/**/*.test.ts\"",
1313 "typecheck": "tsc --noEmit -p tsconfig.json",
1414 "check": "npm run typecheck && npm test",
1515 "format": "biome check --write .",