From b76174d03c3545331cac00371d13f7ae83985449 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sun, 14 Jun 2026 18:49:29 +0000 Subject: [PATCH] Sanitize public test fixtures and docs --- packages/core/test/policy.test.js | 10 +++++----- packages/gateway/README.md | 2 +- packages/gateway/docs/rollout-sidecar.md | 2 +- .../gateway/src/core/task-thread-reporter.ts | 4 ++-- packages/runtime-wrapper/test/policy.test.js | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/core/test/policy.test.js b/packages/core/test/policy.test.js index a22724d..802c453 100644 --- a/packages/core/test/policy.test.js +++ b/packages/core/test/policy.test.js @@ -645,20 +645,20 @@ test("event task planner supports task-specific item prefixes", () => { eventController: { enabled: true, tasks: [{ - id: "tailscale-inventory", + id: "network-inventory", sourceBotId: "111", sourceMention: "<@111>", target: { guildId: "g1", channelId: "c1" }, itemLabel: "node/user", itemPrefixes: ["Node", "User"], - stopConditions: [{ type: "phrase", value: "Tailscale inventory complete" }] + stopConditions: [{ type: "phrase", value: "Network inventory complete" }] }] } }; const nodePlan = planDiscordEventTaskTurn(cfg, { request: { - taskId: "tailscale-inventory", + taskId: "network-inventory", source: { botId: "111" }, target: { guildId: "g1", channelId: "c1" }, messages: [{ id: "n1", content: "Node: lab-node\nStatus: online\nWarning: none" }] @@ -668,12 +668,12 @@ test("event task planner supports task-specific item prefixes", () => { assert.equal(nodePlan.reason, "event_task_follow_up_required"); assert.equal(nodePlan.item, "lab-node"); assert.match(nodePlan.followUpMessage, /next unreported node\/user/); - assert.match(nodePlan.followUpMessage, /Tailscale inventory complete/); + assert.match(nodePlan.followUpMessage, /Network inventory complete/); assert.doesNotMatch(nodePlan.followUpMessage, /“Inventory complete”/); const userPlan = planDiscordEventTaskTurn(cfg, { request: { - taskId: "tailscale-inventory", + taskId: "network-inventory", source: { botId: "111" }, target: { guildId: "g1", channelId: "c1" }, messages: [{ id: "u1", content: "User: admin@example.invalid\nStatus: active" }] diff --git a/packages/gateway/README.md b/packages/gateway/README.md index fccc978..51d80e1 100644 --- a/packages/gateway/README.md +++ b/packages/gateway/README.md @@ -130,7 +130,7 @@ $ npm test -- --test-reporter=dot # pass 99 # fail 0 -$ /root/.local/lib/node_modules/openclaw/node_modules/.bin/tsc -p tsconfig.json --noEmit +$ ./node_modules/.bin/tsc -p tsconfig.json --noEmit # pass ``` diff --git a/packages/gateway/docs/rollout-sidecar.md b/packages/gateway/docs/rollout-sidecar.md index b83ee9e..09b8e61 100644 --- a/packages/gateway/docs/rollout-sidecar.md +++ b/packages/gateway/docs/rollout-sidecar.md @@ -53,7 +53,7 @@ Verification commands after cleanup: ```bash npm test -- --test-reporter=dot -/root/.local/lib/node_modules/openclaw/node_modules/.bin/tsc -p tsconfig.json --noEmit +./node_modules/.bin/tsc -p tsconfig.json --noEmit ``` Results: diff --git a/packages/gateway/src/core/task-thread-reporter.ts b/packages/gateway/src/core/task-thread-reporter.ts index 3d997cf..bfaea44 100644 --- a/packages/gateway/src/core/task-thread-reporter.ts +++ b/packages/gateway/src/core/task-thread-reporter.ts @@ -82,9 +82,9 @@ function classifyTask(task: TaskThreadTaskInput, taskId: string): TaskThreadClas } else if (matches(haystack, ["domain-alpha", "fatture", "invoice", "receipt", "refund"])) { domain = "domain-alpha"; reasons.push("Domain Alpha/backoffice keywords matched"); - } else if (matches(haystack, ["nestdev", "odido", "wipro", "jira"])) { + } else if (matches(haystack, ["nestdev", "client-ops", "vendor", "ticketing"])) { domain = "nestdev"; - reasons.push("NestDev/Odido keywords matched"); + reasons.push("NestDev/client-ops keywords matched"); } else if (matches(haystack, ["openclaw", "memory", "docs", "documentation", "gateway", "codex", "cas"])) { domain = "openclaw"; reasons.push("OpenClaw platform keywords matched"); diff --git a/packages/runtime-wrapper/test/policy.test.js b/packages/runtime-wrapper/test/policy.test.js index bd0a065..1658535 100644 --- a/packages/runtime-wrapper/test/policy.test.js +++ b/packages/runtime-wrapper/test/policy.test.js @@ -659,7 +659,7 @@ test("event task planner normalizes unknown advisor enum to ambiguous confirmati request: { source: { botId: "111" }, target: { guildId: "g1", channelId: "c1" }, - messages: [{ id: "m1", content: "Boh, forse abbiamo finito." }] + messages: [{ id: "m1", content: "Maybe this is complete." }] }, advisor: { classification: "maybe_done", confidence: 0.9 } }); @@ -677,35 +677,35 @@ test("event task planner supports task-specific item prefixes", () => { eventController: { enabled: true, tasks: [{ - id: "tailscale-inventory", + id: "network-inventory", sourceBotId: "111", sourceMention: "<@111>", target: { guildId: "g1", channelId: "c1" }, itemLabel: "node/user", itemPrefixes: ["Node", "User"], - stopConditions: [{ type: "phrase", value: "Tailscale inventory complete" }] + stopConditions: [{ type: "phrase", value: "Network inventory complete" }] }] } }; const nodePlan = planDiscordEventTaskTurn(cfg, { request: { - taskId: "tailscale-inventory", + taskId: "network-inventory", source: { botId: "111" }, target: { guildId: "g1", channelId: "c1" }, - messages: [{ id: "n1", content: "Node: cc-lab\nStatus: online\nWarning: none" }] + messages: [{ id: "n1", content: "Node: lab-node\nStatus: online\nWarning: none" }] }, state: { status: "awaiting_status", itemCount: 0 } }); assert.equal(nodePlan.reason, "event_task_follow_up_required"); - assert.equal(nodePlan.item, "cc-lab"); + assert.equal(nodePlan.item, "lab-node"); assert.match(nodePlan.followUpMessage, /prossimo node\/user/); - assert.match(nodePlan.followUpMessage, /Tailscale inventory complete/); + assert.match(nodePlan.followUpMessage, /Network inventory complete/); assert.doesNotMatch(nodePlan.followUpMessage, /“Inventory complete”/); const userPlan = planDiscordEventTaskTurn(cfg, { request: { - taskId: "tailscale-inventory", + taskId: "network-inventory", source: { botId: "111" }, target: { guildId: "g1", channelId: "c1" }, messages: [{ id: "u1", content: "User: admin@example.invalid\nStatus: active" }]