You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proving on a scratch copy was arranged by each entry point: main.py and
test_folder_batch each built a ScratchProof, swapped the path, and passed
source_path so records would still name the original. Every other caller
-- 17 of the 19 construction sites -- got no copy at all, and the default
was the destructive one.
There is no read-only mode to justify that. load() alone pops the trailing
"Admitted.", clear_all_proof_scripts() rewrites the file, and coqpyt
writes every accepted tactic straight to disk. Any CoqInterface built on a
file the caller cares about will damage it.
So the copy moves into the constructor, and both knobs disappear with it:
- work_on_copy is gone: there is nothing to opt out of.
- source_path is gone: the file you pass IS the source, so the interface
derives it. The question "when is source_path None?" no longer exists.
ScratchProof now has exactly one caller. Nothing else in the tree
references it.
Two things had to move, because they edited the file before a copy
existed and would otherwise have hit the user's own file: the Hammer
import injection, and proof cleaning. Both now run between construction
and load(), on coq_interface.file_path, with clean_success threaded back
through the components dict. Saving became coq_interface.save_result(),
behind a _harvest_proof() helper the signal handler and the normal exit
both use.
Scratch cleanup is registered with atexit rather than done in close(),
because load() calls close() to tear down the previous coq-lsp session
and would otherwise delete the file out from under itself.
ScratchProof.close() only unlinks files, so it is safe at interpreter
exit.
Also drops getattr(self.coq, 'source_path', None) in ProofController. The
attribute is always set, and the None fallback resolved to
proof_file.path -- the scratch name, the exact value the feature exists to
keep out of records.
Verified end to end against a real run (gpt-4.1):
🎉 Proof completed successfully!
examples/example.v a380c035 -> a380c035 (untouched)
examples/autorocq-20260901-153147/example.v holds the found proof
stray *_autorocq_*.v none
Full suite: 34 passed, 1 skipped, 3 errors -- the errors pre-existing and
fixed separately.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments