write_file creates a missing parent directory inside the root - #186
Merged
Conversation
resolve_for_create canonicalized the parent first, so a directory that did not exist yet failed the write. A model that never runs mkdir -p then repeats the same failing write until the repeat guard ends the attempt; dots-3 lost every write of an oracle run that way. The parent is now created the way an editor would, with .. refused up front and the nearest existing ancestor checked against the root before anything is made, so a symlink out of the root creates nothing on the far side. Claude-Session: https://claude.ai/code/session_01ADjombyM8oH114zG9FnMxo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
write_filerefused to write into a directory that did not exist yet:resolve_for_createcanonicalized the parent first, and a missing parent fails that call. A model that never shells outmkdir -pthen repeats the same failing write until the repeat guard ends the attempt. In the terminal-bench-science oracle run of 2026-09-05, dots-3-note-preview did exactly that: 12write_filecalls, 12 errors, 0 files created, across six tasks whose images ship/app/dataand not/app/results. The three models that scored before it all ranmkdir -pfrom the shell first, which is why the harness had not been caught.The tool now creates a missing parent the way an editor does, without loosening the root check:
..anywhere in the path is refused before anything is made, so nothing can be created above the nearest existing ancestor.create_dir_allruns, so a symlink out of the root creates nothing on the far side.Tests cover the new parent, an escaping path that must create nothing, and a symlink out of the root that must create nothing. The tool description tells the model that parent directories are created.
https://claude.ai/code/session_01ADjombyM8oH114zG9FnMxo