Skip to content

agent: save the proof tree with the run's other outputs - #17

Open
dingf3ng wants to merge 1 commit into
tests-context-search-kwargfrom
proof-tree-output-dir
Open

agent: save the proof tree with the run's other outputs#17
dingf3ng wants to merge 1 commit into
tests-context-search-kwargfrom
proof-tree-output-dir

Conversation

@dingf3ng

@dingf3ng dingf3ng commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #16, which fixed the same problem the wrong way: it deleted the proof tree files instead of moving them.

The problem

ProofController._finish_proof writes <theorem>_proof_tree_final.png and .json next to the file being proved. That is the wrong directory. The tree is a run artifact, and every other run artifact — autorocq.log, the resulting .v — already goes to the output directory main.py builds for the run.

Consequence:

  • Named after the theorem rather than the run, each run overwrites the previous run's tree.

#16 deleted the files during cleanup. That removes the litter but throws the tree away: nothing else persists it — ProofRecorder writes statistics, never the tree — so those two files were the only copy.

The change

ProofController takes the run's output directory, and _finish_proof writes the tree there. main() records the resolved directory on the config, the way it already does for config.log_file, so initialize_components can pass it down.

A None default keeps the old behaviour for callers with no run directory. Each test that builds a controller now passes the directory its own run already owns — results_dir for the batch test, the temp copy's directory for the rest.

utils/scratch.py is untouched: with nothing landing in the source tree, there is nothing to clean up.

Checking

Drove _finish_proof both ways on a temporary tree:

run dir source dir
output_dir set my_thm_proof_tree_final.{json,png} empty
output_dir=None falls back beside the .v, as before

ProofController wrote <theorem>_proof_tree_final.png/.json next to the file
being proved. The problem is the directory, not the files: the tree is a run
artifact, and every other run artifact -- autorocq.log, the resulting .v --
already goes to the output directory main.py builds for the run. Writing it
into the source tree left two untracked files per goal in AutoRocq-bench,
which is a submodule; only proof-search/examples has *.png and *.json
gitignored, so nothing covered them there.

_finish_proof now writes the tree into that output directory instead, so it
is kept rather than deleted: it lands beside the log and the proof it
describes, where the next run cannot overwrite it.

main() records the resolved directory on the config, the way it already does
for config.log_file, so initialize_components can pass it down. A None default
keeps the old behaviour for callers that have no run directory; each test that
builds a controller now passes the directory its own run already owns.

Checked by driving _finish_proof both ways on a temporary tree: with an output
directory both files land there and the source directory stays empty; with
None they fall back beside the .v as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dingf3ng
dingf3ng force-pushed the proof-tree-output-dir branch from 5d6692a to 7af8f84 Compare September 2, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant