Marquis03 commited on
Commit
c8c2e4c
·
verified ·
1 Parent(s): c957a37

commit (part 116)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +7 -0
  2. sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  3. sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  4. sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  5. sohimaster--firefox-passwords-decryptor.3a89885/tests/download.sh +157 -0
  6. sohimaster--firefox-passwords-decryptor.3a89885/tests/executable +3 -0
  7. sohimaster--firefox-passwords-decryptor.3a89885/tests/harbor_prepare_download_env.sh +34 -0
  8. sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym-go.tar.gz +3 -0
  9. sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym_evaluator.py +1201 -0
  10. sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym_task.json +270 -0
  11. sohimaster--firefox-passwords-decryptor.3a89885/tests/test.sh +82 -0
  12. sohimaster--firefox-passwords-decryptor.3a89885/tests/workspace.tar.gz +3 -0
  13. solo-io--wasm.d072eb4/environment/Dockerfile +1 -0
  14. solo-io--wasm.d072eb4/tests/Dockerfile +1 -0
  15. sonarsource--docker-sonarqube.2820b78/environment/Dockerfile +65 -0
  16. sonarsource--docker-sonarqube.2820b78/environment/download.sh +138 -0
  17. sonarsource--docker-sonarqube.2820b78/environment/executable +3 -0
  18. sonarsource--docker-sonarqube.2820b78/environment/harbor_prepare_download_env.sh +34 -0
  19. sonarsource--docker-sonarqube.2820b78/environment/programgym-go.tar.gz +3 -0
  20. sonarsource--docker-sonarqube.2820b78/environment/workspace.tar.gz +3 -0
  21. sonarsource--docker-sonarqube.2820b78/instruction.md +98 -0
  22. sonarsource--docker-sonarqube.2820b78/solution/solve.sh +33 -0
  23. sonarsource--docker-sonarqube.2820b78/task.toml +69 -0
  24. sonarsource--docker-sonarqube.2820b78/tests/Dockerfile +74 -0
  25. sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  26. sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  27. sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  28. sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  29. sonarsource--docker-sonarqube.2820b78/tests/download.sh +138 -0
  30. sonarsource--docker-sonarqube.2820b78/tests/executable +3 -0
  31. sonarsource--docker-sonarqube.2820b78/tests/harbor_prepare_download_env.sh +34 -0
  32. sonarsource--docker-sonarqube.2820b78/tests/programgym-go.tar.gz +3 -0
  33. sonarsource--docker-sonarqube.2820b78/tests/programgym_evaluator.py +1201 -0
  34. sonarsource--docker-sonarqube.2820b78/tests/programgym_task.json +266 -0
  35. sonarsource--docker-sonarqube.2820b78/tests/test.sh +82 -0
  36. sonarsource--docker-sonarqube.2820b78/tests/workspace.tar.gz +3 -0
  37. sony--gobreaker.fed8e9e/environment/Dockerfile +1 -0
  38. sony--gobreaker.fed8e9e/tests/Dockerfile +1 -0
  39. sorah--envchain.d244e6a/environment/Dockerfile +1 -0
  40. sorah--envchain.d244e6a/tests/Dockerfile +1 -0
  41. sorah--subsystemctl.cf112a2/environment/Dockerfile +1 -0
  42. sorah--subsystemctl.cf112a2/tests/Dockerfile +1 -0
  43. soulteary--certs-maker.548a147/environment/Dockerfile +1 -0
  44. soulteary--certs-maker.548a147/tests/Dockerfile +1 -0
  45. soundnesslabs--soundness-layer.b0fd690/environment/Dockerfile +60 -0
  46. soundnesslabs--soundness-layer.b0fd690/environment/download.sh +2390 -0
  47. soundnesslabs--soundness-layer.b0fd690/environment/executable +3 -0
  48. soundnesslabs--soundness-layer.b0fd690/environment/harbor_prepare_download_env.sh +37 -0
  49. soundnesslabs--soundness-layer.b0fd690/environment/workspace.tar.gz +3 -0
  50. soundnesslabs--soundness-layer.b0fd690/instruction.md +98 -0
.gitattributes CHANGED
@@ -3661,3 +3661,10 @@ softprops--envy.8eb504f/tests/executable filter=lfs diff=lfs merge=lfs -text
3661
  sohamkamani--detective.8afc2e7/environment/executable filter=lfs diff=lfs merge=lfs -text
3662
  sohamkamani--detective.8afc2e7/tests/executable filter=lfs diff=lfs merge=lfs -text
3663
  sohimaster--firefox-passwords-decryptor.3a89885/environment/executable filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
3661
  sohamkamani--detective.8afc2e7/environment/executable filter=lfs diff=lfs merge=lfs -text
3662
  sohamkamani--detective.8afc2e7/tests/executable filter=lfs diff=lfs merge=lfs -text
3663
  sohimaster--firefox-passwords-decryptor.3a89885/environment/executable filter=lfs diff=lfs merge=lfs -text
3664
+ sohimaster--firefox-passwords-decryptor.3a89885/tests/executable filter=lfs diff=lfs merge=lfs -text
3665
+ sonarsource--docker-sonarqube.2820b78/environment/executable filter=lfs diff=lfs merge=lfs -text
3666
+ sonarsource--docker-sonarqube.2820b78/tests/executable filter=lfs diff=lfs merge=lfs -text
3667
+ soundnesslabs--soundness-layer.b0fd690/environment/executable filter=lfs diff=lfs merge=lfs -text
3668
+ soundnesslabs--soundness-layer.b0fd690/tests/executable filter=lfs diff=lfs merge=lfs -text
3669
+ sourcegraph--syntaxhighlight.bd320f5/environment/executable filter=lfs diff=lfs merge=lfs -text
3670
+ sourcegraph--syntaxhighlight.bd320f5/tests/executable filter=lfs diff=lfs merge=lfs -text
sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c3a959608af64c5abf128de779e9299e13ff811982765ed5703be20b554e461
3
+ size 12587
sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcec23677c77cac4d7a9ec615626abe7e6afb78f916853b247e8cbefabdfa161
3
+ size 13692
sohimaster--firefox-passwords-decryptor.3a89885/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df159ba4bf34b7a1c7ab8137d028d4d93683176690e870be0bdbdcf37e4bc408
3
+ size 7454
sohimaster--firefox-passwords-decryptor.3a89885/tests/download.sh ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
3
+ # Generated deterministically from repository module metadata; do not edit.
4
+ set -u
5
+ export GOTOOLCHAIN=auto
6
+ mkdir -p /workspace/.programgym_build_env/go-prefetch
7
+ cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
8
+ module github.com/sohimaster/Firefox-Passwords-Decryptor
9
+
10
+ go 1.19
11
+
12
+ require (
13
+ github.com/mattn/go-sqlite3 v1.14.16
14
+ golang.org/x/crypto v0.8.0
15
+ )
16
+ PROGRAMGYM_GO_MOD_EOF
17
+ cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
18
+ github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
19
+ github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
20
+ golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
21
+ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
22
+ PROGRAMGYM_GO_SUM_EOF
23
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
24
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
25
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
26
+ *"|"*|*","*)
27
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
28
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
29
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
30
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
31
+ fi
32
+ ;;
33
+ esac
34
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
35
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
36
+ fi
37
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
38
+ import os
39
+ import signal
40
+ import subprocess
41
+ import sys
42
+ import time
43
+
44
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
45
+ if not command:
46
+ raise SystemExit(125)
47
+ environment = os.environ.copy()
48
+ environment["GOPROXY"] = proxy
49
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
50
+ try:
51
+ returncode = process.wait(timeout=float(timeout_text))
52
+ except subprocess.TimeoutExpired:
53
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
54
+ sentinel.write("expired\n")
55
+ try:
56
+ os.killpg(process.pid, signal.SIGTERM)
57
+ except ProcessLookupError:
58
+ pass
59
+ deadline = time.monotonic() + float(grace_text)
60
+ group_alive = True
61
+ while time.monotonic() < deadline:
62
+ process.poll()
63
+ try:
64
+ os.killpg(process.pid, 0)
65
+ except ProcessLookupError:
66
+ group_alive = False
67
+ break
68
+ time.sleep(0.05)
69
+ if group_alive:
70
+ try:
71
+ os.killpg(process.pid, signal.SIGKILL)
72
+ except ProcessLookupError:
73
+ pass
74
+ process.wait()
75
+ raise SystemExit(124)
76
+ if returncode < 0:
77
+ returncode = 128 - returncode
78
+ raise SystemExit(returncode)
79
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
80
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
81
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
82
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
83
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
84
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
85
+ return 1
86
+ else
87
+ exit 1
88
+ fi
89
+ fi
90
+ if ! command -v python3 >/dev/null 2>&1; then
91
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
92
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
93
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
94
+ return 1
95
+ else
96
+ exit 1
97
+ fi
98
+ fi
99
+ _programgym_go_with_nexus_timeout() {
100
+ local programgym_go_rc
101
+ local programgym_go_timeout_sentinel
102
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
103
+ return 1
104
+ fi
105
+ if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
106
+ programgym_go_rc=0
107
+ else
108
+ programgym_go_rc=$?
109
+ fi
110
+ if [ ! -s "$programgym_go_timeout_sentinel" ]; then
111
+ rm -f "$programgym_go_timeout_sentinel"
112
+ return "$programgym_go_rc"
113
+ fi
114
+ rm -f "$programgym_go_timeout_sentinel"
115
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
116
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
117
+ return "$programgym_go_rc"
118
+ fi
119
+ printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
120
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
121
+ }
122
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
123
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
124
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
125
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
126
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
127
+ return 1
128
+ else
129
+ exit 1
130
+ fi
131
+ fi
132
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
133
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
134
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
135
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
136
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
137
+ else
138
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
139
+ fi
140
+ export PATH="$GOROOT/bin:$PATH"
141
+ export GOTOOLCHAIN=local
142
+ if ! (cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
143
+ printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
144
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
145
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
146
+ return 1
147
+ else
148
+ exit 1
149
+ fi
150
+ fi
151
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
152
+ unset -f _programgym_go_with_nexus_timeout
153
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
154
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
155
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
156
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
157
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
sohimaster--firefox-passwords-decryptor.3a89885/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53e25dc4579b941ce37b32761ff1516f0b7c36f437383b3bef7296be36bddb1f
3
+ size 7608864
sohimaster--firefox-passwords-decryptor.3a89885/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym-go.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
3
+ size 59908810
sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
sohimaster--firefox-passwords-decryptor.3a89885/tests/programgym_task.json ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_history_branch.test_history_both_flags_runs_history_only",
9
+ "eval.tests.test_history_branch.test_history_creates_temp_copy_then_cleans",
10
+ "eval.tests.test_history_branch.test_history_error_does_not_reach_passwords",
11
+ "eval.tests.test_history_branch.test_history_missing_profile_prevents_db",
12
+ "eval.tests.test_history_branch.test_history_two_complete_profiles_first_selected",
13
+ "eval.tests.test_history_branch.test_history_with_valid_places_reports_query_error",
14
+ "eval.tests.test_main_flags.test_defaults_to_passwords_not_history",
15
+ "eval.tests.test_main_flags.test_explicit_false_flags_still_default_to_passwords",
16
+ "eval.tests.test_main_flags.test_explicit_history_true_uses_history_branch",
17
+ "eval.tests.test_main_flags.test_flag_explicit_true_forms[-history0]",
18
+ "eval.tests.test_main_flags.test_flag_explicit_true_forms[-history1]",
19
+ "eval.tests.test_main_flags.test_flag_explicit_true_forms[-passwords0]",
20
+ "eval.tests.test_main_flags.test_flag_explicit_true_forms[-passwords1]",
21
+ "eval.tests.test_main_flags.test_help_does_not_look_up_profile",
22
+ "eval.tests.test_main_flags.test_help_prints_usage_to_stderr_exit_0[long-help]",
23
+ "eval.tests.test_main_flags.test_help_prints_usage_to_stderr_exit_0[short-help]",
24
+ "eval.tests.test_main_flags.test_missing_profile_dir_reports_error[history-flag]",
25
+ "eval.tests.test_main_flags.test_missing_profile_dir_reports_error[no-flags]",
26
+ "eval.tests.test_main_flags.test_missing_profile_dir_reports_error[passwords-flag]",
27
+ "eval.tests.test_main_flags.test_no_flags_unknown_home_dir",
28
+ "eval.tests.test_main_flags.test_unknown_flag_rejected_exit_2",
29
+ "eval.tests.test_main_flags.test_unknown_flag_via_space_value",
30
+ "eval.tests.test_passwords_branch.test_passwords_does_not_print_history",
31
+ "eval.tests.test_passwords_branch.test_passwords_empty_logins_file",
32
+ "eval.tests.test_passwords_branch.test_passwords_empty_logins_json",
33
+ "eval.tests.test_passwords_branch.test_passwords_json_without_logins_key",
34
+ "eval.tests.test_passwords_branch.test_passwords_malformed_logins_json",
35
+ "eval.tests.test_passwords_branch.test_passwords_multiple_logins_all_reach_extraction",
36
+ "eval.tests.test_passwords_branch.test_passwords_profile_gone_errors_first",
37
+ "eval.tests.test_passwords_branch.test_passwords_valid_logins_missing_key4_table",
38
+ "eval.tests.test_profile_lookup.test_complete_profile_prints_path",
39
+ "eval.tests.test_profile_lookup.test_empty_firefox_dir_returns_no_profile",
40
+ "eval.tests.test_profile_lookup.test_extra_unlisted_files_still_complete",
41
+ "eval.tests.test_profile_lookup.test_first_complete_profile_wins_in_directory_order",
42
+ "eval.tests.test_profile_lookup.test_incomplete_profile_missing_one_file[missing-cookies.sqlite]",
43
+ "eval.tests.test_profile_lookup.test_incomplete_profile_missing_one_file[missing-key4.db]",
44
+ "eval.tests.test_profile_lookup.test_incomplete_profile_missing_one_file[missing-logins.json]",
45
+ "eval.tests.test_profile_lookup.test_incomplete_profile_missing_one_file[missing-places.sqlite]",
46
+ "eval.tests.test_profile_lookup.test_missing_home_itself",
47
+ "eval.tests.test_profile_lookup.test_missing_mozilla_dir",
48
+ "eval.tests.test_profile_lookup.test_only_files_in_firefox_dir_returns_no_profile",
49
+ "eval.tests.test_profile_lookup.test_profile_path_is_absolute_and_joined",
50
+ "eval.tests.test_profile_lookup.test_two_complete_profiles_uses_first"
51
+ ]
52
+ },
53
+ "generated_module_02": {
54
+ "ignore_reason": "",
55
+ "ignored": false,
56
+ "ignored_tests": [],
57
+ "tests": [
58
+ "eval.tests.test_cli_args.test_default_sets_passwords_flag",
59
+ "eval.tests.test_cli_args.test_help_flag_usage_on_stderr[--help]",
60
+ "eval.tests.test_cli_args.test_help_flag_usage_on_stderr[-h]",
61
+ "eval.tests.test_cli_args.test_help_short_flag_same_as_long",
62
+ "eval.tests.test_cli_args.test_no_profile_error_message[both-flags]",
63
+ "eval.tests.test_cli_args.test_no_profile_error_message[default-no-flags]",
64
+ "eval.tests.test_cli_args.test_no_profile_error_message[explicit-passwords]",
65
+ "eval.tests.test_cli_args.test_no_profile_error_message[history-only]",
66
+ "eval.tests.test_cli_args.test_no_profile_error_message[positional-arg]",
67
+ "eval.tests.test_cli_args.test_unknown_flag_reports_error_and_usage[--bogus]",
68
+ "eval.tests.test_cli_args.test_unknown_flag_reports_error_and_usage[--passwordss]",
69
+ "eval.tests.test_cli_args.test_unknown_flag_reports_error_and_usage[-x]",
70
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[asn1-garbage-password]",
71
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[bad-base64-password]",
72
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[bad-base64-username]",
73
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[new-format-keyid-mismatch]",
74
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[new-format-too-short]",
75
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[password-bad-ciphertext-length]",
76
+ "eval.tests.test_decrypt.test_decrypt_field_failures_warn_and_continue[username-bad-ciphertext-length]",
77
+ "eval.tests.test_decrypt.test_decrypt_multiple_credentials_preserves_order",
78
+ "eval.tests.test_decrypt.test_decrypt_single_credential[admin]",
79
+ "eval.tests.test_decrypt.test_decrypt_single_credential[alice]",
80
+ "eval.tests.test_decrypt.test_decrypt_single_credential[bob]",
81
+ "eval.tests.test_decrypt.test_decrypt_single_credential[carol]",
82
+ "eval.tests.test_decrypt.test_https_and_http_urls_preserved",
83
+ "eval.tests.test_decrypt.test_mixed_failures_and_success_continue",
84
+ "eval.tests.test_decrypt.test_password_gcm_new_format_decrypt_failure_path",
85
+ "eval.tests.test_gcm_decrypt.test_gcm_bad_keeps_other_logins",
86
+ "eval.tests.test_gcm_decrypt.test_gcm_failure_first_and_last_login_are_independent",
87
+ "eval.tests.test_gcm_decrypt.test_gcm_matching_keyid_password_failure",
88
+ "eval.tests.test_gcm_decrypt.test_gcm_matching_keyid_username_failure",
89
+ "eval.tests.test_gcm_decrypt.test_gcm_new_format_routing_distinct_from_asn1",
90
+ "eval.tests.test_passwords_load.test_empty_logins_with_valid_key4_returns_null",
91
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[bad-asn1]",
92
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[empty-nssprivate]",
93
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[keyid-mismatch]",
94
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[master-too-short]",
95
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[no-metadata]",
96
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[no-nssprivate]",
97
+ "eval.tests.test_passwords_load.test_extract_master_key_failures[not-a-database]",
98
+ "eval.tests.test_passwords_load.test_invalid_logins_json_parse_error",
99
+ "eval.tests.test_passwords_load.test_logins_json_wrong_type_rejected",
100
+ "eval.tests.test_passwords_load.test_valid_master_key_success_prefix",
101
+ "eval.tests.test_profile_discovery.test_complete_but_broken_logins_profile_still_discovered",
102
+ "eval.tests.test_profile_discovery.test_incomplete_profile_rejected[missing-cookies]",
103
+ "eval.tests.test_profile_discovery.test_incomplete_profile_rejected[missing-key4]",
104
+ "eval.tests.test_profile_discovery.test_incomplete_profile_rejected[missing-logins]",
105
+ "eval.tests.test_profile_discovery.test_incomplete_profile_rejected[missing-places]",
106
+ "eval.tests.test_profile_discovery.test_no_mozilla_dir_reports_missing_directory",
107
+ "eval.tests.test_remove_padding.test_remove_padding_bad_keeps_other_logins",
108
+ "eval.tests.test_remove_padding.test_remove_padding_branch_yields_empty_field[remove-padding-empty-ciphertext]",
109
+ "eval.tests.test_remove_padding.test_remove_padding_branch_yields_empty_field[remove-padding-invalid-padding-value]",
110
+ "eval.tests.test_remove_padding.test_remove_padding_branch_yields_empty_field[remove-padding-nonmatching-padding-byte]",
111
+ "eval.tests.test_remove_padding.test_remove_padding_empty_ciphertext_username_and_password"
112
+ ]
113
+ },
114
+ "generated_module_03": {
115
+ "ignore_reason": "",
116
+ "ignored": false,
117
+ "ignored_tests": [],
118
+ "tests": [
119
+ "eval.tests.test_crypto_3des.test_3des_cbc_login_decrypts_success[valid_3des-carol@example.net-Tr0ub4dor&3-https://example.net]",
120
+ "eval.tests.test_crypto_3des.test_3des_cbc_login_decrypts_success[valid_mixed-des@mixed-des-pw-https://des.example]",
121
+ "eval.tests.test_crypto_3des.test_3des_non_block_multiple_fails",
122
+ "eval.tests.test_crypto_aes_gcm.test_gcm_bad_tag_fails",
123
+ "eval.tests.test_crypto_aes_gcm.test_gcm_key_id_mismatch_skips_login",
124
+ "eval.tests.test_crypto_aes_gcm.test_gcm_login_decrypts_success[valid_gcm-alice@example.org-p@ssw0rd-42-https://example.org]",
125
+ "eval.tests.test_crypto_aes_gcm.test_gcm_login_decrypts_success[valid_mixed-gcm@mixed-gcm-pw-https://gcm.example]",
126
+ "eval.tests.test_crypto_io.test_default_flag_is_passwords",
127
+ "eval.tests.test_crypto_io.test_history_flag_no_credentials",
128
+ "eval.tests.test_crypto_io.test_incomplete_profile_not_selected",
129
+ "eval.tests.test_crypto_io.test_logins_corrupt_base64_field",
130
+ "eval.tests.test_crypto_io.test_logins_json_empty_logins",
131
+ "eval.tests.test_crypto_io.test_logins_json_invalid_json",
132
+ "eval.tests.test_crypto_io.test_mixed_gcm_and_3des_logins",
133
+ "eval.tests.test_crypto_io.test_multiple_logins_all_decrypted",
134
+ "eval.tests.test_crypto_io.test_new_format_field_too_short",
135
+ "eval.tests.test_crypto_io.test_no_profile_detected_when_home_has_no_firefox_dir",
136
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_bad_padding_master_key_too_short",
137
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_ciphertext_not_block_multiple",
138
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_master_key_decrypts_success[empty_global_salt-empty@gsalt-pw-empty-https://gsalt.example]",
139
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_master_key_decrypts_success[iter_1-iter1@usr-pw-iter1-https://iter1.example]",
140
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_master_key_decrypts_success[iter_50000-iter50k@usr-pw-iter50k-https://iter50k.example]",
141
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_master_key_decrypts_success[keylen_16-keylen16@usr-pw-kl16-https://kl16.example]",
142
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_master_key_decrypts_success[valid_gcm-alice@example.org-p@ssw0rd-42-https://example.org]",
143
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_short_derived_key_aes_error",
144
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_pbes2_unsupported_algorithm",
145
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_profile_garbage_private_key_asn1",
146
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_profile_missing_aes_ckaid_mismatch",
147
+ "eval.tests.test_crypto_pbes2_aes_cbc.test_profile_missing_global_salt"
148
+ ]
149
+ },
150
+ "generated_module_04": {
151
+ "ignore_reason": "",
152
+ "ignored": false,
153
+ "ignored_tests": [],
154
+ "tests": [
155
+ "eval.tests.test_history.TestHistoryDeterminism.test_three_runs_no_temp_accumulation",
156
+ "eval.tests.test_history.TestHistoryDeterminism.test_two_runs_produce_consistent_error",
157
+ "eval.tests.test_history.TestHistoryFlagGating.test_history_false_never_reaches_history[history_false_only]",
158
+ "eval.tests.test_history.TestHistoryFlagGating.test_history_false_never_reaches_history[history_false_with_passwords]",
159
+ "eval.tests.test_history.TestHistoryPlacesErrorPaths.test_places_is_directory_errors",
160
+ "eval.tests.test_history.TestHistoryPlacesErrorPaths.test_places_read_failure_returns_error",
161
+ "eval.tests.test_history.TestHistoryQueryInvariant.test_binary_garbage_places_is_not_a_database",
162
+ "eval.tests.test_history.TestHistoryQueryInvariant.test_empty_places_sqlite_query_error",
163
+ "eval.tests.test_history.TestHistoryQueryInvariant.test_schema_irrelevant_to_query_error",
164
+ "eval.tests.test_history.TestHistoryQueryInvariant.test_valid_sqlite_places_still_query_error",
165
+ "eval.tests.test_history.TestHistoryTempCopy.test_clean_temp_keeps_original_places_file",
166
+ "eval.tests.test_history.TestHistoryTempCopy.test_complete_set_all_present_after_history",
167
+ "eval.tests.test_history.TestHistoryTempCopy.test_only_original_places_remains_after_run",
168
+ "eval.tests.test_history.TestHistoryTempCopy.test_temp_copy_is_cleaned_up_after_run",
169
+ "eval.tests.test_history.TestTempCopyNaming.test_combined_history_and_passwords_flags",
170
+ "eval.tests.test_history.TestTempCopyNaming.test_db_path_precedes_query_error",
171
+ "eval.tests.test_history.TestTempCopyNaming.test_history_emits_temp_db_path_line",
172
+ "eval.tests.test_history.TestTempCopyNaming.test_temp_copy_basename_inherits_places",
173
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_first_complete_wins_over_later_complete",
174
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_incomplete_then_complete_returns_complete",
175
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_non_directories_in_firefox_dir_ignored",
176
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_profile_discovered_via_default_no_flags",
177
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_profile_discovered_via_passwords_flag",
178
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_profile_not_found_when_all_incomplete_via_passwords",
179
+ "eval.tests.test_profile.TestCompleteProfileDiscovery.test_single_complete_profile",
180
+ "eval.tests.test_profile.TestEmptyProfilesDirectory.test_empty_firefox_dir",
181
+ "eval.tests.test_profile.TestIncompleteProfiles.test_empty_profile_dir",
182
+ "eval.tests.test_profile.TestIncompleteProfiles.test_missing_single_required_file[missing_cookies.sqlite]",
183
+ "eval.tests.test_profile.TestIncompleteProfiles.test_missing_single_required_file[missing_key4.db]",
184
+ "eval.tests.test_profile.TestIncompleteProfiles.test_missing_single_required_file[missing_logins.json]",
185
+ "eval.tests.test_profile.TestIncompleteProfiles.test_missing_single_required_file[missing_places.sqlite]",
186
+ "eval.tests.test_profile.TestIncompleteProfiles.test_partial_file_subsets[one_file]",
187
+ "eval.tests.test_profile.TestIncompleteProfiles.test_partial_file_subsets[three_files]",
188
+ "eval.tests.test_profile.TestIncompleteProfiles.test_partial_file_subsets[two_files]",
189
+ "eval.tests.test_profile.TestIncompleteProfiles.test_partial_file_subsets[two_nonadjacent]",
190
+ "eval.tests.test_profile.TestMissingProfilesLocation.test_firefox_dir_is_a_regular_file",
191
+ "eval.tests.test_profile.TestMissingProfilesLocation.test_home_unset_errors",
192
+ "eval.tests.test_profile.TestMissingProfilesLocation.test_no_firefox_dir_at_all"
193
+ ]
194
+ }
195
+ },
196
+ "commit": "3a89885a1b7e2e128b1ea617bd11cd1d3622513f",
197
+ "data_source": "synthetic_programgym",
198
+ "difficulty": "easy",
199
+ "difficulty_score": 1.377488383376133,
200
+ "eval_clean_hashes": [
201
+ "53e25dc4579b941ce37b32761ff1516f0b7c36f437383b3bef7296be36bddb1f"
202
+ ],
203
+ "input_record": {
204
+ "commit": "3a89885a1b7e2e128b1ea617bd11cd1d3622513f",
205
+ "commits": 9,
206
+ "contributors": 1,
207
+ "difficulty": "easy",
208
+ "difficulty_code_lines": 795,
209
+ "difficulty_has_tests": false,
210
+ "difficulty_product_code_lines": 795,
211
+ "difficulty_runtime_deps": 2,
212
+ "difficulty_score": 1.377488383376133,
213
+ "difficulty_test_code_lines": 0,
214
+ "full_name": "Sohimaster/Firefox-Passwords-Decryptor",
215
+ "github_stars": 215,
216
+ "input_joern_zip": "go_joern/Sohimaster__Firefox-Passwords-Decryptor.zip",
217
+ "joern_status": true,
218
+ "joern_time": 13.602446391014382,
219
+ "language": "go",
220
+ "pb_match": [
221
+ {
222
+ "pb_fullname": "FiloSottile/age",
223
+ "rank": 87,
224
+ "similarity": 0.5480815172195435
225
+ }
226
+ ],
227
+ "repo_age": 2.33,
228
+ "repo_path": "go/Sohimaster__Firefox-Passwords-Decryptor",
229
+ "source": "commit:3a89885a1b7e2e128b1ea617bd11cd1d3622513f",
230
+ "status": "done",
231
+ "url": "https://github.com/Sohimaster/Firefox-Passwords-Decryptor"
232
+ },
233
+ "instance_id": "Sohimaster__Firefox-Passwords-Decryptor.3a89885",
234
+ "language": "go",
235
+ "module_iterations": [
236
+ {
237
+ "actual_iterations": 2,
238
+ "branch_name": "generated_module_01",
239
+ "iteration_limit": 5,
240
+ "module_index": 1,
241
+ "module_kind": "source",
242
+ "termination_reason": "module_coverage_threshold_reached"
243
+ },
244
+ {
245
+ "actual_iterations": 5,
246
+ "branch_name": "generated_module_02",
247
+ "iteration_limit": 5,
248
+ "module_index": 2,
249
+ "module_kind": "source",
250
+ "termination_reason": "max_iterations"
251
+ },
252
+ {
253
+ "actual_iterations": 2,
254
+ "branch_name": "generated_module_03",
255
+ "iteration_limit": 5,
256
+ "module_index": 3,
257
+ "module_kind": "source",
258
+ "termination_reason": "module_coverage_threshold_reached"
259
+ },
260
+ {
261
+ "actual_iterations": 5,
262
+ "branch_name": "generated_module_04",
263
+ "iteration_limit": 5,
264
+ "module_index": 4,
265
+ "module_kind": "source",
266
+ "termination_reason": "early_stopping"
267
+ }
268
+ ],
269
+ "repository": "Sohimaster/Firefox-Passwords-Decryptor"
270
+ }
sohimaster--firefox-passwords-decryptor.3a89885/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
sohimaster--firefox-passwords-decryptor.3a89885/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:add8a164d5d3b65e804f415b62c7f140d53e7e6958ef81f7d407de1b6572b134
3
+ size 7750
solo-io--wasm.d072eb4/environment/Dockerfile CHANGED
@@ -56,3 +56,4 @@ RUN mkdir -p /home/agent \
56
  && chmod 111 /workspace/executable
57
  ENV HOME=/home/agent
58
  WORKDIR /workspace
 
 
56
  && chmod 111 /workspace/executable
57
  ENV HOME=/home/agent
58
  WORKDIR /workspace
59
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
solo-io--wasm.d072eb4/tests/Dockerfile CHANGED
@@ -64,3 +64,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
64
  COPY programgym_task.json /tests/programgym_task.json
65
  COPY blobs/ /tests/blobs/
66
  RUN chmod +x /tests/test.sh
 
 
64
  COPY programgym_task.json /tests/programgym_task.json
65
  COPY blobs/ /tests/blobs/
66
  RUN chmod +x /tests/test.sh
67
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sonarsource--docker-sonarqube.2820b78/environment/Dockerfile ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
4
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
5
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
7
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8
+ ENV GOPROXY="https://proxy.golang.org,direct"
9
+ ENV GOSUMDB=sum.golang.google.cn
10
+ ENV GOTOOLCHAIN=auto
11
+ ENV UV_INSECURE_HOST=""
12
+ ENV UV_INDEX_URL="https://pypi.org/simple"
13
+ ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
14
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
15
+ ENV npm_config_registry="https://registry.npmjs.org/"
16
+ ENV npm_config_strict_ssl=false
17
+ ENV npm_config_cache=/workspace/.cache/npm
18
+ ENV PIP_INDEX_URL="https://pypi.org/simple"
19
+ ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
20
+ ENV PIP_TRUSTED_HOST=""
21
+ ENV HOME=/workspace
22
+ ENV XDG_CACHE_HOME=/workspace/.cache
23
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
24
+ ENV PYTHONUSERBASE=/workspace/.local
25
+ ENV GOROOT=/usr/local/go
26
+ ENV GOPATH=/workspace/.go
27
+ ENV GOCACHE=/workspace/.cache/go-build
28
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
29
+ ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
30
+ ENV PAGER=cat
31
+ ENV MANPAGER=cat
32
+ ENV LESS=-R
33
+ ENV TQDM_DISABLE=1
34
+ ENV VIRTUAL_ENV=/opt/programgym-venv
35
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
36
+ COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
37
+ RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
38
+ RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
39
+ WORKDIR /workspace
40
+ ADD workspace.tar.gz /workspace/
41
+ COPY executable /workspace/executable
42
+ COPY download.sh /workspace/download.sh
43
+ RUN chmod 755 /workspace/download.sh
44
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
45
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
46
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
47
+ && rm -f /workspace/download.sh \
48
+ && rm -f /tmp/harbor_prepare_download_env.sh
49
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
50
+ RUN chmod 111 /workspace/executable
51
+ WORKDIR /workspace
52
+ # programgym-runtime-workspace-cleanup: v1
53
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
54
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
55
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
56
+ # submission handed to the separate verifier. Keep the reference executable
57
+ # execute-only; the oracle temporarily restores owner read permission.
58
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
59
+ RUN mkdir -p /home/agent \
60
+ && chown -R agent:agent /home/agent /workspace \
61
+ && chown agent:agent /workspace/executable \
62
+ && chmod 111 /workspace/executable
63
+ ENV HOME=/home/agent
64
+ WORKDIR /workspace
65
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sonarsource--docker-sonarqube.2820b78/environment/download.sh ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
3
+ # Generated deterministically from repository module metadata; do not edit.
4
+ set -u
5
+ export GOTOOLCHAIN=auto
6
+ mkdir -p /workspace/.programgym_build_env/go-prefetch
7
+ cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
8
+ module github.com/SonarSource/docker-sonarqube/docker-official-images
9
+
10
+ go 1.24.4
11
+ PROGRAMGYM_GO_MOD_EOF
12
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
13
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
14
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
15
+ *"|"*|*","*)
16
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
17
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
18
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
19
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
20
+ fi
21
+ ;;
22
+ esac
23
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
24
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
25
+ fi
26
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
27
+ import os
28
+ import signal
29
+ import subprocess
30
+ import sys
31
+ import time
32
+
33
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
34
+ if not command:
35
+ raise SystemExit(125)
36
+ environment = os.environ.copy()
37
+ environment["GOPROXY"] = proxy
38
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
39
+ try:
40
+ returncode = process.wait(timeout=float(timeout_text))
41
+ except subprocess.TimeoutExpired:
42
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
43
+ sentinel.write("expired\n")
44
+ try:
45
+ os.killpg(process.pid, signal.SIGTERM)
46
+ except ProcessLookupError:
47
+ pass
48
+ deadline = time.monotonic() + float(grace_text)
49
+ group_alive = True
50
+ while time.monotonic() < deadline:
51
+ process.poll()
52
+ try:
53
+ os.killpg(process.pid, 0)
54
+ except ProcessLookupError:
55
+ group_alive = False
56
+ break
57
+ time.sleep(0.05)
58
+ if group_alive:
59
+ try:
60
+ os.killpg(process.pid, signal.SIGKILL)
61
+ except ProcessLookupError:
62
+ pass
63
+ process.wait()
64
+ raise SystemExit(124)
65
+ if returncode < 0:
66
+ returncode = 128 - returncode
67
+ raise SystemExit(returncode)
68
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
69
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
70
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
71
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
72
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
73
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
74
+ return 1
75
+ else
76
+ exit 1
77
+ fi
78
+ fi
79
+ if ! command -v python3 >/dev/null 2>&1; then
80
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
81
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
82
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
83
+ return 1
84
+ else
85
+ exit 1
86
+ fi
87
+ fi
88
+ _programgym_go_with_nexus_timeout() {
89
+ local programgym_go_rc
90
+ local programgym_go_timeout_sentinel
91
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
92
+ return 1
93
+ fi
94
+ if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
95
+ programgym_go_rc=0
96
+ else
97
+ programgym_go_rc=$?
98
+ fi
99
+ if [ ! -s "$programgym_go_timeout_sentinel" ]; then
100
+ rm -f "$programgym_go_timeout_sentinel"
101
+ return "$programgym_go_rc"
102
+ fi
103
+ rm -f "$programgym_go_timeout_sentinel"
104
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
105
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
106
+ return "$programgym_go_rc"
107
+ fi
108
+ printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
109
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
110
+ }
111
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
112
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
113
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
114
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
115
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
116
+ return 1
117
+ else
118
+ exit 1
119
+ fi
120
+ fi
121
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
122
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
123
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
124
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
125
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
126
+ else
127
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
128
+ fi
129
+ export PATH="$GOROOT/bin:$PATH"
130
+ export GOTOOLCHAIN=local
131
+ # No external Go module dependencies to prefetch.
132
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
133
+ unset -f _programgym_go_with_nexus_timeout
134
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
135
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
136
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
137
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
138
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
sonarsource--docker-sonarqube.2820b78/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:660f9a065a13bf68ec52bd1709cd79b8dd43f6072188fe1f702a05e3f3d2bc62
3
+ size 5187684
sonarsource--docker-sonarqube.2820b78/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
sonarsource--docker-sonarqube.2820b78/environment/programgym-go.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
3
+ size 59908810
sonarsource--docker-sonarqube.2820b78/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bea976ff4ae507024dc9399254ac112d765ad20f5b8856e523d151e1d2b9879
3
+ size 2359
sonarsource--docker-sonarqube.2820b78/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior
sonarsource--docker-sonarqube.2820b78/solution/solve.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Oracle-only ceiling check. The reference is execute-only for normal agents;
3
+ # because the oracle runs as the owning `agent` user it can temporarily add read
4
+ # permission and encode the binary for Harbor's normal artifact handoff.
5
+ set -euo pipefail
6
+ test -f ./executable
7
+ chmod u+r ./executable
8
+ python3 - <<'PY'
9
+ import base64
10
+ from pathlib import Path
11
+
12
+ Path(".programgym_oracle_reference").write_bytes(
13
+ base64.b64encode(Path("executable").read_bytes())
14
+ )
15
+ PY
16
+ chmod u-r ./executable
17
+ cat > compile.sh <<'EOF'
18
+ #!/usr/bin/env bash
19
+ set -euo pipefail
20
+ if [ -f ./.programgym_oracle_reference ]; then
21
+ python3 - <<'PY'
22
+ import base64
23
+ from pathlib import Path
24
+
25
+ Path("executable").write_bytes(
26
+ base64.b64decode(Path(".programgym_oracle_reference").read_bytes())
27
+ )
28
+ PY
29
+ fi
30
+ test -f ./executable
31
+ chmod +x ./executable
32
+ EOF
33
+ chmod +x compile.sh
sonarsource--docker-sonarqube.2820b78/task.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ source = "ProgramGym"
3
+ artifacts = [
4
+ "/logs/verifier/programgym_eval.json",
5
+ "/logs/verifier/harbor_diagnostics.json",
6
+ "/logs/verifier/programgym_eval.log",
7
+ "/logs/verifier/reward.json",
8
+ "/logs/verifier/reward.txt",
9
+ # Keep agent/runtime state out of the submission handoff. In particular,
10
+ # Claude Code installs an absolute symlink under .local/bin; transferring it
11
+ # makes Python's safe tar extraction reject the entire workspace archive.
12
+ { source = "/workspace", exclude = [
13
+ "executable",
14
+ ".git",
15
+ ".bashrc",
16
+ ".cache",
17
+ ".cc-switch",
18
+ ".claude",
19
+ ".local",
20
+ ] },
21
+ ]
22
+
23
+ [task]
24
+ name = "programgym/sonarsource--docker-sonarqube.2820b78"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for SonarSource/docker-sonarqube"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "SonarSource__docker-sonarqube.2820b78"
32
+ repository = "SonarSource/docker-sonarqube"
33
+ commit = "2820b787cfd098c13fd6505626cf27fce2dc66e8"
34
+ language = "go"
35
+ difficulty = "easy"
36
+ difficulty_score = 0.37657695705651184
37
+ test_branches = 4
38
+ test_count = 160
39
+
40
+ [agent]
41
+ timeout_sec = 14400
42
+ user = "agent"
43
+ network_mode = "allowlist"
44
+ allowed_hosts = ["api.anthropic.com", "api.openai.com"]
45
+
46
+ [verifier]
47
+ timeout_sec = 7200
48
+ user = "root"
49
+ environment_mode = "separate"
50
+
51
+ [verifier.env]
52
+ PROGRAMGYM_XDIST_WORKERS = "8"
53
+
54
+ [verifier.environment]
55
+ build_timeout_sec = 1800
56
+ cpus = 8
57
+ memory_mb = 16384
58
+ storage_mb = 30720
59
+ gpus = 0
60
+ workdir = "/workspace"
61
+
62
+ [environment]
63
+ network_mode = "public"
64
+ build_timeout_sec = 1800
65
+ cpus = 8
66
+ memory_mb = 16384
67
+ storage_mb = 30720
68
+ gpus = 0
69
+ workdir = "/workspace"
sonarsource--docker-sonarqube.2820b78/tests/Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
4
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
5
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
7
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8
+ ENV GOPROXY="https://proxy.golang.org,direct"
9
+ ENV GOSUMDB=sum.golang.google.cn
10
+ ENV GOTOOLCHAIN=auto
11
+ ENV UV_INSECURE_HOST=""
12
+ ENV UV_INDEX_URL="https://pypi.org/simple"
13
+ ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
14
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
15
+ ENV npm_config_registry="https://registry.npmjs.org/"
16
+ ENV npm_config_strict_ssl=false
17
+ ENV npm_config_cache=/workspace/.cache/npm
18
+ ENV PIP_INDEX_URL="https://pypi.org/simple"
19
+ ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
20
+ ENV PIP_TRUSTED_HOST=""
21
+ ENV HOME=/workspace
22
+ ENV XDG_CACHE_HOME=/workspace/.cache
23
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
24
+ ENV PYTHONUSERBASE=/workspace/.local
25
+ ENV GOROOT=/usr/local/go
26
+ ENV GOPATH=/workspace/.go
27
+ ENV GOCACHE=/workspace/.cache/go-build
28
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
29
+ ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
30
+ ENV PAGER=cat
31
+ ENV MANPAGER=cat
32
+ ENV LESS=-R
33
+ ENV TQDM_DISABLE=1
34
+ ENV VIRTUAL_ENV=/opt/programgym-venv
35
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
36
+ COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
37
+ RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
38
+ RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
39
+ WORKDIR /workspace
40
+ ADD workspace.tar.gz /workspace/
41
+ COPY executable /workspace/executable
42
+ COPY download.sh /workspace/download.sh
43
+ RUN chmod 755 /workspace/download.sh
44
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
45
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
46
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
47
+ && rm -f /workspace/download.sh \
48
+ && rm -f /tmp/harbor_prepare_download_env.sh
49
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
50
+ RUN chmod 111 /workspace/executable
51
+ WORKDIR /workspace
52
+ # programgym-runtime-workspace-cleanup: v1
53
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
54
+ # Harbor uses tests/ as the separate verifier build context. Start with the
55
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
56
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
57
+ && mkdir -p /workspace /tests
58
+
59
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
60
+ # Installing a newer pytest alone leaves that apt package importable and creates
61
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
62
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
63
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
64
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
65
+ RUN python3 -m pip install --break-system-packages \
66
+ --no-cache-dir --disable-pip-version-check \
67
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
68
+
69
+ COPY test.sh /tests/test.sh
70
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
71
+ COPY programgym_task.json /tests/programgym_task.json
72
+ COPY blobs/ /tests/blobs/
73
+ RUN chmod +x /tests/test.sh
74
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_01.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f9de11486f6ad1ca8d385894a451ef23f4a903a53e033a17b8f9b78c5923ee2
3
+ size 8180
sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ca89855a7a55fb8cfd285bc390804612bc1b37ca0227e28f525b812b22bfdb1
3
+ size 7767
sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6151565009e4cd255c9bbe28613f0164833f1f57af9b1e400ff852e5d96f51a
3
+ size 6132
sonarsource--docker-sonarqube.2820b78/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65be8ef90a87ddf9645611a4da7a6bd0d3c7e5f49d06788803fcad19ad41e5cd
3
+ size 7997
sonarsource--docker-sonarqube.2820b78/tests/download.sh ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
3
+ # Generated deterministically from repository module metadata; do not edit.
4
+ set -u
5
+ export GOTOOLCHAIN=auto
6
+ mkdir -p /workspace/.programgym_build_env/go-prefetch
7
+ cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
8
+ module github.com/SonarSource/docker-sonarqube/docker-official-images
9
+
10
+ go 1.24.4
11
+ PROGRAMGYM_GO_MOD_EOF
12
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
13
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
14
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
15
+ *"|"*|*","*)
16
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
17
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
18
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
19
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
20
+ fi
21
+ ;;
22
+ esac
23
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
24
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
25
+ fi
26
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
27
+ import os
28
+ import signal
29
+ import subprocess
30
+ import sys
31
+ import time
32
+
33
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
34
+ if not command:
35
+ raise SystemExit(125)
36
+ environment = os.environ.copy()
37
+ environment["GOPROXY"] = proxy
38
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
39
+ try:
40
+ returncode = process.wait(timeout=float(timeout_text))
41
+ except subprocess.TimeoutExpired:
42
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
43
+ sentinel.write("expired\n")
44
+ try:
45
+ os.killpg(process.pid, signal.SIGTERM)
46
+ except ProcessLookupError:
47
+ pass
48
+ deadline = time.monotonic() + float(grace_text)
49
+ group_alive = True
50
+ while time.monotonic() < deadline:
51
+ process.poll()
52
+ try:
53
+ os.killpg(process.pid, 0)
54
+ except ProcessLookupError:
55
+ group_alive = False
56
+ break
57
+ time.sleep(0.05)
58
+ if group_alive:
59
+ try:
60
+ os.killpg(process.pid, signal.SIGKILL)
61
+ except ProcessLookupError:
62
+ pass
63
+ process.wait()
64
+ raise SystemExit(124)
65
+ if returncode < 0:
66
+ returncode = 128 - returncode
67
+ raise SystemExit(returncode)
68
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
69
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
70
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
71
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
72
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
73
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
74
+ return 1
75
+ else
76
+ exit 1
77
+ fi
78
+ fi
79
+ if ! command -v python3 >/dev/null 2>&1; then
80
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
81
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
82
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
83
+ return 1
84
+ else
85
+ exit 1
86
+ fi
87
+ fi
88
+ _programgym_go_with_nexus_timeout() {
89
+ local programgym_go_rc
90
+ local programgym_go_timeout_sentinel
91
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
92
+ return 1
93
+ fi
94
+ if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
95
+ programgym_go_rc=0
96
+ else
97
+ programgym_go_rc=$?
98
+ fi
99
+ if [ ! -s "$programgym_go_timeout_sentinel" ]; then
100
+ rm -f "$programgym_go_timeout_sentinel"
101
+ return "$programgym_go_rc"
102
+ fi
103
+ rm -f "$programgym_go_timeout_sentinel"
104
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
105
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
106
+ return "$programgym_go_rc"
107
+ fi
108
+ printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
109
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
110
+ }
111
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
112
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
113
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
114
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
115
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
116
+ return 1
117
+ else
118
+ exit 1
119
+ fi
120
+ fi
121
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
122
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
123
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
124
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
125
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
126
+ else
127
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
128
+ fi
129
+ export PATH="$GOROOT/bin:$PATH"
130
+ export GOTOOLCHAIN=local
131
+ # No external Go module dependencies to prefetch.
132
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
133
+ unset -f _programgym_go_with_nexus_timeout
134
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
135
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
136
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
137
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
138
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
sonarsource--docker-sonarqube.2820b78/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:660f9a065a13bf68ec52bd1709cd79b8dd43f6072188fe1f702a05e3f3d2bc62
3
+ size 5187684
sonarsource--docker-sonarqube.2820b78/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
sonarsource--docker-sonarqube.2820b78/tests/programgym-go.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
3
+ size 59908810
sonarsource--docker-sonarqube.2820b78/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
sonarsource--docker-sonarqube.2820b78/tests/programgym_task.json ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_config_errors.test_config_and_branch_index_in_fetch_error",
9
+ "eval.tests.test_config_errors.test_empty_branch_invalid",
10
+ "eval.tests.test_config_errors.test_empty_type_invalid",
11
+ "eval.tests.test_config_errors.test_invalid_type_value",
12
+ "eval.tests.test_config_errors.test_json_object_not_array",
13
+ "eval.tests.test_config_errors.test_malformed_json_non_json",
14
+ "eval.tests.test_config_errors.test_malformed_json_truncated_array",
15
+ "eval.tests.test_config_errors.test_missing_config_file",
16
+ "eval.tests.test_config_errors.test_validation_stops_at_first_invalid_config",
17
+ "eval.tests.test_entry.test_cli_ignores_help_flag",
18
+ "eval.tests.test_entry.test_cli_ignores_positional_args",
19
+ "eval.tests.test_entry.test_output_written_to_cwd",
20
+ "eval.tests.test_fetch_errors.test_branch_not_found_without_commitsha",
21
+ "eval.tests.test_fetch_errors.test_commitsha_not_in_repo",
22
+ "eval.tests.test_fetch_errors.test_dockerfile_missing_sonarqube_version",
23
+ "eval.tests.test_fetch_errors.test_invalid_4part_version_but_valid_extraction",
24
+ "eval.tests.test_fetch_errors.test_missing_communitybuild_dockerfile",
25
+ "eval.tests.test_fetch_errors.test_partial_commercial_dockerfile_set",
26
+ "eval.tests.test_fetch_errors.test_version_with_different_arg_label_rejected",
27
+ "eval.tests.test_success.test_branch_resolution_no_commitsha",
28
+ "eval.tests.test_success.test_commitsha_used_verbatim_for_fetch",
29
+ "eval.tests.test_success.test_community_build_type_tagging",
30
+ "eval.tests.test_success.test_dockerfile_path_order_preserved",
31
+ "eval.tests.test_success.test_empty_config_yields_zero_entries",
32
+ "eval.tests.test_success.test_is_latest_appends_bare_edition_tag",
33
+ "eval.tests.test_success.test_lta_tag_2025_1_uses_major_only",
34
+ "eval.tests.test_success.test_lta_tag_non_2025_1_uses_major_minor",
35
+ "eval.tests.test_success.test_multiple_configs_aggregate_metadata",
36
+ "eval.tests.test_success.test_origin_branch_prefixed_with_refs_heads",
37
+ "eval.tests.test_success.test_per_dockerfile_version_extraction_distinct",
38
+ "eval.tests.test_success.test_success_creates_output_file_and_reports_count",
39
+ "eval.tests.test_success.test_version_field_rendered",
40
+ "eval.tests.test_success.test_without_is_latest_no_bare_tag",
41
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[2025.1.4.100-False-True-Tags: 2025.1.4-developer, 2025.1-developer, 2025-lta-developer]",
42
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[2025.5.0.5000-False-False-Tags: 2025.5.0-developer, 2025.5-developer]",
43
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[2025.5.0.5000-False-True-Tags: 2025.5.0-developer, 2025.5-developer, 2025.5-lta-developer]",
44
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[2025.5.0.5000-True-False-Tags: 2025.5.0-developer, 2025.5-developer, developer]",
45
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[2025.5.0.5000-True-True-Tags: 2025.5.0-developer, 2025.5-developer, 2025.5-lta-developer, developer]",
46
+ "eval.tests.test_tags.test_commercial_tag_matrix_resolved[9.0.1.2-True-False-Tags: 9.0.1-developer, 9.0-developer, developer]",
47
+ "eval.tests.test_tags.test_community_build_tag_matrix[1.2.3.4-community-Tags: 1.2.3.4-community, community, latest]",
48
+ "eval.tests.test_tags.test_community_build_tag_matrix[25.10.0.114319-community-Tags: 25.10.0.114319-community, community, latest]",
49
+ "eval.tests.test_template_errors.test_config_error_precedes_template_error",
50
+ "eval.tests.test_template_errors.test_missing_template_file",
51
+ "eval.tests.test_template_errors.test_template_execute_error_bad_field",
52
+ "eval.tests.test_template_errors.test_template_execute_error_bad_method",
53
+ "eval.tests.test_template_errors.test_template_parse_error"
54
+ ]
55
+ },
56
+ "generated_module_02": {
57
+ "ignore_reason": "",
58
+ "ignored": false,
59
+ "ignored_tests": [],
60
+ "tests": [
61
+ "eval.tests.test_config_file_errors.test_config_file_is_directory_fails",
62
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[array_element]",
63
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[bool_element]",
64
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[numeric_element]",
65
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[object_instead_of_array]",
66
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[trailing_comma]",
67
+ "eval.tests.test_config_file_errors.test_malformed_or_wrong_type_json_fails[trailing_garbage]",
68
+ "eval.tests.test_config_file_errors.test_missing_config_file_fails",
69
+ "eval.tests.test_config_file_errors.test_truncated_json_fails[single_brace]",
70
+ "eval.tests.test_config_file_errors.test_truncated_json_fails[truncated_array]",
71
+ "eval.tests.test_config_file_errors.test_truncated_json_fails[truncated_object]",
72
+ "eval.tests.test_config_parse_more_errors.test_empty_or_blank_file_fails_parse[empty_file]",
73
+ "eval.tests.test_config_parse_more_errors.test_empty_or_blank_file_fails_parse[only_newlines_and_tabs]",
74
+ "eval.tests.test_config_parse_more_errors.test_empty_or_blank_file_fails_parse[only_spaces]",
75
+ "eval.tests.test_config_parse_more_errors.test_invalid_type_with_whitespace_not_trimmed",
76
+ "eval.tests.test_config_parse_more_errors.test_late_index_reported_in_large_array",
77
+ "eval.tests.test_config_parse_more_errors.test_unicode_and_punctuation_in_branch_roundtrips_into_error",
78
+ "eval.tests.test_config_parse_more_errors.test_valid_required_fields_only_reaches_build",
79
+ "eval.tests.test_config_success.test_empty_array_parses_successfully",
80
+ "eval.tests.test_config_success.test_extra_unknown_field_is_ignored",
81
+ "eval.tests.test_config_success.test_multiple_valid_entries_parse",
82
+ "eval.tests.test_config_success.test_null_array_parses_to_empty",
83
+ "eval.tests.test_config_success.test_spaces_in_json_do_not_break_parse",
84
+ "eval.tests.test_config_success.test_type_checked_case_sensitively_via_success",
85
+ "eval.tests.test_config_success.test_valid_single_commercialeditions_leaves_config_module",
86
+ "eval.tests.test_config_success.test_valid_single_communitybuild_leaves_config_module",
87
+ "eval.tests.test_config_validation.test_allowed_types_do_not_fail_validation",
88
+ "eval.tests.test_config_validation.test_both_absent_reports_branch_first",
89
+ "eval.tests.test_config_validation.test_error_short_circuits_after_first_valid_then_invalid",
90
+ "eval.tests.test_config_validation.test_index_reports_first_invalid_element",
91
+ "eval.tests.test_config_validation.test_invalid_type_allowlist[arbitrary_unknown]",
92
+ "eval.tests.test_config_validation.test_invalid_type_allowlist[shortened]",
93
+ "eval.tests.test_config_validation.test_invalid_type_allowlist[underscore_separated]",
94
+ "eval.tests.test_config_validation.test_invalid_type_allowlist[upper_case]",
95
+ "eval.tests.test_config_validation.test_invalid_type_allowlist[wrong_case]",
96
+ "eval.tests.test_config_validation.test_later_index_reported_when_earlier_valid",
97
+ "eval.tests.test_config_validation.test_missing_type_reported",
98
+ "eval.tests.test_config_validation.test_null_branch_is_mandatory_violation",
99
+ "eval.tests.test_config_validation.test_optional_fields_do_not_trigger_validation",
100
+ "eval.tests.test_config_validation.test_validation_error_payload_shape"
101
+ ]
102
+ },
103
+ "generated_module_03": {
104
+ "ignore_reason": "",
105
+ "ignored": false,
106
+ "ignored_tests": [],
107
+ "tests": [
108
+ "eval.tests.test_fetcher.test_commit_sha_overrides_unresolvable_branch",
109
+ "eval.tests.test_fetcher.test_commit_sha_that_does_not_exist_fails_fetch",
110
+ "eval.tests.test_fetcher.test_commits_not_in_config_do_not_reflect_unrelated_branch",
111
+ "eval.tests.test_fetcher.test_fetch_commercial_missing_one_dockerfile_errors[datacenter/app]",
112
+ "eval.tests.test_fetcher.test_fetch_commercial_missing_one_dockerfile_errors[datacenter/search]",
113
+ "eval.tests.test_fetcher.test_fetch_commercial_missing_one_dockerfile_errors[enterprise]",
114
+ "eval.tests.test_fetcher.test_fetch_commercial_sources_all_four_dockerfiles",
115
+ "eval.tests.test_fetcher.test_fetch_community_sources_versioned_content[10.5.2.0-10.5.2.0-community, community, latest]",
116
+ "eval.tests.test_fetcher.test_fetch_community_sources_versioned_content[2024.2.0.1-2024.2.0.1-community, community, latest]",
117
+ "eval.tests.test_fetcher.test_fetch_community_sources_versioned_content[9.9.3.0-9.9.3.0-community, community, latest]",
118
+ "eval.tests.test_fetcher.test_fetch_content_without_valid_version_errors[ARG SONARQUBE_VERSION=10.5\\n]",
119
+ "eval.tests.test_fetcher.test_fetch_content_without_valid_version_errors[FROM u\\nARG OTHER=1.2.3.4\\n]",
120
+ "eval.tests.test_fetcher.test_fetch_content_without_valid_version_errors[FROM ubuntu\\n]",
121
+ "eval.tests.test_fetcher.test_fetch_missing_dockerfile_errors",
122
+ "eval.tests.test_fetcher.test_gitfetch_rewrites_origin_ref_to_heads",
123
+ "eval.tests.test_fetcher.test_output_file_created_on_success",
124
+ "eval.tests.test_fetcher.test_resolve_full_commit_sha_sources_content",
125
+ "eval.tests.test_fetcher.test_resolve_local_branch_sources_content[feature/ci]",
126
+ "eval.tests.test_fetcher.test_resolve_local_branch_sources_content[fix-hot]",
127
+ "eval.tests.test_fetcher.test_resolve_local_branch_sources_content[main]",
128
+ "eval.tests.test_fetcher.test_resolve_tag_ref_sources_content[acme-main-True]",
129
+ "eval.tests.test_fetcher.test_resolve_tag_ref_sources_content[v1.0.0-True]",
130
+ "eval.tests.test_fetcher.test_resolve_tag_ref_sources_content[v2025.1-True]",
131
+ "eval.tests.test_fetcher.test_resolve_unresolvable_branch_fails[HEAD~99]",
132
+ "eval.tests.test_fetcher.test_resolve_unresolvable_branch_fails[bogus/missing/ref]",
133
+ "eval.tests.test_fetcher.test_resolve_unresolvable_branch_fails[does_not_exist]",
134
+ "eval.tests.test_fetcher.test_resolve_unresolvable_branch_fails[no-such-branch-xyz]"
135
+ ]
136
+ },
137
+ "generated_module_04": {
138
+ "ignore_reason": "",
139
+ "ignored": false,
140
+ "ignored_tests": [],
141
+ "tests": [
142
+ "eval.tests.test_dockerfile_paths_and_editions.test_commercial_editions_deployment_editions",
143
+ "eval.tests.test_dockerfile_paths_and_editions.test_commercial_editions_yields_four_entries",
144
+ "eval.tests.test_dockerfile_paths_and_editions.test_community_build_yields_single_entry",
145
+ "eval.tests.test_dockerfile_paths_and_editions.test_multiple_configs_processed_in_order",
146
+ "eval.tests.test_dockerfile_paths_and_editions.test_unknown_build_type_fails",
147
+ "eval.tests.test_error_paths.test_commerce_path_missing_in_repo_fails",
148
+ "eval.tests.test_error_paths.test_config_missing_branch_fails",
149
+ "eval.tests.test_error_paths.test_config_missing_type_fails",
150
+ "eval.tests.test_error_paths.test_json_config_not_an_array_fails",
151
+ "eval.tests.test_error_paths.test_malformed_json_config_fails",
152
+ "eval.tests.test_error_paths.test_missing_config_file_fails",
153
+ "eval.tests.test_error_paths.test_missing_template_fails_after_metadata",
154
+ "eval.tests.test_error_paths.test_unresolvable_branch_without_commit_fails",
155
+ "eval.tests.test_metadata_pipeline.test_architectures_are_hardcoded_in_template",
156
+ "eval.tests.test_metadata_pipeline.test_branch_resolution_reports_commit_sha",
157
+ "eval.tests.test_metadata_pipeline.test_commit_sha_short_circuits_branch_resolution",
158
+ "eval.tests.test_metadata_pipeline.test_distinct_commits_render_distinct_gitcommit",
159
+ "eval.tests.test_metadata_pipeline.test_origin_branch_is_rewritten_to_refs_heads",
160
+ "eval.tests.test_metadata_pipeline.test_single_commit_is_reused_across_entries",
161
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[0.0.0.0]",
162
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[10.5.0.0]",
163
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[100.0.77.3-isLatest]",
164
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[2.0.0.0]",
165
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[2024.12.31.999999-isLatestLTATag]",
166
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[2025.1.0.0-isLatest-isLatestLTATag]",
167
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[2025.1.0.0-isLatestLTATag]",
168
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[2025.10.1.2-isLatestLTATag]",
169
+ "eval.tests.test_tag_matrix.test_commercial_tag_matrix[9.9.3.100196-isLatest]",
170
+ "eval.tests.test_tag_matrix.test_community_tag_matrix[0.1.0.0]",
171
+ "eval.tests.test_tag_matrix.test_community_tag_matrix[2025.5.0.108892]",
172
+ "eval.tests.test_tag_matrix.test_community_tag_matrix[25.6.0.109173]",
173
+ "eval.tests.test_tag_matrix.test_community_tag_matrix[9.9.8.100196]",
174
+ "eval.tests.test_tag_matrix.test_community_tags_ignore_all_modifier_flags[latest]",
175
+ "eval.tests.test_tag_matrix.test_community_tags_ignore_all_modifier_flags[lta]",
176
+ "eval.tests.test_tag_matrix.test_community_tags_ignore_all_modifier_flags[lts]",
177
+ "eval.tests.test_tag_matrix.test_crlf_line_endings_dockerfile",
178
+ "eval.tests.test_tag_matrix.test_lowercase_comment_does_not_match",
179
+ "eval.tests.test_tag_matrix.test_version_line_in_middle_of_dockerfile",
180
+ "eval.tests.test_version_tags.test_community_tags_always_latest",
181
+ "eval.tests.test_version_tags.test_is_latest_adds_bare_edition_tag",
182
+ "eval.tests.test_version_tags.test_lta_special_case_2025_1_uses_major_only",
183
+ "eval.tests.test_version_tags.test_lta_tag_appends_lta_suffix",
184
+ "eval.tests.test_version_tags.test_lts_flag_does_not_change_commercial_tags",
185
+ "eval.tests.test_version_tags.test_missing_sonarqube_version_fails",
186
+ "eval.tests.test_version_tags.test_standard_commercial_tags_no_latest",
187
+ "eval.tests.test_version_tags.test_version_with_spaces_is_extracted",
188
+ "eval.tests.test_version_tags.test_version_without_equals_is_extracted"
189
+ ]
190
+ }
191
+ },
192
+ "commit": "2820b787cfd098c13fd6505626cf27fce2dc66e8",
193
+ "data_source": "synthetic_programgym",
194
+ "difficulty": "easy",
195
+ "difficulty_score": 0.37657695705651184,
196
+ "eval_clean_hashes": [
197
+ "660f9a065a13bf68ec52bd1709cd79b8dd43f6072188fe1f702a05e3f3d2bc62"
198
+ ],
199
+ "input_record": {
200
+ "commit": "2820b787cfd098c13fd6505626cf27fce2dc66e8",
201
+ "commits": 487,
202
+ "contributors": 60,
203
+ "difficulty": "easy",
204
+ "difficulty_code_lines": 238,
205
+ "difficulty_has_tests": true,
206
+ "difficulty_product_code_lines": 238,
207
+ "difficulty_runtime_deps": 0,
208
+ "difficulty_score": 0.37657695705651184,
209
+ "difficulty_test_code_lines": 496,
210
+ "full_name": "SonarSource/docker-sonarqube",
211
+ "github_stars": 1557,
212
+ "input_joern_zip": "go_joern/SonarSource__docker-sonarqube.zip",
213
+ "joern_status": true,
214
+ "joern_time": 14.264392074896023,
215
+ "language": "go",
216
+ "pb_match": [
217
+ {
218
+ "pb_fullname": "gabotechs/dep-tree",
219
+ "rank": 895,
220
+ "similarity": 0.4959791302680969
221
+ }
222
+ ],
223
+ "repo_age": 11.25,
224
+ "repo_path": "go/SonarSource__docker-sonarqube",
225
+ "source": "commit:2820b787cfd098c13fd6505626cf27fce2dc66e8",
226
+ "status": "done",
227
+ "url": "https://github.com/SonarSource/docker-sonarqube"
228
+ },
229
+ "instance_id": "SonarSource__docker-sonarqube.2820b78",
230
+ "language": "go",
231
+ "module_iterations": [
232
+ {
233
+ "actual_iterations": 1,
234
+ "branch_name": "generated_module_01",
235
+ "iteration_limit": 5,
236
+ "module_index": 1,
237
+ "module_kind": "source",
238
+ "termination_reason": "coverage_path_attribution_failure"
239
+ },
240
+ {
241
+ "actual_iterations": 1,
242
+ "branch_name": "generated_module_02",
243
+ "iteration_limit": 5,
244
+ "module_index": 2,
245
+ "module_kind": "source",
246
+ "termination_reason": "coverage_path_attribution_failure"
247
+ },
248
+ {
249
+ "actual_iterations": 1,
250
+ "branch_name": "generated_module_03",
251
+ "iteration_limit": 5,
252
+ "module_index": 3,
253
+ "module_kind": "source",
254
+ "termination_reason": "coverage_path_attribution_failure"
255
+ },
256
+ {
257
+ "actual_iterations": 1,
258
+ "branch_name": "generated_module_04",
259
+ "iteration_limit": 5,
260
+ "module_index": 4,
261
+ "module_kind": "source",
262
+ "termination_reason": "coverage_path_attribution_failure"
263
+ }
264
+ ],
265
+ "repository": "SonarSource/docker-sonarqube"
266
+ }
sonarsource--docker-sonarqube.2820b78/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
sonarsource--docker-sonarqube.2820b78/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bea976ff4ae507024dc9399254ac112d765ad20f5b8856e523d151e1d2b9879
3
+ size 2359
sony--gobreaker.fed8e9e/environment/Dockerfile CHANGED
@@ -58,3 +58,4 @@ RUN mkdir -p /home/agent \
58
  && chmod 111 /workspace/executable
