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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog

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
fix(test): avoid walking extension boundary scans · openc...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1,7 +1,8 @@

1+

import { spawnSync } from "node:child_process";

12

import fs from "node:fs";

23

import path from "node:path";

34

import { BUNDLED_PLUGIN_PATH_PREFIX } from "openclaw/plugin-sdk/test-fixtures";

4-

import { describe, expect, it } from "vitest";

5+

import { describe, expect, it, vi } from "vitest";

56

import { GUARDED_EXTENSION_PUBLIC_SURFACE_BASENAMES } from "../src/plugin-sdk/test-helpers/public-artifacts.js";

6778

const repoRoot = path.resolve(import.meta.dirname, "..");

@@ -18,7 +19,35 @@ const BROAD_PUBLIC_SOURCE_ARTIFACT_BASENAMES = new Set(["api.js", "runtime-api.j

1819

const ROOTDIR_BOUNDARY_CANARY_RE =

1920

/(^|\/)__rootdir_boundary_canary__\.(?:[cm]?ts|[cm]?js|tsx|jsx)$/u;

202122+

function listGitFiles(dir: string): string[] | null {

23+

const relativeRoot = path.relative(repoRoot, dir).replaceAll(path.sep, "/");

24+

if (!relativeRoot || relativeRoot.startsWith("..") || path.isAbsolute(relativeRoot)) {

25+

return null;

26+

}

27+

const result = spawnSync("git", ["ls-files", "--", relativeRoot], {

28+

cwd: repoRoot,

29+

encoding: "utf8",

30+

stdio: ["ignore", "pipe", "ignore"],

31+

});

32+

if (result.status !== 0) {

33+

return null;

34+

}

35+

return result.stdout

36+

.split("\n")

37+

.map((line) => line.trim().replaceAll("\\", "/"))

38+

.filter((line) => line.length > 0)

39+

.toSorted((left, right) => left.localeCompare(right));

40+

}

41+2142

function walk(dir: string, entries: string[] = []): string[] {

43+

const gitFiles = listGitFiles(dir);

44+

if (gitFiles) {

45+

entries.push(

46+

...gitFiles.filter((file) => file.endsWith(".test.ts") || file.endsWith(".test.tsx")),

47+

);

48+

return entries;

49+

}

50+2251

for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {

2352

const fullPath = path.join(dir, entry.name);

2453

if (entry.isDirectory()) {

@@ -37,6 +66,19 @@ function walk(dir: string, entries: string[] = []): string[] {

3766

}

38673968

function walkCode(dir: string, entries: string[] = []): string[] {

69+

const gitFiles = listGitFiles(dir);

70+

if (gitFiles) {

71+

entries.push(

72+

...gitFiles.filter((file) => {

73+

if (!file.endsWith(".ts") && !file.endsWith(".tsx")) {

74+

return false;

75+

}

76+

return !ROOTDIR_BOUNDARY_CANARY_RE.test(file);

77+

}),

78+

);

79+

return entries;

80+

}

81+4082

for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {

4183

const fullPath = path.join(dir, entry.name);

4284

if (entry.isDirectory()) {

@@ -100,6 +142,15 @@ function getImportBasename(importPath: string): string {

100142

}

101143102144

function collectBundledPluginIds(): Set<string> {

145+

const extensionFiles = listGitFiles(path.join(repoRoot, "extensions"));

146+

if (extensionFiles) {

147+

return new Set(

148+

extensionFiles

149+

.map((file) => /^extensions\/([^/]+)\//u.exec(file)?.[1])

150+

.filter((pluginId): pluginId is string => Boolean(pluginId)),

151+

);

152+

}

153+103154

return new Set(

104155

fs

105156

.readdirSync(path.join(repoRoot, "extensions"), { withFileTypes: true })

@@ -145,6 +196,22 @@ function isAllowedCoreContractSuite(file: string, imports: readonly string[]): b

145196

}

146197147198

describe("non-extension test boundaries", () => {

199+

it("lists boundary scan files from git without walking repo roots", () => {

200+

const readdirSync = vi.spyOn(fs, "readdirSync");

201+

try {

202+

const srcTests = walk(path.join(repoRoot, "src"));

203+

const srcCode = walkCode(path.join(repoRoot, "src"));

204+

const pluginIds = collectBundledPluginIds();

205+206+

expect(srcTests.length).toBeGreaterThan(0);

207+

expect(srcCode.length).toBeGreaterThan(0);

208+

expect(pluginIds.size).toBeGreaterThan(0);

209+

expect(readdirSync).not.toHaveBeenCalled();

210+

} finally {

211+

readdirSync.mockRestore();

212+

}

213+

});

214+148215

it("keeps plugin-owned behavior suites under the bundled plugin tree", () => {

149216

const testFiles = [

150217

...walk(path.join(repoRoot, "src")),