Skip to content

Commit 708b8c2

Browse files
dingf3ngclaude
authored andcommitted
agent: add --output-dir, and say where the proof actually lands
Proving on a scratch copy changes the behaviour the README documents. The quickstart still promised "the proof script is saved in the same example.v file" which was true, and was the reason example.v arrived in the tree already proven (a4c1e2f committed the output of running that very command). It is not true any more: the source file is left untouched and the result is written into the run's output directory. The rewritten paragraph names where the proof lands and offers --output-dir for choosing somewhere else. That flag did not exist: main.py read output_dir from the config file and nothing else, so the sentence documented something imaginary. Adding it is the smaller fix, and it is the flag a benchmark run wants -- without it every run drops its output directory next to the .v file, which for AutoRocq-bench means inside the submodule. It wins over the config the way every other command line option here already does, and the directory is created with parents so a path like /tmp/runs/today/first works. Checked: --help lists the flag, and setup_output_directory creates a nested path that does not exist yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 102c466 commit 708b8c2

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If AutoRocq runs successfully, you will be able to see in the terminal
107107
```
108108
[INFO] [Main]: 🎉 Proof completed successfully!
109109
```
110-
and the proof script is saved in the same [`example.v`](proof-search/examples/example.v) file. You will also be able to find saved proof states and aggregated results at `data/`, which can be reused to prove other goals in the future.
110+
The proof runs on a throwaway copy, so [`example.v`](proof-search/examples/example.v) itself is left untouched; the resulting proof script is written to the run's output directory, `examples/autorocq-<timestamp>/example.v` by default (use `--output-dir` to choose your own). You will also be able to find saved proof states and aggregated results at `data/`, which can be reused to prove other goals in the future.
111111

112112
For more configurations of the tool, check out the [readme](proof-search/configs/readme.md) or run with `--help` for more options.
113113

proof-search/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ def parse_arguments():
9393
help="Set workspace directory"
9494
)
9595

96+
parser.add_argument(
97+
"--output-dir",
98+
help="Directory for this run's artifacts: the log, the resulting proof, "
99+
"and the proof tree (default: autorocq-<timestamp> beside the proof file)"
100+
)
101+
96102
parser.add_argument(
97103
"--local-session-caching",
98104
action="store_true",
@@ -160,7 +166,7 @@ def setup_output_directory(output_dir: Optional[str]) -> Path:
160166
proof_file_path = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(".")
161167
output_path = proof_file_path.parent / f"autorocq-{datetime.now().strftime('%Y%m%d-%H%M%S')}"
162168

163-
output_path.mkdir(exist_ok=True)
169+
output_path.mkdir(parents=True, exist_ok=True)
164170
return output_path
165171

166172

@@ -610,7 +616,7 @@ def signal_handler(signum, frame):
610616
sys.exit(1)
611617

612618
# Setup output directory
613-
output_dir = setup_output_directory(config.output_dir)
619+
output_dir = setup_output_directory(args.output_dir or config.output_dir)
614620

615621
# Use absolute path
616622
args.proof_file = str(Path(args.proof_file).resolve())

0 commit comments

Comments
 (0)