59
  ENV HOME=/home/agent
60
  WORKDIR /workspace
 
 
58
  && chmod 111 /workspace/executable
59
  ENV HOME=/home/agent
60
  WORKDIR /workspace
61
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sony--gobreaker.fed8e9e/tests/Dockerfile CHANGED
@@ -66,3 +66,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
66
  COPY programgym_task.json /tests/programgym_task.json
67
  COPY blobs/ /tests/blobs/
68
  RUN chmod +x /tests/test.sh
 
 
66
  COPY programgym_task.json /tests/programgym_task.json
67
  COPY blobs/ /tests/blobs/
68
  RUN chmod +x /tests/test.sh
69
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sorah--envchain.d244e6a/environment/Dockerfile CHANGED
@@ -54,3 +54,4 @@ RUN mkdir -p /home/agent \
54
  && chmod 111 /workspace/executable
55
  ENV HOME=/home/agent
56
  WORKDIR /workspace
 
 
54
  && chmod 111 /workspace/executable
55
  ENV HOME=/home/agent
56
  WORKDIR /workspace
57
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sorah--envchain.d244e6a/tests/Dockerfile CHANGED
@@ -68,3 +68,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
68
  COPY programgym_task.json /tests/programgym_task.json
69
  COPY blobs/ /tests/blobs/
