agent: save the proof tree with the run's other outputs - #17
Open
dingf3ng wants to merge 1 commit into
Open
Conversation
dingf3ng
force-pushed
the
proof-tree-output-dir
branch
from
September 2, 2026 07:36
275c743 to
5d6692a
Compare
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
force-pushed
the
proof-tree-output-dir
branch
from
September 2, 2026 07:57
5d6692a to
7af8f84
Compare
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.
Supersedes #16, which fixed the same problem the wrong way: it deleted the proof tree files instead of moving them.
The problem
ProofController._finish_proofwrites<theorem>_proof_tree_final.pngand.jsonnext 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 directorymain.pybuilds for the run.Consequence:
#16 deleted the files during cleanup. That removes the litter but throws the tree away: nothing else persists it —
ProofRecorderwrites statistics, never the tree — so those two files were the only copy.The change
ProofControllertakes the run's output directory, and_finish_proofwrites the tree there.main()records the resolved directory on the config, the way it already does forconfig.log_file, soinitialize_componentscan pass it down.A
Nonedefault 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_dirfor the batch test, the temp copy's directory for the rest.utils/scratch.pyis untouched: with nothing landing in the source tree, there is nothing to clean up.Checking
Drove
_finish_proofboth ways on a temporary tree:output_dirsetmy_thm_proof_tree_final.{json,png}output_dir=None.v, as before