"""Turn sandbox commands back into scratch-directory interactions. Whether an agent read or wrote the scratch directory is a fact about the sandbox event stream, where every exec, `read_file` and `write_file` is recorded verbatim (`inspect_ai/util/_sandbox/events.py:33`). Exec events carry the command as a single shlex-quoted string, and the stock tools do not map onto the verbs you would guess: `read_file()` shells out to `awk`, `list_files()` to `find --`, `grep()` to `grep -rn`, and `bash()` wraps whatever the model wrote in `bash --login -c '