70
  RUN chmod +x /tests/test.sh
 
 
68
  COPY programgym_task.json /tests/programgym_task.json
69
  COPY blobs/ /tests/blobs/
70
  RUN chmod +x /tests/test.sh
71
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sorah--subsystemctl.cf112a2/environment/Dockerfile CHANGED
@@ -57,3 +57,4 @@ RUN mkdir -p /home/agent \
57
  && chmod 111 /workspace/executable
58
  ENV HOME=/home/agent
59
  WORKDIR /workspace
 
 
57
  && chmod 111 /workspace/executable
58
  ENV HOME=/home/agent
59
  WORKDIR /workspace
60
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
sorah--subsystemctl.cf112a2/tests/Dockerfile CHANGED
@@ -66,3 +66,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
66
  COPY programgym_task.json /tests/programgym_task.json
67
  COPY blobs/ /tests/blobs/
68
  RUN chmod +x /tests/test.sh
 
 
66
  COPY programgym_task.json /tests/programgym_task.json
67
  COPY blobs/ /tests/blobs/
68
  RUN chmod +x /tests/test.sh
69
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
soulteary--certs-maker.548a147/environment/Dockerfile CHANGED
@@ -62,3 +62,4 @@ RUN mkdir -p /home/agent \
62
  && chmod 111 /workspace/executable
63
  ENV HOME=/home/agent
64
  WORKDIR /workspace
 
 
62
  && chmod 111 /workspace/executable
63
  ENV HOME=/home/agent
64
  WORKDIR /workspace
65
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
soulteary--certs-maker.548a147/tests/Dockerfile CHANGED
@@ -71,3 +71,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
71
  COPY programgym_task.json /tests/programgym_task.json
72
  COPY blobs/ /tests/blobs/
73
  RUN chmod +x /tests/test.sh
 
 
71
  COPY programgym_task.json /tests/programgym_task.json
72
  COPY blobs/ /tests/blobs/
73
  RUN chmod +x /tests/test.sh
