{"version":32,"agent":"review","message":"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)","time":1791541763659,"timeIso":"2026-10-09T10:29:23.659Z","changes":5,"change":378,"files":["client/scripts/import-git.ts","client/src/state-dir.ts","client/test/new-folder-dir.test.ts","client/test/setup.ts","package.json"],"draft":null,"diff":[{"path":"client/scripts/import-git.ts","added":9,"removed":4,"diff":"--- a/client/scripts/import-git.ts\n+++ b/client/scripts/import-git.ts\n@@ -60,7 +60,11 @@\n const dir = values.dir ? resolve(values.dir) : mkdtempSync(join(tmpdir(), \"avcs-import-\"));\n mkdirSync(dir, { recursive: true });\n if (after === undefined && readdirSync(dir).length > 0) fail(`${dir} isn't empty`);\n-if (after !== undefined && !existsSync(join(dir, \".avcs\", \"config.json\")))\n+if (\n+\tafter !== undefined &&\n+\t!existsSync(join(dir, \".abso\", \"config.json\")) &&\n+\t!existsSync(join(dir, \".avcs\", \"config.json\"))\n+)\n \tfail(`${dir} isn't an abso folder; --after goes on in an earlier run's folder`);\n \n // The last commit first: nothing is created unless it passes.\n@@ -140,15 +144,16 @@\n \t}\n }\n \n-/** The commit's tree in `dir`, replacing everything but .avcs; its files, folder-relative. */\n+/** The commit's tree in `dir`, replacing everything but .avcs and .abso; its files, folder-relative. */\n function extract(sha: string, into: string): string[] {\n-\tfor (const e of readdirSync(into)) if (e !== \".avcs\") rmSync(join(into, e), { recursive: true, force: true });\n+\tfor (const e of readdirSync(into))\n+\t\tif (e !== \".avcs\" && e !== \".abso\") rmSync(join(into, e), { recursive: true, force: true });\n \t// Piped, with tar in the folder: no path for tar to misread (GNU tar takes \"C:\" for a remote host).\n \tconst archive = spawnSync(\"git\", [\"archive\", \"--format=tar\", sha], { maxBuffer: 1 << 30 });\n \tif (archive.status !== 0) fail(`git archive: ${archive.stderr.toString().trim()}`);\n \tconst untar = spawnSync(\"tar\", [\"-xf\", \"-\"], { cwd: into, input: archive.stdout, encoding: \"utf8\" });\n \tif (untar.status !== 0) fail(`tar couldn't unpack ${sha}: ${untar.stderr}`);\n-\treturn walk(into).filter((rel) => !rel.startsWith(\".avcs/\"));\n+\treturn walk(into).filter((rel) => !rel.startsWith(\".avcs/\") && !rel.startsWith(\".abso/\"));\n }\n \n /** Why abso would store these bytes differently from git, or undefined. Binary files (NUL, or not UTF-8) go up byte for byte. */"},{"path":"client/src/state-dir.ts","added":2,"removed":1,"diff":"--- a/client/src/state-dir.ts\n+++ b/client/src/state-dir.ts\n@@ -39,12 +39,13 @@\n export function newFolderDir(env: Readonly<Record<string, string | undefined>> = process.env): string {\n \tconst skills = join(env.CLAUDE_CONFIG_DIR || join(homedir(), \".claude\"), \"skills\");\n \tfor (const name of MOD_NAMES) {\n+\t\tif (!existsSync(join(skills, name))) continue; // not installed\n \t\tlet version: unknown;\n \t\ttry {\n \t\t\tversion = (JSON.parse(readFileSync(join(skills, name, \".avcs-install.json\"), \"utf8\")) as { version?: unknown })\n \t\t\t\t.version;\n \t\t} catch {\n-\t\t\tcontinue; // not installed, or no readable record\n+\t\t\treturn OLD_STATE_DIR; // installed, but no readable record: count it as old\n \t\t}\n \t\tif (typeof version !== \"string\" || !versionAtLeast(version, MOD_KNOWS_ABSO)) return OLD_STATE_DIR;\n \t}"},{"path":"client/test/new-folder-dir.test.ts","added":9,"removed":0,"diff":"--- a/client/test/new-folder-dir.test.ts\n+++ b/client/test/new-folder-dir.test.ts\n@@ -27,3 +27,12 @@\n \tassert.equal(newFolderDir(claudeWith({ avcs: \"0.2.0\", \"avcs-view\": \"0.1.0\" })), \".avcs\");\n \tassert.equal(newFolderDir(claudeWith({ avcs: \"unreadable\" })), \".avcs\");\n });\n+\n+test(\"a mod folder with no readable install record counts as old\", () => {\n+\tconst env = claudeWith({});\n+\tconst mod = join(env.CLAUDE_CONFIG_DIR, \"skills\", \"avcs\");\n+\tmkdirSync(mod, { recursive: true }); // copied in by hand: no .avcs-install.json\n+\tassert.equal(newFolderDir(env), \".avcs\");\n+\twriteFileSync(join(mod, \".avcs-install.json\"), \"not json\");\n+\tassert.equal(newFolderDir(env), \".avcs\");\n+});"},{"path":"client/test/setup.ts","added":13,"removed":0,"diff":"--- /dev/null\n+++ b/client/test/setup.ts\n@@ -0,0 +1,13 @@\n+// Loaded before every test file (npm test: node --import). New folders are made as .abso or .avcs by what mods\n+// are installed (state-dir.ts newFolderDir), so a test must not read this machine's ~/.claude: it gets a Claude\n+// folder with one mod from before the rename installed, which keeps new folders on .avcs. The tests of that\n+// choice (new-folder-dir.test.ts) pass their own folders.\n+import { mkdirSync, mkdtempSync, writeFileSync } from \"node:fs\";\n+import { tmpdir } from \"node:os\";\n+import { join } from \"node:path\";\n+\n+const claude = mkdtempSync(join(tmpdir(), \"abso-test-claude-\"));\n+const mod = join(claude, \"skills\", \"avcs\");\n+mkdirSync(mod, { recursive: true });\n+writeFileSync(join(mod, \".avcs-install.json\"), JSON.stringify({ mod: \"avcs\", version: \"0.1.0+0000000\" }));\n+process.env.CLAUDE_CONFIG_DIR = claude;"},{"path":"package.json","added":1,"removed":1,"diff":"--- a/package.json\n+++ b/package.json\n@@ -9,7 +9,7 @@\n \t\t\"node\": \">=24\"\n \t},\n \t\"scripts\": {\n-\t\t\"test\": \"node --test \\\"src/**/*.test.ts\\\" \\\"worker/project/**/*.test.ts\\\" \\\"client/test/**/*.test.ts\\\"\",\n+\t\t\"test\": \"node --import ./client/test/setup.ts --test \\\"src/**/*.test.ts\\\" \\\"worker/project/**/*.test.ts\\\" \\\"client/test/**/*.test.ts\\\"\",\n \t\t\"typecheck\": \"tsc --noEmit -p tsconfig.json\",\n \t\t\"check\": \"npm run typecheck && npm test\",\n \t\t\"format\": \"biome check --write .\","}],"ci":null}