{"version":300,"agent":"pinch","message":"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.","time":1792140617142,"timeIso":"2026-10-16T08:50:17.142Z","changes":5,"change":4811,"files":["client/src/local-store.ts","client/test/local.test.ts"],"draft":null,"diff":[{"path":"client/src/local-store.ts","added":16,"removed":3,"diff":"--- a/client/src/local-store.ts\n+++ b/client/src/local-store.ts\n@@ -286,7 +286,8 @@\n \n /** A project's calls, and its issues, asks and news, which the open server keeps at /issues/p/<project>/. */\n const PROJECT_PATH = /^(?:\\/issues)?\\/p\\/([^/]+)\\//;\n-const NAME = /^[A-Za-z0-9._-]{1,100}$/;\n+/** A project's name is also its folder in the store, so it never starts with a dot (\".\" and \"..\" would leave it). */\n+const NAME = /^[A-Za-z0-9_-][A-Za-z0-9._-]{0,99}$/;\n const json = (status: number, body: unknown) => Response.json(body, { status });\n \n /**\n@@ -346,7 +347,19 @@\n \t\t\t},\n \t\t},\n \t});\n-\treturn async (input, init = {}) => {\n+\t// One call at a time, as a Durable Object takes them: a call holds its project's write transaction across awaits,\n+\t// and the connection can't start a second (two calls at once come from Promise.all in ci and waiting --mine).\n+\tlet last: Promise<unknown> = Promise.resolve();\n+\treturn (input, init) => {\n+\t\tconst next = last.then(\n+\t\t\t() => call(input, init),\n+\t\t\t() => call(input, init),\n+\t\t);\n+\t\tlast = next.catch(() => {});\n+\t\treturn next;\n+\t};\n+\n+\tasync function call(input: string, init: RequestInit = {}): Promise<Response> {\n \t\tconst s = await loadServer();\n \t\topening = s;\n \t\tconst url = new URL(input);\n@@ -390,5 +403,5 @@\n \t\t\t// Where the Workers runtime answers a throw with a 500, so does this.\n \t\t\treturn json(500, { error: e instanceof Error ? e.message : String(e) });\n \t\t}\n-\t};\n+\t}\n }"},{"path":"client/test/local.test.ts","added":17,"removed":0,"diff":"--- a/client/test/local.test.ts\n+++ b/client/test/local.test.ts\n@@ -9,6 +9,7 @@\n import { join } from \"node:path\";\n import { after, before, describe, it } from \"node:test\";\n import { fileURLToPath } from \"node:url\";\n+import { closeLocalStores, LOCAL_BASE, localFetch } from \"../src/local-store.ts\";\n import { main } from \"../src/main.ts\";\n import { stateDir } from \"../src/state-dir.ts\";\n \n@@ -132,6 +133,22 @@\n \t\tconst issue = await run(alice, \"issue\", \"1\");\n \t\tassert.match(issue.out, /In progress|bob/);\n \t});\n+\n+\tit(\"two calls at once on one project are both answered, one after the other\", async () => {\n+\t\t// As abso ci and waiting --mine make them, with Promise.all.\n+\t\tconst local = localFetch(store);\n+\t\tconst answers = await Promise.all([local(`${LOCAL_BASE}/p/demo/queue`), local(`${LOCAL_BASE}/p/demo/queue`)]);\n+\t\tcloseLocalStores();\n+\t\tfor (const a of answers) assert.equal(a.status, 200, await a.text());\n+\t});\n+\n+\tit(\"a project's name can't start with a dot, so its folder stays inside the store\", async () => {\n+\t\tconst dir = temp(\"dots\");\n+\t\twriteFileSync(join(dir, \"a.txt\"), \"x\\n\");\n+\t\tconst r = await run(dir, \"init\", \"--local\", \"--project\", \"..\", \"--agent\", \"a\");\n+\t\tassert.notEqual(r.exit, 0);\n+\t\tassert.ok(!existsSync(join(store, \"..\", \"project.sqlite\")));\n+\t});\n });\n \n describe(\"where a local project's store is\", { skip: noServer }, () => {"}],"ci":null}