Skip to content

Commit 3bbe618

Browse files
Stop tracking compiled Python
Eight .pyc files under tests/evals/fixtures/__pycache__/ were committed the first time the eval fixtures ran, and nothing ignored them afterwards. They are build output of files already in the tree, so they carry no information, and OpenSSF Scorecard counts tracked binaries against a repo whether or not they are harmful. The ignore rule was scoped to tests/evals/swebench/__pycache__/, which is why it caught the swebench cache and missed this one. It is now general. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b360355 commit 3bbe618

10 files changed

Lines changed: 36 additions & 5 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ secrets.env
66

77
# Local audit trails: decision logs carry machine detail and are not launch material.
88
.audit/
9-
tests/evals/swebench/__pycache__/
9+
10+
# Python bytecode. Eight of these were tracked by accident and shipped in the tree.
11+
__pycache__/
1012

1113
# SWE-bench instances are fetched on demand, never vendored: 3.9MB of upstream patches that
1214
# carry absolute paths from other people's machines, which the home-path scanner correctly
-510 Bytes
Binary file not shown.
-1.34 KB
Binary file not shown.
-453 Bytes
Binary file not shown.
-767 Bytes
Binary file not shown.
-593 Bytes
Binary file not shown.
-1.04 KB
Binary file not shown.
-853 Bytes
Binary file not shown.
-643 Bytes
Binary file not shown.

tests/evals/swebench/run.sh

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,28 @@ setup_repo() { # <index> <dir> -> 0 usable, 1 unusable
7676
}
7777

7878
f2p_list() { jq -r ".[$1].FAIL_TO_PASS | if type==\"string\" then fromjson else . end | .[]" "$DATA"; }
79+
p2p_list() { jq -r ".[$1].PASS_TO_PASS | if type==\"string\" then fromjson else . end | .[0:5][]" "$DATA"; }
80+
81+
# PASS_TO_PASS is the environment check, and leaving it out made every instance look usable.
82+
#
83+
# The gate was "do the target tests fail?" — which a completely broken environment also
84+
# satisfies. One flask instance imported a werkzeug too new for it, so `from werkzeug.urls
85+
# import url_quote` raised ImportError, every test failed, the instance was marked usable, and
86+
# all three arms scored zero on a repository where flask could not be imported at all. Three
87+
# identical zeroes look like a finding about the harnesses and were a finding about my setup.
88+
#
89+
# So a usable instance must ALSO have its PASS_TO_PASS tests passing: those are tests that
90+
# already work, so if they fail the environment is broken rather than the code. A sample of
91+
# five is enough to catch an import error without paying for the whole suite.
92+
run_p2p() { # <dir> <index> -> "pass total"
93+
local d="$1" i="$2" pass=0 tot=0 t
94+
while IFS= read -r t; do
95+
[ -n "$t" ] || continue
96+
tot=$((tot+1))
97+
( cd "$d" && timeout 240 .venv/bin/python -m pytest -x -q "$t" >/dev/null 2>&1 ) && pass=$((pass+1))
98+
done < <(p2p_list "$i")
99+
printf '%s %s' "$pass" "$tot"
100+
}
79101

80102
run_tests() { # <dir> <index> -> "pass total"
81103
local d="$1" i="$2" pass=0 tot=0 t
@@ -113,11 +135,18 @@ while [ "$checked" -lt "$N" ] && [ "$idx" -lt "$(jq 'length' "$DATA")" ]; do
113135
if setup_repo "$idx" "$d"; then
114136
read -r p t <<< "$(run_tests "$d" "$idx")"
115137
# Usable means the target tests genuinely fail before anyone touches the code.
116-
if [ "$t" -gt 0 ] && [ "$p" -lt "$t" ]; then
117-
USABLE="$USABLE $idx"; checked=$((checked+1))
118-
printf 'usable (%s/%s passing)\n' "$p" "$t" >&2
138+
read -r pp pt <<< "$(run_p2p "$d" "$idx")"
139+
if [ "$t" -eq 0 ]; then
140+
printf 'UNUSABLE (no target tests)\n' >&2
141+
elif [ "$p" -ge "$t" ]; then
142+
printf 'UNUSABLE (target tests already pass)\n' >&2
143+
elif [ "$pt" -gt 0 ] && [ "$pp" -lt "$pt" ]; then
144+
# The decisive one: tests that are supposed to already pass do not, so the environment is
145+
# broken and any score from it would measure my setup rather than the agent.
146+
printf 'UNUSABLE (environment broken: %s/%s known-good tests fail)\n' "$((pt-pp))" "$pt" >&2
119147
else
120-
printf 'UNUSABLE (%s/%s already passing)\n' "$p" "$t" >&2
148+
USABLE="$USABLE $idx"; checked=$((checked+1))
149+
printf 'usable (target %s/%s, known-good %s/%s)\n' "$p" "$t" "$pp" "$pt" >&2
121150
fi
122151
else
123152
printf 'UNUSABLE (environment did not build)\n' >&2

0 commit comments

Comments
 (0)