74
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
soundnesslabs--soundness-layer.b0fd690/environment/Dockerfile ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM rust:1.97.1-bookworm
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
4
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
5
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
7
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8
+ ENV GOPROXY="https://proxy.golang.org,direct"
9
+ ENV GOSUMDB=sum.golang.google.cn
10
+ ENV GOTOOLCHAIN=auto
11
+ ENV UV_INSECURE_HOST=""
12
+ ENV UV_INDEX_URL="https://pypi.org/simple"
13
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
14
+ ENV npm_config_registry="https://registry.npmjs.org/"
15
+ ENV npm_config_strict_ssl=false
16
+ ENV npm_config_cache=/workspace/.cache/npm
17
+ ENV PIP_INDEX_URL="https://pypi.org/simple"
18
+ ENV PIP_TRUSTED_HOST=""
19
+ ENV HOME=/workspace
20
+ ENV XDG_CACHE_HOME=/workspace/.cache
21
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
22
+ ENV PYTHONUSERBASE=/workspace/.local
23
+ ENV CARGO_HOME=/usr/local/cargo
24
+ ENV RUSTUP_HOME=/usr/local/rustup
25
+ ENV RUSTUP_TOOLCHAIN=1.97.1
26
+ ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1
27
+ ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
28
+ ENV PAGER=cat
29
+ ENV MANPAGER=cat
30
+ ENV LESS=-R
31
+ ENV TQDM_DISABLE=1
32
+ RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/*
33
+ RUN rustup component add llvm-tools-preview --toolchain 1.97.1
34
+ RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov"
35
+ RUN rustc --version && cargo --version && rustup show active-toolchain
36
+ WORKDIR /workspace
37
+ ADD workspace.tar.gz /workspace/
38
+ COPY executable /workspace/executable
39
+ COPY download.sh /tmp/programgym-download.sh
40
+ RUN chmod 755 /tmp/programgym-download.sh
41
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
42
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
43
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
44
+ && rm -f /tmp/programgym-download.sh \
45
+ && rm -f /tmp/harbor_prepare_download_env.sh
46
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
47
+ RUN chmod 111 /workspace/executable
48
+ WORKDIR /workspace
49
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
50
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
51
+ # submission handed to the separate verifier. Keep the reference executable
52
+ # execute-only; the oracle temporarily restores owner read permission.
53
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
54
+ RUN mkdir -p /home/agent \
55
+ && chown -R agent:agent /home/agent /workspace \
56
+ && chown agent:agent /workspace/executable \
57
+ && chmod 111 /workspace/executable
58
+ ENV HOME=/home/agent
59
+ WORKDIR /workspace
60
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
soundnesslabs--soundness-layer.b0fd690/environment/download.sh ADDED
@@ -0,0 +1,2390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # download.sh — ProgramGym download phase for SoundnessLabs/soundness-layer.
4
+ #
5
+ # This script is source-safe (run via `source /source_ro/download.sh`).
6
+ # It ONLY prefetches the Cargo dependency closure needed for the offline build
7
+ # of the soundness-cli bin. It does NOT read any repository file (Cargo.toml /
8
+ # Cargo.lock) and does NOT compile, link, or test anything.
9
+ #
10
+ # The offline build in build.sh uses the repository's real
11
+ # soundness-cli/Cargo.toml + Cargo.lock and resolves against the cargo cache.
12
+ # To guarantee the cache contains EXACTLY the closure that the offline build
13
+ # needs, this script generates a temporary Cargo manifest plus the complete
14
+ # Cargo.lock content inline and runs `cargo fetch --manifest-path ... --locked`.
15
+ # With `--locked` and a provided lockfile, cargo downloads precisely the locked
16
+ # package versions, which is the same set the offline build resolves to. This
17
+ # avoids any transitive-resolution drift between the prefetch and the build.
18
+
19
+ # ---- Rust dependency prefetch using a generated manifest + embedded lock ----
20
+ # We must not probe the toolchain and must not read the repo manifests, so all
21
+ # dependency information lives inline here. Generate the manifest and lock in a
22
+ # private temp directory and point cargo at them with --manifest-path.
23
+
24
+ down_dir="${TMPDIR:-/tmp}/soundness_pb_deps"
25
+ mkdir -p "$down_dir"
26
+
27
+ # Temporary manifest. Package identity mirrors the repository's soundness-cli
28
+ # package so the embedded lock below is valid for it.
29
+ cat > "$down_dir/Cargo.toml" <<'EOF'
30
+ # Generated by download.sh for ProgramGym offline prefetch.
31
+ [package]
32
+ name = "soundness-cli"
33
+ version = "0.1.2"
34
+ edition = "2021"
35
+
36
+ [lib]
37
+ name = "soundness_cli"
38
+ path = "src/lib.rs"
39
+
40
+ [dependencies]
41
+ aes-gcm = { version = "0.10", features = [] }
42
+ anyhow = "1.0"
43
+ base64 = "0.21"
44
+ bip39 = { version = "1.0", features = ["rand"] }
45
+ clap = { version = "4.4", features = ["derive"] }
46
+ ed25519-dalek = { version = "2.0", features = ["rand_core"] }
47
+ generic-array = "0.14"
48
+ hex = "0.4"
49
+ indicatif = "0.17"
50
+ once_cell = "1.19"
51
+ pbkdf2 = "0.12"
52
+ rand = "0.8"
53
+ rand_chacha = "0.3"
54
+ rand_core = "0.6"
55
+ reqwest = { version = "0.11", features = ["json"] }
56
+ rpassword = "7.3"
57
+ serde = { version = "1.0", features = ["derive"] }
58
+ serde_json = "1.0"
59
+ sha2 = "0.10"
60
+ tokio = { version = "1.0", features = ["full"] }
61
+ typenum = "1.16"
62
+ tempfile = "3.8"
63
+ EOF
64
+
65
+ # Generate the minimal stub lib referenced by the [lib] section above.
66
+ mkdir -p "$down_dir/src"
67
+ cat > "$down_dir/src/lib.rs" <<'EOF'
68
+ // Stub library body for the dependency-only prefetch manifest.
69
+ EOF
70
+
71
+ # Embedded Cargo.lock: the exact repository lockfile content for the
72
+ # soundness-cli package. `cargo fetch --locked` will download precisely these
73
+ # versions into the cargo cache.
74
+ cat > "$down_dir/Cargo.lock" <<'LOCKEOF'
75
+ # This file is automatically @generated by Cargo.
76
+ # It is not intended for manual editing.
77
+ version = 4
78
+
79
+ [[package]]
80
+ name = "addr2line"
81
+ version = "0.24.2"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
84
+ dependencies = [
85
+ "gimli",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "adler2"
90
+ version = "2.0.0"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
93
+
94
+ [[package]]
95
+ name = "aead"
96
+ version = "0.5.2"
97
+ source = "registry+https://github.com/rust-lang/crates.io-index"
98
+ checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
99
+ dependencies = [
100
+ "crypto-common",
101
+ "generic-array",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "aes"
106
+ version = "0.8.4"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
109
+ dependencies = [
110
+ "cfg-if",
111
+ "cipher",
112
+ "cpufeatures",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "aes-gcm"
117
+ version = "0.10.3"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
120
+ dependencies = [
121
+ "aead",
122
+ "aes",
123
+ "cipher",
124
+ "ctr",
125
+ "ghash",
126
+ "subtle",
127
+ ]
128
+
129
+ [[package]]
130
+ name = "anstream"
131
+ version = "0.6.18"
132
+ source = "registry+https://github.com/rust-lang/crates.io-index"
133
+ checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
134
+ dependencies = [
135
+ "anstyle",
136
+ "anstyle-parse",
137
+ "anstyle-query",
138
+ "anstyle-wincon",
139
+ "colorchoice",
140
+ "is_terminal_polyfill",
141
+ "utf8parse",
142
+ ]
143
+
144
+ [[package]]
145
+ name = "anstyle"
146
+ version = "1.0.10"
147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
148
+ checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
149
+
150
+ [[package]]
151
+ name = "anstyle-parse"
152
+ version = "0.2.6"
153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
154
+ checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
155
+ dependencies = [
156
+ "utf8parse",
157
+ ]
158
+
159
+ [[package]]
160
+ name = "anstyle-query"
161
+ version = "1.1.2"
162
+ source = "registry+https://github.com/rust-lang/crates.io-index"
163
+ checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
164
+ dependencies = [
165
+ "windows-sys 0.59.0",
166
+ ]
167
+
168
+ [[package]]
169
+ name = "anstyle-wincon"
170
+ version = "3.0.7"
171
+ source = "registry+https://github.com/rust-lang/crates.io-index"
172
+ checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
173
+ dependencies = [
174
+ "anstyle",
175
+ "once_cell",
176
+ "windows-sys 0.59.0",
177
+ ]
178
+
179
+ [[package]]
180
+ name = "anyhow"
181
+ version = "1.0.97"
182
+ source = "registry+https://github.com/rust-lang/crates.io-index"
183
+ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
184
+
185
+ [[package]]
186
+ name = "autocfg"
187
+ version = "0.1.8"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78"
190
+ dependencies = [
191
+ "autocfg 1.4.0",
192
+ ]
193
+
194
+ [[package]]
195
+ name = "autocfg"
196
+ version = "1.4.0"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
199
+
200
+ [[package]]
201
+ name = "backtrace"
202
+ version = "0.3.74"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a"
205
+ dependencies = [
206
+ "addr2line",
207
+ "cfg-if",
208
+ "libc",
209
+ "miniz_oxide",
210
+ "object",
211
+ "rustc-demangle",
212
+ "windows-targets 0.52.6",
213
+ ]
214
+
215
+ [[package]]
216
+ name = "base64"
217
+ version = "0.21.7"
218
+ source = "registry+https://github.com/rust-lang/crates.io-index"
219
+ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
220
+
221
+ [[package]]
222
+ name = "base64ct"
223
+ version = "1.6.0"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
226
+
227
+ [[package]]
228
+ name = "bip39"
229
+ version = "1.2.0"
230
+ source = "registry+https://github.com/rust-lang/crates.io-index"
231
+ checksum = "29b9e657de8ff1c3488a4ab77cb51d604eab53415ce34f0bc800f2eac9b13c28"
232
+ dependencies = [
233
+ "bitcoin_hashes",
234
+ "rand 0.6.5",
235
+ "rand_core 0.4.2",
236
+ "serde",
237
+ "unicode-normalization",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "bitcoin_hashes"
242
+ version = "0.11.0"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4"
245
+
246
+ [[package]]
247
+ name = "bitflags"
248
+ version = "1.3.2"
249
+ source = "registry+https://github.com/rust-lang/crates.io-index"
250
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
251
+
252
+ [[package]]
253
+ name = "bitflags"
254
+ version = "2.9.0"
255
+ source = "registry+https://github.com/rust-lang/crates.io-index"
256
+ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
257
+
258
+ [[package]]
259
+ name = "block-buffer"
260
+ version = "0.10.4"
261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
262
+ checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
263
+ dependencies = [
264
+ "generic-array",
265
+ ]
266
+
267
+ [[package]]
268
+ name = "bumpalo"
269
+ version = "3.17.0"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
272
+
273
+ [[package]]
274
+ name = "bytes"
275
+ version = "1.10.1"
276
+ source = "registry+https://github.com/rust-lang/crates.io-index"
277
+ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
278
+
279
+ [[package]]
280
+ name = "cc"
281
+ version = "1.2.16"
282
+ source = "registry+https://github.com/rust-lang/crates.io-index"
283
+ checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
284
+ dependencies = [
285
+ "shlex",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "cfg-if"
290
+ version = "1.0.0"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
293
+
294
+ [[package]]
295
+ name = "cipher"
296
+ version = "0.4.4"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
299
+ dependencies = [
300
+ "crypto-common",
301
+ "inout",
302
+ ]
303
+
304
+ [[package]]
305
+ name = "clap"
306
+ version = "4.5.31"
307
+ source = "registry+https://github.com/rust-lang/crates.io-index"
308
+ checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767"
309
+ dependencies = [
310
+ "clap_builder",
311
+ "clap_derive",
312
+ ]
313
+
314
+ [[package]]
315
+ name = "clap_builder"
316
+ version = "4.5.31"
317
+ source = "registry+https://github.com/rust-lang/crates.io-index"
318
+ checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863"
319
+ dependencies = [
320
+ "anstream",
321
+ "anstyle",
322
+ "clap_lex",
323
+ "strsim",
324
+ ]
325
+
326
+ [[package]]
327
+ name = "clap_derive"
328
+ version = "4.5.28"
329
+ source = "registry+https://github.com/rust-lang/crates.io-index"
330
+ checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed"
331
+ dependencies = [
332
+ "heck",
333
+ "proc-macro2",
334
+ "quote",
335
+ "syn",
336
+ ]
337
+
338
+ [[package]]
339
+ name = "clap_lex"
340
+ version = "0.7.4"
341
+ source = "registry+https://github.com/rust-lang/crates.io-index"
342
+ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
343
+
344
+ [[package]]
345
+ name = "cloudabi"
346
+ version = "0.0.3"
347
+ source = "registry+https://github.com/rust-lang/crates.io-index"
348
+ checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
349
+ dependencies = [
350
+ "bitflags 1.3.2",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "colorchoice"
355
+ version = "1.0.3"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
358
+
359
+ [[package]]
360
+ name = "console"
361
+ version = "0.15.11"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8"
364
+ dependencies = [
365
+ "encode_unicode",
366
+ "libc",
367
+ "once_cell",
368
+ "unicode-width",
369
+ "windows-sys 0.59.0",
370
+ ]
371
+
372
+ [[package]]
373
+ name = "const-oid"
374
+ version = "0.9.6"
375
+ source = "registry+https://github.com/rust-lang/crates.io-index"
376
+ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
377
+
378
+ [[package]]
379
+ name = "core-foundation"
380
+ version = "0.9.4"
381
+ source = "registry+https://github.com/rust-lang/crates.io-index"
382
+ checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
383
+ dependencies = [
384
+ "core-foundation-sys",
385
+ "libc",
386
+ ]
387
+
388
+ [[package]]
389
+ name = "core-foundation-sys"
390
+ version = "0.8.7"
391
+ source = "registry+https://github.com/rust-lang/crates.io-index"
392
+ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
393
+
394
+ [[package]]
395
+ name = "cpufeatures"
396
+ version = "0.2.17"
397
+ source = "registry+https://github.com/rust-lang/crates.io-index"
398
+ checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
399
+ dependencies = [
400
+ "libc",
401
+ ]
402
+
403
+ [[package]]
404
+ name = "crypto-common"
405
+ version = "0.1.6"
406
+ source = "registry+https://github.com/rust-lang/crates.io-index"
407
+ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
408
+ dependencies = [
409
+ "generic-array",
410
+ "rand_core 0.6.4",
411
+ "typenum",
412
+ ]
413
+
414
+ [[package]]
415
+ name = "ctr"
416
+ version = "0.9.2"
417
+ source = "registry+https://github.com/rust-lang/crates.io-index"
418
+ checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
419
+ dependencies = [
420
+ "cipher",
421
+ ]
422
+
423
+ [[package]]
424
+ name = "curve25519-dalek"
425
+ version = "4.1.3"
426
+ source = "registry+https://github.com/rust-lang/crates.io-index"
427
+ checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
428
+ dependencies = [
429
+ "cfg-if",
430
+ "cpufeatures",
431
+ "curve25519-dalek-derive",
432
+ "digest",
433
+ "fiat-crypto",
434
+ "rustc_version",
435
+ "subtle",
436
+ "zeroize",
437
+ ]
438
+
439
+ [[package]]
440
+ name = "curve25519-dalek-derive"
441
+ version = "0.1.1"
442
+ source = "registry+https://github.com/rust-lang/crates.io-index"
443
+ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
444
+ dependencies = [
445
+ "proc-macro2",
446
+ "quote",
447
+ "syn",
448
+ ]
449
+
450
+ [[package]]
451
+ name = "der"
452
+ version = "0.7.9"
453
+ source = "registry+https://github.com/rust-lang/crates.io-index"
454
+ checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0"
455
+ dependencies = [
456
+ "const-oid",
457
+ "zeroize",
458
+ ]
459
+
460
+ [[package]]
461
+ name = "digest"
462
+ version = "0.10.7"
463
+ source = "registry+https://github.com/rust-lang/crates.io-index"
464
+ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
465
+ dependencies = [
466
+ "block-buffer",
467
+ "crypto-common",
468
+ "subtle",
469
+ ]
470
+
471
+ [[package]]
472
+ name = "displaydoc"
473
+ version = "0.2.5"
474
+ source = "registry+https://github.com/rust-lang/crates.io-index"
475
+ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
476
+ dependencies = [
477
+ "proc-macro2",
478
+ "quote",
479
+ "syn",
480
+ ]
481
+
482
+ [[package]]
483
+ name = "ed25519"
484
+ version = "2.2.3"
485
+ source = "registry+https://github.com/rust-lang/crates.io-index"
486
+ checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
487
+ dependencies = [
488
+ "pkcs8",
489
+ "signature",
490
+ ]
491
+
492
+ [[package]]
493
+ name = "ed25519-dalek"
494
+ version = "2.1.1"
495
+ source = "registry+https://github.com/rust-lang/crates.io-index"
496
+ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871"
497
+ dependencies = [
498
+ "curve25519-dalek",
499
+ "ed25519",
500
+ "rand_core 0.6.4",
501
+ "serde",
502
+ "sha2",
503
+ "subtle",
504
+ "zeroize",
505
+ ]
506
+
507
+ [[package]]
508
+ name = "encode_unicode"
509
+ version = "1.0.0"
510
+ source = "registry+https://github.com/rust-lang/crates.io-index"
511
+ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
512
+
513
+ [[package]]
514
+ name = "encoding_rs"
515
+ version = "0.8.35"
516
+ source = "registry+https://github.com/rust-lang/crates.io-index"
517
+ checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
518
+ dependencies = [
519
+ "cfg-if",
520
+ ]
521
+
522
+ [[package]]
523
+ name = "equivalent"
524
+ version = "1.0.2"
525
+ source = "registry+https://github.com/rust-lang/crates.io-index"
526
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
527
+
528
+ [[package]]
529
+ name = "errno"
530
+ version = "0.3.10"
531
+ source = "registry+https://github.com/rust-lang/crates.io-index"
532
+ checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
533
+ dependencies = [
534
+ "libc",
535
+ "windows-sys 0.59.0",
536
+ ]
537
+
538
+ [[package]]
539
+ name = "fastrand"
540
+ version = "2.3.0"
541
+ source = "registry+https://github.com/rust-lang/crates.io-index"
542
+ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
543
+
544
+ [[package]]
545
+ name = "fiat-crypto"
546
+ version = "0.2.9"
547
+ source = "registry+https://github.com/rust-lang/crates.io-index"
548
+ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
549
+
550
+ [[package]]
551
+ name = "fnv"
552
+ version = "1.0.7"
553
+ source = "registry+https://github.com/rust-lang/crates.io-index"
554
+ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
555
+
556
+ [[package]]
557
+ name = "foreign-types"
558
+ version = "0.3.2"
559
+ source = "registry+https://github.com/rust-lang/crates.io-index"
560
+ checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
561
+ dependencies = [
562
+ "foreign-types-shared",
563
+ ]
564
+
565
+ [[package]]
566
+ name = "foreign-types-shared"
567
+ version = "0.1.1"
568
+ source = "registry+https://github.com/rust-lang/crates.io-index"
569
+ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
570
+
571
+ [[package]]
572
+ name = "form_urlencoded"
573
+ version = "1.2.1"
574
+ source = "registry+https://github.com/rust-lang/crates.io-index"
575
+ checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
576
+ dependencies = [
577
+ "percent-encoding",
578
+ ]
579
+
580
+ [[package]]
581
+ name = "fuchsia-cprng"
582
+ version = "0.1.1"
583
+ source = "registry+https://github.com/rust-lang/crates.io-index"
584
+ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
585
+
586
+ [[package]]
587
+ name = "futures-channel"
588
+ version = "0.3.31"
589
+ source = "registry+https://github.com/rust-lang/crates.io-index"
590
+ checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
591
+ dependencies = [
592
+ "futures-core",
593
+ ]
594
+
595
+ [[package]]
596
+ name = "futures-core"
597
+ version = "0.3.31"
598
+ source = "registry+https://github.com/rust-lang/crates.io-index"
599
+ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
600
+
601
+ [[package]]
602
+ name = "futures-sink"
603
+ version = "0.3.31"
604
+ source = "registry+https://github.com/rust-lang/crates.io-index"
605
+ checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
606
+
607
+ [[package]]
608
+ name = "futures-task"
609
+ version = "0.3.31"
610
+ source = "registry+https://github.com/rust-lang/crates.io-index"
611
+ checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
612
+
613
+ [[package]]
614
+ name = "futures-util"
615
+ version = "0.3.31"
616
+ source = "registry+https://github.com/rust-lang/crates.io-index"
617
+ checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
618
+ dependencies = [
619
+ "futures-core",
620
+ "futures-task",
621
+ "pin-project-lite",
622
+ "pin-utils",
623
+ ]
624
+
625
+ [[package]]
626
+ name = "generic-array"
627
+ version = "0.14.7"
628
+ source = "registry+https://github.com/rust-lang/crates.io-index"
629
+ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
630
+ dependencies = [
631
+ "typenum",
632
+ "version_check",
633
+ ]
634
+
635
+ [[package]]
636
+ name = "getrandom"
637
+ version = "0.2.15"
638
+ source = "registry+https://github.com/rust-lang/crates.io-index"
639
+ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
640
+ dependencies = [
641
+ "cfg-if",
642
+ "libc",
643
+ "wasi 0.11.0+wasi-snapshot-preview1",
644
+ ]
645
+
646
+ [[package]]
647
+ name = "getrandom"
648
+ version = "0.3.1"
649
+ source = "registry+https://github.com/rust-lang/crates.io-index"
650
+ checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
651
+ dependencies = [
652
+ "cfg-if",
653
+ "libc",
654
+ "wasi 0.13.3+wasi-0.2.2",
655
+ "windows-targets 0.52.6",
656
+ ]
657
+
658
+ [[package]]
659
+ name = "ghash"
660
+ version = "0.5.1"
661
+ source = "registry+https://github.com/rust-lang/crates.io-index"
662
+ checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1"
663
+ dependencies = [
664
+ "opaque-debug",
665
+ "polyval",
666
+ ]
667
+
668
+ [[package]]
669
+ name = "gimli"
670
+ version = "0.31.1"
671
+ source = "registry+https://github.com/rust-lang/crates.io-index"
672
+ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
673
+
674
+ [[package]]
675
+ name = "h2"
676
+ version = "0.3.26"
677
+ source = "registry+https://github.com/rust-lang/crates.io-index"
678
+ checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
679
+ dependencies = [
680
+ "bytes",
681
+ "fnv",
682
+ "futures-core",
683
+ "futures-sink",
684
+ "futures-util",
685
+ "http",
686
+ "indexmap",
687
+ "slab",
688
+ "tokio",
689
+ "tokio-util",
690
+ "tracing",
691
+ ]
692
+
693
+ [[package]]
694
+ name = "hashbrown"
695
+ version = "0.15.2"
696
+ source = "registry+https://github.com/rust-lang/crates.io-index"
697
+ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
698
+
699
+ [[package]]
700
+ name = "heck"
701
+ version = "0.5.0"
702
+ source = "registry+https://github.com/rust-lang/crates.io-index"
703
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
704
+
705
+ [[package]]
706
+ name = "hex"
707
+ version = "0.4.3"
708
+ source = "registry+https://github.com/rust-lang/crates.io-index"
709
+ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
710
+
711
+ [[package]]
712
+ name = "hmac"
713
+ version = "0.12.1"
714
+ source = "registry+https://github.com/rust-lang/crates.io-index"
715
+ checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
716
+ dependencies = [
717
+ "digest",
718
+ ]
719
+
720
+ [[package]]
721
+ name = "http"
722
+ version = "0.2.12"
723
+ source = "registry+https://github.com/rust-lang/crates.io-index"
724
+ checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
725
+ dependencies = [
726
+ "bytes",
727
+ "fnv",
728
+ "itoa",
729
+ ]
730
+
731
+ [[package]]
732
+ name = "http-body"
733
+ version = "0.4.6"
734
+ source = "registry+https://github.com/rust-lang/crates.io-index"
735
+ checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
736
+ dependencies = [
737
+ "bytes",
738
+ "http",
739
+ "pin-project-lite",
740
+ ]
741
+
742
+ [[package]]
743
+ name = "httparse"
744
+ version = "1.10.1"
745
+ source = "registry+https://github.com/rust-lang/crates.io-index"
746
+ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
747
+
748
+ [[package]]
749
+ name = "httpdate"
750
+ version = "1.0.3"
751
+ source = "registry+https://github.com/rust-lang/crates.io-index"
752
+ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
753
+
754
+ [[package]]
755
+ name = "hyper"
756
+ version = "0.14.32"
757
+ source = "registry+https://github.com/rust-lang/crates.io-index"
758
+ checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
759
+ dependencies = [
760
+ "bytes",
761
+ "futures-channel",
762
+ "futures-core",
763
+ "futures-util",
764
+ "h2",
765
+ "http",
766
+ "http-body",
767
+ "httparse",
768
+ "httpdate",
769
+ "itoa",
770
+ "pin-project-lite",
771
+ "socket2",
772
+ "tokio",
773
+ "tower-service",
774
+ "tracing",
775
+ "want",
776
+ ]
777
+
778
+ [[package]]
779
+ name = "hyper-tls"
780
+ version = "0.5.0"
781
+ source = "registry+https://github.com/rust-lang/crates.io-index"
782
+ checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
783
+ dependencies = [
784
+ "bytes",
785
+ "hyper",
786
+ "native-tls",
787
+ "tokio",
788
+ "tokio-native-tls",
789
+ ]
790
+
791
+ [[package]]
792
+ name = "icu_collections"
793
+ version = "1.5.0"
794
+ source = "registry+https://github.com/rust-lang/crates.io-index"
795
+ checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
796
+ dependencies = [
797
+ "displaydoc",
798
+ "yoke",
799
+ "zerofrom",
800
+ "zerovec",
801
+ ]
802
+
803
+ [[package]]
804
+ name = "icu_locid"
805
+ version = "1.5.0"
806
+ source = "registry+https://github.com/rust-lang/crates.io-index"
807
+ checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
808
+ dependencies = [
809
+ "displaydoc",
810
+ "litemap",
811
+ "tinystr",
812
+ "writeable",
813
+ "zerovec",
814
+ ]
815
+
816
+ [[package]]
817
+ name = "icu_locid_transform"
818
+ version = "1.5.0"
819
+ source = "registry+https://github.com/rust-lang/crates.io-index"
820
+ checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
821
+ dependencies = [
822
+ "displaydoc",
823
+ "icu_locid",
824
+ "icu_locid_transform_data",
825
+ "icu_provider",
826
+ "tinystr",
827
+ "zerovec",
828
+ ]
829
+
830
+ [[package]]
831
+ name = "icu_locid_transform_data"
832
+ version = "1.5.0"
833
+ source = "registry+https://github.com/rust-lang/crates.io-index"
834
+ checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
835
+
836
+ [[package]]
837
+ name = "icu_normalizer"
838
+ version = "1.5.0"
839
+ source = "registry+https://github.com/rust-lang/crates.io-index"
840
+ checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
841
+ dependencies = [
842
+ "displaydoc",
843
+ "icu_collections",
844
+ "icu_normalizer_data",
845
+ "icu_properties",
846
+ "icu_provider",
847
+ "smallvec 1.14.0",
848
+ "utf16_iter",
849
+ "utf8_iter",
850
+ "write16",
851
+ "zerovec",
852
+ ]
853
+
854
+ [[package]]
855
+ name = "icu_normalizer_data"
856
+ version = "1.5.0"
857
+ source = "registry+https://github.com/rust-lang/crates.io-index"
858
+ checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
859
+
860
+ [[package]]
861
+ name = "icu_properties"
862
+ version = "1.5.1"
863
+ source = "registry+https://github.com/rust-lang/crates.io-index"
864
+ checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5"
865
+ dependencies = [
866
+ "displaydoc",
867
+ "icu_collections",
868
+ "icu_locid_transform",
869
+ "icu_properties_data",
870
+ "icu_provider",
871
+ "tinystr",
872
+ "zerovec",
873
+ ]
874
+
875
+ [[package]]
876
+ name = "icu_properties_data"
877
+ version = "1.5.0"
878
+ source = "registry+https://github.com/rust-lang/crates.io-index"
879
+ checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
880
+
881
+ [[package]]
882
+ name = "icu_provider"
883
+ version = "1.5.0"
884
+ source = "registry+https://github.com/rust-lang/crates.io-index"
885
+ checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
886
+ dependencies = [
887
+ "displaydoc",
888
+ "icu_locid",
889
+ "icu_provider_macros",
890
+ "stable_deref_trait",
891
+ "tinystr",
892
+ "writeable",
893
+ "yoke",
894
+ "zerofrom",
895
+ "zerovec",
896
+ ]
897
+
898
+ [[package]]
899
+ name = "icu_provider_macros"
900
+ version = "1.5.0"
901
+ source = "registry+https://github.com/rust-lang/crates.io-index"
902
+ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
903
+ dependencies = [
904
+ "proc-macro2",
905
+ "quote",
906
+ "syn",
907
+ ]
908
+
909
+ [[package]]
910
+ name = "idna"
911
+ version = "1.0.3"
912
+ source = "registry+https://github.com/rust-lang/crates.io-index"
913
+ checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
914
+ dependencies = [
915
+ "idna_adapter",
916
+ "smallvec 1.14.0",
917
+ "utf8_iter",
918
+ ]
919
+
920
+ [[package]]
921
+ name = "idna_adapter"
922
+ version = "1.2.0"
923
+ source = "registry+https://github.com/rust-lang/crates.io-index"
924
+ checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71"
925
+ dependencies = [
926
+ "icu_normalizer",
927
+ "icu_properties",
928
+ ]
929
+
930
+ [[package]]
931
+ name = "indexmap"
932
+ version = "2.7.1"
933
+ source = "registry+https://github.com/rust-lang/crates.io-index"
934
+ checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
935
+ dependencies = [
936
+ "equivalent",
937
+ "hashbrown",
938
+ ]
939
+
940
+ [[package]]
941
+ name = "indicatif"
942
+ version = "0.17.11"
943
+ source = "registry+https://github.com/rust-lang/crates.io-index"
944
+ checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235"
945
+ dependencies = [
946
+ "console",
947
+ "number_prefix",
948
+ "portable-atomic",
949
+ "unicode-width",
950
+ "web-time",
951
+ ]
952
+
953
+ [[package]]
954
+ name = "inout"
955
+ version = "0.1.4"
956
+ source = "registry+https://github.com/rust-lang/crates.io-index"
957
+ checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
958
+ dependencies = [
959
+ "generic-array",
960
+ ]
961
+
962
+ [[package]]
963
+ name = "ipnet"
964
+ version = "2.11.0"
965
+ source = "registry+https://github.com/rust-lang/crates.io-index"
966
+ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
967
+
968
+ [[package]]
969
+ name = "is_terminal_polyfill"
970
+ version = "1.70.1"
971
+ source = "registry+https://github.com/rust-lang/crates.io-index"
972
+ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
973
+
974
+ [[package]]
975
+ name = "itoa"
976
+ version = "1.0.15"
977
+ source = "registry+https://github.com/rust-lang/crates.io-index"
978
+ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
979
+
980
+ [[package]]
981
+ name = "js-sys"
982
+ version = "0.3.77"
983
+ source = "registry+https://github.com/rust-lang/crates.io-index"
984
+ checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
985
+ dependencies = [
986
+ "once_cell",
987
+ "wasm-bindgen",
988
+ ]
989
+
990
+ [[package]]
991
+ name = "libc"
992
+ version = "0.2.170"
993
+ source = "registry+https://github.com/rust-lang/crates.io-index"
994
+ checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
995
+
996
+ [[package]]
997
+ name = "linux-raw-sys"
998
+ version = "0.9.2"
999
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1000
+ checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9"
1001
+
1002
+ [[package]]
1003
+ name = "litemap"
1004
+ version = "0.7.5"
1005
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1006
+ checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856"
1007
+
1008
+ [[package]]
1009
+ name = "lock_api"
1010
+ version = "0.4.12"
1011
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1012
+ checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
1013
+ dependencies = [
1014
+ "autocfg 1.4.0",
1015
+ "scopeguard",
1016
+ ]
1017
+
1018
+ [[package]]
1019
+ name = "log"
1020
+ version = "0.4.26"
1021
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1022
+ checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
1023
+
1024
+ [[package]]
1025
+ name = "maybe-uninit"
1026
+ version = "2.0.0"
1027
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1028
+ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
1029
+
1030
+ [[package]]
1031
+ name = "memchr"
1032
+ version = "2.7.4"
1033
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1034
+ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
1035
+
1036
+ [[package]]
1037
+ name = "mime"
1038
+ version = "0.3.17"
1039
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1040
+ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
1041
+
1042
+ [[package]]
1043
+ name = "miniz_oxide"
1044
+ version = "0.8.5"
1045
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1046
+ checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5"
1047
+ dependencies = [
1048
+ "adler2",
1049
+ ]
1050
+
1051
+ [[package]]
1052
+ name = "mio"
1053
+ version = "1.0.3"
1054
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1055
+ checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
1056
+ dependencies = [
1057
+ "libc",
1058
+ "wasi 0.11.0+wasi-snapshot-preview1",
1059
+ "windows-sys 0.52.0",
1060
+ ]
1061
+
1062
+ [[package]]
1063
+ name = "native-tls"
1064
+ version = "0.2.14"
1065
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1066
+ checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
1067
+ dependencies = [
1068
+ "libc",
1069
+ "log",
1070
+ "openssl",
1071
+ "openssl-probe",
1072
+ "openssl-sys",
1073
+ "schannel",
1074
+ "security-framework",
1075
+ "security-framework-sys",
1076
+ "tempfile",
1077
+ ]
1078
+
1079
+ [[package]]
1080
+ name = "number_prefix"
1081
+ version = "0.4.0"
1082
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1083
+ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
1084
+
1085
+ [[package]]
1086
+ name = "object"
1087
+ version = "0.36.7"
1088
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1089
+ checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
1090
+ dependencies = [
1091
+ "memchr",
1092
+ ]
1093
+
1094
+ [[package]]
1095
+ name = "once_cell"
1096
+ version = "1.20.3"
1097
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1098
+ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
1099
+
1100
+ [[package]]
1101
+ name = "opaque-debug"
1102
+ version = "0.3.1"
1103
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1104
+ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
1105
+
1106
+ [[package]]
1107
+ name = "openssl"
1108
+ version = "0.10.71"
1109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1110
+ checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd"
1111
+ dependencies = [
1112
+ "bitflags 2.9.0",
1113
+ "cfg-if",
1114
+ "foreign-types",
1115
+ "libc",
1116
+ "once_cell",
1117
+ "openssl-macros",
1118
+ "openssl-sys",
1119
+ ]
1120
+
1121
+ [[package]]
1122
+ name = "openssl-macros"
1123
+ version = "0.1.1"
1124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1125
+ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1126
+ dependencies = [
1127
+ "proc-macro2",
1128
+ "quote",
1129
+ "syn",
1130
+ ]
1131
+
1132
+ [[package]]
1133
+ name = "openssl-probe"
1134
+ version = "0.1.6"
1135
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1136
+ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
1137
+
1138
+ [[package]]
1139
+ name = "openssl-sys"
1140
+ version = "0.9.106"
1141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1142
+ checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
1143
+ dependencies = [
1144
+ "cc",
1145
+ "libc",
1146
+ "pkg-config",
1147
+ "vcpkg",
1148
+ ]
1149
+
1150
+ [[package]]
1151
+ name = "parking_lot"
1152
+ version = "0.12.3"
1153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1154
+ checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
1155
+ dependencies = [
1156
+ "lock_api",
1157
+ "parking_lot_core",
1158
+ ]
1159
+
1160
+ [[package]]
1161
+ name = "parking_lot_core"
1162
+ version = "0.9.10"
1163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1164
+ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
1165
+ dependencies = [
1166
+ "cfg-if",
1167
+ "libc",
1168
+ "redox_syscall",
1169
+ "smallvec 1.14.0",
1170
+ "windows-targets 0.52.6",
1171
+ ]
1172
+
1173
+ [[package]]
1174
+ name = "pbkdf2"
1175
+ version = "0.12.2"
1176
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1177
+ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
1178
+ dependencies = [
1179
+ "digest",
1180
+ "hmac",
1181
+ ]
1182
+
1183
+ [[package]]
1184
+ name = "percent-encoding"
1185
+ version = "2.3.1"
1186
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1187
+ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
1188
+
1189
+ [[package]]
1190
+ name = "pin-project-lite"
1191
+ version = "0.2.16"
1192
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1193
+ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1194
+
1195
+ [[package]]
1196
+ name = "pin-utils"
1197
+ version = "0.1.0"
1198
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1199
+ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1200
+
1201
+ [[package]]
1202
+ name = "pkcs8"
1203
+ version = "0.10.2"
1204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1205
+ checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
1206
+ dependencies = [
1207
+ "der",
1208
+ "spki",
1209
+ ]
1210
+
1211
+ [[package]]
1212
+ name = "pkg-config"
1213
+ version = "0.3.32"
1214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1215
+ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
1216
+
1217
+ [[package]]
1218
+ name = "polyval"
1219
+ version = "0.6.2"
1220
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1221
+ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
1222
+ dependencies = [
1223
+ "cfg-if",
1224
+ "cpufeatures",
1225
+ "opaque-debug",
1226
+ "universal-hash",
1227
+ ]
1228
+
1229
+ [[package]]
1230
+ name = "portable-atomic"
1231
+ version = "1.11.0"
1232
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1233
+ checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
1234
+
1235
+ [[package]]
1236
+ name = "ppv-lite86"
1237
+ version = "0.2.21"
1238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1239
+ checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
1240
+ dependencies = [
1241
+ "zerocopy",
1242
+ ]
1243
+
1244
+ [[package]]
1245
+ name = "proc-macro2"
1246
+ version = "1.0.94"
1247
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1248
+ checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
1249
+ dependencies = [
1250
+ "unicode-ident",
1251
+ ]
1252
+
1253
+ [[package]]
1254
+ name = "quote"
1255
+ version = "1.0.39"
1256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1257
+ checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801"
1258
+ dependencies = [
1259
+ "proc-macro2",
1260
+ ]
1261
+
1262
+ [[package]]
1263
+ name = "rand"
1264
+ version = "0.6.5"
1265
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1266
+ checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
1267
+ dependencies = [
1268
+ "autocfg 0.1.8",
1269
+ "libc",
1270
+ "rand_chacha 0.1.1",
1271
+ "rand_core 0.4.2",
1272
+ "rand_hc",
1273
+ "rand_isaac",
1274
+ "rand_jitter",
1275
+ "rand_os",
1276
+ "rand_pcg",
1277
+ "rand_xorshift",
1278
+ "winapi",
1279
+ ]
1280
+
1281
+ [[package]]
1282
+ name = "rand"
1283
+ version = "0.8.5"
1284
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1285
+ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
1286
+ dependencies = [
1287
+ "libc",
1288
+ "rand_chacha 0.3.1",
1289
+ "rand_core 0.6.4",
1290
+ ]
1291
+
1292
+ [[package]]
1293
+ name = "rand_chacha"
1294
+ version = "0.1.1"
1295
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1296
+ checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
1297
+ dependencies = [
1298
+ "autocfg 0.1.8",
1299
+ "rand_core 0.3.1",
1300
+ ]
1301
+
1302
+ [[package]]
1303
+ name = "rand_chacha"
1304
+ version = "0.3.1"
1305
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1306
+ checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
1307
+ dependencies = [
1308
+ "ppv-lite86",
1309
+ "rand_core 0.6.4",
1310
+ ]
1311
+
1312
+ [[package]]
1313
+ name = "rand_core"
1314
+ version = "0.3.1"
1315
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1316
+ checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
1317
+ dependencies = [
1318
+ "rand_core 0.4.2",
1319
+ ]
1320
+
1321
+ [[package]]
1322
+ name = "rand_core"
1323
+ version = "0.4.2"
1324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1325
+ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
1326
+
1327
+ [[package]]
1328
+ name = "rand_core"
1329
+ version = "0.6.4"
1330
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1331
+ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1332
+ dependencies = [
1333
+ "getrandom 0.2.15",
1334
+ ]
1335
+
1336
+ [[package]]
1337
+ name = "rand_hc"
1338
+ version = "0.1.0"
1339
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1340
+ checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
1341
+ dependencies = [
1342
+ "rand_core 0.3.1",
1343
+ ]
1344
+
1345
+ [[package]]
1346
+ name = "rand_isaac"
1347
+ version = "0.1.1"
1348
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1349
+ checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
1350
+ dependencies = [
1351
+ "rand_core 0.3.1",
1352
+ ]
1353
+
1354
+ [[package]]
1355
+ name = "rand_jitter"
1356
+ version = "0.1.4"
1357
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1358
+ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
1359
+ dependencies = [
1360
+ "libc",
1361
+ "rand_core 0.4.2",
1362
+ "winapi",
1363
+ ]
1364
+
1365
+ [[package]]
1366
+ name = "rand_os"
1367
+ version = "0.1.3"
1368
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1369
+ checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
1370
+ dependencies = [
1371
+ "cloudabi",
1372
+ "fuchsia-cprng",
1373
+ "libc",
1374
+ "rand_core 0.4.2",
1375
+ "rdrand",
1376
+ "winapi",
1377
+ ]
1378
+
1379
+ [[package]]
1380
+ name = "rand_pcg"
1381
+ version = "0.1.2"
1382
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1383
+ checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
1384
+ dependencies = [
1385
+ "autocfg 0.1.8",
1386
+ "rand_core 0.4.2",
1387
+ ]
1388
+
1389
+ [[package]]
1390
+ name = "rand_xorshift"
1391
+ version = "0.1.1"
1392
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1393
+ checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
1394
+ dependencies = [
1395
+ "rand_core 0.3.1",
1396
+ ]
1397
+
1398
+ [[package]]
1399
+ name = "rdrand"
1400
+ version = "0.4.0"
1401
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1402
+ checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
1403
+ dependencies = [
1404
+ "rand_core 0.3.1",
1405
+ ]
1406
+
1407
+ [[package]]
1408
+ name = "redox_syscall"
1409
+ version = "0.5.10"
1410
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1411
+ checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
1412
+ dependencies = [
1413
+ "bitflags 2.9.0",
1414
+ ]
1415
+
1416
+ [[package]]
1417
+ name = "reqwest"
1418
+ version = "0.11.27"
1419
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1420
+ checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
1421
+ dependencies = [
1422
+ "base64",
1423
+ "bytes",
1424
+ "encoding_rs",
1425
+ "futures-core",
1426
+ "futures-util",
1427
+ "h2",
1428
+ "http",
1429
+ "http-body",
1430
+ "hyper",
1431
+ "hyper-tls",
1432
+ "ipnet",
1433
+ "js-sys",
1434
+ "log",
1435
+ "mime",
1436
+ "native-tls",
1437
+ "once_cell",
1438
+ "percent-encoding",
1439
+ "pin-project-lite",
1440
+ "rustls-pemfile",
1441
+ "serde",
1442
+ "serde_json",
1443
+ "serde_urlencoded",
1444
+ "sync_wrapper",
1445
+ "system-configuration",
1446
+ "tokio",
1447
+ "tokio-native-tls",
1448
+ "tower-service",
1449
+ "url",
1450
+ "wasm-bindgen",
1451
+ "wasm-bindgen-futures",
1452
+ "web-sys",
1453
+ "winreg",
1454
+ ]
1455
+
1456
+ [[package]]
1457
+ name = "rpassword"
1458
+ version = "7.3.1"
1459
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1460
+ checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f"
1461
+ dependencies = [
1462
+ "libc",
1463
+ "rtoolbox",
1464
+ "windows-sys 0.48.0",
1465
+ ]
1466
+
1467
+ [[package]]
1468
+ name = "rtoolbox"
1469
+ version = "0.0.2"
1470
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1471
+ checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e"
1472
+ dependencies = [
1473
+ "libc",
1474
+ "windows-sys 0.48.0",
1475
+ ]
1476
+
1477
+ [[package]]
1478
+ name = "rustc-demangle"
1479
+ version = "0.1.24"
1480
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1481
+ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
1482
+
1483
+ [[package]]
1484
+ name = "rustc_version"
1485
+ version = "0.4.1"
1486
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1487
+ checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
1488
+ dependencies = [
1489
+ "semver",
1490
+ ]
1491
+
1492
+ [[package]]
1493
+ name = "rustix"
1494
+ version = "1.0.1"
1495
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1496
+ checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657"
1497
+ dependencies = [
1498
+ "bitflags 2.9.0",
1499
+ "errno",
1500
+ "libc",
1501
+ "linux-raw-sys",
1502
+ "windows-sys 0.59.0",
1503
+ ]
1504
+
1505
+ [[package]]
1506
+ name = "rustls-pemfile"
1507
+ version = "1.0.4"
1508
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1509
+ checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
1510
+ dependencies = [
1511
+ "base64",
1512
+ ]
1513
+
1514
+ [[package]]
1515
+ name = "rustversion"
1516
+ version = "1.0.20"
1517
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1518
+ checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
1519
+
1520
+ [[package]]
1521
+ name = "ryu"
1522
+ version = "1.0.20"
1523
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1524
+ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
1525
+
1526
+ [[package]]
1527
+ name = "schannel"
1528
+ version = "0.1.27"
1529
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1530
+ checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d"
1531
+ dependencies = [
1532
+ "windows-sys 0.59.0",
1533
+ ]
1534
+
1535
+ [[package]]
1536
+ name = "scopeguard"
1537
+ version = "1.2.0"
1538
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1539
+ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1540
+
1541
+ [[package]]
1542
+ name = "security-framework"
1543
+ version = "2.11.1"
1544
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1545
+ checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
1546
+ dependencies = [
1547
+ "bitflags 2.9.0",
1548
+ "core-foundation",
1549
+ "core-foundation-sys",
1550
+ "libc",
1551
+ "security-framework-sys",
1552
+ ]
1553
+
1554
+ [[package]]
1555
+ name = "security-framework-sys"
1556
+ version = "2.14.0"
1557
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1558
+ checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
1559
+ dependencies = [
1560
+ "core-foundation-sys",
1561
+ "libc",
1562
+ ]
1563
+
1564
+ [[package]]
1565
+ name = "semver"
1566
+ version = "1.0.26"
1567
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1568
+ checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
1569
+
1570
+ [[package]]
1571
+ name = "serde"
1572
+ version = "1.0.219"
1573
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1574
+ checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1575
+ dependencies = [
1576
+ "serde_derive",
1577
+ ]
1578
+
1579
+ [[package]]
1580
+ name = "serde_derive"
1581
+ version = "1.0.219"
1582
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1583
+ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1584
+ dependencies = [
1585
+ "proc-macro2",
1586
+ "quote",
1587
+ "syn",
1588
+ ]
1589
+
1590
+ [[package]]
1591
+ name = "serde_json"
1592
+ version = "1.0.140"
1593
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1594
+ checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
1595
+ dependencies = [
1596
+ "itoa",
1597
+ "memchr",
1598
+ "ryu",
1599
+ "serde",
1600
+ ]
1601
+
1602
+ [[package]]
1603
+ name = "serde_urlencoded"
1604
+ version = "0.7.1"
1605
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1606
+ checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
1607
+ dependencies = [
1608
+ "form_urlencoded",
1609
+ "itoa",
1610
+ "ryu",
1611
+ "serde",
1612
+ ]
1613
+
1614
+ [[package]]
1615
+ name = "sha2"
1616
+ version = "0.10.8"
1617
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1618
+ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
1619
+ dependencies = [
1620
+ "cfg-if",
1621
+ "cpufeatures",
1622
+ "digest",
1623
+ ]
1624
+
1625
+ [[package]]
1626
+ name = "shlex"
1627
+ version = "1.3.0"
1628
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1629
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1630
+
1631
+ [[package]]
1632
+ name = "signal-hook-registry"
1633
+ version = "1.4.2"
1634
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1635
+ checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
1636
+ dependencies = [
1637
+ "libc",
1638
+ ]
1639
+
1640
+ [[package]]
1641
+ name = "signature"
1642
+ version = "2.2.0"
1643
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1644
+ checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
1645
+ dependencies = [
1646
+ "rand_core 0.6.4",
1647
+ ]
1648
+
1649
+ [[package]]
1650
+ name = "slab"
1651
+ version = "0.4.9"
1652
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1653
+ checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
1654
+ dependencies = [
1655
+ "autocfg 1.4.0",
1656
+ ]
1657
+
1658
+ [[package]]
1659
+ name = "smallvec"
1660
+ version = "0.6.14"
1661
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1662
+ checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0"
1663
+ dependencies = [
1664
+ "maybe-uninit",
1665
+ ]
1666
+
1667
+ [[package]]
1668
+ name = "smallvec"
1669
+ version = "1.14.0"
1670
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1671
+ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
1672
+
1673
+ [[package]]
1674
+ name = "socket2"
1675
+ version = "0.5.8"
1676
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1677
+ checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
1678
+ dependencies = [
1679
+ "libc",
1680
+ "windows-sys 0.52.0",
1681
+ ]
1682
+
1683
+ [[package]]
1684
+ name = "soundness-cli"
1685
+ version = "0.1.2"
1686
+ dependencies = [
1687
+ "aes-gcm",
1688
+ "anyhow",
1689
+ "base64",
1690
+ "bip39",
1691
+ "clap",
1692
+ "ed25519-dalek",
1693
+ "generic-array",
1694
+ "hex",
1695
+ "indicatif",
1696
+ "once_cell",
1697
+ "pbkdf2",
1698
+ "rand 0.8.5",
1699
+ "rand_chacha 0.3.1",
1700
+ "rand_core 0.6.4",
1701
+ "reqwest",
1702
+ "rpassword",
1703
+ "serde",
1704
+ "serde_json",
1705
+ "sha2",
1706
+ "tempfile",
1707
+ "tokio",
1708
+ "typenum",
1709
+ ]
1710
+
1711
+ [[package]]
1712
+ name = "spki"
1713
+ version = "0.7.3"
1714
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1715
+ checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
1716
+ dependencies = [
1717
+ "base64ct",
1718
+ "der",
1719
+ ]
1720
+
1721
+ [[package]]
1722
+ name = "stable_deref_trait"
1723
+ version = "1.2.0"
1724
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1725
+ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
1726
+
1727
+ [[package]]
1728
+ name = "strsim"
1729
+ version = "0.11.1"
1730
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1731
+ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1732
+
1733
+ [[package]]
1734
+ name = "subtle"
1735
+ version = "2.6.1"
1736
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1737
+ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
1738
+
1739
+ [[package]]
1740
+ name = "syn"
1741
+ version = "2.0.100"
1742
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1743
+ checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
1744
+ dependencies = [
1745
+ "proc-macro2",
1746
+ "quote",
1747
+ "unicode-ident",
1748
+ ]
1749
+
1750
+ [[package]]
1751
+ name = "sync_wrapper"
1752
+ version = "0.1.2"
1753
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1754
+ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
1755
+
1756
+ [[package]]
1757
+ name = "synstructure"
1758
+ version = "0.13.1"
1759
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1760
+ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
1761
+ dependencies = [
1762
+ "proc-macro2",
1763
+ "quote",
1764
+ "syn",
1765
+ ]
1766
+
1767
+ [[package]]
1768
+ name = "system-configuration"
1769
+ version = "0.5.1"
1770
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1771
+ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
1772
+ dependencies = [
1773
+ "bitflags 1.3.2",
1774
+ "core-foundation",
1775
+ "system-configuration-sys",
1776
+ ]
1777
+
1778
+ [[package]]
1779
+ name = "system-configuration-sys"
1780
+ version = "0.5.0"
1781
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1782
+ checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
1783
+ dependencies = [
1784
+ "core-foundation-sys",
1785
+ "libc",
1786
+ ]
1787
+
1788
+ [[package]]
1789
+ name = "tempfile"
1790
+ version = "3.18.0"
1791
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1792
+ checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567"
1793
+ dependencies = [
1794
+ "cfg-if",
1795
+ "fastrand",
1796
+ "getrandom 0.3.1",
1797
+ "once_cell",
1798
+ "rustix",
1799
+ "windows-sys 0.59.0",
1800
+ ]
1801
+
1802
+ [[package]]
1803
+ name = "tinystr"
1804
+ version = "0.7.6"
1805
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1806
+ checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
1807
+ dependencies = [
1808
+ "displaydoc",
1809
+ "zerovec",
1810
+ ]
1811
+
1812
+ [[package]]
1813
+ name = "tokio"
1814
+ version = "1.44.0"
1815
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1816
+ checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a"
1817
+ dependencies = [
1818
+ "backtrace",
1819
+ "bytes",
1820
+ "libc",
1821
+ "mio",
1822
+ "parking_lot",
1823
+ "pin-project-lite",
1824
+ "signal-hook-registry",
1825
+ "socket2",
1826
+ "tokio-macros",
1827
+ "windows-sys 0.52.0",
1828
+ ]
1829
+
1830
+ [[package]]
1831
+ name = "tokio-macros"
1832
+ version = "2.5.0"
1833
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1834
+ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
1835
+ dependencies = [
1836
+ "proc-macro2",
1837
+ "quote",
1838
+ "syn",
1839
+ ]
1840
+
1841
+ [[package]]
1842
+ name = "tokio-native-tls"
1843
+ version = "0.3.1"
1844
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1845
+ checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
1846
+ dependencies = [
1847
+ "native-tls",
1848
+ "tokio",
1849
+ ]
1850
+
1851
+ [[package]]
1852
+ name = "tokio-util"
1853
+ version = "0.7.13"
1854
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1855
+ checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078"
1856
+ dependencies = [
1857
+ "bytes",
1858
+ "futures-core",
1859
+ "futures-sink",
1860
+ "pin-project-lite",
1861
+ "tokio",
1862
+ ]
1863
+
1864
+ [[package]]
1865
+ name = "tower-service"
1866
+ version = "0.3.3"
1867
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1868
+ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
1869
+
1870
+ [[package]]
1871
+ name = "tracing"
1872
+ version = "0.1.41"
1873
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1874
+ checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
1875
+ dependencies = [
1876
+ "pin-project-lite",
1877
+ "tracing-core",
1878
+ ]
1879
+
1880
+ [[package]]
1881
+ name = "tracing-core"
1882
+ version = "0.1.33"
1883
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1884
+ checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
1885
+ dependencies = [
1886
+ "once_cell",
1887
+ ]
1888
+
1889
+ [[package]]
1890
+ name = "try-lock"
1891
+ version = "0.2.5"
1892
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1893
+ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
1894
+
1895
+ [[package]]
1896
+ name = "typenum"
1897
+ version = "1.18.0"
1898
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1899
+ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
1900
+
1901
+ [[package]]
1902
+ name = "unicode-ident"
1903
+ version = "1.0.18"
1904
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1905
+ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
1906
+
1907
+ [[package]]
1908
+ name = "unicode-normalization"
1909
+ version = "0.1.9"
1910
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1911
+ checksum = "09c8070a9942f5e7cfccd93f490fdebd230ee3c3c9f107cb25bad5351ef671cf"
1912
+ dependencies = [
1913
+ "smallvec 0.6.14",
1914
+ ]
1915
+
1916
+ [[package]]
1917
+ name = "unicode-width"
1918
+ version = "0.2.0"
1919
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1920
+ checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
1921
+
1922
+ [[package]]
1923
+ name = "universal-hash"
1924
+ version = "0.5.1"
1925
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1926
+ checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
1927
+ dependencies = [
1928
+ "crypto-common",
1929
+ "subtle",
1930
+ ]
1931
+
1932
+ [[package]]
1933
+ name = "url"
1934
+ version = "2.5.4"
1935
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1936
+ checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60"
1937
+ dependencies = [
1938
+ "form_urlencoded",
1939
+ "idna",
1940
+ "percent-encoding",
1941
+ ]
1942
+
1943
+ [[package]]
1944
+ name = "utf16_iter"
1945
+ version = "1.0.5"
1946
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1947
+ checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
1948
+
1949
+ [[package]]
1950
+ name = "utf8_iter"
1951
+ version = "1.0.4"
1952
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1953
+ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
1954
+
1955
+ [[package]]
1956
+ name = "utf8parse"
1957
+ version = "0.2.2"
1958
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1959
+ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
1960
+
1961
+ [[package]]
1962
+ name = "vcpkg"
1963
+ version = "0.2.15"
1964
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1965
+ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
1966
+
1967
+ [[package]]
1968
+ name = "version_check"
1969
+ version = "0.9.5"
1970
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1971
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
1972
+
1973
+ [[package]]
1974
+ name = "want"
1975
+ version = "0.3.1"
1976
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1977
+ checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
1978
+ dependencies = [
1979
+ "try-lock",
1980
+ ]
1981
+
1982
+ [[package]]
1983
+ name = "wasi"
1984
+ version = "0.11.0+wasi-snapshot-preview1"
1985
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1986
+ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1987
+
1988
+ [[package]]
1989
+ name = "wasi"
1990
+ version = "0.13.3+wasi-0.2.2"
1991
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1992
+ checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
1993
+ dependencies = [
1994
+ "wit-bindgen-rt",
1995
+ ]
1996
+
1997
+ [[package]]
1998
+ name = "wasm-bindgen"
1999
+ version = "0.2.100"
2000
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2001
+ checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
2002
+ dependencies = [
2003
+ "cfg-if",
2004
+ "once_cell",
2005
+ "rustversion",
2006
+ "wasm-bindgen-macro",
2007
+ ]
2008
+
2009
+ [[package]]
2010
+ name = "wasm-bindgen-backend"
2011
+ version = "0.2.100"
2012
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2013
+ checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
2014
+ dependencies = [
2015
+ "bumpalo",
2016
+ "log",
2017
+ "proc-macro2",
2018
+ "quote",
2019
+ "syn",
2020
+ "wasm-bindgen-shared",
2021
+ ]
2022
+
2023
+ [[package]]
2024
+ name = "wasm-bindgen-futures"
2025
+ version = "0.4.50"
2026
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2027
+ checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
2028
+ dependencies = [
2029
+ "cfg-if",
2030
+ "js-sys",
2031
+ "once_cell",
2032
+ "wasm-bindgen",
2033
+ "web-sys",
2034
+ ]
2035
+
2036
+ [[package]]
2037
+ name = "wasm-bindgen-macro"
2038
+ version = "0.2.100"
2039
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2040
+ checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
2041
+ dependencies = [
2042
+ "quote",
2043
+ "wasm-bindgen-macro-support",
2044
+ ]
2045
+
2046
+ [[package]]
2047
+ name = "wasm-bindgen-macro-support"
2048
+ version = "0.2.100"
2049
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2050
+ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
2051
+ dependencies = [
2052
+ "proc-macro2",
2053
+ "quote",
2054
+ "syn",
2055
+ "wasm-bindgen-backend",
2056
+ "wasm-bindgen-shared",
2057
+ ]
2058
+
2059
+ [[package]]
2060
+ name = "wasm-bindgen-shared"
2061
+ version = "0.2.100"
2062
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2063
+ checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
2064
+ dependencies = [
2065
+ "unicode-ident",
2066
+ ]
2067
+
2068
+ [[package]]
2069
+ name = "web-sys"
2070
+ version = "0.3.77"
2071
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2072
+ checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
2073
+ dependencies = [
2074
+ "js-sys",
2075
+ "wasm-bindgen",
2076
+ ]
2077
+
2078
+ [[package]]
2079
+ name = "web-time"
2080
+ version = "1.1.0"
2081
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2082
+ checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
2083
+ dependencies = [
2084
+ "js-sys",
2085
+ "wasm-bindgen",
2086
+ ]
2087
+
2088
+ [[package]]
2089
+ name = "winapi"
2090
+ version = "0.3.9"
2091
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2092
+ checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
2093
+ dependencies = [
2094
+ "winapi-i686-pc-windows-gnu",
2095
+ "winapi-x86_64-pc-windows-gnu",
2096
+ ]
2097
+
2098
+ [[package]]
2099
+ name = "winapi-i686-pc-windows-gnu"
2100
+ version = "0.4.0"
2101
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2102
+ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
2103
+
2104
+ [[package]]
2105
+ name = "winapi-x86_64-pc-windows-gnu"
2106
+ version = "0.4.0"
2107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2108
+ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
2109
+
2110
+ [[package]]
2111
+ name = "windows-sys"
2112
+ version = "0.48.0"
2113
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2114
+ checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
2115
+ dependencies = [
2116
+ "windows-targets 0.48.5",
2117
+ ]
2118
+
2119
+ [[package]]
2120
+ name = "windows-sys"
2121
+ version = "0.52.0"
2122
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2123
+ checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
2124
+ dependencies = [
2125
+ "windows-targets 0.52.6",
2126
+ ]
2127
+
2128
+ [[package]]
2129
+ name = "windows-sys"
2130
+ version = "0.59.0"
2131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2132
+ checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
2133
+ dependencies = [
2134
+ "windows-targets 0.52.6",
2135
+ ]
2136
+
2137
+ [[package]]
2138
+ name = "windows-targets"
2139
+ version = "0.48.5"
2140
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2141
+ checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
2142
+ dependencies = [
2143
+ "windows_aarch64_gnullvm 0.48.5",
2144
+ "windows_aarch64_msvc 0.48.5",
2145
+ "windows_i686_gnu 0.48.5",
2146
+ "windows_i686_msvc 0.48.5",
2147
+ "windows_x86_64_gnu 0.48.5",
2148
+ "windows_x86_64_gnullvm 0.48.5",
2149
+ "windows_x86_64_msvc 0.48.5",
2150
+ ]
2151
+
2152
+ [[package]]
2153
+ name = "windows-targets"
2154
+ version = "0.52.6"
2155
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2156
+ checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
2157
+ dependencies = [
2158
+ "windows_aarch64_gnullvm 0.52.6",
2159
+ "windows_aarch64_msvc 0.52.6",
2160
+ "windows_i686_gnu 0.52.6",
2161
+ "windows_i686_gnullvm",
2162
+ "windows_i686_msvc 0.52.6",
2163
+ "windows_x86_64_gnu 0.52.6",
2164
+ "windows_x86_64_gnullvm 0.52.6",
2165
+ "windows_x86_64_msvc 0.52.6",
2166
+ ]
2167
+
2168
+ [[package]]
2169
+ name = "windows_aarch64_gnullvm"
2170
+ version = "0.48.5"
2171
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2172
+ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
2173
+
2174
+ [[package]]
2175
+ name = "windows_aarch64_gnullvm"
2176
+ version = "0.52.6"
2177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2178
+ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
2179
+
2180
+ [[package]]
2181
+ name = "windows_aarch64_msvc"
2182
+ version = "0.48.5"
2183
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2184
+ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
2185
+
2186
+ [[package]]
2187
+ name = "windows_aarch64_msvc"
2188
+ version = "0.52.6"
2189
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2190
+ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
2191
+
2192
+ [[package]]
2193
+ name = "windows_i686_gnu"
2194
+ version = "0.48.5"
2195
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2196
+ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
2197
+
2198
+ [[package]]
2199
+ name = "windows_i686_gnu"
2200
+ version = "0.52.6"
2201
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2202
+ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
2203
+
2204
+ [[package]]
2205
+ name = "windows_i686_gnullvm"
2206
+ version = "0.52.6"
2207
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2208
+ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
2209
+
2210
+ [[package]]
2211
+ name = "windows_i686_msvc"
2212
+ version = "0.48.5"
2213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2214
+ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
2215
+
2216
+ [[package]]
2217
+ name = "windows_i686_msvc"
2218
+ version = "0.52.6"
2219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2220
+ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
2221
+
2222
+ [[package]]
2223
+ name = "windows_x86_64_gnu"
2224
+ version = "0.48.5"
2225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2226
+ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
2227
+
2228
+ [[package]]
2229
+ name = "windows_x86_64_gnu"
2230
+ version = "0.52.6"
2231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2232
+ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
2233
+
2234
+ [[package]]
2235
+ name = "windows_x86_64_gnullvm"
2236
+ version = "0.48.5"
2237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2238
+ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
2239
+
2240
+ [[package]]
2241
+ name = "windows_x86_64_gnullvm"
2242
+ version = "0.52.6"
2243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2244
+ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
2245
+
2246
+ [[package]]
2247
+ name = "windows_x86_64_msvc"
2248
+ version = "0.48.5"
2249
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2250
+ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
2251
+
2252
+ [[package]]
2253
+ name = "windows_x86_64_msvc"
2254
+ version = "0.52.6"
2255
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2256
+ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
2257
+
2258
+ [[package]]
2259
+ name = "winreg"
2260
+ version = "0.50.0"
2261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2262
+ checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
2263
+ dependencies = [
2264
+ "cfg-if",
2265
+ "windows-sys 0.48.0",
2266
+ ]
2267
+
2268
+ [[package]]
2269
+ name = "wit-bindgen-rt"
2270
+ version = "0.33.0"
2271
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2272
+ checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
2273
+ dependencies = [
2274
+ "bitflags 2.9.0",
2275
+ ]
2276
+
2277
+ [[package]]
2278
+ name = "write16"
2279
+ version = "1.0.0"
2280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2281
+ checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
2282
+
2283
+ [[package]]
2284
+ name = "writeable"
2285
+ version = "0.5.5"
2286
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2287
+ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
2288
+
2289
+ [[package]]
2290
+ name = "yoke"
2291
+ version = "0.7.5"
2292
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2293
+ checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40"
2294
+ dependencies = [
2295
+ "serde",
2296
+ "stable_deref_trait",
2297
+ "yoke-derive",
2298
+ "zerofrom",
2299
+ ]
2300
+
2301
+ [[package]]
2302
+ name = "yoke-derive"
2303
+ version = "0.7.5"
2304
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2305
+ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
2306
+ dependencies = [
2307
+ "proc-macro2",
2308
+ "quote",
2309
+ "syn",
2310
+ "synstructure",
2311
+ ]
2312
+
2313
+ [[package]]
2314
+ name = "zerocopy"
2315
+ version = "0.8.23"
2316
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2317
+ checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6"
2318
+ dependencies = [
2319
+ "zerocopy-derive",
2320
+ ]
2321
+
2322
+ [[package]]
2323
+ name = "zerocopy-derive"
2324
+ version = "0.8.23"
2325
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2326
+ checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154"
2327
+ dependencies = [
2328
+ "proc-macro2",
2329
+ "quote",
2330
+ "syn",
2331
+ ]
2332
+
2333
+ [[package]]
2334
+ name = "zerofrom"
2335
+ version = "0.1.6"
2336
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2337
+ checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
2338
+ dependencies = [
2339
+ "zerofrom-derive",
2340
+ ]
2341
+
2342
+ [[package]]
2343
+ name = "zerofrom-derive"
2344
+ version = "0.1.6"
2345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2346
+ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
2347
+ dependencies = [
2348
+ "proc-macro2",
2349
+ "quote",
2350
+ "syn",
2351
+ "synstructure",
2352
+ ]
2353
+
2354
+ [[package]]
2355
+ name = "zeroize"
2356
+ version = "1.8.1"
2357
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2358
+ checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
2359
+
2360
+ [[package]]
2361
+ name = "zerovec"
2362
+ version = "0.10.4"
2363
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2364
+ checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
2365
+ dependencies = [
2366
+ "yoke",
2367
+ "zerofrom",
2368
+ "zerovec-derive",
2369
+ ]
2370
+
2371
+ [[package]]
2372
+ name = "zerovec-derive"
2373
+ version = "0.10.3"
2374
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2375
+ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
2376
+ dependencies = [
2377
+ "proc-macro2",
2378
+ "quote",
2379
+ "syn",
2380
+ ]
2381
+ LOCKEOF
2382
+
2383
+ # Note: the embedded lock is the repository's exact lock for the soundness-cli
2384
+ # package; --locked below makes cargo fetch this precise set into the cache.
2385
+
2386
+ # Fetch the full transitive closure into the cargo cache (CARGO_HOME).
2387
+ cargo fetch --manifest-path "$down_dir/Cargo.toml" --locked
2388
+
2389
+ # The generated manifest directory is no longer needed after fetching.
2390
+ rm -rf "$down_dir"
soundnesslabs--soundness-layer.b0fd690/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db22eadd99cce618269361a396b42ad9edfc9e1172e73eb435477b802cd26dfd
3
+ size 6367296
soundnesslabs--soundness-layer.b0fd690/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ command -v cargo
4
+ command -v rustc
5
+ command -v rustup
6
+ cd /workspace
7
+ set -a
8
+ source /tmp/programgym-download.sh
9
+ set +a
10
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
11
+ import os
12
+ import shlex
13
+
14
+ ignored = {
15
+ "ALL_PROXY",
16
+ "HTTP_PROXY",
17
+ "HTTPS_PROXY",
18
+ "NO_PROXY",
19
+ "OLDPWD",
20
+ "PIP_PROXY",
21
+ "PWD",
22
+ "SHLVL",
23
+ "_",
24
+ "all_proxy",
25
+ "http_proxy",
26
+ "https_proxy",
27
+ "no_proxy",
28
+ "pip_proxy",
29
+ }
30
+ for key in sorted(os.environ):
31
+ if key in ignored or key.startswith("BASH_FUNC_"):
32
+ continue
33
+ value = os.environ[key]
34
+ if "\n" in value:
35
+ continue
36
+ print(f"export {key}={shlex.quote(value)}")
37
+ PY
soundnesslabs--soundness-layer.b0fd690/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7f87ec5ecea36ab690c8675baf1f2901c608adeacd39c79c5c6b4ad39cac23b
3
+ size 174179
soundnesslabs--soundness-layer.b0fd690/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior