Skip to content

Commit 14a2ee9

Browse files
brabojclaude
andauthored
fix(efficacy): keep a virtualenv that lost its pyvenv.cfg out of the judge's bundle (#1950) (#1951)
A half-deleted environment keeps launchers that embed the trial's path, so the blindness check refused round 4's hybrid-2. copied_dir now also skips a venv-shaped directory name, and the self-test plants one. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 69a2d0d commit 14a2ee9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎tests/efficacy/judge.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ def copied_dir(base, name):
302302
# a trial may call one anything, and every one records its own path.
303303
if os.path.isfile(os.path.join(path, "pyvenv.cfg")):
304304
return False
305+
306+
# A half-deleted one has lost that file and still holds launchers that
307+
# embed the trial's path, so a venv-shaped name alone keeps it out.
308+
if name.lstrip(".").startswith("venv"):
309+
return False
305310
return not any(name == cache and os.path.isdir(os.path.join(path, inner))
306311
for cache, inner in USER_CACHE_DIRS)
307312

@@ -921,6 +926,9 @@ def bundle_checks(scratch):
921926
# environment under a name of its own, and two per-user caches.
922927
os.path.join(".venv-clean", "pyvenv.cfg"): "home = %s\n" % scored,
923928
os.path.join(".venv-clean", "Scripts", "activate"): scored,
929+
930+
# One whose removal stopped at a locked launcher: no pyvenv.cfg left.
931+
os.path.join(".venv-stale", "Scripts", "tariff-serve.exe"): scored,
924932
os.path.join("pip", "cache", "selfcheck", "state"): scored,
925933
os.path.join("Microsoft", "Windows", "PowerShell", "cache"): scored,
926934
}

0 commit comments

Comments
 (0)