Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(#5312): the stale-socket sweep runs natively on the Windows row only; semgrep annotations follow the allowlist code moved from secret-scan.ts

garrytan0605fa13ce49
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8666568cc4..16f280bc9c 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -221,8 +221,14 @@ jobs:
# on this row once a Bun release carries that change.
- name: Teardown bounds that used to park the Windows unit run (#5332)
run: bun test --timeout 120000 test/postgres-disconnect-bounded.test.ts
- - name: Backup archive round trip and stale AF_UNIX socket sweep on this host (#5312)
- run: bun test --timeout 60000 test/backup-archive-roundtrip-5312.test.ts test/backup-stale-socket-5312.test.ts
+ - name: Backup archive round trip on this host (#5312)
+ run: bun test --timeout 60000 test/backup-archive-roundtrip-5312.test.ts
+ # The stale-socket sweep's native AF_UNIX reparse-point path exists only on Windows; the POSIX cases run in the
+ # Linux unit shards. On macOS the PGLite socket lives at a shortened /private/tmp path (the 104-byte AF_UNIX limit),
+ # which this file's data-dir fixtures do not model: wave 16 follow-up, not covered here.
+ - name: Stale AF_UNIX socket sweep through the native tag check (#5312)
+ if: runner.os == 'Windows'
+ run: bun test --timeout 60000 test/backup-stale-socket-5312.test.ts
- name: Hidden console windows from detached processes (#4992)
run: bun test --timeout 300000 test/windows-hidden-console.test.ts test/spawn-windows-hide.test.ts test/scripts/windows-hide-guard.test.ts
diff --git a/src/core/secret-scan-allowlist.ts b/src/core/secret-scan-allowlist.ts
index 5f08c7742e..37d40787bb 100644
--- a/src/core/secret-scan-allowlist.ts
+++ b/src/core/secret-scan-allowlist.ts
@@ -16,6 +16,7 @@ export const SCAN_ALLOW_FILENAME = '.gbrain-scan-allow';
*/
export function loadWorkspaceAllowlist(workspaceRoot: string): string[] {
try {
+ // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal -- workspaceRoot is the operator's own workspace path and the file name is a constant; no caller-supplied segment (moved unchanged from secret-scan.ts in wave 16)
const p = join(workspaceRoot, SCAN_ALLOW_FILENAME);
if (!existsSync(p)) return [];
return readFileSync(p, 'utf-8')
@@ -62,6 +63,7 @@ export function globToRegExp(glob: string): RegExp {
re += c;
}
}
+ // nosemgrep: javascript.lang.security.audit.detect-non-literal-regexp.detect-non-literal-regexp -- `re` is built here from the operator's workspace allowlist glob with every non-wildcard character escaped (`*` → `[^/]*`, `**` → `.*`, `?` → `[^/]`); no caller input reaches it (moved unchanged from secret-scan.ts in wave 16)
const compiled = new RegExp(`^${re}$`);
GLOB_REGEX_CACHE.set(glob, compiled);
return compiled;