The shell guard refuses heredocs that contain a /** comment #264
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
In the #260 re-run, 10 shell calls were refused with:
Refused: /**: another process's environment, working directory and open files are out of bounds.Every one wrote a file through a heredoc (
cat > src/physics/vec.ts <<'E',python3 - <<'E'), and the file's text had a doc comment opening with/**. The guard (#201) reads heredoc text for absolute paths, takes/**for a pattern that could reach/proc/*/environ, and refuses. Each refusal costs the agent a turn and a rewrite. Runs 122, 123, 124 and 125 all hit it.Fix
*,?or[). Insrc/osf/agent/path_guard.js,checkCommandscans the whole text, andprocPrivatereads a leading**as/proc./is refused, say that, not "another process's environment".Done when
cat > a.ts <<'E'with a/** … */comment runs, andcat /proc/1/environis still refused. The guard's tests cover both.Still happening, final count for the #260 re-run: 15 refusals in 9 of its 12 runs (122–129 and 131).
cat > src/game/highscores.ts <<'E'sed -i …. The agent gave up on the shell and used thewritetool instead.cat > src/table/theme.ts <<'E'Each costs a turn and a rewrite. In run 125 it cost a step: the refused command also wrote
.osf/test/unit.command, so the apply failed its check and ran again.No refusal of any kind in run 136, the only run since the
8c527d6deploy. I scanned every step's tool calls: three commands contained/*, all of them globs, and all ran. A doc comment in a heredoc didn't come up in that run, so the evidence for this case is the test:tests/agent/test_path_guard.pyruns the shippedpath_guard.jsunder node on the command from this issue, and it passes. Reopen if a refusal like this shows up again.