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

推荐订阅源

T
Threat Research - Cisco Blogs
Google DeepMind News
Google DeepMind News
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
Webroot Blog
Webroot Blog
Stack Overflow Blog
Stack Overflow Blog
T
The Blog of Author Tim Ferriss
D
Docker
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Know Your Adversary
Know Your Adversary
A
About on SuperTechFans
U
Unit 42
NISL@THU
NISL@THU
M
MIT News - Artificial intelligence
T
The Exploit Database - CXSecurity.com
K
Kaspersky official blog
Martin Fowler
Martin Fowler
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Hacker News - Newest:
Hacker News - Newest: "LLM"
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
WordPress大学
WordPress大学
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
小众软件
小众软件
G
Google Developers Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
博客园 - 司徒正美
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
Google Online Security Blog
Google Online Security Blog
Cisco Talos Blog
Cisco Talos Blog
C
Check Point 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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
refactor(plugins): enforce config API deprecations · openclaw/openclaw@9d5a211
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -0,0 +1,325 @@

1+

import { existsSync, readFileSync, readdirSync } from "node:fs";

2+

import { dirname, relative, resolve, sep } from "node:path";

3+

import { fileURLToPath } from "node:url";

4+5+

const DEFAULT_REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../..");

6+7+

const COMPAT_CONFIG_API_FILES = new Set([

8+

"src/config/config.ts",

9+

"src/config/io.ts",

10+

"src/config/mutate.ts",

11+

"src/memory-host-sdk/runtime-core.ts",

12+

"src/plugin-sdk/browser-config-runtime.ts",

13+

"src/plugin-sdk/config-runtime.ts",

14+

"src/plugin-sdk/memory-core.ts",

15+

"src/plugin-sdk/memory-core-host-runtime-core.ts",

16+

"src/plugins/contracts/deprecated-internal-config-api.test.ts",

17+

"src/plugins/runtime/runtime-config.test.ts",

18+

"src/plugins/runtime/runtime-config.ts",

19+

"src/plugins/runtime/types-core.ts",

20+

]);

21+22+

const AMBIENT_RUNTIME_LOAD_CONFIG_COMPAT_FILES = new Set([

23+

"src/plugins/runtime/load-context.ts",

24+

"src/plugins/runtime/runtime-config.ts",

25+

"src/plugins/runtime/runtime-plugin-boundary.ts",

26+

]);

27+28+

const PROCESS_BOUNDARY_DIRECT_CONFIG_LOAD_FILES = new Set([

29+

"src/cli/banner-config-lite.ts",

30+

"src/cli/daemon-cli/status.gather.ts",

31+

]);

32+33+

function collectTypeScriptFiles(dir) {

34+

if (!existsSync(dir)) {

35+

return [];

36+

}

37+

const entries = readdirSync(dir, { withFileTypes: true });

38+

const files = [];

39+

for (const entry of entries) {

40+

const fullPath = resolve(dir, entry.name);

41+

if (entry.isDirectory()) {

42+

if (entry.name === "dist" || entry.name === "node_modules") {

43+

continue;

44+

}

45+

files.push(...collectTypeScriptFiles(fullPath));

46+

continue;

47+

}

48+

if (entry.isFile() && entry.name.endsWith(".ts")) {

49+

files.push(fullPath);

50+

}

51+

}

52+

return files;

53+

}

54+55+

function repoRelative(repoRoot, filePath) {

56+

return relative(repoRoot, filePath).split(sep).join("/");

57+

}

58+59+

function isProductionExtensionFile(relPath) {

60+

if (

61+

relPath.includes("/test-support/") ||

62+

relPath.includes(".test.") ||

63+

relPath.includes(".live.test.") ||

64+

relPath.includes(".test-d.") ||

65+

relPath.includes(".test-harness.") ||

66+

relPath.includes(".test-shared.") ||

67+

relPath.endsWith("-test-helpers.ts") ||

68+

relPath.endsWith("-test-support.ts")

69+

) {

70+

return false;

71+

}

72+

return true;

73+

}

74+75+

function isTestOrHarnessFile(relPath) {

76+

return (

77+

relPath.includes("test-support") ||

78+

relPath.includes("/test-support/") ||

79+

relPath.includes("/test-helpers/") ||

80+

relPath.includes(".test.") ||

81+

relPath.includes(".live.test.") ||

82+

relPath.includes(".test-d.") ||

83+

relPath.includes(".test-harness.") ||

84+

relPath.includes(".test-shared.") ||

85+

relPath.endsWith(".test-helpers.ts") ||

86+

relPath.endsWith(".test-support.ts") ||

87+

relPath.endsWith("-test-helpers.ts") ||

88+

relPath.endsWith("-test-support.ts")

89+

);

90+

}

91+92+

function isCompatConfigApiFile(relPath) {

93+

return COMPAT_CONFIG_API_FILES.has(relPath);

94+

}

95+96+

function isAmbientRuntimeConfigCompatFile(relPath) {

97+

return AMBIENT_RUNTIME_LOAD_CONFIG_COMPAT_FILES.has(relPath);

98+

}

99+100+

function findLineNumbers(source, pattern) {

101+

const lines = source.split(/\r?\n/);

102+

return lines.flatMap((line, index) => (pattern.test(line) ? [index + 1] : []));

103+

}

104+105+

function findMatchLineNumbers(source, pattern) {

106+

const flags = pattern.flags.includes("g") ? pattern.flags : `${pattern.flags}g`;

107+

const regex = new RegExp(pattern.source, flags);

108+

const lines = [];

109+

for (let match = regex.exec(source); match; match = regex.exec(source)) {

110+

lines.push(source.slice(0, match.index).split(/\r?\n/).length);

111+

}

112+

return lines;

113+

}

114+115+

function findNonCommentLineNumbers(source, pattern) {

116+

return source.split(/\r?\n/).flatMap((line, index) => {

117+

const trimmed = line.trimStart();

118+

if (trimmed.startsWith("//") || trimmed.startsWith("*")) {

119+

return [];

120+

}

121+

return pattern.test(line) ? [index + 1] : [];

122+

});

123+

}

124+125+

function repoCodeRoots(repoRoot) {

126+

return ["src", "extensions", "packages", "test", "scripts"].map((entry) =>

127+

resolve(repoRoot, entry),

128+

);

129+

}

130+131+

function pushDeprecatedRuntimeApiViolations(violations, files) {

132+

const guards = [

133+

{

134+

pattern:

135+

/(?:api\.runtime\.config|core\.config|runtime\.config|get[A-Za-z0-9]+Runtime\(\)\.config|rt\.config|configApi)\??\.loadConfig\b/,

136+

replacement: "use runtime.config.current() or pass the already loaded config",

137+

},

138+

{

139+

pattern:

140+

/(?:api\.runtime\.config|core\.config|runtime\.config|get[A-Za-z0-9]+Runtime\(\)\.config|rt\.config|configApi)\??\.writeConfigFile\b/,

141+

replacement:

142+

"use runtime.config.mutateConfigFile(...) or replaceConfigFile(...) with afterWrite",

143+

},

144+

];

145+146+

for (const { filePath, relPath } of files) {

147+

const source = readFileSync(filePath, "utf8");

148+

for (const guard of guards) {

149+

for (const line of findMatchLineNumbers(source, guard.pattern)) {

150+

violations.push(`${relPath}:${line} ${guard.replacement}`);

151+

}

152+

}

153+

}

154+

}

155+156+

export function collectDeprecatedInternalConfigApiViolations({

157+

repoRoot = DEFAULT_REPO_ROOT,

158+

} = {}) {

159+

const srcRoot = resolve(repoRoot, "src");

160+

const extensionsRoot = resolve(repoRoot, "extensions");

161+

const gatewayServerMethodsRoot = resolve(srcRoot, "gateway/server-methods");

162+

const ambientRuntimeConfigRoots = [

163+

"src/gateway",

164+

"src/auto-reply",

165+

"src/agents",

166+

"src/infra",

167+

"src/mcp",

168+

"src/plugins/runtime",

169+

"src/config/sessions",

170+

].map((entry) => resolve(repoRoot, entry));

171+172+

const violations = [];

173+174+

const productionExtensionFiles = collectTypeScriptFiles(extensionsRoot)

175+

.map((filePath) => ({ filePath, relPath: repoRelative(repoRoot, filePath) }))

176+

.filter(({ relPath }) => isProductionExtensionFile(relPath));

177+

pushDeprecatedRuntimeApiViolations(violations, productionExtensionFiles);

178+179+

for (const { filePath, relPath } of productionExtensionFiles) {

180+

const source = readFileSync(filePath, "utf8");

181+

const guards = [

182+

{

183+

pattern:

184+

/\b(?:import|export)\s+(?:type\s+)?\{[^}]*\bloadConfig\b[^}]*\}\s+from\s+["']openclaw\/plugin-sdk\/(?:browser-config-runtime|config-runtime|memory-core-host-runtime-core)["']/,

185+

replacement:

186+

"use getRuntimeConfig(), runtime.config.current(), or pass the already loaded config",

187+

},

188+

{

189+

pattern: /(?<!\.)\bloadConfig\s*\(/,

190+

replacement: "use getRuntimeConfig(), runtime.config.current(), or passed config",

191+

},

192+

{

193+

pattern: /\bcreateConfigIO\b|\.\s*loadConfig\s*\(/,

194+

replacement: "use runtime.config.current(), getRuntimeConfig(), or passed config",

195+

},

196+

{

197+

pattern: /\bwriteConfigFile\s*\(/,

198+

replacement: "use mutateConfigFile(...) or replaceConfigFile(...) with afterWrite",

199+

},

200+

];

201+

for (const guard of guards) {

202+

for (const line of findLineNumbers(source, guard.pattern)) {

203+

violations.push(`${relPath}:${line} ${guard.replacement}`);

204+

}

205+

}

206+

}

207+208+

const repoFiles = repoCodeRoots(repoRoot)

209+

.flatMap(collectTypeScriptFiles)

210+

.map((filePath) => ({ filePath, relPath: repoRelative(repoRoot, filePath) }));

211+212+

pushDeprecatedRuntimeApiViolations(

213+

violations,

214+

repoFiles.filter(({ relPath }) => !isCompatConfigApiFile(relPath)),

215+

);

216+217+

for (const { filePath, relPath } of repoFiles.filter(

218+

({ relPath }) => !isCompatConfigApiFile(relPath),

219+

)) {

220+

const source = readFileSync(filePath, "utf8");

221+

const guards = [

222+

{

223+

pattern:

224+

/\b(?:import|export)\s+(?:type\s+)?\{[\s\S]*?\b(?:loadConfig|writeConfigFile)\b[\s\S]*?\}\s+from\s+["']openclaw\/plugin-sdk\/(?:browser-config-runtime|config-runtime|memory-core-host-runtime-core|memory-core)["']/,

225+

replacement:

226+

"use getRuntimeConfig(), runtime.config.current(), or mutation helpers with afterWrite",

227+

},

228+

{

229+

pattern:

230+

/ReturnType<typeof import\(["']openclaw\/plugin-sdk\/(?:browser-config-runtime|config-runtime|memory-core-host-runtime-core|memory-core)["']\)\.(?:loadConfig|writeConfigFile)>/,

231+

replacement: "use OpenClawConfig or the explicit mutation helper type",

232+

},

233+

];

234+

for (const guard of guards) {

235+

for (const line of findMatchLineNumbers(source, guard.pattern)) {

236+

violations.push(`${relPath}:${line} ${guard.replacement}`);

237+

}

238+

}

239+

}

240+241+

for (const { filePath, relPath } of repoFiles.filter(

242+

({ relPath }) =>

243+

!isTestOrHarnessFile(relPath) &&

244+

!isCompatConfigApiFile(relPath) &&

245+

!relPath.startsWith("test/"),

246+

)) {

247+

const source = readFileSync(filePath, "utf8");

248+

const importPattern =

249+

/\bimport\s+\{[\s\S]*?\bwriteConfigFile\b[\s\S]*?\}\s+from\s+["'][^"']*(?:config\/config|config\/io)\.js["']/;

250+

const dynamicImportPattern =

251+

/\bconst\s+\{[\s\S]*?\bwriteConfigFile\b[\s\S]*?\}\s*=\s*await\s+import\(["'][^"']*(?:config\/config|config\/io)\.js["']\)/;

252+

const directMethodPattern = /\.\s*writeConfigFile\s*\(/;

253+

for (const pattern of [importPattern, dynamicImportPattern]) {

254+

for (const line of findMatchLineNumbers(source, pattern)) {

255+

violations.push(

256+

`${relPath}:${line} use replaceConfigFile(...) or mutateConfigFile(...) with afterWrite`,

257+

);

258+

}

259+

}

260+

for (const line of findNonCommentLineNumbers(source, directMethodPattern)) {

261+

violations.push(

262+

`${relPath}:${line} use replaceConfigFile(...) or mutateConfigFile(...) with afterWrite`,

263+

);

264+

}

265+

}

266+267+

for (const { filePath, relPath } of repoFiles.filter(

268+

({ relPath }) =>

269+

!isTestOrHarnessFile(relPath) &&

270+

!isCompatConfigApiFile(relPath) &&

271+

!PROCESS_BOUNDARY_DIRECT_CONFIG_LOAD_FILES.has(relPath) &&

272+

!relPath.startsWith("test/"),

273+

)) {

274+

const source = readFileSync(filePath, "utf8");

275+

for (const line of findNonCommentLineNumbers(source, /(?<!\.)\bloadConfig\s*\(/)) {

276+

violations.push(

277+

`${relPath}:${line} use a passed cfg, context.getRuntimeConfig(), or getRuntimeConfig() at an explicit process boundary`,

278+

);

279+

}

280+

for (const line of findNonCommentLineNumbers(source, /\.\s*loadConfig\s*\(/)) {

281+

violations.push(

282+

`${relPath}:${line} use a passed cfg, context.getRuntimeConfig(), or getRuntimeConfig() at an explicit process boundary`,

283+

);

284+

}

285+

}

286+287+

for (const { filePath, relPath } of collectTypeScriptFiles(gatewayServerMethodsRoot)

288+

.map((filePath) => ({ filePath, relPath: repoRelative(repoRoot, filePath) }))

289+

.filter(({ relPath }) => !isTestOrHarnessFile(relPath))) {

290+

const source = readFileSync(filePath, "utf8");

291+

const importPattern =

292+

/\bimport\s+\{[\s\S]*?\bloadConfig\b[\s\S]*?\}\s+from\s+["'][^"']*(?:config\/config|config\/io)\.js["']/;

293+

for (const line of findMatchLineNumbers(source, importPattern)) {

294+

violations.push(

295+

`${relPath}:${line} use context.getRuntimeConfig() in gateway request handlers`,

296+

);

297+

}

298+

for (const line of findNonCommentLineNumbers(source, /(?<!\.)\bloadConfig\s*\(/)) {

299+

violations.push(

300+

`${relPath}:${line} use context.getRuntimeConfig() in gateway request handlers`,

301+

);

302+

}

303+

}

304+305+

for (const { filePath, relPath } of ambientRuntimeConfigRoots

306+

.flatMap(collectTypeScriptFiles)

307+

.map((filePath) => ({ filePath, relPath: repoRelative(repoRoot, filePath) }))

308+

.filter(

309+

({ relPath }) =>

310+

!isTestOrHarnessFile(relPath) &&

311+

!isCompatConfigApiFile(relPath) &&

312+

!isAmbientRuntimeConfigCompatFile(relPath),

313+

)) {

314+

const source = readFileSync(filePath, "utf8");

315+

const loadConfigLines = findNonCommentLineNumbers(source, /(?<!\.)\bloadConfig\s*\(/);

316+

if (loadConfigLines.length === 0) {

317+

continue;

318+

}

319+

violations.push(

320+

`${relPath}:${loadConfigLines.join(",")} has ${loadConfigLines.length} ambient loadConfig() calls. Pass cfg through the call path, use context.getRuntimeConfig(), or use getRuntimeConfig() at a process boundary.`,

321+

);

322+

}

323+324+

return violations;

325+

}