From 3ad7fd6b45a809fdd7e4c22ac123cd9a89e9d0e6 Mon Sep 17 00:00:00 2001 From: 134 Date: Tue, 20 Oct 2026 15:02:02 +0800 Subject: [PATCH] fix(canvas-agent): avoid production migration numbering collision --- ...d_canvas_agent_runs.sql => 0104_add_canvas_agent_runs.sql} | 0 lib/db/migrations/meta/_journal.json | 4 ++-- services/zcode-agent/README.md | 2 +- tests/routes/canvas-agent-runtime-store.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename lib/db/migrations/{0100_add_canvas_agent_runs.sql => 0104_add_canvas_agent_runs.sql} (100%) diff --git a/lib/db/migrations/0100_add_canvas_agent_runs.sql b/lib/db/migrations/0104_add_canvas_agent_runs.sql similarity index 100% rename from lib/db/migrations/0100_add_canvas_agent_runs.sql rename to lib/db/migrations/0104_add_canvas_agent_runs.sql diff --git a/lib/db/migrations/meta/_journal.json b/lib/db/migrations/meta/_journal.json index 66bb667db..56f3f6c0d 100644 --- a/lib/db/migrations/meta/_journal.json +++ b/lib/db/migrations/meta/_journal.json @@ -607,8 +607,8 @@ { "idx": 84, "version": "7", - "when": 1792022400000, - "tag": "0100_add_canvas_agent_runs", + "when": 1792454400000, + "tag": "0104_add_canvas_agent_runs", "breakpoints": true } ] diff --git a/services/zcode-agent/README.md b/services/zcode-agent/README.md index 7ee9155f2..83e7bd134 100644 --- a/services/zcode-agent/README.md +++ b/services/zcode-agent/README.md @@ -25,7 +25,7 @@ required. Configure the project service: - `CANVAS_ZCODE_STATE_DIR=/var/lib/yedir-canvas-agent` - `CANVAS_ZCODE_NODE_PATH=/opt/yedir-canvas-zcode/current/bin/node` -Apply the additive `0100_add_canvas_agent_runs.sql` migration before the new +Apply the additive `0104_add_canvas_agent_runs.sql` migration before the new route is used. The host service launches a scope, drops to a unique numeric task UID and starts unshared mount/user/PID/network/IPC namespaces. Each task mounts only its workspace/home, read-only runtime/system binaries and its exact broker diff --git a/tests/routes/canvas-agent-runtime-store.test.ts b/tests/routes/canvas-agent-runtime-store.test.ts index 2c270aa4d..053d365ca 100644 --- a/tests/routes/canvas-agent-runtime-store.test.ts +++ b/tests/routes/canvas-agent-runtime-store.test.ts @@ -45,7 +45,7 @@ test.describe("canvas agent durable run isolation", () => { await client.unsafe( 'CREATE TABLE "User" ("id" uuid PRIMARY KEY); CREATE TABLE "Chat" ("id" uuid PRIMARY KEY, "userId" uuid NOT NULL); CREATE TABLE "CanvasProject" ("id" uuid PRIMARY KEY, "userId" uuid NOT NULL, "workspaceType" varchar DEFAULT \'canvas\', "canvasData" jsonb, "updatedAt" timestamp DEFAULT now());', ); - await client.unsafe(readFileSync("lib/db/migrations/0100_add_canvas_agent_runs.sql", "utf8")); + await client.unsafe(readFileSync("lib/db/migrations/0104_add_canvas_agent_runs.sql", "utf8")); await client`INSERT INTO "User" VALUES (${owner}), (${other})`; await client`INSERT INTO "Chat" VALUES (${chatId}, ${owner}), (${otherChat}, ${other})`; await client`INSERT INTO "CanvasProject" ("id", "userId") VALUES (${projectId}, ${owner}), (${otherProject}, ${other})`;