Answer architecture round 1: 0 🔴, 6 🟡 (0 misread); count a release review only where it names the next release, split task_bench into bugs, features and figures, group README's packages
CI / tests (pull_request) Successful in 4m55s

This commit is contained in:
2026-11-27 11:23:08 +01:00
parent d1b01c76c8
commit b563a597f1
55 changed files with 293 additions and 198 deletions
+24
View File
@@ -0,0 +1,24 @@
"""A copy of a tree for a mutation tool to run in, so that what the tool writes there goes with the copy."""
import os
import shutil
from failure import Failure
from mutate_changes.tool_process import remove, scratch_folder
def scratch_copy(top: str) -> tuple[str, str] | Failure:
"""A new scratch folder in top, and in it a copy of top's other entries, links kept as links: the two folders' paths. The
caller removes the scratch folder.
A mutation tool leaves files where it runs: its cache, and each log the project's config asks for, which tells where every
mutant is. A bug's tree is a copy of top, so the tool runs in this copy and top stays as it was."""
scratch = scratch_folder(top)
if isinstance(scratch, Failure):
return scratch
copy = os.path.join(scratch, "copy")
try:
shutil.copytree(top, copy, symlinks=True, ignore=shutil.ignore_patterns(os.path.basename(scratch)))
except OSError as failure:
remove(scratch)
return Failure(f"could not copy {top} into {scratch}: {failure}")
return scratch, copy