Skip to content

agent: clean up the proof tree files a run leaves behind - #16

Closed
dingf3ng wants to merge 1 commit into
tests-context-search-kwargfrom
scratch-cleanup
Closed

agent: clean up the proof tree files a run leaves behind#16
dingf3ng wants to merge 1 commit into
tests-context-search-kwargfrom
scratch-cleanup

Conversation

@dingf3ng

@dingf3ng dingf3ng commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Why

ProofController writes <theorem>_proof_tree_final.png and .json next to the file being proved (proof_controller.py:280).

They're named after the theorem, not the scratch copy — so ScratchProof's cleanup, which works from self.path, never matched them. Five benchmark goals left ten files in AutoRocq-bench, untracked and not gitignored.

That undercuts the whole promise of the scratch copy: your tree comes back untouched.

What changed

Deleting by name pattern would risk removing output from an earlier run. So instead:

  • open() records which *_proof_tree_final.* already exist
  • close() removes only the ones this run added

Same shape as the _CoqProject backup already in the class.

Result

Same five goals re-run. Afterwards the benchmark tree is empty on both checks:

git status --porcelain          (nothing)
*_autorocq_*.v                  (nothing)
*_proof_tree_final.*            (nothing)

ProofController writes <theorem>_proof_tree_final.png and .json next to
the file being proved (proof_controller.py:280). They are named after the
theorem, not the scratch copy, so ScratchProof's cleanup -- which works
from self.path -- never matched them. Five benchmark goals left ten files
behind in AutoRocq-bench, untracked and not gitignored.

Deleting by name pattern would risk removing output from an earlier run,
so open() records which of them already exist and close() removes only
what this run added. Same shape as the _CoqProject backup already here.

Re-running the same five goals, the benchmark tree is empty afterwards on
both checks: git status clean, and no *_autorocq_*.v or
*_proof_tree_final.* anywhere under benchmarks/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dingf3ng

dingf3ng commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #17.

Two things were wrong here:

  1. The description claimed the files were "untracked and not gitignored" as a general fact. The root .gitignore scopes *.png / *.json to proof-search/examples/ (lines 36-37), so runs against the examples were always covered. Only AutoRocq-bench — a submodule with no such entries — was affected.

  2. Deleting the files was the wrong repair. The proof tree is a run artifact in the wrong directory, not litter: ProofRecorder writes statistics and never the tree, so those two files were the only copy of it. This PR removed the output instead of relocating it.

#17 writes the tree into the run's output directory instead, beside autorocq.log and the resulting .v, and leaves utils/scratch.py untouched.

@dingf3ng dingf3ng closed this Sep 2, 2026
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