Problem
Some Eval tests fail when the repository checkout path contains spaces or other characters that require URL encoding.
The affected tests construct wrapper locations with new URL(..., import.meta.url).pathname and pass the resulting value directly to child_process:
packages/eval/src/__tests__/lifecycle-boundaries.test.ts
packages/eval/src/__tests__/provider-admission-integration.test.ts
For a checkout such as:
/Users/example/Documents/New project/maka
.pathname produces a value containing %20:
/Users/example/Documents/New%20project/maka/...
That URL pathname is not decoded back into a filesystem path before it is passed to Node. The wrapper process therefore fails to start.
Reproduction
Reproduced against main at:
fde5fb078056be88eeb41733c8772024e6170851
- Check out the repository under a path containing a space.
- Install dependencies and build the repository.
- Run:
node --test \
--test-name-pattern="the Maka shim projects only|eight-arm spec and wrappers" \
packages/eval/dist/__tests__/lifecycle-boundaries.test.js
The two selected tests fail consistently:
the Maka shim projects only a completed subject as a zero exit
expected: 0
actual: 1
eight-arm spec and wrappers freeze the working provider contracts
expected: MAKA-EVAL-RESULT-V1
actual: <empty>
The same tests passed in three consecutive runs from a clean checkout whose path contained no spaces. They failed in three consecutive runs from a clean checkout whose path contained spaces.
Cause
The tests use values such as:
const wrapper = new URL('../harbor-external-subject.js', import.meta.url);
await execFileAsync(process.execPath, [wrapper.pathname, ...args]);
URL.pathname is a URL-encoded pathname, not a platform filesystem path.
The same pattern is also used when launching harbor-maka-subject.js and in several provider-admission integration cases.
Suggested fix
Convert file URLs with Node's fileURLToPath() before passing them to execFile() or spawn():
import { fileURLToPath } from 'node:url';
const wrapperPath = fileURLToPath(
new URL('../harbor-external-subject.js', import.meta.url),
);
await execFileAsync(process.execPath, [wrapperPath, ...args]);
Apply the same conversion to all wrapper and shim paths passed to child-process APIs in the affected Eval tests.
简体中文
问题
当仓库检出路径包含空格或其他需要 URL 编码的字符时,部分 Eval 测试会失败。
受影响的测试使用 new URL(..., import.meta.url).pathname 构造 wrapper 路径,并将结果直接传给 child_process:
packages/eval/src/__tests__/lifecycle-boundaries.test.ts
packages/eval/src/__tests__/provider-admission-integration.test.ts
例如仓库位于:
/Users/example/Documents/New project/maka
.pathname 返回的路径包含 %20:
/Users/example/Documents/New%20project/maka/...
该 URL pathname 在传给 Node 之前没有转换回文件系统路径,因此 wrapper 子进程无法启动。
复现
已在以下 main 提交上复现:
fde5fb078056be88eeb41733c8772024e6170851
- 将仓库检出到包含空格的路径。
- 安装依赖并构建仓库。
- 运行:
node --test \
--test-name-pattern="the Maka shim projects only|eight-arm spec and wrappers" \
packages/eval/dist/__tests__/lifecycle-boundaries.test.js
两个测试会稳定失败:
the Maka shim projects only a completed subject as a zero exit
预期:0
实际:1
eight-arm spec and wrappers freeze the working provider contracts
预期:MAKA-EVAL-RESULT-V1
实际:空输出
在路径不含空格的干净检出中,两个测试连续运行三次均通过;在路径包含空格的干净检出中,连续运行三次均失败。
原因
测试代码使用了类似以下写法:
const wrapper = new URL('../harbor-external-subject.js', import.meta.url);
await execFileAsync(process.execPath, [wrapper.pathname, ...args]);
URL.pathname 是经过 URL 编码的 pathname,并不是平台文件系统路径。
启动 harbor-maka-subject.js 以及部分 provider-admission 集成测试时也使用了相同模式。
建议修复
在将文件 URL 传给 execFile() 或 spawn() 前,使用 Node 的 fileURLToPath() 进行转换:
import { fileURLToPath } from 'node:url';
const wrapperPath = fileURLToPath(
new URL('../harbor-external-subject.js', import.meta.url),
);
await execFileAsync(process.execPath, [wrapperPath, ...args]);
对受影响 Eval 测试中传给子进程 API 的所有 wrapper 和 shim 路径应用相同转换。
AI assistance: OpenAI Codex assisted with source inspection, clean-worktree reproduction, and drafting this issue. I reviewed the reproduction, proposed fix, and final text.
Problem
Some Eval tests fail when the repository checkout path contains spaces or other characters that require URL encoding.
The affected tests construct wrapper locations with
new URL(..., import.meta.url).pathnameand pass the resulting value directly tochild_process:packages/eval/src/__tests__/lifecycle-boundaries.test.tspackages/eval/src/__tests__/provider-admission-integration.test.tsFor a checkout such as:
.pathnameproduces a value containing%20:That URL pathname is not decoded back into a filesystem path before it is passed to Node. The wrapper process therefore fails to start.
Reproduction
Reproduced against
mainat:node --test \ --test-name-pattern="the Maka shim projects only|eight-arm spec and wrappers" \ packages/eval/dist/__tests__/lifecycle-boundaries.test.jsThe two selected tests fail consistently:
The same tests passed in three consecutive runs from a clean checkout whose path contained no spaces. They failed in three consecutive runs from a clean checkout whose path contained spaces.
Cause
The tests use values such as:
URL.pathnameis a URL-encoded pathname, not a platform filesystem path.The same pattern is also used when launching
harbor-maka-subject.jsand in several provider-admission integration cases.Suggested fix
Convert file URLs with Node's
fileURLToPath()before passing them toexecFile()orspawn():Apply the same conversion to all wrapper and shim paths passed to child-process APIs in the affected Eval tests.
简体中文
问题
当仓库检出路径包含空格或其他需要 URL 编码的字符时,部分 Eval 测试会失败。
受影响的测试使用
new URL(..., import.meta.url).pathname构造 wrapper 路径,并将结果直接传给child_process:packages/eval/src/__tests__/lifecycle-boundaries.test.tspackages/eval/src/__tests__/provider-admission-integration.test.ts例如仓库位于:
.pathname返回的路径包含%20:该 URL pathname 在传给 Node 之前没有转换回文件系统路径,因此 wrapper 子进程无法启动。
复现
已在以下
main提交上复现:node --test \ --test-name-pattern="the Maka shim projects only|eight-arm spec and wrappers" \ packages/eval/dist/__tests__/lifecycle-boundaries.test.js两个测试会稳定失败:
在路径不含空格的干净检出中,两个测试连续运行三次均通过;在路径包含空格的干净检出中,连续运行三次均失败。
原因
测试代码使用了类似以下写法:
URL.pathname是经过 URL 编码的 pathname,并不是平台文件系统路径。启动
harbor-maka-subject.js以及部分 provider-admission 集成测试时也使用了相同模式。建议修复
在将文件 URL 传给
execFile()或spawn()前,使用 Node 的fileURLToPath()进行转换:对受影响 Eval 测试中传给子进程 API 的所有 wrapper 和 shim 路径应用相同转换。
AI assistance: OpenAI Codex assisted with source inspection, clean-worktree reproduction, and drafting this issue. I reviewed the reproduction, proposed fix, and final text.