Repository navigation
Commit f348f7a
committed
Let the shell change the run's files through the Host
A script can write, append, make a directory, remove, move, and copy: `RunFiles` sends each of these six changes to the Host as a `FileRequest`, and `READ_ONLY` is removed. What the contract has no function for, `RunFiles` answers itself, with no state kept: a fixed mode, a time that is not kept, and no link or named pipe. The tool is marked with `changes_files()`, so the Host runs the `Shell` calls of one reply in the order the reply lists them.
- `write_path` refuses a write or an append to a path under `/dev/` with `NO_DEVICE`, on every platform, and sends no request to the Host. The comment beside the refusal cites the bashkit fault on Windows that is its reason: everruns/bashkit#2933
- The refusal covers `write_file` and `append_file` alone. A `mkdir`, a `rename`, or a `copy` to a path under `/dev/` goes to the Host.
- `write_path` also refuses more than `RV_MAX_WRITE` bytes, with a sentence that names the limit. The shell does not split a write.
- `mkdir` with `recursive` follows a failure for a path that is taken with a `Stat` request, and it succeeds when the path names a directory, because bashkit takes such a request as done.
- `chmod` asks the Host what the path names. It succeeds for the mode the shell reports, 644 for a file and 755 for a directory, and it fails with `FIXED_MODE` for another mode.
- `io_error` gives `AlreadyExists` and `NotEmpty` cases of their own, with the words `File exists` and `Directory not empty`.
- `shell.json` says that the Shell calls of one reply run in order. It also says that no file has an execute bit and that a script runs with `bash script.sh`.
- A write makes each absent directory on the way to its file, because the Host does. A real shell fails that write.
- `mktemp` makes `/tmp` among the run's files when that directory is absent.
- A change whose job was killed before the request went to the Host does not happen. A change of a job that the script kills in the step that sends the request still happens, because bashkit lets go of a killed job when it next polls its jobs.
- A script that bashkit stops at its time limit keeps its `&` jobs, and the call ends after the changes of those jobs that are in progress.
- No test covers a `cp`, a `mv`, or a `mkdir` to a path under `/dev/`.
- No test makes the Host refuse the write of `sed -i` alone. The test of a failed write of `sed -i` uses a file under `/dev/`.
- `a_script_that_ended_waits_for_its_changes_in_progress` sleeps 300 ms so that the time limit passes. A limit that fires late lets the writes happen while the script sleeps, so the test cannot fail from timing.
Plan: runvil-harness/plan/2026-11-16-1-tool-file-effects.plan.md1 parent 1c26d04 commit f348f7a
10 files changed
Lines changed: 886 additions & 180 deletions
File tree
- crates/plugin-bashkit
- schemas
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments