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

Local projects take one call at a time, and a project's name can't start with a dot. A call holds its project's write transaction across awaits, so a second call started meanwhile (Promise.all in abso ci and waiting --mine) failed to begin its own; localFetch now runs calls in turn, as a Durable Object takes them. A name of . or .. put the project's file outside the store; names now start with a letter, digit, _ or -. Found in review.

of shared·pinch··Not checked

Version 299 · Files at version 300

2 files, 33 lines added, 3 removed.

--- a/client/src/local-store.ts
+++ b/client/src/local-store.ts
@@ -286,7 +286,8 @@
286286
287287/** A project's calls, and its issues, asks and news, which the open server keeps at /issues/p/<project>/. */
288288const PROJECT_PATH = /^(?:\/issues)?\/p\/([^/]+)\//;
289−const NAME = /^[A-Za-z0-9._-]{1,100}$/;
289+/** A project's name is also its folder in the store, so it never starts with a dot ("." and ".." would leave it). */
290+const NAME = /^[A-Za-z0-9_-][A-Za-z0-9._-]{0,99}$/;
290291const json = (status: number, body: unknown) => Response.json(body, { status });
291292
292293/**
@@ -346,7 +347,19 @@
346347 },
347348 },
348349 });
349− return async (input, init = {}) => {
350+ // One call at a time, as a Durable Object takes them: a call holds its project's write transaction across awaits,
351+ // and the connection can't start a second (two calls at once come from Promise.all in ci and waiting --mine).
352+ let last: Promise<unknown> = Promise.resolve();
353+ return (input, init) => {
354+ const next = last.then(
355+ () => call(input, init),
356+ () => call(input, init),
357+ );
358+ last = next.catch(() => {});
359+ return next;
360+ };
362+ async function call(input: string, init: RequestInit = {}): Promise<Response> {
350363 const s = await loadServer();
351364 opening = s;
352365 const url = new URL(input);
@@ -390,5 +403,5 @@
390403 // Where the Workers runtime answers a throw with a 500, so does this.
391404 return json(500, { error: e instanceof Error ? e.message : String(e) });
392405 }
393− };
406+ }
394407}
--- a/client/test/local.test.ts
+++ b/client/test/local.test.ts
@@ -9,6 +9,7 @@
99import { join } from "node:path";
1010import { after, before, describe, it } from "node:test";
1111import { fileURLToPath } from "node:url";
12+import { closeLocalStores, LOCAL_BASE, localFetch } from "../src/local-store.ts";
1213import { main } from "../src/main.ts";
1314import { stateDir } from "../src/state-dir.ts";
1415
@@ -132,6 +133,22 @@
132133 const issue = await run(alice, "issue", "1");
133134 assert.match(issue.out, /In progress|bob/);
134135 });
137+ it("two calls at once on one project are both answered, one after the other", async () => {
138+ // As abso ci and waiting --mine make them, with Promise.all.
139+ const local = localFetch(store);
140+ const answers = await Promise.all([local(`${LOCAL_BASE}/p/demo/queue`), local(`${LOCAL_BASE}/p/demo/queue`)]);
141+ closeLocalStores();
142+ for (const a of answers) assert.equal(a.status, 200, await a.text());
143+ });
145+ it("a project's name can't start with a dot, so its folder stays inside the store", async () => {
146+ const dir = temp("dots");
147+ writeFileSync(join(dir, "a.txt"), "x\n");
148+ const r = await run(dir, "init", "--local", "--project", "..", "--agent", "a");
149+ assert.notEqual(r.exit, 0);
150+ assert.ok(!existsSync(join(store, "..", "project.sqlite")));
151+ });
135152});
136153
137154describe("where a local project's store is", { skip: noServer }, () => {