fix(profiles): make evaluator permissions and Windows checks portable

This commit is contained in:
haelyra committed 2026-09-27 17:03:28 -04:00
1 parent 0765f7a2ca
commit 874883c728
3 files changed
+9 -5

No files matched your search

+4 -2
View File
@@ -489,9 +489,11 @@ function syntheticEnvironments(root) {
function checkArguments(cwd, file = CHECK_FILE, writable = false) {
const major = Number(process.versions.node.split('.')[0]);
const flag = major >= 22 ? '--permission' : major >= 20 ? '--experimental-permission' : null;
return flag ? [flag, `--allow-fs-read=${cwd}`, `--allow-fs-read=${path.join(cwd, '*')}`,
// A directory grant covers its children. Node 20.20.2 can abort in its native
// permission radix tree when the same directory is also granted as "cwd/*".
return flag ? [flag, `--allow-fs-read=${cwd}`,
// Stepped graders exercise stateful apps (persistence); single-step graders stay read-only.
...(writable ? [`--allow-fs-write=${cwd}`, `--allow-fs-write=${path.join(cwd, '*')}`] : []), file] : [file];
...(writable ? [`--allow-fs-write=${cwd}`] : []), file] : [file];
}
// The hidden grader enters the workspace only after the agent exits, and runs read-only where Node supports it.