--- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -179,7 +179,7 @@
179179 const { name, folders } = await project({ "src/a.ts": "one\ntwo\n", "README.md": "# hi\n" }, "alice", "bob"); 180180 assert.equal(read(folders.bob!, "src/a.ts"), "one\ntwo\n"); 181181 assert.equal(read(folders.bob!, "README.md"), "# hi\n"); 182− const config = JSON.parse(read(folders.bob!, ".abso/config.json"));
182+ const config = JSON.parse(read(folders.bob!, ".avcs/config.json")); 183183 assert.deepEqual(config, { server: fake.url, project: name, agent: "bob" }); 184184 const status = await avcs(folders.alice!, "status"); 185185 assert.equal(status.json.version, 0); @@ -288,17 +288,17 @@
288288 assert.equal((await avcs(dir, "record")).json.sent, 0); 291− it("keeps .abso/ out of git through .git/info/exclude", async () => {
291+ it("keeps .avcs/ out of git through .git/info/exclude", async () => { 292292 const dir = temp(); 293293 write(dir, { "a.txt": "a\n", ".git/HEAD": "ref: refs/heads/main\n" }); 294294 const r = await avcs(dir, "init", "--server", fake.url, "--project", `p${++projects}`, "--agent", "alice"); 295295 assert.equal(r.exit, 0, r.out); 296− assert.match(read(dir, ".git/info/exclude"), /^\/\.abso\/$/m);
296+ assert.match(read(dir, ".git/info/exclude"), /^\/\.avcs\/$/m); 299299 it("never writes the token into the folder", async () => { 300300 const { folders } = await project({ "a.txt": "a\n" }, "alice", "bob"); 301− assert.ok(!read(folders.bob!, ".abso/config.json").includes(TOKEN));
301+ assert.ok(!read(folders.bob!, ".avcs/config.json").includes(TOKEN)); 304304 it("says plainly when the token is wrong", async () => { @@ -403,13 +403,13 @@
403403 it("logs and exits quietly when the server is down, and record catches up", async () => { 404404 const { name, folders } = await project({ "a.txt": "one\n" }, "alice"); 405405 const root = folders.alice!; 406− const config = JSON.parse(read(root, ".abso/config.json"));
407− writeFileSync(join(root, ".abso", "config.json"), JSON.stringify({ ...config, server: "http://127.0.0.1:9" }));
406+ const config = JSON.parse(read(root, ".avcs/config.json")); 407+ writeFileSync(join(root, ".avcs", "config.json"), JSON.stringify({ ...config, server: "http://127.0.0.1:9" })); 408408 const r = await edit(root, "a.txt", "one\n", "ONE\n"); 409409 assert.match(r.outcome, /^error: could not reach/); 410410 assert.equal(r.stdout, ""); 411− assert.match(read(root, ".abso/hook.log"), /\tEdit\ta\.txt\terror: could not reach/);
412− writeFileSync(join(root, ".abso", "config.json"), JSON.stringify(config));
411+ assert.match(read(root, ".avcs/hook.log"), /\tEdit\ta\.txt\terror: could not reach/); 412+ writeFileSync(join(root, ".avcs", "config.json"), JSON.stringify(config)); 413413 assert.equal((await avcs(root, "record")).json.sent, 1); 414414 assert.equal((await avcs(root, "publish", "-m", "caps")).exit, 0); 415415 assert.equal(shared(name)["a.txt"], "ONE\n"); @@ -440,7 +440,7 @@
440440 const p = await spawnHook(input); 441441 assert.equal(p.status, 0, p.stderr); 442442 assert.equal(p.stdout, ""); 443− assert.match(read(folders.alice!, ".abso/hook.log"), /\tEdit\ta\.txt\tsent edit\t/);
443+ assert.match(read(folders.alice!, ".avcs/hook.log"), /\tEdit\ta\.txt\tsent edit\t/); 444444 const bad = await spawnHook("not json"); 445445 assert.equal(bad.status, 0); @@ -716,7 +716,7 @@
716716 const bob = await avcs(folders.bob!, "news"); 717717 assert.deepEqual(bob.json.news, ["Announcement from lead (as claimed): Stop publishing until v12 lands"]); 719− read(folders.bob!, ".abso/news.log"),
719+ read(folders.bob!, ".avcs/news.log"), 720720 /\tAnnouncement from lead \(as claimed\): Stop publishing until v12 lands\n$/, 722722 assert.deepEqual((await avcs(folders.bob!, "news")).json.news, [], "each item comes once"); @@ -883,7 +883,7 @@
883883 assert.equal(follow.exit, 0, follow.stderr); 884884 assert.match(follow.stdout, /now follows label stable: .* It is on version 1\./); 885885 assert.equal(read(bob, "a.txt"), "a1\n"); 886− assert.equal(JSON.parse(read(bob, ".abso/config.json")).follow, "stable");
886+ assert.equal(JSON.parse(read(bob, ".avcs/config.json")).follow, "stable"); 887887 assert.match((await text(bob, "status")).stdout, /It follows label stable/); 888888 assert.match((await text(bob, "labels")).stdout, /stable: 1 {3}\(this folder follows it\)/); @@ -897,7 +897,7 @@
897897 const none = await avcs(bob, "follow", "--none"); 898898 assert.equal(none.exit, 0, none.out); 899899 assert.equal(none.json.version, 2); 900− assert.equal("follow" in JSON.parse(read(bob, ".abso/config.json")), false);
900+ assert.equal("follow" in JSON.parse(read(bob, ".avcs/config.json")), false); 903903 it("plucks some versions of a named draft into shared", async () => { @@ -1084,7 +1084,7 @@
10851085 assert.ok(tries[0]!.key && tries.every((t) => t.key === tries[0]!.key), "one key for every try"); 1087− read(alice, ".abso/run.log"),
1087+ read(alice, ".avcs/run.log"), 10881088 /starting again \(try 2\), no answer came: node hi\.js\t.+\n.*starting again \(try 3\)/, @@ -1115,7 +1115,7 @@
1118− read(folders.alice!, ".abso/run.log"),
1118+ read(folders.alice!, ".avcs/run.log"), 11191119 /starting again \(try 2\), no answer came: node hi\.js\trun answered 502: bad gateway/, @@ -1580,8 +1580,8 @@
15801580 it("refuses a folder whose config names another server, before any call", async () => { 15811581 const { folders } = await project({ "a.txt": "a\n" }, "alice"); 15821582 const alice = folders.alice!; 1583− const config = JSON.parse(read(alice, ".abso/config.json"));
1584− writeFileSync(join(alice, ".abso", "config.json"), JSON.stringify({ ...config, server: "https://evil.example" }));
1583+ const config = JSON.parse(read(alice, ".avcs/config.json")); 1584+ writeFileSync(join(alice, ".avcs", "config.json"), JSON.stringify({ ...config, server: "https://evil.example" })); 15851585 const r = await main(["status"], { cwd: alice, env: ENV, write: () => {} }); 15861586 assert.equal(r.exit, 1); @@ -2029,7 +2029,7 @@
20292029 // What a partial join leaves: neither the file nor avcs's copy of it. 20302030 for (const rel of ["src/state.ts", "vite.config.ts"]) { 20312031 rmSync(join(bob, ...rel.split("/"))); 2032− rmSync(join(bob, ".abso", "known", ...rel.split("/")));
2032+ rmSync(join(bob, ".avcs", "known", ...rel.split("/"))); 20342034 const status = await main(["status"], { cwd: bob, env: ENV, write: () => {} }); @@ -2277,7 +2277,7 @@
22772277 it("a command waits, then says who holds the lock; the hook skips; a lock left behind is taken over", async () => { 22782278 const { folders } = await project({ "a.txt": "one\n" }, "alice"); 22792279 const root = folders.alice!; 2280− const lock = join(root, ".abso", "lock");
2280+ const lock = join(root, ".avcs", "lock"); 22812281 // Another process holding the lock, as a long sync would. 22822282 const holder = spawn(process.execPath, ["-e", "setTimeout(() => {}, 20000)"]); @@ -2290,13 +2290,13 @@
2293− `another abso command \\(sync, process ${holder.pid}, since [0-9:]+ UTC\\) is changing this folder's records; run this again when it has finished\\. If none is running, delete \\.abso/lock\\.`,
2293+ `another abso command \\(sync, process ${holder.pid}, since [0-9:]+ UTC\\) is changing this folder's records; run this again when it has finished\\. If none is running, delete \\.avcs/lock\\.`, 22962296 const hooked = await hook(root, "Write", { file_path: join(root, "a.txt"), content: "two\n" }); 22972297 assert.equal(hooked.outcome, "skipped: another abso command is changing this folder; abso record sends it"); 2299− readFileSync(join(root, ".abso", "known", "a.txt"), "utf8"),
2299+ readFileSync(join(root, ".avcs", "known", "a.txt"), "utf8"), 23012301 "the known copy is left alone", @@ -2309,7 +2309,7 @@
23092309 const after = await main(["record"], { cwd: root, env: ENV, write: () => {} }); 23102310 assert.equal(after.exit, 0, after.stderr); 23112311 assert.equal(existsSync(lock), false, "no lock left behind"); 2312− assert.equal(readFileSync(join(root, ".abso", "known", "a.txt"), "utf8"), "two\n");
2312+ assert.equal(readFileSync(join(root, ".avcs", "known", "a.txt"), "utf8"), "two\n"); 23152315 it("the mod's check: a lock renewed in the last 2 minutes is held, and so is one it can't read", () => { @@ -2329,7 +2329,7 @@
23292329 it("two takers never both hold it: an unreadable lock is held until old, and one not renewed is taken over whatever its pid (AVCS - Git Lessons)", async () => { 23302330 const { folders } = await project({ "a.txt": "one\n" }, "alice"); 23312331 const root = folders.alice!; 2332− const lock = join(root, ".abso", "lock");
2332+ const lock = join(root, ".avcs", "lock"); 23332333 // Empty, as one caught between creating and writing: held, not taken. 23342334 writeFileSync(lock, ""); 23352335 assert.equal(tryFolderLock(root, "hook"), undefined); @@ -2347,7 +2347,7 @@
23472347 assert.ok(again); 23492349 assert.deepEqual( 2350− readdirSync(join(root, ".abso")).filter((f) => f.startsWith("lock")),
2350+ readdirSync(join(root, ".avcs")).filter((f) => f.startsWith("lock")), 23522352 "nothing left aside", @@ -2365,7 +2365,7 @@
23652365 const { folders } = await project(files, "alice", "bob"); 23662366 const status = await avcs(folders.alice!, "status"); 23672367 assert.deepEqual(status.json.unrecorded, [], "nothing waits to be recorded right after init"); 2368− assert.match(readFileSync(join(folders.alice!, ".abso", "blobs.json"), "utf8"), /"package-lock\.json"/);
2368+ assert.match(readFileSync(join(folders.alice!, ".avcs", "blobs.json"), "utf8"), /"package-lock\.json"/); 23692369 assert.equal(readFileSync(join(folders.bob!, "package-lock.json"), "utf8"), '{\n "v": 1\n}\n'); 23702370 assert.deepEqual((await avcs(folders.bob!, "status")).json.unrecorded, []); @@ -2693,7 +2693,7 @@
26932693 await new Promise<void>((ok) => listener.listen(0, "127.0.0.1", ok)); 26942694 const port = (listener.address() as AddressInfo).port; 26952695 await new Promise<void>((ok) => listener.close(() => ok())); 2696− const configPath = join(folders.alice!, ".abso", "config.json");
2696+ const configPath = join(folders.alice!, ".avcs", "config.json"); 26972697 const config = JSON.parse(readFileSync(configPath, "utf8")); 26982698 writeFileSync(configPath, JSON.stringify({ ...config, server: `http://127.0.0.1:${port}` })); 26992699 const status = await main(["status"], { cwd: folders.alice!, env: ENV, write: () => {} }); @@ -3404,17 +3404,17 @@
34043404 (await main(["status"], { cwd: dir, env: ENV, write: () => {} })).stdout, 34053405 /This folder is rep, a reader \(it records and publishes nothing\)/, 3407− assert.match(read(dir, ".abso/hook.log"), /\tskipped: this folder is a reader\t/);
3407+ assert.match(read(dir, ".avcs/hook.log"), /\tskipped: this folder is a reader\t/); 34083408 // The server refuses too, whatever the folder says. 3409− const config = JSON.parse(read(dir, ".abso/config.json"));
3410− write(dir, { ".abso/config.json": JSON.stringify({ ...config, reader: undefined }) });
3409+ const config = JSON.parse(read(dir, ".avcs/config.json")); 3410+ write(dir, { ".avcs/config.json": JSON.stringify({ ...config, reader: undefined }) }); 34113411 const forced = await main(["record"], { cwd: dir, env: ENV, write: () => {} }); 34123412 assert.match(forced.stdout + forced.stderr, /agent rep is a reader: it records nothing/); 3413− write(dir, { ".abso/config.json": JSON.stringify(config) });
3413+ write(dir, { ".avcs/config.json": JSON.stringify(config) }); 34143414 // Back to a writer. 34153415 assert.equal((await avcs(dir, "restore", "--all")).exit, 0); 34163416 assert.equal((await avcs(dir, "reader", "off")).exit, 0); 3417− assert.equal(JSON.parse(read(dir, ".abso/config.json")).reader, undefined);
3417+ assert.equal(JSON.parse(read(dir, ".avcs/config.json")).reader, undefined); 34183418 write(dir, { "notes.md": "now recorded\n" }); 34193419 assert.equal((await avcs(dir, "publish", "-m", "rep writes")).exit, 0); @@ -3425,7 +3425,7 @@
34253425 assert.equal((await avcs(folders.alice!, "record")).exit, 0); 34263426 const on = await main(["reader", "on"], { cwd: folders.alice!, env: ENV, write: () => {} }); 34273427 assert.equal(on.exit, 2); 3428− assert.equal(JSON.parse(read(folders.alice!, ".abso/config.json")).reader, undefined);
3428+ assert.equal(JSON.parse(read(folders.alice!, ".avcs/config.json")).reader, undefined); @@ -3447,7 +3447,7 @@
34473447 "424ms sending, 63ms queued (in process, async)", 34483448 ...(version ? [version] : []), 3450− write(alice, { ".abso/hook.log": `${line()}\n` });
3450+ write(alice, { ".avcs/hook.log": `${line()}\n` }); 34513451 install("0.1.0"); 34523452 assert.doesNotMatch(await said(), /edit mod/, "an install without a commit: nothing to compare"); 34533453 install("0.1.0+abc1234"); @@ -3455,9 +3455,9 @@
34563456 /\nThe last edit here \(at 22:50 UTC\) came from edit mod from before mods carried a version, but 0\.1\.0\+abc1234 is installed\. A chat keeps the mod it started with; restart the chat that edits this folder to load the installed one\.\n/, 3458− write(alice, { ".abso/hook.log": `${line()}\n${line("avcs-mod/0.1.0+0ld0000")}\n` });
3458+ write(alice, { ".avcs/hook.log": `${line()}\n${line("avcs-mod/0.1.0+0ld0000")}\n` }); 34593459 assert.match(await said(), /came from edit mod 0\.1\.0\+0ld0000, but 0\.1\.0\+abc1234 is installed/); 3460− write(alice, { ".abso/hook.log": `${line("avcs-mod/0.1.0+abc1234")}\n` });
3460+ write(alice, { ".avcs/hook.log": `${line("avcs-mod/0.1.0+abc1234")}\n` }); 34613461 assert.doesNotMatch(await said(), /edit mod/, "the installed mod sent it"); @@ -3819,7 +3819,7 @@
38193819 assert.equal(r.stderr, ""); 38203820 assert.equal(r.streamed, "first\nsecond\n"); 38213821 assert.equal(r.exit, 3); 3822− assert.match(read(folders.alice!, ".abso/run.log"), /reconnecting \(try 1\) to: node slow\.js/);
3822+ assert.match(read(folders.alice!, ".avcs/run.log"), /reconnecting \(try 1\) to: node slow\.js/); 38253825 it("survives the reconnection dropping too", async () => { @@ -3828,7 +3828,7 @@
38283828 const r = await runWith(folders.alice!); 38293829 assert.equal(r.streamed, "first\nsecond\n"); 38303830 assert.equal(r.exit, 3); 3831− assert.equal(read(folders.alice!, ".abso/run.log").trim().split("\n").length, 2);
3831+ assert.equal(read(folders.alice!, ".avcs/run.log").trim().split("\n").length, 2); 38343834 it("reattaches when the server ends the stream with retry (a deploy), and copes with non-ASCII output", async () => { @@ -3911,7 +3911,7 @@
39113911 const alice = folders.alice!; 39123912 const synced = await avcs(alice, "sync"); 39133913 assert.equal(synced.exit, 0, synced.out); 3914− assert.deepEqual(JSON.parse(read(alice, ".abso/modes.json")), { "run.sh": { exec: true } });
3914+ assert.deepEqual(JSON.parse(read(alice, ".avcs/modes.json")), { "run.sh": { exec: true } }); 39153915 if (process.platform !== "win32") 39163916 assert.ok((statSync(join(alice, "run.sh")).mode & 0o100) !== 0, "the bit is set on disk"); 39173917 assert.equal((await avcs(alice, "record")).json.sent, 0, "nothing to send back"); @@ -4387,19 +4387,20 @@
43894389describe("the state folder after the rename to abso", () => { 4390− it("keeps new folders in .abso, and folders from before in .avcs, untouched", async () => {
4390+ it("makes new folders with .avcs for now, and works in a .abso folder too, never half-moving either", async () => { 43914391 const { folders } = await project({ "a.txt": "a\n" }, "alice"); 43924392 const dir = folders.alice!; 4393− assert.equal(existsSync(join(dir, ".abso", "config.json")), true, "a new folder keeps its state in .abso");
4394− assert.equal(existsSync(join(dir, ".avcs")), false, "and makes no .avcs");
4395− // A folder from before: only .avcs. It keeps working, and never gets a second state folder.
4396− renameSync(join(dir, ".abso"), join(dir, ".avcs"));
4393+ // An edit mod installed before the rename finds only .avcs/config.json: a .abso folder's edits would go unrecorded. 4394+ assert.equal(existsSync(join(dir, ".avcs", "config.json")), true, "a new folder keeps its state in .avcs for now"); 4395+ assert.equal(existsSync(join(dir, ".abso")), false, "and makes no .abso"); 4396+ // A folder moved to .abso (by hand, or a later abso migrate) works the same, and gets no second state folder. 4397+ renameSync(join(dir, ".avcs"), join(dir, ".abso")); 43974398 writeFileSync(join(dir, "a.txt"), "a\nb\n"); 43984399 const rec = await avcs(dir, "record"); 43994400 assert.equal(rec.exit, 0, rec.out); 44004401 assert.equal(rec.json.sent, 1); 4401− assert.equal(existsSync(join(dir, ".abso")), false, "an older folder is never half-moved");
4402− assert.equal(stateDir(dir), join(dir, ".avcs"));
4402+ assert.equal(existsSync(join(dir, ".avcs")), false, "a moved folder is never half-moved back"); 4403+ assert.equal(stateDir(dir), join(dir, ".abso")); 44054406 it("reads ~/.abso before ~/.avcs and writes only ~/.abso, leaving the old file as it is", () => {