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

abso init checks the project's name before any call, as join does. A name like .. went out as part of the request's path, where it collapsed, so a local init answered about project calls instead of naming the rule. The test now checks the message for .. and .hidden, and that init leaves the folder as it was.

of shared·pinch··Not checked

Version 304 · Files at version 305

2 files, 13 lines added, 3 removed.

--- a/client/src/join-commands.ts
+++ b/client/src/join-commands.ts
@@ -154,6 +154,11 @@
154154 if (findRoot(root) === root) throw new UsageError(`${root} already has .abso/config.json`);
155155 const project = str(args, "project");
156156 if (!project) throw new UsageError("give the project a name with --project <name>");
157+ // Checked before any call: a name like ".." would otherwise go out as part of the request's path.
158+ if (!NAME.test(project))
159+ throw new UsageError(
160+ `project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,
161+ );
157162 if (bool(args, "public") && bool(args, "private")) throw new UsageError("--public or --private, not both");
158163 const local = localFrom(args, env, "init");
159164 // A box signed in here, and no other credential asked for: the project is made as the person who approved the box,
--- a/client/test/local.test.ts
+++ b/client/test/local.test.ts
@@ -4,7 +4,7 @@
44
55import assert from "node:assert/strict";
66import { spawnSync } from "node:child_process";
7−import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
7+import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
88import { tmpdir } from "node:os";
99import { join } from "node:path";
1010import { after, before, describe, it } from "node:test";
@@ -145,9 +145,14 @@
145145 it("a project's name can't start with a dot, so its folder stays inside the store", async () => {
146146 const dir = temp("dots");
147147 writeFileSync(join(dir, "a.txt"), "x\n");
148− const r = await run(dir, "init", "--local", "--project", "..", "--agent", "a");
149− assert.notEqual(r.exit, 0);
148+ for (const name of ["..", ".hidden"]) {
149+ const r = await run(dir, "init", "--local", "--project", name, "--agent", "a");
150+ assert.equal(r.exit, 1, r.out + r.err);
151+ // The name rule says why, before any call is made (a ".." would collapse the call's path).
152+ assert.match(r.err, /project names are letters, digits, dot, dash and underscore/);
153+ }
150154 assert.ok(!existsSync(join(store, "..", "project.sqlite")));
155+ assert.deepEqual(readdirSync(dir), ["a.txt"], "init left nothing behind");
151156 });
152157});
153158