Marquis03 commited on
Commit
8ad680b
·
verified ·
1 Parent(s): 2f70927

commit (part 14)

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. banach-space--clang-tutor.ddd702e/environment/harbor_prepare_download_env.sh +44 -0
  3. banach-space--clang-tutor.ddd702e/environment/programgym-gcc13.tar.gz +3 -0
  4. banach-space--clang-tutor.ddd702e/environment/workspace.tar.gz +3 -0
  5. banach-space--clang-tutor.ddd702e/instruction.md +98 -0
  6. banach-space--clang-tutor.ddd702e/solution/solve.sh +33 -0
  7. banach-space--clang-tutor.ddd702e/task.toml +69 -0
  8. banach-space--clang-tutor.ddd702e/tests/Dockerfile +106 -0
  9. banach-space--clang-tutor.ddd702e/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  10. banach-space--clang-tutor.ddd702e/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  11. banach-space--clang-tutor.ddd702e/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  12. banach-space--clang-tutor.ddd702e/tests/blobs/tests/generated_upstream.tar.gz +3 -0
  13. banach-space--clang-tutor.ddd702e/tests/docker-compose.yaml +22 -0
  14. banach-space--clang-tutor.ddd702e/tests/download.sh +21 -0
  15. banach-space--clang-tutor.ddd702e/tests/executable +3 -0
  16. banach-space--clang-tutor.ddd702e/tests/harbor_configure_apt_mirror.sh +37 -0
  17. banach-space--clang-tutor.ddd702e/tests/harbor_configure_java_mirrors.sh +50 -0
  18. banach-space--clang-tutor.ddd702e/tests/harbor_prepare_download_env.sh +44 -0
  19. banach-space--clang-tutor.ddd702e/tests/programgym-gcc13.tar.gz +3 -0
  20. banach-space--clang-tutor.ddd702e/tests/programgym_evaluator.py +1201 -0
  21. banach-space--clang-tutor.ddd702e/tests/programgym_task.json +1900 -0
  22. banach-space--clang-tutor.ddd702e/tests/test.sh +82 -0
  23. banach-space--clang-tutor.ddd702e/tests/workspace.tar.gz +3 -0
  24. banach-space--llvm-tutor.6245457/environment/Dockerfile +1 -0
  25. banach-space--llvm-tutor.6245457/tests/Dockerfile +1 -0
  26. banksy-git--lidl-gateway-freedom.f44f47f/environment/Dockerfile +57 -0
  27. banksy-git--lidl-gateway-freedom.f44f47f/environment/download.sh +35 -0
  28. banksy-git--lidl-gateway-freedom.f44f47f/environment/executable +3 -0
  29. banksy-git--lidl-gateway-freedom.f44f47f/environment/harbor_prepare_download_env.sh +34 -0
  30. banksy-git--lidl-gateway-freedom.f44f47f/environment/workspace.tar.gz +3 -0
  31. banksy-git--lidl-gateway-freedom.f44f47f/instruction.md +98 -0
  32. banksy-git--lidl-gateway-freedom.f44f47f/solution/solve.sh +33 -0
  33. banksy-git--lidl-gateway-freedom.f44f47f/task.toml +69 -0
  34. banksy-git--lidl-gateway-freedom.f44f47f/tests/Dockerfile +71 -0
  35. banksy-git--lidl-gateway-freedom.f44f47f/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  36. banksy-git--lidl-gateway-freedom.f44f47f/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  37. banksy-git--lidl-gateway-freedom.f44f47f/tests/download.sh +35 -0
  38. banksy-git--lidl-gateway-freedom.f44f47f/tests/executable +3 -0
  39. banksy-git--lidl-gateway-freedom.f44f47f/tests/harbor_prepare_download_env.sh +34 -0
  40. banksy-git--lidl-gateway-freedom.f44f47f/tests/programgym_evaluator.py +1201 -0
  41. banksy-git--lidl-gateway-freedom.f44f47f/tests/programgym_task.json +677 -0
  42. banksy-git--lidl-gateway-freedom.f44f47f/tests/test.sh +82 -0
  43. banksy-git--lidl-gateway-freedom.f44f47f/tests/workspace.tar.gz +3 -0
  44. barnybug--cli53.5581c5a/environment/Dockerfile +98 -0
  45. barnybug--cli53.5581c5a/environment/docker-compose.yaml +22 -0
  46. barnybug--cli53.5581c5a/environment/download.sh +265 -0
  47. barnybug--cli53.5581c5a/environment/executable +3 -0
  48. barnybug--cli53.5581c5a/environment/harbor_configure_apt_mirror.sh +37 -0
  49. barnybug--cli53.5581c5a/environment/harbor_configure_java_mirrors.sh +50 -0
  50. barnybug--cli53.5581c5a/environment/harbor_prepare_download_env.sh +44 -0
.gitattributes CHANGED
@@ -3069,3 +3069,10 @@ azure--aztfexport.4893255/tests/executable filter=lfs diff=lfs merge=lfs -text
3069
  azure--secrets-store-csi-driver-provider-azure.d5f7cf5/environment/executable filter=lfs diff=lfs merge=lfs -text
3070
  azure--secrets-store-csi-driver-provider-azure.d5f7cf5/tests/executable filter=lfs diff=lfs merge=lfs -text
3071
  banach-space--clang-tutor.ddd702e/environment/executable filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
3069
  azure--secrets-store-csi-driver-provider-azure.d5f7cf5/environment/executable filter=lfs diff=lfs merge=lfs -text
3070
  azure--secrets-store-csi-driver-provider-azure.d5f7cf5/tests/executable filter=lfs diff=lfs merge=lfs -text
3071
  banach-space--clang-tutor.ddd702e/environment/executable filter=lfs diff=lfs merge=lfs -text
3072
+ banach-space--clang-tutor.ddd702e/tests/executable filter=lfs diff=lfs merge=lfs -text
3073
+ banksy-git--lidl-gateway-freedom.f44f47f/environment/executable filter=lfs diff=lfs merge=lfs -text
3074
+ banksy-git--lidl-gateway-freedom.f44f47f/tests/executable filter=lfs diff=lfs merge=lfs -text
3075
+ barnybug--cli53.5581c5a/environment/executable filter=lfs diff=lfs merge=lfs -text
3076
+ barnybug--cli53.5581c5a/tests/executable filter=lfs diff=lfs merge=lfs -text
3077
+ bdon--osmexpress.045a515/environment/executable filter=lfs diff=lfs merge=lfs -text
3078
+ bdon--osmexpress.045a515/tests/executable filter=lfs diff=lfs merge=lfs -text
banach-space--clang-tutor.ddd702e/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ if [[ -n "${PROGRAMGYM_MAVEN_MIRROR_URL:-}" ]]; then
6
+ sed -i -e "s|https://repo.maven.apache.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" -e "s|https://repo1.maven.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" /workspace/download.sh
7
+ fi
8
+ if [[ -n "${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL:-}" ]]; then
9
+ sed -i -e "s|https://services.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" -e "s|https://downloads.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" /workspace/download.sh
10
+ fi
11
+ if [[ -n "${PROGRAMGYM_JITPACK_REPOSITORY_URL:-}" ]]; then
12
+ sed -i -e "s|https://jitpack.io|${PROGRAMGYM_JITPACK_REPOSITORY_URL%/}|g" /workspace/download.sh
13
+ fi
14
+ source /workspace/download.sh
15
+ set +a
16
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
17
+ import os
18
+ import shlex
19
+
20
+ ignored = {
21
+ "ALL_PROXY",
22
+ "HTTP_PROXY",
23
+ "HTTPS_PROXY",
24
+ "NO_PROXY",
25
+ "OLDPWD",
26
+ "PIP_PROXY",
27
+ "PWD",
28
+ "SHLVL",
29
+ "_",
30
+ "all_proxy",
31
+ "http_proxy",
32
+ "https_proxy",
33
+ "no_proxy",
34
+ "pip_proxy",
35
+ }
36
+ for key in sorted(os.environ):
37
+ if key in ignored or key.startswith("BASH_FUNC_"):
38
+ continue
39
+ value = os.environ[key]
40
+ if "\n" in value:
41
+ continue
42
+ print(f"export {key}={shlex.quote(value)}")
43
+ PY
44
+ chmod 0644 /etc/profile.d/programgym_download_env.sh
banach-space--clang-tutor.ddd702e/environment/programgym-gcc13.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88
3
+ size 146620404
banach-space--clang-tutor.ddd702e/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7d63ec2ce383b9852ab8457c957ba43895ff8cd2017e1fa8ac10bb58a00ef65
3
+ size 11337
banach-space--clang-tutor.ddd702e/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
banach-space--clang-tutor.ddd702e/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
banach-space--clang-tutor.ddd702e/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/banach-space--clang-tutor.ddd702e"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for banach-space/clang-tutor"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "banach-space__clang-tutor.ddd702e"
32
+ repository = "banach-space/clang-tutor"
33
+ commit = "ddd702e68a2a9e0a6766c4d0a63deef7409a8888"
34
+ language = "cpp"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.5208763816883417
37
+ test_branches = 4
38
+ test_count = 211
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"
banach-space--clang-tutor.ddd702e/tests/Dockerfile ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_GOSUMDB="sum.golang.org"
5
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
6
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
7
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
8
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
9
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
10
+ ARG PROGRAMGYM_RUSTUP_DIST_SERVER="https://static.rust-lang.org"
11
+ ARG PROGRAMGYM_RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
12
+ ARG PROGRAMGYM_CARGO_INDEX="sparse+https://index.crates.io/"
13
+ ARG PROGRAMGYM_CARGO_NET_RETRY="10"
14
+ ARG PROGRAMGYM_CARGO_HTTP_TIMEOUT="600"
15
+ ARG PROGRAMGYM_CARGO_HTTP_MULTIPLEXING="false"
16
+ ARG PROGRAMGYM_MAVEN_MIRROR_URL=""
17
+ ARG PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL=""
18
+ ARG PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL="https://services.gradle.org/distributions"
19
+ ARG PROGRAMGYM_JITPACK_REPOSITORY_URL="https://jitpack.io"
20
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
21
+ ENV GOSUMDB=${PROGRAMGYM_GOSUMDB}
22
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
23
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
24
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
25
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
26
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
27
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
28
+ ENV RUSTUP_DIST_SERVER=${PROGRAMGYM_RUSTUP_DIST_SERVER}
29
+ ENV RUSTUP_UPDATE_ROOT=${PROGRAMGYM_RUSTUP_UPDATE_ROOT}
30
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX=${PROGRAMGYM_CARGO_INDEX}
31
+ ENV CARGO_NET_RETRY=${PROGRAMGYM_CARGO_NET_RETRY}
32
+ ENV CARGO_HTTP_TIMEOUT=${PROGRAMGYM_CARGO_HTTP_TIMEOUT}
33
+ ENV CARGO_HTTP_MULTIPLEXING=${PROGRAMGYM_CARGO_HTTP_MULTIPLEXING}
34
+ ENV PROGRAMGYM_MAVEN_MIRROR_URL=${PROGRAMGYM_MAVEN_MIRROR_URL}
35
+ ENV PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL=${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL}
36
+ ENV PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL=${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL}
37
+ ENV PROGRAMGYM_JITPACK_REPOSITORY_URL=${PROGRAMGYM_JITPACK_REPOSITORY_URL}
38
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
39
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
40
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
41
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
42
+ COPY harbor_configure_java_mirrors.sh /tmp/harbor_configure_java_mirrors.sh
43
+ RUN chmod 0755 /tmp/harbor_configure_java_mirrors.sh \
44
+ && /bin/bash /tmp/harbor_configure_java_mirrors.sh "${PROGRAMGYM_MAVEN_MIRROR_URL}" "${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL}" "${PROGRAMGYM_JITPACK_REPOSITORY_URL}" \
45
+ && rm -f /tmp/harbor_configure_java_mirrors.sh
46
+ ENV DEBIAN_FRONTEND=noninteractive
47
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
48
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
49
+ ENV GOTOOLCHAIN=auto
50
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
51
+ ENV npm_config_cache=/workspace/.cache/npm
52
+ ENV HOME=/workspace
53
+ ENV XDG_CACHE_HOME=/workspace/.cache
54
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
55
+ ENV PYTHONUSERBASE=/workspace/.local
56
+ ENV PAGER=cat
57
+ ENV MANPAGER=cat
58
+ ENV LESS=-R
59
+ ENV TQDM_DISABLE=1
60
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/*
61
+ ARG CMAKE_VERSION=3.31.10
62
+ RUN set -eux; python3 -m pip install --no-cache-dir "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version
63
+ COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz
64
+ ARG GCC_VERSION=13.3.0
65
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true
66
+ # programgym_quota_aware_nproc=1
67
+ RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null
68
+ WORKDIR /workspace
69
+ ADD workspace.tar.gz /workspace/
70
+ COPY executable /workspace/executable
71
+ COPY download.sh /workspace/download.sh
72
+ RUN chmod 755 /workspace/download.sh
73
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
74
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
75
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
76
+ && rm -f /workspace/download.sh \
77
+ && rm -f /tmp/harbor_prepare_download_env.sh
78
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
79
+ RUN chmod 111 /workspace/executable
80
+ WORKDIR /workspace
81
+ # Harbor uses tests/ as the separate verifier build context. Start with the
82
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
83
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
84
+ && mkdir -p /workspace /tests
85
+
86
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
87
+ # Installing a newer pytest alone leaves that apt package importable and creates
88
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
89
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
90
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
91
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
92
+ RUN set -eu; \
93
+ pip_break_system_packages=""; \
94
+ if python3 -m pip install --help | grep -q -- '--break-system-packages'; then \
95
+ pip_break_system_packages="--break-system-packages"; \
96
+ fi; \
97
+ python3 -m pip install ${pip_break_system_packages} \
98
+ --no-cache-dir --disable-pip-version-check --retries 10 --timeout 120 \
99
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
100
+
101
+ COPY test.sh /tests/test.sh
102
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
103
+ COPY programgym_task.json /tests/programgym_task.json
104
+ COPY blobs/ /tests/blobs/
105
+ RUN chmod +x /tests/test.sh
106
+ 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"]
banach-space--clang-tutor.ddd702e/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:7026eacc45c3ee9543fb532ab27fbd6b6e3d2498d7389792336d5e45705ffc6e
3
+ size 26442
banach-space--clang-tutor.ddd702e/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:bae84b11916f9edb6b892ce0c5307f4bfe7c62dc7ab93dadca16f82bb8eaa60b
3
+ size 19164
banach-space--clang-tutor.ddd702e/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:9dad34776c87d0afdc49ddf2c5a0894ba626614ed08dc6c26d9d0af84365309e
3
+ size 19160
banach-space--clang-tutor.ddd702e/tests/blobs/tests/generated_upstream.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:def7f8d84e89eeb0cdf024f5af4742de2828871588bb0452090f8f61c422cd60
3
+ size 2604
banach-space--clang-tutor.ddd702e/tests/docker-compose.yaml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_GOSUMDB: ${PROGRAMGYM_GOSUMDB:-sum.golang.org}
8
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
9
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
10
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
11
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
12
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
13
+ PROGRAMGYM_RUSTUP_DIST_SERVER: ${PROGRAMGYM_RUSTUP_DIST_SERVER:-https://static.rust-lang.org}
14
+ PROGRAMGYM_RUSTUP_UPDATE_ROOT: ${PROGRAMGYM_RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}
15
+ PROGRAMGYM_CARGO_INDEX: ${PROGRAMGYM_CARGO_INDEX:-sparse+https://index.crates.io/}
16
+ PROGRAMGYM_CARGO_NET_RETRY: ${PROGRAMGYM_CARGO_NET_RETRY:-10}
17
+ PROGRAMGYM_CARGO_HTTP_TIMEOUT: ${PROGRAMGYM_CARGO_HTTP_TIMEOUT:-600}
18
+ PROGRAMGYM_CARGO_HTTP_MULTIPLEXING: ${PROGRAMGYM_CARGO_HTTP_MULTIPLEXING:-false}
19
+ PROGRAMGYM_MAVEN_MIRROR_URL: ${PROGRAMGYM_MAVEN_MIRROR_URL:-}
20
+ PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL: ${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL:-}
21
+ PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL: ${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL:-https://services.gradle.org/distributions}
22
+ PROGRAMGYM_JITPACK_REPOSITORY_URL: ${PROGRAMGYM_JITPACK_REPOSITORY_URL:-https://jitpack.io}
banach-space--clang-tutor.ddd702e/tests/download.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Optional private apt archive cache; signature verification remains unchanged.
3
+ if [ -d /opt/pb_scripts_download_cache ]; then
4
+ mkdir -p /opt/pb_scripts_download_cache/apt/partial
5
+ cat > /tmp/pb_scripts_apt_cache.conf <<'PB_APT_CACHE_CONFIG'
6
+ Dir::Cache::archives "/opt/pb_scripts_download_cache/apt";
7
+ Binary::apt::APT::Keep-Downloaded-Packages "true";
8
+ APT::Keep-Downloaded-Packages "true";
9
+ Acquire::Retries "2";
10
+ PB_APT_CACHE_CONFIG
11
+ export APT_CONFIG=/tmp/pb_scripts_apt_cache.conf
12
+ fi
13
+ set -euo pipefail
14
+ export LD_LIBRARY_PATH=/opt/gcc-13/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
15
+ apt-get update
16
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg
17
+ curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL --http1.1 --retry 0 --max-time 180 https://apt.llvm.org/llvm-snapshot.gpg.key -o /tmp/llvm-key
18
+ gpg --batch --yes --dearmor -o /usr/share/keyrings/pb-llvm.gpg /tmp/llvm-key
19
+ printf 'deb [arch=amd64 signed-by=/usr/share/keyrings/pb-llvm.gpg] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-22 main\n' > /etc/apt/sources.list.d/pb-llvm.list
20
+ apt-get update
21
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libllvm22 libclang-cpp22 llvm-22-dev llvm-22-tools clang-22 libclang-22-dev
banach-space--clang-tutor.ddd702e/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20b17df21a26f9c26a01534aa7366cfb6aaf369ca4fb1a533ad2f80a48baeda0
3
+ size 45111192
banach-space--clang-tutor.ddd702e/tests/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
banach-space--clang-tutor.ddd702e/tests/harbor_configure_java_mirrors.sh ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ maven_url="${1%/}"
5
+ plugin_url="${2%/}"
6
+ jitpack_url="${3%/}"
7
+
8
+ install -d /workspace/.m2 /workspace/.gradle/init.d /opt/programgym/gradle-init
9
+ if [[ -n "$maven_url" ]]; then
10
+ cat >/workspace/.m2/settings.xml <<EOF
11
+ <?xml version="1.0" encoding="UTF-8"?>
12
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
13
+ <mirrors>
14
+ <mirror>
15
+ <id>programgym-maven</id>
16
+ <name>ProgramGym Maven mirror</name>
17
+ <url>${maven_url}</url>
18
+ <mirrorOf>*</mirrorOf>
19
+ </mirror>
20
+ </mirrors>
21
+ </settings>
22
+ EOF
23
+ fi
24
+
25
+ cat >/opt/programgym/gradle-init/programgym-mirrors.gradle <<'EOF'
26
+ def pbMaven = System.getenv('PROGRAMGYM_MAVEN_MIRROR_URL')
27
+ def pbPlugins = System.getenv('PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL')
28
+ def pbJitpack = System.getenv('PROGRAMGYM_JITPACK_REPOSITORY_URL')
29
+
30
+ settingsEvaluated { settings ->
31
+ settings.pluginManagement.repositories {
32
+ if (pbPlugins) { maven { url = uri(pbPlugins) } }
33
+ if (pbMaven) { maven { url = uri(pbMaven) } }
34
+ }
35
+ }
36
+
37
+ allprojects {
38
+ buildscript.repositories {
39
+ if (pbPlugins) { maven { url = uri(pbPlugins) } }
40
+ if (pbMaven) { maven { url = uri(pbMaven) } }
41
+ if (pbJitpack) { maven { url = uri(pbJitpack) } }
42
+ }
43
+ repositories {
44
+ if (pbMaven) { maven { url = uri(pbMaven) } }
45
+ if (pbJitpack) { maven { url = uri(pbJitpack) } }
46
+ }
47
+ }
48
+ EOF
49
+ cp /opt/programgym/gradle-init/programgym-mirrors.gradle \
50
+ /workspace/.gradle/init.d/programgym-mirrors.gradle
banach-space--clang-tutor.ddd702e/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ if [[ -n "${PROGRAMGYM_MAVEN_MIRROR_URL:-}" ]]; then
6
+ sed -i -e "s|https://repo.maven.apache.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" -e "s|https://repo1.maven.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" /workspace/download.sh
7
+ fi
8
+ if [[ -n "${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL:-}" ]]; then
9
+ sed -i -e "s|https://services.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" -e "s|https://downloads.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" /workspace/download.sh
10
+ fi
11
+ if [[ -n "${PROGRAMGYM_JITPACK_REPOSITORY_URL:-}" ]]; then
12
+ sed -i -e "s|https://jitpack.io|${PROGRAMGYM_JITPACK_REPOSITORY_URL%/}|g" /workspace/download.sh
13
+ fi
14
+ source /workspace/download.sh
15
+ set +a
16
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
17
+ import os
18
+ import shlex
19
+
20
+ ignored = {
21
+ "ALL_PROXY",
22
+ "HTTP_PROXY",
23
+ "HTTPS_PROXY",
24
+ "NO_PROXY",
25
+ "OLDPWD",
26
+ "PIP_PROXY",
27
+ "PWD",
28
+ "SHLVL",
29
+ "_",
30
+ "all_proxy",
31
+ "http_proxy",
32
+ "https_proxy",
33
+ "no_proxy",
34
+ "pip_proxy",
35
+ }
36
+ for key in sorted(os.environ):
37
+ if key in ignored or key.startswith("BASH_FUNC_"):
38
+ continue
39
+ value = os.environ[key]
40
+ if "\n" in value:
41
+ continue
42
+ print(f"export {key}={shlex.quote(value)}")
43
+ PY
44
+ chmod 0644 /etc/profile.d/programgym_download_env.sh
banach-space--clang-tutor.ddd702e/tests/programgym-gcc13.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88
3
+ size 146620404
banach-space--clang-tutor.ddd702e/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()
banach-space--clang-tutor.ddd702e/tests/programgym_task.json ADDED
@@ -0,0 +1,1900 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [
7
+ {
8
+ "name": "eval.tests.test_cli_edges.test_chained_two_run_rename_is_causally_connected",
9
+ "reasons": [
10
+ {
11
+ "id": "short_substring",
12
+ "message": "pytest test uses a too-short substring oracle",
13
+ "path": "eval/tests/test_cli_edges.py",
14
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
15
+ "severity": "error",
16
+ "stage": "static_lint"
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "name": "eval.tests.test_cli_edges.test_empty_build_path_no_compilation_db_required",
22
+ "reasons": [
23
+ {
24
+ "id": "short_substring",
25
+ "message": "pytest test uses a too-short substring oracle",
26
+ "path": "eval/tests/test_cli_edges.py",
27
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
28
+ "severity": "error",
29
+ "stage": "static_lint"
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "name": "eval.tests.test_cli_edges.test_extra_arg_before_define_also_works",
35
+ "reasons": [
36
+ {
37
+ "id": "short_substring",
38
+ "message": "pytest test uses a too-short substring oracle",
39
+ "path": "eval/tests/test_cli_edges.py",
40
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
41
+ "severity": "error",
42
+ "stage": "static_lint"
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "name": "eval.tests.test_cli_edges.test_extra_arg_define_enables_rename_branch",
48
+ "reasons": [
49
+ {
50
+ "id": "short_substring",
51
+ "message": "pytest test uses a too-short substring oracle",
52
+ "path": "eval/tests/test_cli_edges.py",
53
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
54
+ "severity": "error",
55
+ "stage": "static_lint"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "name": "eval.tests.test_cli_edges.test_help_list_hidden_exits_zero",
61
+ "reasons": [
62
+ {
63
+ "id": "short_substring",
64
+ "message": "pytest test uses a too-short substring oracle",
65
+ "path": "eval/tests/test_cli_edges.py",
66
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
67
+ "severity": "error",
68
+ "stage": "static_lint"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "name": "eval.tests.test_cli_edges.test_help_wins_over_positional_source",
74
+ "reasons": [
75
+ {
76
+ "id": "short_substring",
77
+ "message": "pytest test uses a too-short substring oracle",
78
+ "path": "eval/tests/test_cli_edges.py",
79
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
80
+ "severity": "error",
81
+ "stage": "static_lint"
82
+ },
83
+ {
84
+ "id": "generic_keyword_oracle",
85
+ "message": "pytest test uses a generic keyword oracle",
86
+ "path": "eval/tests/test_cli_edges.py",
87
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
88
+ "severity": "error",
89
+ "stage": "static_lint"
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "name": "eval.tests.test_cli_edges.test_include_header_call_site_renamed_header_not_mutated",
95
+ "reasons": [
96
+ {
97
+ "id": "short_substring",
98
+ "message": "pytest test uses a too-short substring oracle",
99
+ "path": "eval/tests/test_cli_edges.py",
100
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
101
+ "severity": "error",
102
+ "stage": "static_lint"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "name": "eval.tests.test_cli_edges.test_version_flag_prints_llvm_banner_to_stdout",
108
+ "reasons": [
109
+ {
110
+ "id": "short_substring",
111
+ "message": "pytest test uses a too-short substring oracle",
112
+ "path": "eval/tests/test_cli_edges.py",
113
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
114
+ "severity": "error",
115
+ "stage": "static_lint"
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "name": "eval.tests.test_driver_arg_validation.test_multiple_extra_arg_flags_both_needed_for_rename",
121
+ "reasons": [
122
+ {
123
+ "id": "short_substring",
124
+ "message": "pytest test uses a too-short substring oracle",
125
+ "path": "eval/tests/test_driver_arg_validation.py",
126
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
127
+ "severity": "error",
128
+ "stage": "static_lint"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "name": "eval.tests.test_driver_arg_validation.test_valid_compile_database_used_renames_cleanly",
134
+ "reasons": [
135
+ {
136
+ "id": "short_substring",
137
+ "message": "pytest test uses a too-short substring oracle",
138
+ "path": "eval/tests/test_driver_arg_validation.py",
139
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
140
+ "severity": "error",
141
+ "stage": "static_lint"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "name": "eval.tests.test_driver_depth.test_block_comment_preserved_across_rename",
147
+ "reasons": [
148
+ {
149
+ "id": "short_substring",
150
+ "message": "pytest test uses a too-short substring oracle",
151
+ "path": "eval/tests/test_driver_depth.py",
152
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
153
+ "severity": "error",
154
+ "stage": "static_lint"
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "name": "eval.tests.test_driver_depth.test_empty_new_name_rewrites_decl_and_call_to_empty",
160
+ "reasons": [
161
+ {
162
+ "id": "short_substring",
163
+ "message": "pytest test uses a too-short substring oracle",
164
+ "path": "eval/tests/test_driver_depth.py",
165
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
166
+ "severity": "error",
167
+ "stage": "static_lint"
168
+ },
169
+ {
170
+ "id": "golden_written_in_test",
171
+ "message": "pytest test writes to its own golden file",
172
+ "path": "eval/tests/test_driver_depth.py",
173
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
174
+ "severity": "error",
175
+ "stage": "static_lint"
176
+ },
177
+ {
178
+ "id": "golden_no_equality",
179
+ "message": "pytest test references golden data without equality comparison",
180
+ "path": "eval/tests/test_driver_depth.py",
181
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
182
+ "severity": "error",
183
+ "stage": "static_lint"
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "name": "eval.tests.test_driver_depth.test_help_short_circuits_before_rewrite",
189
+ "reasons": [
190
+ {
191
+ "id": "short_substring",
192
+ "message": "pytest test uses a too-short substring oracle",
193
+ "path": "eval/tests/test_driver_depth.py",
194
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
195
+ "severity": "error",
196
+ "stage": "static_lint"
197
+ },
198
+ {
199
+ "id": "generic_keyword_oracle",
200
+ "message": "pytest test uses a generic keyword oracle",
201
+ "path": "eval/tests/test_driver_depth.py",
202
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
203
+ "severity": "error",
204
+ "stage": "static_lint"
205
+ }
206
+ ]
207
+ },
208
+ {
209
+ "name": "eval.tests.test_driver_depth.test_missing_required_option_exits_one",
210
+ "reasons": [
211
+ {
212
+ "id": "short_substring",
213
+ "message": "pytest test uses a too-short substring oracle",
214
+ "path": "eval/tests/test_driver_depth.py",
215
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
216
+ "severity": "error",
217
+ "stage": "static_lint"
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "name": "eval.tests.test_driver_depth.test_missing_separator_no_progress_stderr_on_single",
223
+ "reasons": [
224
+ {
225
+ "id": "short_substring",
226
+ "message": "pytest test uses a too-short substring oracle",
227
+ "path": "eval/tests/test_driver_depth.py",
228
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
229
+ "severity": "error",
230
+ "stage": "static_lint"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "name": "eval.tests.test_driver_depth.test_print_options_with_missing_required_option_prints_nothing",
236
+ "reasons": [
237
+ {
238
+ "id": "short_substring",
239
+ "message": "pytest test uses a too-short substring oracle",
240
+ "path": "eval/tests/test_driver_depth.py",
241
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
242
+ "severity": "error",
243
+ "stage": "static_lint"
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "name": "eval.tests.test_driver_depth.test_repeated_class_name_last_value_wins",
249
+ "reasons": [
250
+ {
251
+ "id": "short_substring",
252
+ "message": "pytest test uses a too-short substring oracle",
253
+ "path": "eval/tests/test_driver_depth.py",
254
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
255
+ "severity": "error",
256
+ "stage": "static_lint"
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ "name": "eval.tests.test_driver_depth.test_repeated_old_name_last_value_wins",
262
+ "reasons": [
263
+ {
264
+ "id": "short_substring",
265
+ "message": "pytest test uses a too-short substring oracle",
266
+ "path": "eval/tests/test_driver_depth.py",
267
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
268
+ "severity": "error",
269
+ "stage": "static_lint"
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "name": "eval.tests.test_driver_depth.test_response_file_contents_honored_for_required_options",
275
+ "reasons": [
276
+ {
277
+ "id": "short_substring",
278
+ "message": "pytest test uses a too-short substring oracle",
279
+ "path": "eval/tests/test_driver_depth.py",
280
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
281
+ "severity": "error",
282
+ "stage": "static_lint"
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ "name": "eval.tests.test_driver_depth.test_response_file_missing_ignored_as_empty_argv",
288
+ "reasons": [
289
+ {
290
+ "id": "short_substring",
291
+ "message": "pytest test uses a too-short substring oracle",
292
+ "path": "eval/tests/test_driver_depth.py",
293
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
294
+ "severity": "error",
295
+ "stage": "static_lint"
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "name": "eval.tests.test_driver_depth.test_response_file_supplies_options_and_renames",
301
+ "reasons": [
302
+ {
303
+ "id": "short_substring",
304
+ "message": "pytest test uses a too-short substring oracle",
305
+ "path": "eval/tests/test_driver_depth.py",
306
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
307
+ "severity": "error",
308
+ "stage": "static_lint"
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "name": "eval.tests.test_driver_depth.test_successful_refactor_exits_exactly_zero",
314
+ "reasons": [
315
+ {
316
+ "id": "short_substring",
317
+ "message": "pytest test uses a too-short substring oracle",
318
+ "path": "eval/tests/test_driver_depth.py",
319
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
320
+ "severity": "error",
321
+ "stage": "static_lint"
322
+ }
323
+ ]
324
+ },
325
+ {
326
+ "name": "eval.tests.test_help_and_version.test_help_list_exits_zero_and_lists_options",
327
+ "reasons": [
328
+ {
329
+ "id": "short_substring",
330
+ "message": "pytest test uses a too-short substring oracle",
331
+ "path": "eval/tests/test_help_and_version.py",
332
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
333
+ "severity": "error",
334
+ "stage": "static_lint"
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ "name": "eval.tests.test_help_and_version.test_long_help_exits_zero_and_lists_required_options",
340
+ "reasons": [
341
+ {
342
+ "id": "short_substring",
343
+ "message": "pytest test uses a too-short substring oracle",
344
+ "path": "eval/tests/test_help_and_version.py",
345
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
346
+ "severity": "error",
347
+ "stage": "static_lint"
348
+ },
349
+ {
350
+ "id": "generic_keyword_oracle",
351
+ "message": "pytest test uses a generic keyword oracle",
352
+ "path": "eval/tests/test_help_and_version.py",
353
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
354
+ "severity": "error",
355
+ "stage": "static_lint"
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ "name": "eval.tests.test_help_and_version.test_no_arguments_fails_with_all_three_option_errors",
361
+ "reasons": [
362
+ {
363
+ "id": "short_substring",
364
+ "message": "pytest test uses a too-short substring oracle",
365
+ "path": "eval/tests/test_help_and_version.py",
366
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
367
+ "severity": "error",
368
+ "stage": "static_lint"
369
+ }
370
+ ]
371
+ },
372
+ {
373
+ "name": "eval.tests.test_help_and_version.test_only_new_name_supplied_is_still_rejected",
374
+ "reasons": [
375
+ {
376
+ "id": "short_substring",
377
+ "message": "pytest test uses a too-short substring oracle",
378
+ "path": "eval/tests/test_help_and_version.py",
379
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
380
+ "severity": "error",
381
+ "stage": "static_lint"
382
+ }
383
+ ]
384
+ },
385
+ {
386
+ "name": "eval.tests.test_help_and_version.test_only_source_supplied_with_no_options_fails",
387
+ "reasons": [
388
+ {
389
+ "id": "short_substring",
390
+ "message": "pytest test uses a too-short substring oracle",
391
+ "path": "eval/tests/test_help_and_version.py",
392
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
393
+ "severity": "error",
394
+ "stage": "static_lint"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ "name": "eval.tests.test_help_and_version.test_short_help_dash_h_exits_zero",
400
+ "reasons": [
401
+ {
402
+ "id": "short_substring",
403
+ "message": "pytest test uses a too-short substring oracle",
404
+ "path": "eval/tests/test_help_and_version.py",
405
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
406
+ "severity": "error",
407
+ "stage": "static_lint"
408
+ },
409
+ {
410
+ "id": "generic_keyword_oracle",
411
+ "message": "pytest test uses a generic keyword oracle",
412
+ "path": "eval/tests/test_help_and_version.py",
413
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
414
+ "severity": "error",
415
+ "stage": "static_lint"
416
+ }
417
+ ]
418
+ },
419
+ {
420
+ "name": "eval.tests.test_help_and_version.test_unknown_option_fails_with_message",
421
+ "reasons": [
422
+ {
423
+ "id": "short_substring",
424
+ "message": "pytest test uses a too-short substring oracle",
425
+ "path": "eval/tests/test_help_and_version.py",
426
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
427
+ "severity": "error",
428
+ "stage": "static_lint"
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ "name": "eval.tests.test_help_and_version.test_unknown_single_dash_option_fails",
434
+ "reasons": [
435
+ {
436
+ "id": "assertion_disjunction",
437
+ "message": "pytest assertion accepts alternatives with or",
438
+ "path": "eval/tests/test_help_and_version.py",
439
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
440
+ "severity": "error",
441
+ "stage": "static_lint"
442
+ }
443
+ ]
444
+ },
445
+ {
446
+ "name": "eval.tests.test_help_and_version.test_version_exits_zero_and_prints_llvm_version",
447
+ "reasons": [
448
+ {
449
+ "id": "short_substring",
450
+ "message": "pytest test uses a too-short substring oracle",
451
+ "path": "eval/tests/test_help_and_version.py",
452
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
453
+ "severity": "error",
454
+ "stage": "static_lint"
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ "name": "eval.tests.test_io_and_errors.test_comments_and_strings_literals_are_kept",
460
+ "reasons": [
461
+ {
462
+ "id": "short_substring",
463
+ "message": "pytest test uses a too-short substring oracle",
464
+ "path": "eval/tests/test_io_and_errors.py",
465
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
466
+ "severity": "error",
467
+ "stage": "static_lint"
468
+ }
469
+ ]
470
+ },
471
+ {
472
+ "name": "eval.tests.test_io_and_errors.test_malformed_source_reports_diagnostics_and_fails",
473
+ "reasons": [
474
+ {
475
+ "id": "short_substring",
476
+ "message": "pytest test uses a too-short substring oracle",
477
+ "path": "eval/tests/test_io_and_errors.py",
478
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
479
+ "severity": "error",
480
+ "stage": "static_lint"
481
+ },
482
+ {
483
+ "id": "generic_keyword_oracle",
484
+ "message": "pytest test uses a generic keyword oracle",
485
+ "path": "eval/tests/test_io_and_errors.py",
486
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
487
+ "severity": "error",
488
+ "stage": "static_lint"
489
+ }
490
+ ]
491
+ },
492
+ {
493
+ "name": "eval.tests.test_io_and_errors.test_no_separator_still_writes_rewrite_to_stdout",
494
+ "reasons": [
495
+ {
496
+ "id": "assertion_disjunction",
497
+ "message": "pytest assertion accepts alternatives with or",
498
+ "path": "eval/tests/test_io_and_errors.py",
499
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
500
+ "severity": "error",
501
+ "stage": "static_lint"
502
+ }
503
+ ]
504
+ },
505
+ {
506
+ "name": "eval.tests.test_io_and_errors.test_nonexistent_input_file_fails",
507
+ "reasons": [
508
+ {
509
+ "id": "assertion_disjunction",
510
+ "message": "pytest assertion accepts alternatives with or",
511
+ "path": "eval/tests/test_io_and_errors.py",
512
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
513
+ "severity": "error",
514
+ "stage": "static_lint"
515
+ },
516
+ {
517
+ "id": "short_substring",
518
+ "message": "pytest test uses a too-short substring oracle",
519
+ "path": "eval/tests/test_io_and_errors.py",
520
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
521
+ "severity": "error",
522
+ "stage": "static_lint"
523
+ }
524
+ ]
525
+ },
526
+ {
527
+ "name": "eval.tests.test_io_and_errors.test_source_file_not_rewritten_on_disk",
528
+ "reasons": [
529
+ {
530
+ "id": "short_substring",
531
+ "message": "pytest test uses a too-short substring oracle",
532
+ "path": "eval/tests/test_io_and_errors.py",
533
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
534
+ "severity": "error",
535
+ "stage": "static_lint"
536
+ }
537
+ ]
538
+ },
539
+ {
540
+ "name": "eval.tests.test_macro_and_build.test_build_path_flags_from_database_control_source",
541
+ "reasons": [
542
+ {
543
+ "detail": "AssertionError: assert 'class A { public: void go(){} };' in '#ifdef USE\\nclass A { public: void run(){} };\\n#endif\\n'",
544
+ "id": "gold_fail",
545
+ "message": "test failed against the reference executable",
546
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
547
+ "severity": "error",
548
+ "stage": "gold_execution"
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ "name": "eval.tests.test_new_quirks.test_outofline_definition_gap_is_explicit",
554
+ "reasons": [
555
+ {
556
+ "id": "short_substring",
557
+ "message": "pytest test uses a too-short substring oracle",
558
+ "path": "eval/tests/test_new_quirks.py",
559
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
560
+ "severity": "error",
561
+ "stage": "static_lint"
562
+ }
563
+ ]
564
+ },
565
+ {
566
+ "name": "eval.tests.test_new_quirks.test_static_call_sites_not_rewritten",
567
+ "reasons": [
568
+ {
569
+ "id": "short_substring",
570
+ "message": "pytest test uses a too-short substring oracle",
571
+ "path": "eval/tests/test_new_quirks.py",
572
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
573
+ "severity": "error",
574
+ "stage": "static_lint"
575
+ }
576
+ ]
577
+ },
578
+ {
579
+ "name": "eval.tests.test_new_shapes.test_anonymous_namespace_call_site_renamed",
580
+ "reasons": [
581
+ {
582
+ "id": "short_substring",
583
+ "message": "pytest test uses a too-short substring oracle",
584
+ "path": "eval/tests/test_new_shapes.py",
585
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
586
+ "severity": "error",
587
+ "stage": "static_lint"
588
+ }
589
+ ]
590
+ },
591
+ {
592
+ "name": "eval.tests.test_new_shapes.test_nested_member_decl_and_outer_type_untouched",
593
+ "reasons": [
594
+ {
595
+ "id": "short_substring",
596
+ "message": "pytest test uses a too-short substring oracle",
597
+ "path": "eval/tests/test_new_shapes.py",
598
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
599
+ "severity": "error",
600
+ "stage": "static_lint"
601
+ }
602
+ ]
603
+ },
604
+ {
605
+ "name": "eval.tests.test_print_options.test_print_all_options_full_golden",
606
+ "reasons": [
607
+ {
608
+ "id": "missing_fixture_assets",
609
+ "message": "pytest test references fixture assets that are not packaged",
610
+ "path": "eval/tests/test_print_options.py",
611
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
612
+ "severity": "error",
613
+ "stage": "static_lint"
614
+ }
615
+ ]
616
+ },
617
+ {
618
+ "name": "eval.tests.test_print_options.test_print_all_options_includes_both_print_flags",
619
+ "reasons": [
620
+ {
621
+ "id": "generic_keyword_oracle",
622
+ "message": "pytest test uses a generic keyword oracle",
623
+ "path": "eval/tests/test_print_options.py",
624
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
625
+ "severity": "error",
626
+ "stage": "static_lint"
627
+ }
628
+ ]
629
+ },
630
+ {
631
+ "name": "eval.tests.test_print_options.test_print_options_empty_class_name_is_noop_and_omitted",
632
+ "reasons": [
633
+ {
634
+ "id": "assertion_disjunction",
635
+ "message": "pytest assertion accepts alternatives with or",
636
+ "path": "eval/tests/test_print_options.py",
637
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
638
+ "severity": "error",
639
+ "stage": "static_lint"
640
+ },
641
+ {
642
+ "id": "short_substring",
643
+ "message": "pytest test uses a too-short substring oracle",
644
+ "path": "eval/tests/test_print_options.py",
645
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
646
+ "severity": "error",
647
+ "stage": "static_lint"
648
+ }
649
+ ]
650
+ },
651
+ {
652
+ "name": "eval.tests.test_print_options.test_print_options_full_table_and_rewrite",
653
+ "reasons": [
654
+ {
655
+ "id": "missing_fixture_assets",
656
+ "message": "pytest test references fixture assets that are not packaged",
657
+ "path": "eval/tests/test_print_options.py",
658
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
659
+ "severity": "error",
660
+ "stage": "static_lint"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "name": "eval.tests.test_print_options.test_print_options_help_flags_marked_cannot_print",
666
+ "reasons": [
667
+ {
668
+ "id": "short_substring",
669
+ "message": "pytest test uses a too-short substring oracle",
670
+ "path": "eval/tests/test_print_options.py",
671
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
672
+ "severity": "error",
673
+ "stage": "static_lint"
674
+ }
675
+ ]
676
+ },
677
+ {
678
+ "name": "eval.tests.test_print_options.test_print_options_without_separator_still_dumps_table",
679
+ "reasons": [
680
+ {
681
+ "id": "assertion_disjunction",
682
+ "message": "pytest assertion accepts alternatives with or",
683
+ "path": "eval/tests/test_print_options.py",
684
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
685
+ "severity": "error",
686
+ "stage": "static_lint"
687
+ },
688
+ {
689
+ "id": "short_substring",
690
+ "message": "pytest test uses a too-short substring oracle",
691
+ "path": "eval/tests/test_print_options.py",
692
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
693
+ "severity": "error",
694
+ "stage": "static_lint"
695
+ }
696
+ ]
697
+ },
698
+ {
699
+ "name": "eval.tests.test_refactor.test_rename_arrow_call_sites",
700
+ "reasons": [
701
+ {
702
+ "id": "short_substring",
703
+ "message": "pytest test uses a too-short substring oracle",
704
+ "path": "eval/tests/test_refactor.py",
705
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
706
+ "severity": "error",
707
+ "stage": "static_lint"
708
+ }
709
+ ]
710
+ },
711
+ {
712
+ "name": "eval.tests.test_refactor.test_rename_updates_declaration_and_call_sites",
713
+ "reasons": [
714
+ {
715
+ "id": "short_substring",
716
+ "message": "pytest test uses a too-short substring oracle",
717
+ "path": "eval/tests/test_refactor.py",
718
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
719
+ "severity": "error",
720
+ "stage": "static_lint"
721
+ }
722
+ ]
723
+ },
724
+ {
725
+ "name": "eval.tests.test_refactor.test_unrelated_method_in_same_class_left_alone",
726
+ "reasons": [
727
+ {
728
+ "id": "short_substring",
729
+ "message": "pytest test uses a too-short substring oracle",
730
+ "path": "eval/tests/test_refactor.py",
731
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
732
+ "severity": "error",
733
+ "stage": "static_lint"
734
+ }
735
+ ]
736
+ },
737
+ {
738
+ "name": "eval.tests.test_refactor_quirks.test_class_name_that_is_not_a_class_is_noop",
739
+ "reasons": [
740
+ {
741
+ "id": "short_substring",
742
+ "message": "pytest test uses a too-short substring oracle",
743
+ "path": "eval/tests/test_refactor_quirks.py",
744
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
745
+ "severity": "error",
746
+ "stage": "static_lint"
747
+ }
748
+ ]
749
+ },
750
+ {
751
+ "name": "eval.tests.test_refactor_quirks.test_empty_old_name_is_noop",
752
+ "reasons": [
753
+ {
754
+ "id": "short_substring",
755
+ "message": "pytest test uses a too-short substring oracle",
756
+ "path": "eval/tests/test_refactor_quirks.py",
757
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
758
+ "severity": "error",
759
+ "stage": "static_lint"
760
+ }
761
+ ]
762
+ },
763
+ {
764
+ "name": "eval.tests.test_refactor_quirks.test_member_function_pointer_target_not_rewritten",
765
+ "reasons": [
766
+ {
767
+ "id": "short_substring",
768
+ "message": "pytest test uses a too-short substring oracle",
769
+ "path": "eval/tests/test_refactor_quirks.py",
770
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
771
+ "severity": "error",
772
+ "stage": "static_lint"
773
+ }
774
+ ]
775
+ },
776
+ {
777
+ "name": "eval.tests.test_refactor_quirks.test_version_suppresses_refactoring",
778
+ "reasons": [
779
+ {
780
+ "id": "short_substring",
781
+ "message": "pytest test uses a too-short substring oracle",
782
+ "path": "eval/tests/test_refactor_quirks.py",
783
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
784
+ "severity": "error",
785
+ "stage": "static_lint"
786
+ }
787
+ ]
788
+ },
789
+ {
790
+ "name": "eval.tests.test_refactor_shapes.test_free_function_with_same_name_not_renamed",
791
+ "reasons": [
792
+ {
793
+ "id": "short_substring",
794
+ "message": "pytest test uses a too-short substring oracle",
795
+ "path": "eval/tests/test_refactor_shapes.py",
796
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
797
+ "severity": "error",
798
+ "stage": "static_lint"
799
+ }
800
+ ]
801
+ },
802
+ {
803
+ "name": "eval.tests.test_refactor_shapes.test_namespace_nested_class_rename",
804
+ "reasons": [
805
+ {
806
+ "id": "short_substring",
807
+ "message": "pytest test uses a too-short substring oracle",
808
+ "path": "eval/tests/test_refactor_shapes.py",
809
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
810
+ "severity": "error",
811
+ "stage": "static_lint"
812
+ },
813
+ {
814
+ "id": "golden_no_equality",
815
+ "message": "pytest test references golden data without equality comparison",
816
+ "path": "eval/tests/test_refactor_shapes.py",
817
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
818
+ "severity": "error",
819
+ "stage": "static_lint"
820
+ }
821
+ ]
822
+ },
823
+ {
824
+ "name": "eval.tests.test_refactor_shapes.test_overload_renames_only_head_overload",
825
+ "reasons": [
826
+ {
827
+ "id": "golden_no_equality",
828
+ "message": "pytest test references golden data without equality comparison",
829
+ "path": "eval/tests/test_refactor_shapes.py",
830
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
831
+ "severity": "error",
832
+ "stage": "static_lint"
833
+ }
834
+ ]
835
+ },
836
+ {
837
+ "name": "eval.tests.test_refactor_shapes.test_rename_then_inherited_call_sites",
838
+ "reasons": [
839
+ {
840
+ "id": "short_substring",
841
+ "message": "pytest test uses a too-short substring oracle",
842
+ "path": "eval/tests/test_refactor_shapes.py",
843
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
844
+ "severity": "error",
845
+ "stage": "static_lint"
846
+ }
847
+ ]
848
+ },
849
+ {
850
+ "name": "eval.tests.test_refactor_shapes.test_two_classes_same_method_disambiguated_alpha",
851
+ "reasons": [
852
+ {
853
+ "id": "short_substring",
854
+ "message": "pytest test uses a too-short substring oracle",
855
+ "path": "eval/tests/test_refactor_shapes.py",
856
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
857
+ "severity": "error",
858
+ "stage": "static_lint"
859
+ },
860
+ {
861
+ "id": "golden_no_equality",
862
+ "message": "pytest test references golden data without equality comparison",
863
+ "path": "eval/tests/test_refactor_shapes.py",
864
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
865
+ "severity": "error",
866
+ "stage": "static_lint"
867
+ }
868
+ ]
869
+ },
870
+ {
871
+ "name": "eval.tests.test_refactor_shapes.test_two_classes_same_method_disambiguated_beta",
872
+ "reasons": [
873
+ {
874
+ "id": "short_substring",
875
+ "message": "pytest test uses a too-short substring oracle",
876
+ "path": "eval/tests/test_refactor_shapes.py",
877
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
878
+ "severity": "error",
879
+ "stage": "static_lint"
880
+ },
881
+ {
882
+ "id": "golden_no_equality",
883
+ "message": "pytest test references golden data without equality comparison",
884
+ "path": "eval/tests/test_refactor_shapes.py",
885
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
886
+ "severity": "error",
887
+ "stage": "static_lint"
888
+ }
889
+ ]
890
+ },
891
+ {
892
+ "name": "eval.tests.test_required_options.test_missing_class_name",
893
+ "reasons": [
894
+ {
895
+ "id": "short_substring",
896
+ "message": "pytest test uses a too-short substring oracle",
897
+ "path": "eval/tests/test_required_options.py",
898
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
899
+ "severity": "error",
900
+ "stage": "static_lint"
901
+ }
902
+ ]
903
+ },
904
+ {
905
+ "name": "eval.tests.test_required_options.test_missing_class_name_when_old_and_new_present",
906
+ "reasons": [
907
+ {
908
+ "id": "short_substring",
909
+ "message": "pytest test uses a too-short substring oracle",
910
+ "path": "eval/tests/test_required_options.py",
911
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
912
+ "severity": "error",
913
+ "stage": "static_lint"
914
+ }
915
+ ]
916
+ },
917
+ {
918
+ "name": "eval.tests.test_required_options.test_missing_new_name",
919
+ "reasons": [
920
+ {
921
+ "id": "short_substring",
922
+ "message": "pytest test uses a too-short substring oracle",
923
+ "path": "eval/tests/test_required_options.py",
924
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
925
+ "severity": "error",
926
+ "stage": "static_lint"
927
+ }
928
+ ]
929
+ },
930
+ {
931
+ "name": "eval.tests.test_required_options.test_missing_old_name",
932
+ "reasons": [
933
+ {
934
+ "id": "short_substring",
935
+ "message": "pytest test uses a too-short substring oracle",
936
+ "path": "eval/tests/test_required_options.py",
937
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
938
+ "severity": "error",
939
+ "stage": "static_lint"
940
+ }
941
+ ]
942
+ }
943
+ ],
944
+ "tests": [
945
+ "eval.tests.test_cli_edges.test_chained_two_run_rename_is_causally_connected",
946
+ "eval.tests.test_cli_edges.test_empty_build_path_no_compilation_db_required",
947
+ "eval.tests.test_cli_edges.test_extra_arg_before_define_also_works",
948
+ "eval.tests.test_cli_edges.test_extra_arg_define_enables_rename_branch",
949
+ "eval.tests.test_cli_edges.test_help_hidden_lists_ct_options",
950
+ "eval.tests.test_cli_edges.test_help_list_hidden_exits_zero",
951
+ "eval.tests.test_cli_edges.test_help_wins_over_positional_source",
952
+ "eval.tests.test_cli_edges.test_include_header_call_site_renamed_header_not_mutated",
953
+ "eval.tests.test_cli_edges.test_multiple_input_files_class_disambiguation_across_tus",
954
+ "eval.tests.test_cli_edges.test_no_sources_with_separator_is_error",
955
+ "eval.tests.test_cli_edges.test_version_flag_prints_llvm_banner_to_stdout",
956
+ "eval.tests.test_cli_edges.test_without_define_rename_is_noop",
957
+ "eval.tests.test_driver_arg_validation.test_build_path_flag_missing_value_rejected",
958
+ "eval.tests.test_driver_arg_validation.test_compile_database_no_matching_entry_skips_file",
959
+ "eval.tests.test_driver_arg_validation.test_extra_arg_before_option_missing_value_rejected",
960
+ "eval.tests.test_driver_arg_validation.test_extra_arg_option_missing_value_rejected",
961
+ "eval.tests.test_driver_arg_validation.test_multiple_extra_arg_flags_both_needed_for_rename",
962
+ "eval.tests.test_driver_arg_validation.test_stdin_dash_source_is_rejected",
963
+ "eval.tests.test_driver_arg_validation.test_valid_compile_database_used_renames_cleanly",
964
+ "eval.tests.test_driver_depth.test_block_comment_preserved_across_rename",
965
+ "eval.tests.test_driver_depth.test_directory_input_is_rejected",
966
+ "eval.tests.test_driver_depth.test_empty_new_name_rewrites_decl_and_call_to_empty",
967
+ "eval.tests.test_driver_depth.test_help_short_circuits_before_rewrite",
968
+ "eval.tests.test_driver_depth.test_missing_input_file_reports_no_such_file",
969
+ "eval.tests.test_driver_depth.test_missing_required_option_exits_one",
970
+ "eval.tests.test_driver_depth.test_missing_separator_no_progress_stderr_on_single",
971
+ "eval.tests.test_driver_depth.test_print_options_with_missing_required_option_prints_nothing",
972
+ "eval.tests.test_driver_depth.test_repeated_class_name_last_value_wins",
973
+ "eval.tests.test_driver_depth.test_repeated_old_name_last_value_wins",
974
+ "eval.tests.test_driver_depth.test_response_file_contents_honored_for_required_options",
975
+ "eval.tests.test_driver_depth.test_response_file_missing_ignored_as_empty_argv",
976
+ "eval.tests.test_driver_depth.test_response_file_supplies_options_and_renames",
977
+ "eval.tests.test_driver_depth.test_successful_refactor_exits_exactly_zero",
978
+ "eval.tests.test_driver_depth.test_unknown_file_extension_is_rejected",
979
+ "eval.tests.test_help_and_version.test_help_list_exits_zero_and_lists_options",
980
+ "eval.tests.test_help_and_version.test_long_help_exits_zero_and_lists_required_options",
981
+ "eval.tests.test_help_and_version.test_no_arguments_fails_with_all_three_option_errors",
982
+ "eval.tests.test_help_and_version.test_only_new_name_supplied_is_still_rejected",
983
+ "eval.tests.test_help_and_version.test_only_source_supplied_with_no_options_fails",
984
+ "eval.tests.test_help_and_version.test_short_help_dash_h_exits_zero",
985
+ "eval.tests.test_help_and_version.test_unknown_option_fails_with_message",
986
+ "eval.tests.test_help_and_version.test_unknown_single_dash_option_fails",
987
+ "eval.tests.test_help_and_version.test_version_exits_zero_and_prints_llvm_version",
988
+ "eval.tests.test_io_and_errors.test_comments_and_strings_literals_are_kept",
989
+ "eval.tests.test_io_and_errors.test_empty_input_file_exits_zero",
990
+ "eval.tests.test_io_and_errors.test_malformed_source_reports_diagnostics_and_fails",
991
+ "eval.tests.test_io_and_errors.test_multiple_input_files_each_processed",
992
+ "eval.tests.test_io_and_errors.test_no_separator_still_writes_rewrite_to_stdout",
993
+ "eval.tests.test_io_and_errors.test_nonexistent_input_file_fails",
994
+ "eval.tests.test_io_and_errors.test_source_file_not_rewritten_on_disk",
995
+ "eval.tests.test_io_and_errors.test_whitespace_only_input_exits_zero",
996
+ "eval.tests.test_macro_and_build.test_build_path_compilation_database_rename",
997
+ "eval.tests.test_macro_and_build.test_build_path_flags_from_database_control_source",
998
+ "eval.tests.test_macro_and_build.test_macro_guard_off_echoes_source_unchanged",
999
+ "eval.tests.test_macro_and_build.test_macro_guard_on_reenames",
1000
+ "eval.tests.test_macro_and_build.test_macro_whole_class_removed_leaves_source",
1001
+ "eval.tests.test_macro_and_build.test_macro_whole_class_renamed_when_enabled",
1002
+ "eval.tests.test_new_quirks.test_new_quirk_matches_golden[ctor_rename.cpp]",
1003
+ "eval.tests.test_new_quirks.test_new_quirk_matches_golden[outofline.cpp]",
1004
+ "eval.tests.test_new_quirks.test_new_quirk_matches_golden[static_call.cpp]",
1005
+ "eval.tests.test_new_quirks.test_new_quirk_matches_golden[substring.cpp]",
1006
+ "eval.tests.test_new_quirks.test_new_quirk_matches_golden[var_same_name.cpp]",
1007
+ "eval.tests.test_new_quirks.test_outofline_definition_gap_is_explicit",
1008
+ "eval.tests.test_new_quirks.test_static_call_sites_not_rewritten",
1009
+ "eval.tests.test_new_shapes.test_anonymous_namespace_call_site_renamed",
1010
+ "eval.tests.test_new_shapes.test_nested_member_decl_and_outer_type_untouched",
1011
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go0]",
1012
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go1]",
1013
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go2]",
1014
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go3]",
1015
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go4]",
1016
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go5]",
1017
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go6]",
1018
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go7]",
1019
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go8]",
1020
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-A old-name-run new-name-go9]",
1021
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-B old-name-run new-name-go]",
1022
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-Base old-name-run new-name-walk0]",
1023
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-Base old-name-run new-name-walk1]",
1024
+ "eval.tests.test_new_shapes.test_new_shape_matches_golden[class-name-U old-name-run new-name-walk]",
1025
+ "eval.tests.test_no_match.test_no_match_cases_emit_source_unchanged[class_base.cpp---old-name=missing]",
1026
+ "eval.tests.test_no_match.test_no_match_cases_emit_source_unchanged[class_base.cpp---old-name=run]",
1027
+ "eval.tests.test_no_match.test_no_match_cases_emit_source_unchanged[simple.cpp---old-name=greet]",
1028
+ "eval.tests.test_no_match.test_no_match_echoes_unchanged[no_match.cpp]",
1029
+ "eval.tests.test_no_match.test_rename_to_same_name_is_noop",
1030
+ "eval.tests.test_no_match.test_wrong_case_method_not_renamed",
1031
+ "eval.tests.test_print_options.test_print_all_options_full_golden",
1032
+ "eval.tests.test_print_options.test_print_all_options_includes_both_print_flags",
1033
+ "eval.tests.test_print_options.test_print_options_echoes_parsed_values",
1034
+ "eval.tests.test_print_options.test_print_options_empty_class_name_is_noop_and_omitted",
1035
+ "eval.tests.test_print_options.test_print_options_full_table_and_rewrite",
1036
+ "eval.tests.test_print_options.test_print_options_help_flags_marked_cannot_print",
1037
+ "eval.tests.test_print_options.test_print_options_rewrite_still_applies_rename",
1038
+ "eval.tests.test_print_options.test_print_options_without_separator_still_dumps_table",
1039
+ "eval.tests.test_refactor.test_rename_arrow_call_sites",
1040
+ "eval.tests.test_refactor.test_rename_matches_golden[class_base.cpp]",
1041
+ "eval.tests.test_refactor.test_rename_matches_golden[derived_only.cpp]",
1042
+ "eval.tests.test_refactor.test_rename_matches_golden[simple.cpp]",
1043
+ "eval.tests.test_refactor.test_rename_matches_golden[struct_base.cpp]",
1044
+ "eval.tests.test_refactor.test_rename_updates_declaration_and_call_sites",
1045
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[class_base.cpp-equals]",
1046
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[class_base.cpp-space]",
1047
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[derived_only.cpp-equals]",
1048
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[derived_only.cpp-space]",
1049
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[simple.cpp-equals]",
1050
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[simple.cpp-space]",
1051
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[struct_base.cpp-equals]",
1052
+ "eval.tests.test_refactor.test_rename_with_space_separated_values[struct_base.cpp-space]",
1053
+ "eval.tests.test_refactor.test_unrelated_method_in_same_class_left_alone",
1054
+ "eval.tests.test_refactor_quirks.test_class_name_that_is_not_a_class_is_noop",
1055
+ "eval.tests.test_refactor_quirks.test_empty_new_name_matches_but_no_change",
1056
+ "eval.tests.test_refactor_quirks.test_empty_old_name_is_noop",
1057
+ "eval.tests.test_refactor_quirks.test_member_function_pointer_target_not_rewritten",
1058
+ "eval.tests.test_refactor_quirks.test_quirk_matches_golden[collide.cpp]",
1059
+ "eval.tests.test_refactor_quirks.test_quirk_matches_golden[mfp.cpp]",
1060
+ "eval.tests.test_refactor_quirks.test_version_suppresses_refactoring",
1061
+ "eval.tests.test_refactor_shapes.test_free_function_with_same_name_not_renamed",
1062
+ "eval.tests.test_refactor_shapes.test_namespace_nested_class_rename",
1063
+ "eval.tests.test_refactor_shapes.test_overload_renames_only_head_overload",
1064
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-Base old-name-run new-name-walk0]",
1065
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-Base old-name-run new-name-walk1]",
1066
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-Base old-name-step new-name-hop]",
1067
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-Box old-name-get new-name-fetch]",
1068
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-C old-name-helper new-name-assist]",
1069
+ "eval.tests.test_refactor_shapes.test_refactor_shape_matches_golden[class-name-Q old-name-step new-name-advance]",
1070
+ "eval.tests.test_refactor_shapes.test_rename_then_inherited_call_sites",
1071
+ "eval.tests.test_refactor_shapes.test_two_classes_same_method_disambiguated_alpha",
1072
+ "eval.tests.test_refactor_shapes.test_two_classes_same_method_disambiguated_beta",
1073
+ "eval.tests.test_required_options.test_empty_class_name_value_is_accepted",
1074
+ "eval.tests.test_required_options.test_empty_new_name_value_is_accepted",
1075
+ "eval.tests.test_required_options.test_empty_old_name_value_is_accepted",
1076
+ "eval.tests.test_required_options.test_missing_class_name",
1077
+ "eval.tests.test_required_options.test_missing_class_name_when_old_and_new_present",
1078
+ "eval.tests.test_required_options.test_missing_new_name",
1079
+ "eval.tests.test_required_options.test_missing_old_name",
1080
+ "eval.tests.test_stream_multifile.test_progress_lines_on_stderr_sequence",
1081
+ "eval.tests.test_stream_multifile.test_single_unit_has_no_progress_banner_on_stderr",
1082
+ "eval.tests.test_stream_multifile.test_stdout_has_no_processing_banners",
1083
+ "eval.tests.test_stream_multifile.test_three_units_each_rewritten_on_stdout",
1084
+ "eval.tests.test_stream_multifile.test_two_units_distinct_content_concatenated"
1085
+ ]
1086
+ },
1087
+ "generated_module_02": {
1088
+ "ignore_reason": "",
1089
+ "ignored": false,
1090
+ "ignored_tests": [
1091
+ {
1092
+ "name": "eval.tests.test_cli_and_args.test_no_source_file_fails",
1093
+ "reasons": [
1094
+ {
1095
+ "id": "generic_keyword_oracle",
1096
+ "message": "pytest test uses a generic keyword oracle",
1097
+ "path": "eval/tests/test_cli_and_args.py",
1098
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1099
+ "severity": "error",
1100
+ "stage": "static_lint"
1101
+ }
1102
+ ]
1103
+ },
1104
+ {
1105
+ "name": "eval.tests.test_cli_and_args.test_rewritten_source_matches_golden",
1106
+ "reasons": [
1107
+ {
1108
+ "id": "missing_fixture_assets",
1109
+ "message": "pytest test references fixture assets that are not packaged",
1110
+ "path": "eval/tests/test_cli_and_args.py",
1111
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1112
+ "severity": "error",
1113
+ "stage": "static_lint"
1114
+ }
1115
+ ]
1116
+ },
1117
+ {
1118
+ "name": "eval.tests.test_cli_and_args.test_syntax_error_keeps_erroneous_tu_otherwise_unchanged",
1119
+ "reasons": [
1120
+ {
1121
+ "id": "generic_keyword_oracle",
1122
+ "message": "pytest test uses a generic keyword oracle",
1123
+ "path": "eval/tests/test_cli_and_args.py",
1124
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1125
+ "severity": "error",
1126
+ "stage": "static_lint"
1127
+ }
1128
+ ]
1129
+ },
1130
+ {
1131
+ "name": "eval.tests.test_cli_and_args.test_three_source_files_progress_and_concatenation",
1132
+ "reasons": [
1133
+ {
1134
+ "id": "generic_keyword_oracle",
1135
+ "message": "pytest test uses a generic keyword oracle",
1136
+ "path": "eval/tests/test_cli_and_args.py",
1137
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1138
+ "severity": "error",
1139
+ "stage": "static_lint"
1140
+ }
1141
+ ]
1142
+ },
1143
+ {
1144
+ "name": "eval.tests.test_cli_and_args.test_two_source_files_both_rewritten_exact",
1145
+ "reasons": [
1146
+ {
1147
+ "id": "generic_keyword_oracle",
1148
+ "message": "pytest test uses a generic keyword oracle",
1149
+ "path": "eval/tests/test_cli_and_args.py",
1150
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1151
+ "severity": "error",
1152
+ "stage": "static_lint"
1153
+ }
1154
+ ]
1155
+ },
1156
+ {
1157
+ "name": "eval.tests.test_cli_and_args.test_two_source_files_stdout_golden",
1158
+ "reasons": [
1159
+ {
1160
+ "id": "missing_fixture_assets",
1161
+ "message": "pytest test references fixture assets that are not packaged",
1162
+ "path": "eval/tests/test_cli_and_args.py",
1163
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1164
+ "severity": "error",
1165
+ "stage": "static_lint"
1166
+ }
1167
+ ]
1168
+ },
1169
+ {
1170
+ "name": "eval.tests.test_cli_and_args.test_unknown_option_fails",
1171
+ "reasons": [
1172
+ {
1173
+ "id": "generic_keyword_oracle",
1174
+ "message": "pytest test uses a generic keyword oracle",
1175
+ "path": "eval/tests/test_cli_and_args.py",
1176
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1177
+ "severity": "error",
1178
+ "stage": "static_lint"
1179
+ }
1180
+ ]
1181
+ },
1182
+ {
1183
+ "name": "eval.tests.test_derivation_graphs.test_diamond_virtual_inheritance_all_levels_renamed",
1184
+ "reasons": [
1185
+ {
1186
+ "id": "missing_fixture_assets",
1187
+ "message": "pytest test references fixture assets that are not packaged",
1188
+ "path": "eval/tests/test_derivation_graphs.py",
1189
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1190
+ "severity": "error",
1191
+ "stage": "static_lint"
1192
+ }
1193
+ ]
1194
+ },
1195
+ {
1196
+ "name": "eval.tests.test_derivation_graphs.test_final_override_renamed",
1197
+ "reasons": [
1198
+ {
1199
+ "id": "missing_fixture_assets",
1200
+ "message": "pytest test references fixture assets that are not packaged",
1201
+ "path": "eval/tests/test_derivation_graphs.py",
1202
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1203
+ "severity": "error",
1204
+ "stage": "static_lint"
1205
+ }
1206
+ ]
1207
+ },
1208
+ {
1209
+ "name": "eval.tests.test_derivation_graphs.test_four_level_inheritance_chain_renamed",
1210
+ "reasons": [
1211
+ {
1212
+ "id": "missing_fixture_assets",
1213
+ "message": "pytest test references fixture assets that are not packaged",
1214
+ "path": "eval/tests/test_derivation_graphs.py",
1215
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1216
+ "severity": "error",
1217
+ "stage": "static_lint"
1218
+ }
1219
+ ]
1220
+ },
1221
+ {
1222
+ "name": "eval.tests.test_derivation_graphs.test_multiple_inheritance_renames_only_the_matched_base",
1223
+ "reasons": [
1224
+ {
1225
+ "id": "short_substring",
1226
+ "message": "pytest test uses a too-short substring oracle",
1227
+ "path": "eval/tests/test_derivation_graphs.py",
1228
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1229
+ "severity": "error",
1230
+ "stage": "static_lint"
1231
+ }
1232
+ ]
1233
+ },
1234
+ {
1235
+ "name": "eval.tests.test_derivation_graphs.test_namespace_qualified_class_and_call_renamed",
1236
+ "reasons": [
1237
+ {
1238
+ "id": "missing_fixture_assets",
1239
+ "message": "pytest test references fixture assets that are not packaged",
1240
+ "path": "eval/tests/test_derivation_graphs.py",
1241
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1242
+ "severity": "error",
1243
+ "stage": "static_lint"
1244
+ }
1245
+ ]
1246
+ },
1247
+ {
1248
+ "name": "eval.tests.test_derivation_graphs.test_private_inheritance_still_matches",
1249
+ "reasons": [
1250
+ {
1251
+ "id": "missing_fixture_assets",
1252
+ "message": "pytest test references fixture assets that are not packaged",
1253
+ "path": "eval/tests/test_derivation_graphs.py",
1254
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1255
+ "severity": "error",
1256
+ "stage": "static_lint"
1257
+ }
1258
+ ]
1259
+ },
1260
+ {
1261
+ "name": "eval.tests.test_derivation_graphs.test_protected_inheritance_still_matches",
1262
+ "reasons": [
1263
+ {
1264
+ "id": "missing_fixture_assets",
1265
+ "message": "pytest test references fixture assets that are not packaged",
1266
+ "path": "eval/tests/test_derivation_graphs.py",
1267
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1268
+ "severity": "error",
1269
+ "stage": "static_lint"
1270
+ }
1271
+ ]
1272
+ },
1273
+ {
1274
+ "name": "eval.tests.test_derivation_graphs.test_two_parallel_derived_branches_renamed",
1275
+ "reasons": [
1276
+ {
1277
+ "id": "missing_fixture_assets",
1278
+ "message": "pytest test references fixture assets that are not packaged",
1279
+ "path": "eval/tests/test_derivation_graphs.py",
1280
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1281
+ "severity": "error",
1282
+ "stage": "static_lint"
1283
+ }
1284
+ ]
1285
+ },
1286
+ {
1287
+ "name": "eval.tests.test_derivation_graphs.test_virtual_inheritance_derived_renamed",
1288
+ "reasons": [
1289
+ {
1290
+ "id": "missing_fixture_assets",
1291
+ "message": "pytest test references fixture assets that are not packaged",
1292
+ "path": "eval/tests/test_derivation_graphs.py",
1293
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1294
+ "severity": "error",
1295
+ "stage": "static_lint"
1296
+ }
1297
+ ]
1298
+ },
1299
+ {
1300
+ "name": "eval.tests.test_driver_edge_cases.test_empty_new_name_rewrites_tokens_to_empty",
1301
+ "reasons": [
1302
+ {
1303
+ "id": "missing_fixture_assets",
1304
+ "message": "pytest test references fixture assets that are not packaged",
1305
+ "path": "eval/tests/test_driver_edge_cases.py",
1306
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1307
+ "severity": "error",
1308
+ "stage": "static_lint"
1309
+ }
1310
+ ]
1311
+ },
1312
+ {
1313
+ "name": "eval.tests.test_driver_edge_cases.test_repeated_class_name_uses_last_value",
1314
+ "reasons": [
1315
+ {
1316
+ "id": "missing_fixture_assets",
1317
+ "message": "pytest test references fixture assets that are not packaged",
1318
+ "path": "eval/tests/test_driver_edge_cases.py",
1319
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1320
+ "severity": "error",
1321
+ "stage": "static_lint"
1322
+ }
1323
+ ]
1324
+ },
1325
+ {
1326
+ "name": "eval.tests.test_driver_edge_cases.test_unrelated_filename_extension_accepted",
1327
+ "reasons": [
1328
+ {
1329
+ "id": "short_substring",
1330
+ "message": "pytest test uses a too-short substring oracle",
1331
+ "path": "eval/tests/test_driver_edge_cases.py",
1332
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1333
+ "severity": "error",
1334
+ "stage": "static_lint"
1335
+ }
1336
+ ]
1337
+ },
1338
+ {
1339
+ "name": "eval.tests.test_inheritance_negative.test_method_spelled_in_string_literal_untouched",
1340
+ "reasons": [
1341
+ {
1342
+ "id": "short_substring",
1343
+ "message": "pytest test uses a too-short substring oracle",
1344
+ "path": "eval/tests/test_inheritance_negative.py",
1345
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1346
+ "severity": "error",
1347
+ "stage": "static_lint"
1348
+ }
1349
+ ]
1350
+ },
1351
+ {
1352
+ "name": "eval.tests.test_inheritance_negative.test_multilevel_inheritance_all_levels_renamed",
1353
+ "reasons": [
1354
+ {
1355
+ "id": "missing_fixture_assets",
1356
+ "message": "pytest test references fixture assets that are not packaged",
1357
+ "path": "eval/tests/test_inheritance_negative.py",
1358
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1359
+ "severity": "error",
1360
+ "stage": "static_lint"
1361
+ }
1362
+ ]
1363
+ },
1364
+ {
1365
+ "name": "eval.tests.test_inheritance_negative.test_qualified_name_appearing_in_comment_untouched",
1366
+ "reasons": [
1367
+ {
1368
+ "id": "short_substring",
1369
+ "message": "pytest test uses a too-short substring oracle",
1370
+ "path": "eval/tests/test_inheritance_negative.py",
1371
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1372
+ "severity": "error",
1373
+ "stage": "static_lint"
1374
+ }
1375
+ ]
1376
+ },
1377
+ {
1378
+ "name": "eval.tests.test_inheritance_negative.test_struct_derived_from_class_renamed",
1379
+ "reasons": [
1380
+ {
1381
+ "id": "missing_fixture_assets",
1382
+ "message": "pytest test references fixture assets that are not packaged",
1383
+ "path": "eval/tests/test_inheritance_negative.py",
1384
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1385
+ "severity": "error",
1386
+ "stage": "static_lint"
1387
+ }
1388
+ ]
1389
+ },
1390
+ {
1391
+ "name": "eval.tests.test_refactor_rename.test_rename_base_and_all_derived_exact",
1392
+ "reasons": [
1393
+ {
1394
+ "id": "missing_fixture_assets",
1395
+ "message": "pytest test references fixture assets that are not packaged",
1396
+ "path": "eval/tests/test_refactor_rename.py",
1397
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1398
+ "severity": "error",
1399
+ "stage": "static_lint"
1400
+ }
1401
+ ]
1402
+ },
1403
+ {
1404
+ "name": "eval.tests.test_rename_boundaries.test_pure_virtual_interface_declaration_renamed",
1405
+ "reasons": [
1406
+ {
1407
+ "id": "generic_keyword_oracle",
1408
+ "message": "pytest test uses a generic keyword oracle",
1409
+ "path": "eval/tests/test_rename_boundaries.py",
1410
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1411
+ "severity": "error",
1412
+ "stage": "static_lint"
1413
+ }
1414
+ ]
1415
+ },
1416
+ {
1417
+ "name": "eval.tests.test_rename_boundaries.test_rename_method_with_overloads_exact",
1418
+ "reasons": [
1419
+ {
1420
+ "id": "missing_fixture_assets",
1421
+ "message": "pytest test references fixture assets that are not packaged",
1422
+ "path": "eval/tests/test_rename_boundaries.py",
1423
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1424
+ "severity": "error",
1425
+ "stage": "static_lint"
1426
+ }
1427
+ ]
1428
+ },
1429
+ {
1430
+ "name": "eval.tests.test_rename_boundaries.test_static_member_declaration_renamed_but_calls_untouched",
1431
+ "reasons": [
1432
+ {
1433
+ "id": "missing_fixture_assets",
1434
+ "message": "pytest test references fixture assets that are not packaged",
1435
+ "path": "eval/tests/test_rename_boundaries.py",
1436
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1437
+ "severity": "error",
1438
+ "stage": "static_lint"
1439
+ }
1440
+ ]
1441
+ },
1442
+ {
1443
+ "name": "eval.tests.test_rewrite_preservation.test_address_of_method_stays_old_but_decl_renamed",
1444
+ "reasons": [
1445
+ {
1446
+ "id": "missing_fixture_assets",
1447
+ "message": "pytest test references fixture assets that are not packaged",
1448
+ "path": "eval/tests/test_rewrite_preservation.py",
1449
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1450
+ "severity": "error",
1451
+ "stage": "static_lint"
1452
+ }
1453
+ ]
1454
+ },
1455
+ {
1456
+ "name": "eval.tests.test_rewrite_preservation.test_call_in_destructor_helper_preserved_surroundings",
1457
+ "reasons": [
1458
+ {
1459
+ "id": "short_substring",
1460
+ "message": "pytest test uses a too-short substring oracle",
1461
+ "path": "eval/tests/test_rewrite_preservation.py",
1462
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1463
+ "severity": "error",
1464
+ "stage": "static_lint"
1465
+ }
1466
+ ]
1467
+ },
1468
+ {
1469
+ "name": "eval.tests.test_rewrite_preservation.test_const_method_on_const_object_renamed",
1470
+ "reasons": [
1471
+ {
1472
+ "id": "missing_fixture_assets",
1473
+ "message": "pytest test references fixture assets that are not packaged",
1474
+ "path": "eval/tests/test_rewrite_preservation.py",
1475
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1476
+ "severity": "error",
1477
+ "stage": "static_lint"
1478
+ }
1479
+ ]
1480
+ },
1481
+ {
1482
+ "name": "eval.tests.test_rewrite_preservation.test_friend_function_call_renamed",
1483
+ "reasons": [
1484
+ {
1485
+ "id": "missing_fixture_assets",
1486
+ "message": "pytest test references fixture assets that are not packaged",
1487
+ "path": "eval/tests/test_rewrite_preservation.py",
1488
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1489
+ "severity": "error",
1490
+ "stage": "static_lint"
1491
+ }
1492
+ ]
1493
+ },
1494
+ {
1495
+ "name": "eval.tests.test_rewrite_preservation.test_method_in_unrelated_namespace_not_renamed",
1496
+ "reasons": [
1497
+ {
1498
+ "id": "short_substring",
1499
+ "message": "pytest test uses a too-short substring oracle",
1500
+ "path": "eval/tests/test_rewrite_preservation.py",
1501
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1502
+ "severity": "error",
1503
+ "stage": "static_lint"
1504
+ }
1505
+ ]
1506
+ },
1507
+ {
1508
+ "name": "eval.tests.test_rewrite_preservation.test_noexcept_and_const_combined_preserved",
1509
+ "reasons": [
1510
+ {
1511
+ "id": "short_substring",
1512
+ "message": "pytest test uses a too-short substring oracle",
1513
+ "path": "eval/tests/test_rewrite_preservation.py",
1514
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1515
+ "severity": "error",
1516
+ "stage": "static_lint"
1517
+ }
1518
+ ]
1519
+ },
1520
+ {
1521
+ "name": "eval.tests.test_rewrite_preservation.test_out_of_line_definition_left_ungouched",
1522
+ "reasons": [
1523
+ {
1524
+ "id": "short_substring",
1525
+ "message": "pytest test uses a too-short substring oracle",
1526
+ "path": "eval/tests/test_rewrite_preservation.py",
1527
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1528
+ "severity": "error",
1529
+ "stage": "static_lint"
1530
+ }
1531
+ ]
1532
+ },
1533
+ {
1534
+ "name": "eval.tests.test_rewrite_preservation.test_rvalue_ref_qualified_method_renamed",
1535
+ "reasons": [
1536
+ {
1537
+ "id": "missing_fixture_assets",
1538
+ "message": "pytest test references fixture assets that are not packaged",
1539
+ "path": "eval/tests/test_rewrite_preservation.py",
1540
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1541
+ "severity": "error",
1542
+ "stage": "static_lint"
1543
+ }
1544
+ ]
1545
+ },
1546
+ {
1547
+ "name": "eval.tests.test_rewrite_preservation.test_trailing_return_type_method_renamed",
1548
+ "reasons": [
1549
+ {
1550
+ "id": "missing_fixture_assets",
1551
+ "message": "pytest test references fixture assets that are not packaged",
1552
+ "path": "eval/tests/test_rewrite_preservation.py",
1553
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1554
+ "severity": "error",
1555
+ "stage": "static_lint"
1556
+ }
1557
+ ]
1558
+ }
1559
+ ],
1560
+ "tests": [
1561
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_0]",
1562
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_10]",
1563
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_11]",
1564
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_12]",
1565
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_13]",
1566
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_14]",
1567
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_15]",
1568
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_16]",
1569
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_17]",
1570
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_1]",
1571
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_2]",
1572
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_3]",
1573
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_4]",
1574
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_5]",
1575
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_6]",
1576
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_7]",
1577
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_8]",
1578
+ "eval.tests.test_call_site_variants.test_call_site_variant[call_site_9]",
1579
+ "eval.tests.test_cli_and_args.test_empty_input_file_no_crash",
1580
+ "eval.tests.test_cli_and_args.test_help_flag_has_no_compilation_attempted",
1581
+ "eval.tests.test_cli_and_args.test_help_list_flag_exits_zero",
1582
+ "eval.tests.test_cli_and_args.test_help_lists_all_three_options",
1583
+ "eval.tests.test_cli_and_args.test_include_guard_single_member_no_match_identity",
1584
+ "eval.tests.test_cli_and_args.test_missing_class_name_option_fails",
1585
+ "eval.tests.test_cli_and_args.test_missing_new_name_option_fails",
1586
+ "eval.tests.test_cli_and_args.test_missing_old_name_option_fails",
1587
+ "eval.tests.test_cli_and_args.test_mixed_identity_and_rewrite_across_files",
1588
+ "eval.tests.test_cli_and_args.test_no_source_file_fails",
1589
+ "eval.tests.test_cli_and_args.test_nonexistent_input_file_fails",
1590
+ "eval.tests.test_cli_and_args.test_rename_does_not_alter_unrelated_text",
1591
+ "eval.tests.test_cli_and_args.test_rewritten_source_matches_golden",
1592
+ "eval.tests.test_cli_and_args.test_source_file_is_a_directory_fails",
1593
+ "eval.tests.test_cli_and_args.test_successful_rename_produces_exact_source",
1594
+ "eval.tests.test_cli_and_args.test_syntax_error_exits_nonzero_but_still_rewrites",
1595
+ "eval.tests.test_cli_and_args.test_syntax_error_keeps_erroneous_tu_otherwise_unchanged",
1596
+ "eval.tests.test_cli_and_args.test_three_source_files_progress_and_concatenation",
1597
+ "eval.tests.test_cli_and_args.test_two_source_files_both_rewritten_exact",
1598
+ "eval.tests.test_cli_and_args.test_two_source_files_stdout_golden",
1599
+ "eval.tests.test_cli_and_args.test_unknown_option_fails",
1600
+ "eval.tests.test_cli_and_args.test_version_reports_llvm_and_optimized_build",
1601
+ "eval.tests.test_cli_and_args.test_whitespace_only_input_unchanged",
1602
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_0]",
1603
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_1]",
1604
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_2]",
1605
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_3]",
1606
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_4]",
1607
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_5]",
1608
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_6]",
1609
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_7]",
1610
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_8]",
1611
+ "eval.tests.test_declaration_variants.test_declaration_variant[decl_9]",
1612
+ "eval.tests.test_derivation_graphs.test_diamond_virtual_inheritance_all_levels_renamed",
1613
+ "eval.tests.test_derivation_graphs.test_final_override_renamed",
1614
+ "eval.tests.test_derivation_graphs.test_four_level_inheritance_chain_renamed",
1615
+ "eval.tests.test_derivation_graphs.test_multiple_inheritance_renames_only_the_matched_base",
1616
+ "eval.tests.test_derivation_graphs.test_namespace_qualified_class_and_call_renamed",
1617
+ "eval.tests.test_derivation_graphs.test_private_inheritance_still_matches",
1618
+ "eval.tests.test_derivation_graphs.test_protected_inheritance_still_matches",
1619
+ "eval.tests.test_derivation_graphs.test_redeclare_method_base_then_forward_derived",
1620
+ "eval.tests.test_derivation_graphs.test_two_parallel_derived_branches_renamed",
1621
+ "eval.tests.test_derivation_graphs.test_virtual_inheritance_derived_renamed",
1622
+ "eval.tests.test_driver_edge_cases.test_empty_class_name_produces_identity_passthrough",
1623
+ "eval.tests.test_driver_edge_cases.test_empty_new_name_rewrites_tokens_to_empty",
1624
+ "eval.tests.test_driver_edge_cases.test_empty_old_name_produces_identity_passthrough",
1625
+ "eval.tests.test_driver_edge_cases.test_help_lists_all_rename_options_typenames",
1626
+ "eval.tests.test_driver_edge_cases.test_help_option_missing_from_success_path",
1627
+ "eval.tests.test_driver_edge_cases.test_repeated_class_name_uses_last_value",
1628
+ "eval.tests.test_driver_edge_cases.test_same_file_named_twice_is_processed_twice",
1629
+ "eval.tests.test_driver_edge_cases.test_unrelated_filename_extension_accepted",
1630
+ "eval.tests.test_driver_edge_cases.test_very_long_new_name_applied",
1631
+ "eval.tests.test_inheritance_negative.test_class_derived_from_struct_renamed",
1632
+ "eval.tests.test_inheritance_negative.test_free_function_with_same_name_not_renamed",
1633
+ "eval.tests.test_inheritance_negative.test_global_scoped_and_qualified_member_call",
1634
+ "eval.tests.test_inheritance_negative.test_method_spelled_in_string_literal_untouched",
1635
+ "eval.tests.test_inheritance_negative.test_multilevel_inheritance_all_levels_renamed",
1636
+ "eval.tests.test_inheritance_negative.test_no_match_for_unrelated_class_method",
1637
+ "eval.tests.test_inheritance_negative.test_no_match_when_method_has_different_case",
1638
+ "eval.tests.test_inheritance_negative.test_no_rewrite_of_identical_basename_other_class",
1639
+ "eval.tests.test_inheritance_negative.test_qualified_name_appearing_in_comment_untouched",
1640
+ "eval.tests.test_inheritance_negative.test_rename_in_struct_derived_class_chain",
1641
+ "eval.tests.test_inheritance_negative.test_struct_derived_from_class_renamed",
1642
+ "eval.tests.test_refactor_rename.test_rename_base_and_all_derived_exact",
1643
+ "eval.tests.test_refactor_rename.test_rename_caller_inside_member_of_derived",
1644
+ "eval.tests.test_refactor_rename.test_rename_calls_through_base_pointer",
1645
+ "eval.tests.test_refactor_rename.test_rename_declaration_only_in_derived",
1646
+ "eval.tests.test_refactor_rename.test_rename_method_called_on_new_expression",
1647
+ "eval.tests.test_refactor_rename.test_rename_multiple_call_sites_exact_count",
1648
+ "eval.tests.test_refactor_rename.test_rename_object_then_pointer_and_deref",
1649
+ "eval.tests.test_refactor_rename.test_rename_reference_and_pointer_calls",
1650
+ "eval.tests.test_refactor_rename.test_rename_struct_member_method",
1651
+ "eval.tests.test_rename_boundaries.test_arrow_vs_dot_both_rewritten",
1652
+ "eval.tests.test_rename_boundaries.test_declaration_only_rename_with_no_calls",
1653
+ "eval.tests.test_rename_boundaries.test_destructor_and_operator_names_not_matched",
1654
+ "eval.tests.test_rename_boundaries.test_nested_class_member_renamed",
1655
+ "eval.tests.test_rename_boundaries.test_new_name_that_is_distinct_identifier",
1656
+ "eval.tests.test_rename_boundaries.test_overload_declaration_order_determines_rename",
1657
+ "eval.tests.test_rename_boundaries.test_pointee_and_object_members_rewritten",
1658
+ "eval.tests.test_rename_boundaries.test_protected_member_via_derived_renamed",
1659
+ "eval.tests.test_rename_boundaries.test_pure_virtual_interface_declaration_renamed",
1660
+ "eval.tests.test_rename_boundaries.test_rename_method_with_overloads_exact",
1661
+ "eval.tests.test_rename_boundaries.test_rename_non_virtual_base_method_preserves_semantics",
1662
+ "eval.tests.test_rename_boundaries.test_self_rename_old_equals_new_is_noop",
1663
+ "eval.tests.test_rename_boundaries.test_static_member_declaration_renamed_but_calls_untouched",
1664
+ "eval.tests.test_rename_boundaries.test_template_instance_call_rewritten",
1665
+ "eval.tests.test_rewrite_preservation.test_address_of_method_stays_old_but_decl_renamed",
1666
+ "eval.tests.test_rewrite_preservation.test_call_in_destructor_helper_preserved_surroundings",
1667
+ "eval.tests.test_rewrite_preservation.test_const_method_on_const_object_renamed",
1668
+ "eval.tests.test_rewrite_preservation.test_friend_function_call_renamed",
1669
+ "eval.tests.test_rewrite_preservation.test_method_in_unrelated_namespace_not_renamed",
1670
+ "eval.tests.test_rewrite_preservation.test_noexcept_and_const_combined_preserved",
1671
+ "eval.tests.test_rewrite_preservation.test_operator_definition_not_confused_with_method",
1672
+ "eval.tests.test_rewrite_preservation.test_out_of_line_definition_left_ungouched",
1673
+ "eval.tests.test_rewrite_preservation.test_rvalue_ref_qualified_method_renamed",
1674
+ "eval.tests.test_rewrite_preservation.test_trailing_return_type_method_renamed"
1675
+ ]
1676
+ },
1677
+ "generated_module_03": {
1678
+ "ignore_reason": "",
1679
+ "ignored": false,
1680
+ "ignored_tests": [
1681
+ {
1682
+ "name": "eval.tests.test_cli_args.test_equals_and_separated_arg_forms_are_equivalent_and_exact",
1683
+ "reasons": [
1684
+ {
1685
+ "id": "golden_written_in_test",
1686
+ "message": "pytest test writes to its own golden file",
1687
+ "path": "eval/tests/test_cli_args.py",
1688
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
1689
+ "severity": "error",
1690
+ "stage": "static_lint"
1691
+ }
1692
+ ]
1693
+ },
1694
+ {
1695
+ "name": "eval.tests.test_cli_args.test_help_list_flat_enumeration_is_exact",
1696
+ "reasons": [
1697
+ {
1698
+ "detail": "AssertionError: assert 'USAGE: <PROG...his program\\n' == 'USAGE: execu...his program\\n' - USAGE: executable [options] <source0> [... <sourceN>] ? ^^^^^^^^^^ + USAGE: <PROG> [options] <source0> [... <s",
1699
+ "id": "gold_fail",
1700
+ "message": "test failed against the reference executable",
1701
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
1702
+ "severity": "error",
1703
+ "stage": "gold_execution"
1704
+ }
1705
+ ]
1706
+ },
1707
+ {
1708
+ "name": "eval.tests.test_cli_args.test_multiple_sources_iterated_and_both_renamed",
1709
+ "reasons": [
1710
+ {
1711
+ "id": "golden_written_in_test",
1712
+ "message": "pytest test writes to its own golden file",
1713
+ "path": "eval/tests/test_cli_args.py",
1714
+ "repair_hint": "Read committed golden data instead of writing expected output inside the test.",
1715
+ "severity": "error",
1716
+ "stage": "static_lint"
1717
+ }
1718
+ ]
1719
+ },
1720
+ {
1721
+ "name": "eval.tests.test_rename_extended",
1722
+ "reasons": [
1723
+ {
1724
+ "detail": "collection failure",
1725
+ "id": "gold_fail",
1726
+ "message": "test failed against the reference executable",
1727
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
1728
+ "severity": "error",
1729
+ "stage": "gold_execution"
1730
+ }
1731
+ ]
1732
+ },
1733
+ {
1734
+ "name": "eval.tests.test_rename_sequence",
1735
+ "reasons": [
1736
+ {
1737
+ "detail": "collection failure",
1738
+ "id": "gold_fail",
1739
+ "message": "test failed against the reference executable",
1740
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
1741
+ "severity": "error",
1742
+ "stage": "gold_execution"
1743
+ }
1744
+ ]
1745
+ }
1746
+ ],
1747
+ "tests": [
1748
+ "eval.tests.test_cli_args.test_empty_source_path_is_rejected",
1749
+ "eval.tests.test_cli_args.test_equals_and_separated_arg_forms_are_equivalent_and_exact",
1750
+ "eval.tests.test_cli_args.test_extra_arg_flags_preserve_exact_output[extra_arg_before_std_flag]",
1751
+ "eval.tests.test_cli_args.test_extra_arg_flags_preserve_exact_output[extra_arg_std_flag]",
1752
+ "eval.tests.test_cli_args.test_extra_arg_flags_preserve_exact_output[plain]",
1753
+ "eval.tests.test_cli_args.test_help_grouped_and_short_spellings_are_identical[--help]",
1754
+ "eval.tests.test_cli_args.test_help_grouped_and_short_spellings_are_identical[-h]",
1755
+ "eval.tests.test_cli_args.test_help_grouped_and_short_spellings_are_identical[-help]",
1756
+ "eval.tests.test_cli_args.test_help_list_flat_enumeration_is_exact",
1757
+ "eval.tests.test_cli_args.test_missing_input_file_fails",
1758
+ "eval.tests.test_cli_args.test_missing_required_option_fails[--class-name-for the --class-name option]",
1759
+ "eval.tests.test_cli_args.test_missing_required_option_fails[--new-name-for the --new-name option]",
1760
+ "eval.tests.test_cli_args.test_missing_required_option_fails[--old-name-for the --old-name option]",
1761
+ "eval.tests.test_cli_args.test_multiple_sources_iterated_and_both_renamed",
1762
+ "eval.tests.test_cli_args.test_no_positional_source_fails",
1763
+ "eval.tests.test_cli_args.test_non_source_extension_not_parsed_as_cpp",
1764
+ "eval.tests.test_cli_args.test_unknown_option_fails",
1765
+ "eval.tests.test_cli_args.test_version_banner_is_exact",
1766
+ "eval.tests.test_errors.test_capitalized_method_preserved_but_lowercase_renamed",
1767
+ "eval.tests.test_errors.test_empty_class_name_echoes_verbatim",
1768
+ "eval.tests.test_errors.test_empty_new_name_removes_matched_token_exactly",
1769
+ "eval.tests.test_errors.test_empty_old_name_echoes_verbatim",
1770
+ "eval.tests.test_errors.test_garbage_tokens_rejected_with_unqualified_id",
1771
+ "eval.tests.test_errors.test_minimal_translation_units_echo_verbatim[#ifndef GUARD_H\\n#define GUARD_H\\n#endif\\n-include_guard-guard]",
1772
+ "eval.tests.test_errors.test_minimal_translation_units_echo_verbatim[-empty_translation_unit-empty_tu]",
1773
+ "eval.tests.test_errors.test_minimal_translation_units_echo_verbatim[// only a comment line\\n-comment_only-comment]",
1774
+ "eval.tests.test_errors.test_no_target_class_leaves_source_untouched",
1775
+ "eval.tests.test_errors.test_syntax_error_bad_main_body_diagnostic_and_echo",
1776
+ "eval.tests.test_errors.test_syntax_error_reports_specific_diagnostic_and_partial_rename",
1777
+ "eval.tests.test_rename_core.test_core_rename_matrix[alpha_beta]",
1778
+ "eval.tests.test_rename_core.test_core_rename_matrix[array_objects]",
1779
+ "eval.tests.test_rename_core.test_core_rename_matrix[base_ptr_call]",
1780
+ "eval.tests.test_rename_core.test_core_rename_matrix[base_run_walk]",
1781
+ "eval.tests.test_rename_core.test_core_rename_matrix[const_member]",
1782
+ "eval.tests.test_rename_core.test_core_rename_matrix[derived_chain]",
1783
+ "eval.tests.test_rename_core.test_core_rename_matrix[method_args]",
1784
+ "eval.tests.test_rename_core.test_core_rename_matrix[namespace_widget]",
1785
+ "eval.tests.test_rename_core.test_core_rename_matrix[nested_inner]",
1786
+ "eval.tests.test_rename_core.test_core_rename_matrix[only_first]",
1787
+ "eval.tests.test_rename_core.test_core_rename_matrix[ool_split]",
1788
+ "eval.tests.test_rename_core.test_core_rename_matrix[pointer_call]",
1789
+ "eval.tests.test_rename_core.test_core_rename_matrix[pure_virtual]",
1790
+ "eval.tests.test_rename_core.test_core_rename_matrix[struct_rename]",
1791
+ "eval.tests.test_rename_core.test_core_rename_matrix[template_put]",
1792
+ "eval.tests.test_rename_core.test_core_rename_matrix[two_methods]",
1793
+ "eval.tests.test_rename_core.test_rename_updates_declaration_and_all_call_sites_golden_exact",
1794
+ "eval.tests.test_rename_extended",
1795
+ "eval.tests.test_rename_features.test_data_member_field_not_renamed_golden_exact",
1796
+ "eval.tests.test_rename_features.test_feature_matrix[capitalized]",
1797
+ "eval.tests.test_rename_features.test_feature_matrix[chain_this]",
1798
+ "eval.tests.test_rename_features.test_feature_matrix[data_field]",
1799
+ "eval.tests.test_rename_features.test_feature_matrix[reference_call]",
1800
+ "eval.tests.test_rename_features.test_feature_matrix[renamed_new_contains_old]",
1801
+ "eval.tests.test_rename_features.test_feature_matrix[static_asym]",
1802
+ "eval.tests.test_rename_features.test_feature_matrix[thiscall]",
1803
+ "eval.tests.test_rename_features.test_operator_overload_members_not_renamed_and_preserved",
1804
+ "eval.tests.test_rename_features.test_static_declaration_renamed_but_qualified_call_site_kept",
1805
+ "eval.tests.test_rename_sequence"
1806
+ ]
1807
+ },
1808
+ "generated_upstream": {
1809
+ "ignore_reason": "",
1810
+ "ignored": false,
1811
+ "ignored_tests": [],
1812
+ "tests": [
1813
+ "eval.tests.test_code_refactor.test_class_rename_renames_method_and_call_sites",
1814
+ "eval.tests.test_code_refactor.test_derived_only_renames_only_derived",
1815
+ "eval.tests.test_code_refactor.test_no_match_leaves_source_identical",
1816
+ "eval.tests.test_code_refactor.test_struct_rename_renames_method_and_call_sites"
1817
+ ]
1818
+ }
1819
+ },
1820
+ "commit": "ddd702e68a2a9e0a6766c4d0a63deef7409a8888",
1821
+ "data_source": "synthetic_programgym",
1822
+ "difficulty": "easy",
1823
+ "difficulty_score": 1.5208763816883417,
1824
+ "eval_clean_hashes": [
1825
+ "20b17df21a26f9c26a01534aa7366cfb6aaf369ca4fb1a533ad2f80a48baeda0"
1826
+ ],
1827
+ "input_record": {
1828
+ "commit": "ddd702e68a2a9e0a6766c4d0a63deef7409a8888",
1829
+ "difficulty": "easy",
1830
+ "difficulty_code_lines": 1659,
1831
+ "difficulty_has_tests": true,
1832
+ "difficulty_product_code_lines": 1659,
1833
+ "difficulty_runtime_deps": 1,
1834
+ "difficulty_score": 1.5208763816883417,
1835
+ "difficulty_test_code_lines": 820,
1836
+ "full_name": "banach-space/clang-tutor",
1837
+ "input_joern_zip": "cpp_joern/banach-space__clang-tutor.zip",
1838
+ "joern_status": true,
1839
+ "joern_time": 12.116293272934854,
1840
+ "language": "cpp",
1841
+ "pb_match": [
1842
+ {
1843
+ "pb_fullname": "ArthurSonzogni/json-tui",
1844
+ "rank": 885,
1845
+ "similarity": 0.4453078508377075
1846
+ },
1847
+ {
1848
+ "pb_fullname": "ninja-build/ninja",
1849
+ "rank": 79,
1850
+ "similarity": 0.5024422407150269
1851
+ },
1852
+ {
1853
+ "pb_fullname": "tstack/lnav",
1854
+ "rank": 994,
1855
+ "similarity": 0.41948291659355164
1856
+ }
1857
+ ],
1858
+ "repo_path": "cpp/banach-space__clang-tutor",
1859
+ "source": "commit:ddd702e68a2a9e0a6766c4d0a63deef7409a8888",
1860
+ "status": "done",
1861
+ "url": "https://github.com/banach-space/clang-tutor"
1862
+ },
1863
+ "instance_id": "banach-space__clang-tutor.ddd702e",
1864
+ "language": "cpp",
1865
+ "module_iterations": [
1866
+ {
1867
+ "actual_iterations": 5,
1868
+ "branch_name": "generated_module_01",
1869
+ "iteration_limit": 5,
1870
+ "module_index": 1,
1871
+ "module_kind": "source",
1872
+ "termination_reason": "max_iterations"
1873
+ },
1874
+ {
1875
+ "actual_iterations": 5,
1876
+ "branch_name": "generated_module_02",
1877
+ "iteration_limit": 5,
1878
+ "module_index": 2,
1879
+ "module_kind": "source",
1880
+ "termination_reason": "max_iterations"
1881
+ },
1882
+ {
1883
+ "actual_iterations": 5,
1884
+ "branch_name": "generated_module_03",
1885
+ "iteration_limit": 5,
1886
+ "module_index": 3,
1887
+ "module_kind": "source",
1888
+ "termination_reason": "max_iterations"
1889
+ },
1890
+ {
1891
+ "actual_iterations": 5,
1892
+ "branch_name": "generated_upstream",
1893
+ "iteration_limit": 5,
1894
+ "module_index": 4,
1895
+ "module_kind": "tests",
1896
+ "termination_reason": "early_stopping"
1897
+ }
1898
+ ],
1899
+ "repository": "banach-space/clang-tutor"
1900
+ }
banach-space--clang-tutor.ddd702e/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
banach-space--clang-tutor.ddd702e/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7d63ec2ce383b9852ab8457c957ba43895ff8cd2017e1fa8ac10bb58a00ef65
3
+ size 11337
banach-space--llvm-tutor.6245457/environment/Dockerfile CHANGED
@@ -53,3 +53,4 @@ RUN mkdir -p /home/agent \
53
  && chmod 111 /workspace/executable
54
  ENV HOME=/home/agent
55
  WORKDIR /workspace
 
 
53
  && chmod 111 /workspace/executable
54
  ENV HOME=/home/agent
55
  WORKDIR /workspace
56
+ 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"]
banach-space--llvm-tutor.6245457/tests/Dockerfile CHANGED
@@ -61,3 +61,4 @@ COPY programgym_evaluator.py /tests/programgym_evaluator.py
61
  COPY programgym_task.json /tests/programgym_task.json
62
  COPY blobs/ /tests/blobs/
63
  RUN chmod +x /tests/test.sh
 
 
61
  COPY programgym_task.json /tests/programgym_task.json
62
  COPY blobs/ /tests/blobs/
63
  RUN chmod +x /tests/test.sh
64
+ 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"]
banksy-git--lidl-gateway-freedom.f44f47f/environment/Dockerfile ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.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_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 PAGER=cat
24
+ ENV MANPAGER=cat
25
+ ENV LESS=-R
26
+ ENV TQDM_DISABLE=1
27
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/*
28
+ ARG CMAKE_VERSION=3.31.10
29
+ ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple
30
+ RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version
31
+ # programgym_quota_aware_nproc=1
32
+ RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null
33
+ WORKDIR /workspace
34
+ ADD workspace.tar.gz /workspace/
35
+ COPY executable /workspace/executable
36
+ COPY download.sh /workspace/download.sh
37
+ RUN chmod 755 /workspace/download.sh
38
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
39
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
40
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
41
+ && rm -f /workspace/download.sh \
42
+ && rm -f /tmp/harbor_prepare_download_env.sh
43
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
44
+ RUN chmod 111 /workspace/executable
45
+ WORKDIR /workspace
46
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
47
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
48
+ # submission handed to the separate verifier. Keep the reference executable
49
+ # execute-only; the oracle temporarily restores owner read permission.
50
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
51
+ RUN mkdir -p /home/agent \
52
+ && chown -R agent:agent /home/agent /workspace \
53
+ && chown agent:agent /workspace/executable \
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"]
banksy-git--lidl-gateway-freedom.f44f47f/environment/download.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # download.sh - standalone dependency setup for banksy-git/lidl-gateway-freedom.
4
+ #
5
+ # The selected target `serialgateway` (gateway/serialgateway) is a self-contained
6
+ # POSIX C program (gateway/main.c + gateway/serial.c) using only libc sockets,
7
+ # termios and select. No external libraries are required to build or run it, so
8
+ # this script only verifies the native toolchain that build.sh relies on and
9
+ # exports the environment it needs. It performs no build, compile, link or test.
10
+ #
11
+ # This file is sourced (`source /source_ro/download.sh`), not executed, so it is
12
+ # source-safe: it uses only `export`, takes no positional arguments, and never
13
+ # calls `exit` in normal control flow.
14
+
15
+ # Verify the C compiler that build.sh will use is available. This is a
16
+ # dependency-presence check only; it does not compile anything. stdout of
17
+ # `command -v` is silenced; a genuine absence takes the explicit else branch
18
+ # below and surfaces a message on stderr.
19
+ if command -v gcc >/dev/null; then
20
+ :
21
+ else
22
+ printf '%s\n' "download.sh: required toolchain 'gcc' is not available on PATH" >&2
23
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
24
+ return 1
25
+ else
26
+ exit 1
27
+ fi
28
+ fi
29
+
30
+ # build.sh takes no network and needs no external libraries; export a marker so
31
+ # build.sh can confirm the download stage ran. Idempotent: harmless to re-run.
32
+ export PB_DOWNLOAD_COMPLETE=1
33
+ export PB_CC="$(command -v gcc)"
34
+
35
+ printf '%s\n' "download.sh: toolchain ready (CC=${PB_CC}); no external dependencies required for serialgateway."
banksy-git--lidl-gateway-freedom.f44f47f/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed3257dd4de668a623cce2a31fc1561beee5de25a07d38b217a78582de16dd52
3
+ size 919712
banksy-git--lidl-gateway-freedom.f44f47f/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
banksy-git--lidl-gateway-freedom.f44f47f/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83691301d15ac6f9f5ccab07a0c6ddb2f165c45a946f280bd9731e06315d5cff
3
+ size 876
banksy-git--lidl-gateway-freedom.f44f47f/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
banksy-git--lidl-gateway-freedom.f44f47f/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
banksy-git--lidl-gateway-freedom.f44f47f/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/banksy-git--lidl-gateway-freedom.f44f47f"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for banksy-git/lidl-gateway-freedom"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "c"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "banksy-git__lidl-gateway-freedom.f44f47f"
32
+ repository = "banksy-git/lidl-gateway-freedom"
33
+ commit = "f44f47f9f5a4fcfb44ded5ed3be97430d3293249"
34
+ language = "c"
35
+ difficulty = "easy"
36
+ difficulty_score = 0.8796692056320534
37
+ test_branches = 2
38
+ test_count = 564
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"
banksy-git--lidl-gateway-freedom.f44f47f/tests/Dockerfile ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.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_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 PAGER=cat
24
+ ENV MANPAGER=cat
25
+ ENV LESS=-R
26
+ ENV TQDM_DISABLE=1
27
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/*
28
+ ARG CMAKE_VERSION=3.31.10
29
+ ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple
30
+ RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version
31
+ # programgym_quota_aware_nproc=1
32
+ RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null
33
+ WORKDIR /workspace
34
+ ADD workspace.tar.gz /workspace/
35
+ COPY executable /workspace/executable
36
+ COPY download.sh /workspace/download.sh
37
+ RUN chmod 755 /workspace/download.sh
38
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
39
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
40
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
41
+ && rm -f /workspace/download.sh \
42
+ && rm -f /tmp/harbor_prepare_download_env.sh
43
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
44
+ RUN chmod 111 /workspace/executable
45
+ WORKDIR /workspace
46
+ # Harbor uses tests/ as the separate verifier build context. Start with the
47
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
48
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
49
+ && mkdir -p /workspace /tests
50
+
51
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
52
+ # Installing a newer pytest alone leaves that apt package importable and creates
53
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
54
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
55
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
56
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
57
+ RUN set -eu; \
58
+ pip_break_system_packages=""; \
59
+ if python3 -m pip install --help | grep -q -- '--break-system-packages'; then \
60
+ pip_break_system_packages="--break-system-packages"; \
61
+ fi; \
62
+ python3 -m pip install ${pip_break_system_packages} \
63
+ --no-cache-dir --disable-pip-version-check \
64
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
65
+
66
+ COPY test.sh /tests/test.sh
67
+ 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
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"]
banksy-git--lidl-gateway-freedom.f44f47f/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:579d15929d61ea273e6a19b4c8d4a7f7996bf2ed49ecf84922baaca673b98a14
3
+ size 18459
banksy-git--lidl-gateway-freedom.f44f47f/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:4e12240e7ada79593259c4af0c0660f6881761ed6c2f4bfddbd04a23efd8993e
3
+ size 18319
banksy-git--lidl-gateway-freedom.f44f47f/tests/download.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # download.sh - standalone dependency setup for banksy-git/lidl-gateway-freedom.
4
+ #
5
+ # The selected target `serialgateway` (gateway/serialgateway) is a self-contained
6
+ # POSIX C program (gateway/main.c + gateway/serial.c) using only libc sockets,
7
+ # termios and select. No external libraries are required to build or run it, so
8
+ # this script only verifies the native toolchain that build.sh relies on and
9
+ # exports the environment it needs. It performs no build, compile, link or test.
10
+ #
11
+ # This file is sourced (`source /source_ro/download.sh`), not executed, so it is
12
+ # source-safe: it uses only `export`, takes no positional arguments, and never
13
+ # calls `exit` in normal control flow.
14
+
15
+ # Verify the C compiler that build.sh will use is available. This is a
16
+ # dependency-presence check only; it does not compile anything. stdout of
17
+ # `command -v` is silenced; a genuine absence takes the explicit else branch
18
+ # below and surfaces a message on stderr.
19
+ if command -v gcc >/dev/null; then
20
+ :
21
+ else
22
+ printf '%s\n' "download.sh: required toolchain 'gcc' is not available on PATH" >&2
23
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
24
+ return 1
25
+ else
26
+ exit 1
27
+ fi
28
+ fi
29
+
30
+ # build.sh takes no network and needs no external libraries; export a marker so
31
+ # build.sh can confirm the download stage ran. Idempotent: harmless to re-run.
32
+ export PB_DOWNLOAD_COMPLETE=1
33
+ export PB_CC="$(command -v gcc)"
34
+
35
+ printf '%s\n' "download.sh: toolchain ready (CC=${PB_CC}); no external dependencies required for serialgateway."
banksy-git--lidl-gateway-freedom.f44f47f/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed3257dd4de668a623cce2a31fc1561beee5de25a07d38b217a78582de16dd52
3
+ size 919712
banksy-git--lidl-gateway-freedom.f44f47f/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
banksy-git--lidl-gateway-freedom.f44f47f/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()
banksy-git--lidl-gateway-freedom.f44f47f/tests/programgym_task.json ADDED
@@ -0,0 +1,677 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_cli_baud_edges.test_baud_beyond_table_fails_at_boundary[-4000000--4000000]",
9
+ "eval.tests.test_cli_baud_edges.test_baud_beyond_table_fails_at_boundary[4000001-4000001]",
10
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_accepted[ 115200-115200]",
11
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_accepted[+9600-9600]",
12
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_accepted[1152000-1152000]",
13
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_invalid[-1--1]",
14
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_invalid[0007-7]",
15
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_invalid[12x-12]",
16
+ "eval.tests.test_cli_baud_edges.test_baud_prefix_parses_to_invalid[999999-999999]",
17
+ "eval.tests.test_cli_parsing.test_banner_version_token_present",
18
+ "eval.tests.test_cli_parsing.test_banner_written_to_stderr_not_stdout",
19
+ "eval.tests.test_cli_parsing.test_baud_non_numeric_is_zero",
20
+ "eval.tests.test_cli_parsing.test_combined_flags_all_reflected",
21
+ "eval.tests.test_cli_parsing.test_default_serial_device_is_ttyS1",
22
+ "eval.tests.test_cli_parsing.test_defaults_port_baud_flow",
23
+ "eval.tests.test_cli_parsing.test_empty_device_argument_opens_path",
24
+ "eval.tests.test_cli_parsing.test_flag_f_disables_hardware_flow[extra0-/nonexistent/serialdev-sw]",
25
+ "eval.tests.test_cli_parsing.test_flag_f_disables_hardware_flow[extra1-/nonexistent/serialdev-sw]",
26
+ "eval.tests.test_cli_parsing.test_getopt_respects_option_order_independence",
27
+ "eval.tests.test_cli_parsing.test_missing_argument_aborts[-b]",
28
+ "eval.tests.test_cli_parsing.test_missing_argument_aborts[-d]",
29
+ "eval.tests.test_cli_parsing.test_missing_argument_aborts[-p]",
30
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[115200]",
31
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[230400]",
32
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[38400]",
33
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[460800]",
34
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[57600]",
35
+ "eval.tests.test_cli_parsing.test_option_b_sets_baud_in_banner[9600]",
36
+ "eval.tests.test_cli_parsing.test_option_d_sets_serial_device_in_banner[/dev/serial0]",
37
+ "eval.tests.test_cli_parsing.test_option_d_sets_serial_device_in_banner[/dev/ttyAMA0]",
38
+ "eval.tests.test_cli_parsing.test_option_d_sets_serial_device_in_banner[/dev/ttyS3]",
39
+ "eval.tests.test_cli_parsing.test_option_d_sets_serial_device_in_banner[/dev/ttyUSB7]",
40
+ "eval.tests.test_cli_parsing.test_option_d_sets_serial_device_in_banner[/tmp/gwser]",
41
+ "eval.tests.test_cli_parsing.test_option_ordering_and_repeats_last_wins[argv0-3210-115200-sw-/nonexistent/serialdev]",
42
+ "eval.tests.test_cli_parsing.test_option_ordering_and_repeats_last_wins[argv1-2000-115200-HW-/nonexistent/serialdev]",
43
+ "eval.tests.test_cli_parsing.test_option_ordering_and_repeats_last_wins[argv2-8888-19200-HW-/nonexistent/serialdev]",
44
+ "eval.tests.test_cli_parsing.test_option_ordering_and_repeats_last_wins[argv3-3000-115200-sw-/nonexistent/serialdev]",
45
+ "eval.tests.test_cli_parsing.test_option_ordering_and_repeats_last_wins[argv4-777-4800-sw-/dev/ttyS1]",
46
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[0]",
47
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[1234]",
48
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[1]",
49
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[22222]",
50
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[65535]",
51
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[8080]",
52
+ "eval.tests.test_cli_parsing.test_option_p_sets_port_in_banner[9999]",
53
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[ 42-42]",
54
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[+9-9]",
55
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[-1-65535]",
56
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[-7-65529]",
57
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[0-0]",
58
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[0007-7]",
59
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[12x-12]",
60
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[65534-65534]",
61
+ "eval.tests.test_cli_parsing.test_port_at_least_parses_prefix[abc-0]",
62
+ "eval.tests.test_cli_parsing.test_positional_arguments_ignored[trailing0]",
63
+ "eval.tests.test_cli_parsing.test_positional_arguments_ignored[trailing1]",
64
+ "eval.tests.test_cli_parsing.test_positional_arguments_ignored[trailing2]",
65
+ "eval.tests.test_cli_parsing.test_positional_arguments_ignored[trailing3]",
66
+ "eval.tests.test_cli_parsing.test_positional_arguments_ignored[trailing4]",
67
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-+]",
68
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[--version]",
69
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-1]",
70
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-9]",
71
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-?]",
72
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-P]",
73
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-V]",
74
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-h]",
75
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-q]",
76
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-x]",
77
+ "eval.tests.test_cli_parsing.test_unknown_option_aborts_before_banner[-z]",
78
+ "eval.tests.test_connection_lifecycle.test_bind_port_conflict_reports_address_in_use",
79
+ "eval.tests.test_connection_lifecycle.test_client_disconnect_emits_close_diagnostic",
80
+ "eval.tests.test_connection_lifecycle.test_connect_diagnostic_fd_reported_each_time",
81
+ "eval.tests.test_connection_lifecycle.test_connection_replaced_multiple_times_stays_consistent[3]",
82
+ "eval.tests.test_connection_lifecycle.test_listener_reuses_address_with_so_reuseaddr",
83
+ "eval.tests.test_connection_lifecycle.test_oob_flow_off_then_replacement_forwards_in_off_state",
84
+ "eval.tests.test_connection_lifecycle.test_oob_off_then_replacement_serial_to_tcp",
85
+ "eval.tests.test_connection_lifecycle.test_reconnect_after_disconnect_works",
86
+ "eval.tests.test_connection_lifecycle.test_reconnect_allows_serial_forward_again",
87
+ "eval.tests.test_connection_lifecycle.test_reconnect_loop_toggles_flow_each_round[2]",
88
+ "eval.tests.test_connection_lifecycle.test_second_connection_closes_first_and_serves_second[1]",
89
+ "eval.tests.test_connection_lifecycle.test_second_connection_closes_first_and_serves_second[2]",
90
+ "eval.tests.test_forwarding_boundaries.test_extreme_valid_baud_connection_forwards[0]",
91
+ "eval.tests.test_forwarding_boundaries.test_extreme_valid_baud_connection_forwards[1500000]",
92
+ "eval.tests.test_forwarding_boundaries.test_extreme_valid_baud_connection_forwards[3000000]",
93
+ "eval.tests.test_forwarding_boundaries.test_extreme_valid_baud_connection_forwards[4000000]",
94
+ "eval.tests.test_forwarding_boundaries.test_extreme_valid_baud_connection_forwards[921600]",
95
+ "eval.tests.test_forwarding_boundaries.test_in_band_payload_then_oob_flow_off_keeps_forwarding",
96
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_boundary_after_oob_on[1024]",
97
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_boundary_after_oob_on[1025]",
98
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_full_byte_range_forward[256]",
99
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_full_byte_range_forward[512]",
100
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_full_byte_range_forward[768]",
101
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_spans_read_boundary[1024]",
102
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_spans_read_boundary[1025]",
103
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_spans_read_boundary[2048]",
104
+ "eval.tests.test_forwarding_boundaries.test_serial_to_tcp_spans_read_boundary[3072]",
105
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_after_oob_off[1024]",
106
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_after_oob_off[1025]",
107
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_after_oob_off[16384]",
108
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_split_payload[1023]",
109
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_split_payload[1]",
110
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_split_payload[2]",
111
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_large_split_payload[3]",
112
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_spans_read_boundary[1024]",
113
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_spans_read_boundary[1025]",
114
+ "eval.tests.test_forwarding_boundaries.test_tcp_to_serial_spans_read_boundary[4096]",
115
+ "eval.tests.test_oob_flow_control.test_in_band_oob_values_do_not_toggle_flow",
116
+ "eval.tests.test_oob_flow_control.test_inband_mark_followed_by_urgent_still_forwards_inband",
117
+ "eval.tests.test_oob_flow_control.test_oob_flow_off_diagnostic[16]",
118
+ "eval.tests.test_oob_flow_control.test_oob_flow_off_then_on_keeps_forwarding",
119
+ "eval.tests.test_oob_flow_control.test_oob_flow_off_then_serial_to_tcp[\\x11\\x10flow-off-serial\\x00]",
120
+ "eval.tests.test_oob_flow_control.test_oob_flow_off_then_serial_to_tcp[post-off-1]",
121
+ "eval.tests.test_oob_flow_control.test_oob_flow_on_after_off_keeps_forwarding",
122
+ "eval.tests.test_oob_flow_control.test_oob_flow_on_as_first_command_then_tcp_forward",
123
+ "eval.tests.test_oob_flow_control.test_oob_flow_on_diagnostic[17]",
124
+ "eval.tests.test_oob_flow_control.test_oob_no_diagnostic_without_connection",
125
+ "eval.tests.test_oob_flow_control.test_oob_off_on_off_then_reports_latest",
126
+ "eval.tests.test_oob_flow_control.test_oob_serial_port_reopen_keeps_tcp_path_after_toggle",
127
+ "eval.tests.test_oob_flow_control.test_oob_zero_then_unknown_sequence_reports_unknown_only",
128
+ "eval.tests.test_oob_flow_control.test_repeated_oob_off_toggles_keep_tcp_forward",
129
+ "eval.tests.test_oob_flow_control.test_two_unknown_oob_bytes_preserve_forwarding",
130
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[0-0]",
131
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[1-1]",
132
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[127-127]",
133
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[128--128]",
134
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[254--2]",
135
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[255--1]",
136
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[32-32]",
137
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[66-66]",
138
+ "eval.tests.test_oob_flow_control.test_unknown_oob_command_reported[85-85]",
139
+ "eval.tests.test_oob_flow_control.test_unknown_oob_does_not_reopen_then_flow_off_reopens",
140
+ "eval.tests.test_oob_flow_control.test_urgent_then_inband_no_oob_value_forwarded[16-Flow control OFF]",
141
+ "eval.tests.test_oob_flow_control.test_urgent_then_inband_no_oob_value_forwarded[17-Flow control ON]",
142
+ "eval.tests.test_select_loop.test_banner_stays_exact_after_accept_forward_close[1024]",
143
+ "eval.tests.test_select_loop.test_banner_stays_exact_after_accept_forward_close[1]",
144
+ "eval.tests.test_select_loop.test_banner_stays_exact_after_accept_forward_close[2048]",
145
+ "eval.tests.test_select_loop.test_banner_stays_exact_after_accept_forward_close[8192]",
146
+ "eval.tests.test_select_loop.test_bidirectional_forwarding_interleaved",
147
+ "eval.tests.test_select_loop.test_binary_payload_with_0xff_roundtrip",
148
+ "eval.tests.test_select_loop.test_buf_size_forwarding_boundary[1023]",
149
+ "eval.tests.test_select_loop.test_buf_size_forwarding_boundary[1024]",
150
+ "eval.tests.test_select_loop.test_buf_size_forwarding_boundary[1025]",
151
+ "eval.tests.test_select_loop.test_buf_size_forwarding_boundary[2048]",
152
+ "eval.tests.test_select_loop.test_buf_size_forwarding_boundary[4096]",
153
+ "eval.tests.test_select_loop.test_connect_diag_and_clean_exit_have_no_orphan_lines",
154
+ "eval.tests.test_select_loop.test_connect_emits_connect_diagnostic[hw]",
155
+ "eval.tests.test_select_loop.test_connect_emits_connect_diagnostic[sw]",
156
+ "eval.tests.test_select_loop.test_connection_fd_reported_is_positive_integer",
157
+ "eval.tests.test_select_loop.test_extra_args_ignored_positionals",
158
+ "eval.tests.test_select_loop.test_gateway_listens_with_pty_serial[0]",
159
+ "eval.tests.test_select_loop.test_gateway_listens_with_pty_serial[115200]",
160
+ "eval.tests.test_select_loop.test_gateway_listens_with_pty_serial[38400]",
161
+ "eval.tests.test_select_loop.test_gateway_listens_with_pty_serial[9600]",
162
+ "eval.tests.test_select_loop.test_large_payload_roundtrip_spans_reads",
163
+ "eval.tests.test_select_loop.test_many_small_tcp_writes_forward_contiguously[1]",
164
+ "eval.tests.test_select_loop.test_many_small_tcp_writes_forward_contiguously[3]",
165
+ "eval.tests.test_select_loop.test_many_small_tcp_writes_forward_contiguously[50]",
166
+ "eval.tests.test_select_loop.test_many_small_tcp_writes_forward_contiguously[7]",
167
+ "eval.tests.test_select_loop.test_serial_to_tcp_forwarding_exact_bytes[UP]",
168
+ "eval.tests.test_select_loop.test_serial_to_tcp_forwarding_exact_bytes[\\x00\\xff\\x00\\xff]",
169
+ "eval.tests.test_select_loop.test_serial_to_tcp_forwarding_exact_bytes[\\xfe\\x01\\x7fOK\\x1a]",
170
+ "eval.tests.test_select_loop.test_sw_flow_still_forwards_data",
171
+ "eval.tests.test_select_loop.test_tcp_to_serial_forwarding_binary_with_zero_and_high_bytes",
172
+ "eval.tests.test_select_loop.test_tcp_to_serial_forwarding_exact_bytes[A]",
173
+ "eval.tests.test_select_loop.test_tcp_to_serial_forwarding_exact_bytes[ZB\\x01\\x02AT+RST\\r\\n]",
174
+ "eval.tests.test_select_loop.test_tcp_to_serial_forwarding_exact_bytes[\\x1a\\x1b\\x1cZIGBEE\\x00]",
175
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_after_extreme_baud_forward[0]",
176
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_after_extreme_baud_forward[115200]",
177
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_after_extreme_baud_forward[4000000]",
178
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_after_second_connection_replaced",
179
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_reports_last_branch",
180
+ "eval.tests.test_serial_close_error.test_serial_eof_exit_still_forwarded_all_payload",
181
+ "eval.tests.test_serial_close_error.test_serial_eof_exits_idle",
182
+ "eval.tests.test_serial_close_error.test_serial_eof_exits_when_connected",
183
+ "eval.tests.test_serial_open_errors.test_device_open_failure_appears_before_exit[/dev/serial0]",
184
+ "eval.tests.test_serial_open_errors.test_device_open_failure_appears_before_exit[/dev/ttyS3]",
185
+ "eval.tests.test_serial_open_errors.test_device_open_failure_appears_before_exit[/dev/ttyUSB7]",
186
+ "eval.tests.test_serial_open_errors.test_device_open_failure_appears_before_exit[/tmp/gwser]",
187
+ "eval.tests.test_serial_open_errors.test_empty_device_argument_opens_path",
188
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[100]",
189
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[12345]",
190
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[123]",
191
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[2147483647]",
192
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[9601]",
193
+ "eval.tests.test_serial_open_errors.test_invalid_baud_rate_reports_error[999999]",
194
+ "eval.tests.test_serial_open_errors.test_non_tty_device_reports_ioctl_error[/dev/null]",
195
+ "eval.tests.test_serial_open_errors.test_nonexistent_device_errors[/dev/nonexistent_serial]",
196
+ "eval.tests.test_serial_open_errors.test_nonexistent_device_errors[/dev/ttyUSB-nope]",
197
+ "eval.tests.test_serial_open_errors.test_nonexistent_device_errors[/nonexistent/dev/serial0]",
198
+ "eval.tests.test_serial_open_errors.test_nonexistent_device_errors[/some/very/deep/missing/path]",
199
+ "eval.tests.test_serial_open_errors.test_regular_file_device_is_not_a_tty",
200
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[0]",
201
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[1000000]",
202
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[110]",
203
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[1152000]",
204
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[115200]",
205
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[1200]",
206
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[134]",
207
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[1500000]",
208
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[150]",
209
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[1800]",
210
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[19200]",
211
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[2000000]",
212
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[200]",
213
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[230400]",
214
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[2400]",
215
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[2500000]",
216
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[3000000]",
217
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[300]",
218
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[3500000]",
219
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[38400]",
220
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[4000000]",
221
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[460800]",
222
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[4800]",
223
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[500000]",
224
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[50]",
225
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[576000]",
226
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[57600]",
227
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[600]",
228
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[75]",
229
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[921600]",
230
+ "eval.tests.test_serial_open_errors.test_valid_baud_reaches_serial_open[9600]"
231
+ ]
232
+ },
233
+ "generated_module_02": {
234
+ "ignore_reason": "",
235
+ "ignored": false,
236
+ "ignored_tests": [
237
+ {
238
+ "name": "eval.tests.test_cli_atoi_edges.test_repeated_f_then_d_last_wins_flow",
239
+ "reasons": [
240
+ {
241
+ "id": "missing_fixture_assets",
242
+ "message": "pytest test references fixture assets that are not packaged",
243
+ "path": "eval/tests/test_cli_atoi_edges.py",
244
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
245
+ "severity": "error",
246
+ "stage": "static_lint"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "name": "eval.tests.test_flow_control.test_oob_flow_on_from_softflow",
252
+ "reasons": [
253
+ {
254
+ "id": "golden_docstring",
255
+ "message": "pytest test docstring mentions golden data that is not used in the body",
256
+ "path": "eval/tests/test_flow_control.py",
257
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
258
+ "severity": "error",
259
+ "stage": "static_lint"
260
+ },
261
+ {
262
+ "id": "golden_no_equality",
263
+ "message": "pytest test references golden data without equality comparison",
264
+ "path": "eval/tests/test_flow_control.py",
265
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
266
+ "severity": "error",
267
+ "stage": "static_lint"
268
+ }
269
+ ]
270
+ }
271
+ ],
272
+ "tests": [
273
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[-115200]",
274
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[-1]",
275
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[-50]",
276
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[10000000]",
277
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1000001]",
278
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[109]",
279
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[111]",
280
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1151999]",
281
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[115199]",
282
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1152001]",
283
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[115201]",
284
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1199]",
285
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1201]",
286
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[12345]",
287
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[133]",
288
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[135]",
289
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1499999]",
290
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[149]",
291
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1500001]",
292
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[151]",
293
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1799]",
294
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1801]",
295
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[19199]",
296
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[19201]",
297
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1999999]",
298
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[199]",
299
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[1]",
300
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2000001]",
301
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[201]",
302
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2147483647]",
303
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[230399]",
304
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[230401]",
305
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2399]",
306
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2401]",
307
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2499999]",
308
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2500001]",
309
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[250]",
310
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[25]",
311
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[2999999]",
312
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[299]",
313
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[3000001]",
314
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[301]",
315
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[3499999]",
316
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[3500001]",
317
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[38399]",
318
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[38401]",
319
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[3999999]",
320
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[4000001]",
321
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[460799]",
322
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[460801]",
323
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[4799]",
324
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[4801]",
325
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[499999]",
326
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[49]",
327
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[500001]",
328
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[51]",
329
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[575999]",
330
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[57599]",
331
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[576001]",
332
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[57601]",
333
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[599]",
334
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[601]",
335
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[74]",
336
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[76]",
337
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[8100]",
338
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[921599]",
339
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[921601]",
340
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[9599]",
341
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[9601]",
342
+ "eval.tests.test_baud_translation.test_invalid_baud_rejected[999999]",
343
+ "eval.tests.test_baud_translation.test_invalid_baud_reports_before_device_open",
344
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[0]",
345
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[1000000]",
346
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[110]",
347
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[1152000]",
348
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[115200]",
349
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[1200]",
350
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[134]",
351
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[1500000]",
352
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[150]",
353
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[1800]",
354
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[19200]",
355
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[2000000]",
356
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[200]",
357
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[230400]",
358
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[2400]",
359
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[2500000]",
360
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[3000000]",
361
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[300]",
362
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[3500000]",
363
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[38400]",
364
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[4000000]",
365
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[460800]",
366
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[4800]",
367
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[500000]",
368
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[50]",
369
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[576000]",
370
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[57600]",
371
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[600]",
372
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[75]",
373
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[921600]",
374
+ "eval.tests.test_baud_translation.test_valid_baud_no_invalid_message[9600]",
375
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[0]",
376
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[1000000]",
377
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[110]",
378
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[1152000]",
379
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[115200]",
380
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[1200]",
381
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[134]",
382
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[1500000]",
383
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[150]",
384
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[1800]",
385
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[19200]",
386
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[2000000]",
387
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[200]",
388
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[230400]",
389
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[2400]",
390
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[2500000]",
391
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[3000000]",
392
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[300]",
393
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[3500000]",
394
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[38400]",
395
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[4000000]",
396
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[460800]",
397
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[4800]",
398
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[500000]",
399
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[50]",
400
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[576000]",
401
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[57600]",
402
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[600]",
403
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[75]",
404
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[921600]",
405
+ "eval.tests.test_baud_translation.test_valid_baud_opens_and_runs[9600]",
406
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[ 1200-1200-True]",
407
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[+80000-80000-False]",
408
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[+9600-9600-True]",
409
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[-0-0-True]",
410
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[-0-True]",
411
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[115x-115-False]",
412
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[12x00-12-False]",
413
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[50foo-50-True]",
414
+ "eval.tests.test_cli_atoi_edges.test_baud_atoi_parse_edge[9600x-9600-True]",
415
+ "eval.tests.test_cli_atoi_edges.test_device_path_trailing_whitespace_not_stripped",
416
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_more_edges[ 00123-123]",
417
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_more_edges[-0x10-0]",
418
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[ 7777-7777]",
419
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[+4000-4000]",
420
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[-0]",
421
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[-1-65535]",
422
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[30x00-30]",
423
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[65535-65535]",
424
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[65536-0]",
425
+ "eval.tests.test_cli_atoi_edges.test_port_atoi_parse_edge[abc-0]",
426
+ "eval.tests.test_cli_atoi_edges.test_repeated_f_flag_stays_softflow[2]",
427
+ "eval.tests.test_cli_atoi_edges.test_repeated_f_flag_stays_softflow[3]",
428
+ "eval.tests.test_cli_atoi_edges.test_repeated_f_then_d_last_wins_flow",
429
+ "eval.tests.test_cli_atoi_edges.test_repeated_p_last_wins",
430
+ "eval.tests.test_cli_parse.test_cluster_trailing_char_is_option_value[args0-baud-0-Could not open serial port /dev/ttyS1]",
431
+ "eval.tests.test_cli_parse.test_cluster_trailing_char_is_option_value[args1-baud-0-Could not open serial port /dev/ttyS1]",
432
+ "eval.tests.test_cli_parse.test_cluster_trailing_char_is_option_value[args2-serial-f-Could not open serial port f]",
433
+ "eval.tests.test_cli_parse.test_cluster_trailing_char_is_option_value[args3-serial-p-Could not open serial port p]",
434
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args0]",
435
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args1]",
436
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args2]",
437
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args3]",
438
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args4]",
439
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args5]",
440
+ "eval.tests.test_cli_parse.test_compound_unknown_flags_abort[args6]",
441
+ "eval.tests.test_cli_parse.test_d_before_and_after_b_order_independent[115200]",
442
+ "eval.tests.test_cli_parse.test_d_before_and_after_b_order_independent[4000000]",
443
+ "eval.tests.test_cli_parse.test_flag_after_serial_open_fails_cleanly",
444
+ "eval.tests.test_cli_parse.test_last_b_flag_invalid_wins[115200-115199]",
445
+ "eval.tests.test_cli_parse.test_last_b_flag_invalid_wins[57600-250]",
446
+ "eval.tests.test_cli_parse.test_last_b_flag_invalid_wins[9600-999999999]",
447
+ "eval.tests.test_cli_parse.test_last_b_flag_valid_wins[115199-115200]",
448
+ "eval.tests.test_cli_parse.test_last_b_flag_valid_wins[250-57600]",
449
+ "eval.tests.test_cli_parse.test_last_b_flag_valid_wins[999999999-9600]",
450
+ "eval.tests.test_cli_parse.test_last_d_flag_wins_banner[/dev/ptmx-/dev/ttyUSB0]",
451
+ "eval.tests.test_cli_parse.test_last_d_flag_wins_banner[/dev/ttyS0-/dev/ttyUSB0]",
452
+ "eval.tests.test_cli_parse.test_missing_option_value_aborts[-b]",
453
+ "eval.tests.test_cli_parse.test_missing_option_value_aborts[-d]",
454
+ "eval.tests.test_cli_parse.test_missing_option_value_aborts[-p]",
455
+ "eval.tests.test_cli_parse.test_missing_option_value_no_banner[-b]",
456
+ "eval.tests.test_cli_parse.test_missing_option_value_no_banner[-d]",
457
+ "eval.tests.test_cli_parse.test_missing_option_value_no_banner[-p]",
458
+ "eval.tests.test_cli_parse.test_unknown_long_flag_aborts[args0]",
459
+ "eval.tests.test_cli_parse.test_unknown_long_flag_aborts[args1]",
460
+ "eval.tests.test_cli_parse.test_unknown_long_flag_aborts[args2]",
461
+ "eval.tests.test_cli_parse.test_unknown_long_flag_aborts[args3]",
462
+ "eval.tests.test_cli_parse.test_unknown_long_flag_aborts[args4]",
463
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-!]",
464
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-1]",
465
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-9]",
466
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-a]",
467
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-c]",
468
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-e]",
469
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-g]",
470
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-j]",
471
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-k]",
472
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-l]",
473
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-m]",
474
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-n]",
475
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-o]",
476
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-r]",
477
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-s]",
478
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-t]",
479
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-u]",
480
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-v]",
481
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-w]",
482
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-y]",
483
+ "eval.tests.test_cli_parse.test_unknown_short_flag_aborts[-z]",
484
+ "eval.tests.test_flow_control.test_flow_control_banner[args0-HW]",
485
+ "eval.tests.test_flow_control.test_flow_control_banner[args1-sw]",
486
+ "eval.tests.test_flow_control.test_flow_control_banner[args2-sw]",
487
+ "eval.tests.test_flow_control.test_flow_hw_default_banner",
488
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[0]",
489
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[115200]",
490
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[230400]",
491
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[300]",
492
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[4000000]",
493
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[50]",
494
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[57600]",
495
+ "eval.tests.test_flow_control.test_flow_off_banner_other_bauds[9600]",
496
+ "eval.tests.test_flow_control.test_oob_flow_off",
497
+ "eval.tests.test_flow_control.test_oob_flow_on",
498
+ "eval.tests.test_flow_control.test_oob_flow_on_from_softflow",
499
+ "eval.tests.test_flow_control.test_oob_flow_toggle_off_then_on",
500
+ "eval.tests.test_flow_control.test_oob_unknown_command",
501
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[0-0]",
502
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[1-1]",
503
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[111-111]",
504
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[112-112]",
505
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[126-126]",
506
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[127-127]",
507
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[128--128]",
508
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[129--127]",
509
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[153--103]",
510
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[160--96]",
511
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[18-18]",
512
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[181--75]",
513
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[192--64]",
514
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[2-2]",
515
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[222--34]",
516
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[224--32]",
517
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[240--16]",
518
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[254--2]",
519
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[255--1]",
520
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[3-3]",
521
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[32-32]",
522
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[48-48]",
523
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[64-64]",
524
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[80-80]",
525
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[85-85]",
526
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[90-90]",
527
+ "eval.tests.test_oob_command_sweep.test_unknown_oob_byte_logged_without_reopen[96-96]",
528
+ "eval.tests.test_reachability.test_banner_all_flags_combined",
529
+ "eval.tests.test_reachability.test_banner_baud_field[115200]",
530
+ "eval.tests.test_reachability.test_banner_baud_field[4000000]",
531
+ "eval.tests.test_reachability.test_banner_baud_field[50]",
532
+ "eval.tests.test_reachability.test_banner_baud_field[9600]",
533
+ "eval.tests.test_reachability.test_banner_default_port",
534
+ "eval.tests.test_reachability.test_banner_device_baud_flow_combined",
535
+ "eval.tests.test_reachability.test_banner_device_field[/dev/ptmx]",
536
+ "eval.tests.test_reachability.test_banner_device_field[/dev/pts/99]",
537
+ "eval.tests.test_reachability.test_banner_device_field[/dev/ttyS3]",
538
+ "eval.tests.test_reachability.test_banner_device_field[/dev/ttyUSB0]",
539
+ "eval.tests.test_reachability.test_banner_port_field[0]",
540
+ "eval.tests.test_reachability.test_banner_port_field[1]",
541
+ "eval.tests.test_reachability.test_banner_port_field[3000]",
542
+ "eval.tests.test_reachability.test_banner_port_field[65535]",
543
+ "eval.tests.test_reachability.test_banner_port_field[8889]",
544
+ "eval.tests.test_reachability.test_banner_port_field_unique",
545
+ "eval.tests.test_reachability.test_tcp_connection_close_and_reopen",
546
+ "eval.tests.test_reachability.test_tcp_oob_inline_after_data",
547
+ "eval.tests.test_reachability.test_tcp_serial_write_survives[A]",
548
+ "eval.tests.test_reachability.test_tcp_serial_write_survives[\\x00\\x01\\x02\\xff]",
549
+ "eval.tests.test_reachability.test_tcp_serial_write_survives[]",
550
+ "eval.tests.test_reachability.test_tcp_serial_write_survives[hello]",
551
+ "eval.tests.test_reachability.test_tcp_serial_write_survives[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]",
552
+ "eval.tests.test_reachability.test_unknown_argument_aborts[--help]",
553
+ "eval.tests.test_reachability.test_unknown_argument_aborts[-h]",
554
+ "eval.tests.test_reachability.test_unknown_argument_aborts[-q]",
555
+ "eval.tests.test_reachability.test_unknown_argument_aborts[-x]",
556
+ "eval.tests.test_reachability.test_unknown_argument_aborts[-z]",
557
+ "eval.tests.test_serial_open.test_character_device_is_not_tty[/dev/full]",
558
+ "eval.tests.test_serial_open.test_character_device_is_not_tty[/dev/null]",
559
+ "eval.tests.test_serial_open.test_character_device_is_not_tty[/dev/zero]",
560
+ "eval.tests.test_serial_open.test_dev_tty_without_controlling_terminal",
561
+ "eval.tests.test_serial_open.test_device_path_flag_default",
562
+ "eval.tests.test_serial_open.test_device_path_is_dir_symlink[real]",
563
+ "eval.tests.test_serial_open.test_device_path_is_dir_symlink[sub/real]",
564
+ "eval.tests.test_serial_open.test_fifo_device_open[]",
565
+ "eval.tests.test_serial_open.test_fifo_device_open[abc]",
566
+ "eval.tests.test_serial_open.test_fifo_device_open_other_bauds[4000000]",
567
+ "eval.tests.test_serial_open.test_fifo_device_open_other_bauds[9600]",
568
+ "eval.tests.test_serial_open.test_open_directory",
569
+ "eval.tests.test_serial_open.test_open_empty_path[115200]",
570
+ "eval.tests.test_serial_open.test_open_empty_path[9600]",
571
+ "eval.tests.test_serial_open.test_open_missing_device[missing]",
572
+ "eval.tests.test_serial_open.test_open_missing_device[nested_missing]",
573
+ "eval.tests.test_serial_open.test_open_regular_file_is_not_tty[]",
574
+ "eval.tests.test_serial_open.test_open_regular_file_is_not_tty[hello\\n]",
575
+ "eval.tests.test_serial_open.test_open_regular_file_is_not_tty[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]",
576
+ "eval.tests.test_serial_open.test_regular_file_valid_baud_is_not_tty[230400]",
577
+ "eval.tests.test_serial_open.test_regular_file_valid_baud_is_not_tty[57600]",
578
+ "eval.tests.test_serial_open.test_regular_file_valid_baud_is_not_tty[9600]",
579
+ "eval.tests.test_serial_open.test_regular_file_with_invalid_baud_reports_baud_first",
580
+ "eval.tests.test_serial_open.test_symlink_to_regular_file_is_not_tty",
581
+ "eval.tests.test_success_flush.test_valid_baud_softflow_success_then_bind_error[0]",
582
+ "eval.tests.test_success_flush.test_valid_baud_softflow_success_then_bind_error[115200]",
583
+ "eval.tests.test_success_flush.test_valid_baud_softflow_success_then_bind_error[4000000]",
584
+ "eval.tests.test_success_flush.test_valid_baud_softflow_success_then_bind_error[9600]",
585
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[0]",
586
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[1000000]",
587
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[110]",
588
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[1152000]",
589
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[115200]",
590
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[1200]",
591
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[134]",
592
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[1500000]",
593
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[150]",
594
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[1800]",
595
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[19200]",
596
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[2000000]",
597
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[200]",
598
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[230400]",
599
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[2400]",
600
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[2500000]",
601
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[3000000]",
602
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[300]",
603
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[3500000]",
604
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[38400]",
605
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[4000000]",
606
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[460800]",
607
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[4800]",
608
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[500000]",
609
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[50]",
610
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[576000]",
611
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[57600]",
612
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[600]",
613
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[75]",
614
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[921600]",
615
+ "eval.tests.test_success_flush.test_valid_baud_success_then_bind_error[9600]"
616
+ ]
617
+ }
618
+ },
619
+ "commit": "f44f47f9f5a4fcfb44ded5ed3be97430d3293249",
620
+ "data_source": "synthetic_programgym",
621
+ "difficulty": "easy",
622
+ "difficulty_score": 0.8796692056320534,
623
+ "eval_clean_hashes": [
624
+ "ed3257dd4de668a623cce2a31fc1561beee5de25a07d38b217a78582de16dd52"
625
+ ],
626
+ "input_record": {
627
+ "commit": "f44f47f9f5a4fcfb44ded5ed3be97430d3293249",
628
+ "commits": 18,
629
+ "contributors": 2,
630
+ "difficulty": "easy",
631
+ "difficulty_code_lines": 758,
632
+ "difficulty_has_tests": false,
633
+ "difficulty_product_code_lines": 758,
634
+ "difficulty_runtime_deps": 0,
635
+ "difficulty_score": 0.8796692056320534,
636
+ "difficulty_test_code_lines": 0,
637
+ "full_name": "banksy-git/lidl-gateway-freedom",
638
+ "github_stars": 252,
639
+ "input_joern_zip": "c_joern/banksy-git__lidl-gateway-freedom.zip",
640
+ "joern_status": true,
641
+ "joern_time": 9.384070534957573,
642
+ "language": "c",
643
+ "pb_match": [
644
+ {
645
+ "pb_fullname": "mkj/dropbear",
646
+ "rank": 844,
647
+ "similarity": 0.4529694616794586
648
+ }
649
+ ],
650
+ "repo_age": 5.51,
651
+ "repo_path": "c/banksy-git__lidl-gateway-freedom",
652
+ "source": "commit:f44f47f9f5a4fcfb44ded5ed3be97430d3293249",
653
+ "status": "done",
654
+ "url": "https://github.com/banksy-git/lidl-gateway-freedom"
655
+ },
656
+ "instance_id": "banksy-git__lidl-gateway-freedom.f44f47f",
657
+ "language": "c",
658
+ "module_iterations": [
659
+ {
660
+ "actual_iterations": 5,
661
+ "branch_name": "generated_module_01",
662
+ "iteration_limit": 5,
663
+ "module_index": 1,
664
+ "module_kind": "source",
665
+ "termination_reason": "max_iterations"
666
+ },
667
+ {
668
+ "actual_iterations": 5,
669
+ "branch_name": "generated_module_02",
670
+ "iteration_limit": 5,
671
+ "module_index": 2,
672
+ "module_kind": "source",
673
+ "termination_reason": "max_iterations"
674
+ }
675
+ ],
676
+ "repository": "banksy-git/lidl-gateway-freedom"
677
+ }
banksy-git--lidl-gateway-freedom.f44f47f/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
banksy-git--lidl-gateway-freedom.f44f47f/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83691301d15ac6f9f5ccab07a0c6ddb2f165c45a946f280bd9731e06315d5cff
3
+ size 876
barnybug--cli53.5581c5a/environment/Dockerfile ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_GOSUMDB="sum.golang.org"
5
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
6
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
7
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
8
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
9
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
10
+ ARG PROGRAMGYM_RUSTUP_DIST_SERVER="https://static.rust-lang.org"
11
+ ARG PROGRAMGYM_RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
12
+ ARG PROGRAMGYM_CARGO_INDEX="sparse+https://index.crates.io/"
13
+ ARG PROGRAMGYM_CARGO_NET_RETRY="10"
14
+ ARG PROGRAMGYM_CARGO_HTTP_TIMEOUT="600"
15
+ ARG PROGRAMGYM_CARGO_HTTP_MULTIPLEXING="false"
16
+ ARG PROGRAMGYM_MAVEN_MIRROR_URL=""
17
+ ARG PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL=""
18
+ ARG PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL="https://services.gradle.org/distributions"
19
+ ARG PROGRAMGYM_JITPACK_REPOSITORY_URL="https://jitpack.io"
20
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
21
+ ENV GOSUMDB=${PROGRAMGYM_GOSUMDB}
22
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
23
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
24
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
25
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
26
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
27
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
28
+ ENV RUSTUP_DIST_SERVER=${PROGRAMGYM_RUSTUP_DIST_SERVER}
29
+ ENV RUSTUP_UPDATE_ROOT=${PROGRAMGYM_RUSTUP_UPDATE_ROOT}
30
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX=${PROGRAMGYM_CARGO_INDEX}
31
+ ENV CARGO_NET_RETRY=${PROGRAMGYM_CARGO_NET_RETRY}
32
+ ENV CARGO_HTTP_TIMEOUT=${PROGRAMGYM_CARGO_HTTP_TIMEOUT}
33
+ ENV CARGO_HTTP_MULTIPLEXING=${PROGRAMGYM_CARGO_HTTP_MULTIPLEXING}
34
+ ENV PROGRAMGYM_MAVEN_MIRROR_URL=${PROGRAMGYM_MAVEN_MIRROR_URL}
35
+ ENV PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL=${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL}
36
+ ENV PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL=${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL}
37
+ ENV PROGRAMGYM_JITPACK_REPOSITORY_URL=${PROGRAMGYM_JITPACK_REPOSITORY_URL}
38
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
39
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
40
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
41
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
42
+ COPY harbor_configure_java_mirrors.sh /tmp/harbor_configure_java_mirrors.sh
43
+ RUN chmod 0755 /tmp/harbor_configure_java_mirrors.sh \
44
+ && /bin/bash /tmp/harbor_configure_java_mirrors.sh "${PROGRAMGYM_MAVEN_MIRROR_URL}" "${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL}" "${PROGRAMGYM_JITPACK_REPOSITORY_URL}" \
45
+ && rm -f /tmp/harbor_configure_java_mirrors.sh
46
+ ENV DEBIAN_FRONTEND=noninteractive
47
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
48
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
49
+ ENV GOTOOLCHAIN=auto
50
+ ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
51
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
52
+ ENV npm_config_cache=/workspace/.cache/npm
53
+ ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
54
+ ENV HOME=/workspace
55
+ ENV XDG_CACHE_HOME=/workspace/.cache
56
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
57
+ ENV PYTHONUSERBASE=/workspace/.local
58
+ ENV GOROOT=/usr/local/go
59
+ ENV GOPATH=/workspace/.go
60
+ ENV GOCACHE=/workspace/.cache/go-build
61
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
62
+ 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
63
+ ENV PAGER=cat
64
+ ENV MANPAGER=cat
65
+ ENV LESS=-R
66
+ ENV TQDM_DISABLE=1
67
+ ENV VIRTUAL_ENV=/opt/programgym-venv
68
+ 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/*
69
+ COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
70
+ 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
71
+ 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
72
+ WORKDIR /workspace
73
+ ADD workspace.tar.gz /workspace/
74
+ COPY executable /workspace/executable
75
+ COPY download.sh /workspace/download.sh
76
+ RUN chmod 755 /workspace/download.sh
77
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
78
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
79
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
80
+ && rm -f /workspace/download.sh \
81
+ && rm -f /tmp/harbor_prepare_download_env.sh
82
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
83
+ RUN chmod 111 /workspace/executable
84
+ WORKDIR /workspace
85
+ # programgym-runtime-workspace-cleanup: v1
86
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
87
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
88
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
89
+ # submission handed to the separate verifier. Keep the reference executable
90
+ # execute-only; the oracle temporarily restores owner read permission.
91
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
92
+ RUN mkdir -p /home/agent \
93
+ && chown -R agent:agent /home/agent /workspace \
94
+ && chown agent:agent /workspace/executable \
95
+ && chmod 111 /workspace/executable
96
+ ENV HOME=/home/agent
97
+ WORKDIR /workspace
98
+ 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"]
barnybug--cli53.5581c5a/environment/docker-compose.yaml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_GOSUMDB: ${PROGRAMGYM_GOSUMDB:-sum.golang.org}
8
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
9
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
10
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
11
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
12
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
13
+ PROGRAMGYM_RUSTUP_DIST_SERVER: ${PROGRAMGYM_RUSTUP_DIST_SERVER:-https://static.rust-lang.org}
14
+ PROGRAMGYM_RUSTUP_UPDATE_ROOT: ${PROGRAMGYM_RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}
15
+ PROGRAMGYM_CARGO_INDEX: ${PROGRAMGYM_CARGO_INDEX:-sparse+https://index.crates.io/}
16
+ PROGRAMGYM_CARGO_NET_RETRY: ${PROGRAMGYM_CARGO_NET_RETRY:-10}
17
+ PROGRAMGYM_CARGO_HTTP_TIMEOUT: ${PROGRAMGYM_CARGO_HTTP_TIMEOUT:-600}
18
+ PROGRAMGYM_CARGO_HTTP_MULTIPLEXING: ${PROGRAMGYM_CARGO_HTTP_MULTIPLEXING:-false}
19
+ PROGRAMGYM_MAVEN_MIRROR_URL: ${PROGRAMGYM_MAVEN_MIRROR_URL:-}
20
+ PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL: ${PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL:-}
21
+ PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL: ${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL:-https://services.gradle.org/distributions}
22
+ PROGRAMGYM_JITPACK_REPOSITORY_URL: ${PROGRAMGYM_JITPACK_REPOSITORY_URL:-https://jitpack.io}
barnybug--cli53.5581c5a/environment/download.sh ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/barnybug/cli53
9
+
10
+ go 1.24
11
+
12
+ toolchain go1.24.4
13
+
14
+ require (
15
+ github.com/aws/aws-sdk-go-v2 v1.41.5
16
+ github.com/aws/aws-sdk-go-v2/config v1.32.14
17
+ github.com/aws/aws-sdk-go-v2/credentials v1.19.14
18
+ github.com/aws/aws-sdk-go-v2/service/ec2 v1.296.2
19
+ github.com/aws/aws-sdk-go-v2/service/route53 v1.62.5
20
+ github.com/aws/aws-sdk-go-v2/service/sts v1.41.10
21
+ github.com/aws/smithy-go v1.24.3
22
+ github.com/gucumber/gucumber v0.0.0-20180127021336-7d5c79e832a2
23
+ github.com/miekg/dns v1.1.65
24
+ github.com/stretchr/testify v1.4.0
25
+ github.com/urfave/cli/v2 v2.27.6
26
+ )
27
+
28
+ require (
29
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect
30
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
31
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
32
+ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect
33
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
34
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
35
+ github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect
36
+ github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 // indirect
37
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 // indirect
38
+ github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
39
+ github.com/davecgh/go-spew v1.1.0 // indirect
40
+ github.com/pmezard/go-difflib v1.0.0 // indirect
41
+ github.com/russross/blackfriday/v2 v2.1.0 // indirect
42
+ github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect
43
+ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
44
+ golang.org/x/mod v0.24.0 // indirect
45
+ golang.org/x/net v0.39.0 // indirect
46
+ golang.org/x/sync v0.13.0 // indirect
47
+ golang.org/x/sys v0.32.0 // indirect
48
+ golang.org/x/tools v0.32.0 // indirect
49
+ gopkg.in/yaml.v2 v2.2.8 // indirect
50
+ )
51
+ PROGRAMGYM_GO_MOD_EOF
52
+ cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
53
+ github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY=
54
+ github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o=
55
+ github.com/aws/aws-sdk-go-v2/config v1.32.14 h1:opVIRo/ZbbI8OIqSOKmpFaY7IwfFUOCCXBsUpJOwDdI=
56
+ github.com/aws/aws-sdk-go-v2/config v1.32.14/go.mod h1:U4/V0uKxh0Tl5sxmCBZ3AecYny4UNlVmObYjKuuaiOo=
57
+ github.com/aws/aws-sdk-go-v2/credentials v1.19.14 h1:n+UcGWAIZHkXzYt87uMFBv/l8THYELoX6gVcUvgl6fI=
58
+ github.com/aws/aws-sdk-go-v2/credentials v1.19.14/go.mod h1:cJKuyWB59Mqi0jM3nFYQRmnHVQIcgoxjEMAbLkpr62w=
59
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 h1:NUS3K4BTDArQqNu2ih7yeDLaS3bmHD0YndtA6UP884g=
60
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21/go.mod h1:YWNWJQNjKigKY1RHVJCuupeWDrrHjRqHm0N9rdrWzYI=
61
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4=
62
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c=
63
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A=
64
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps=
65
+ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 h1:qYQ4pzQ2Oz6WpQ8T3HvGHnZydA72MnLuFK9tJwmrbHw=
66
+ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6/go.mod h1:O3h0IK87yXci+kg6flUKzJnWeziQUKciKrLjcatSNcY=
67
+ github.com/aws/aws-sdk-go-v2/service/ec2 v1.296.2 h1:Ytu50ChAxCiDsOlBcBq8jbczXy6+QLb07T65DBJASRs=
68
+ github.com/aws/aws-sdk-go-v2/service/ec2 v1.296.2/go.mod h1:R+2BNtUfTfhPY0RH18oL02q116bakeBWjanrbnVBqkM=
69
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 h1:5EniKhLZe4xzL7a+fU3C2tfUN4nWIqlLesfrjkuPFTY=
70
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7/go.mod h1:x0nZssQ3qZSnIcePWLvcoFisRXJzcTVvYpAAdYX8+GI=
71
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 h1:c31//R3xgIJMSC8S6hEVq+38DcvUlgFY0FM6mSI5oto=
72
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21/go.mod h1:r6+pf23ouCB718FUxaqzZdbpYFyDtehyZcmP5KL9FkA=
73
+ github.com/aws/aws-sdk-go-v2/service/route53 v1.62.5 h1:Z+/OLsb85Kpq7TVLCspskqePaf68Tdv6GfmJP4kH6i0=
74
+ github.com/aws/aws-sdk-go-v2/service/route53 v1.62.5/go.mod h1:TmxGowuBYwjmHFOsEDxaZdsQE62JJzOmtiWafTi/czg=
75
+ github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 h1:QKZH0S178gCmFEgst8hN0mCX1KxLgHBKKY/CLqwP8lg=
76
+ github.com/aws/aws-sdk-go-v2/service/signin v1.0.9/go.mod h1:7yuQJoT+OoH8aqIxw9vwF+8KpvLZ8AWmvmUWHsGQZvI=
77
+ github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 h1:lFd1+ZSEYJZYvv9d6kXzhkZu07si3f+GQ1AaYwa2LUM=
78
+ github.com/aws/aws-sdk-go-v2/service/sso v1.30.15/go.mod h1:WSvS1NLr7JaPunCXqpJnWk1Bjo7IxzZXrZi1QQCkuqM=
79
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 h1:dzztQ1YmfPrxdrOiuZRMF6fuOwWlWpD2StNLTceKpys=
80
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w=
81
+ github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U=
82
+ github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw=
83
+ github.com/aws/smithy-go v1.24.3 h1:XgOAaUgx+HhVBoP4v8n6HCQoTRDhoMghKqw4LNHsDNg=
84
+ github.com/aws/smithy-go v1.24.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
85
+ github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
86
+ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
87
+ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
88
+ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
89
+ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
90
+ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
91
+ github.com/gucumber/gucumber v0.0.0-20180127021336-7d5c79e832a2 h1:iR8wSrr/JCzL1Ul+dRVxtIOnP8DGg/m02nHZJ9PH6P0=
92
+ github.com/gucumber/gucumber v0.0.0-20180127021336-7d5c79e832a2/go.mod h1:YbdHRK9ViqwGMS0rtRY+1I6faHvVyyurKPIPwifihxI=
93
+ github.com/miekg/dns v1.1.65 h1:0+tIPHzUW0GCge7IiK3guGP57VAw7hoPDfApjkMD1Fc=
94
+ github.com/miekg/dns v1.1.65/go.mod h1:Dzw9769uoKVaLuODMDZz9M6ynFU6Em65csPuoi8G0ck=
95
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
96
+ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
97
+ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
98
+ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
99
+ github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 h1:v9ezJDHA1XGxViAUSIoO/Id7Fl63u6d0YmsAm+/p2hs=
100
+ github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02/go.mod h1:RF16/A3L0xSa0oSERcnhd8Pu3IXSDZSK2gmGIMsttFE=
101
+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
102
+ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
103
+ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
104
+ github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g=
105
+ github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
106
+ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
107
+ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
108
+ golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
109
+ golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
110
+ golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
111
+ golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
112
+ golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
113
+ golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
114
+ golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
115
+ golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
116
+ golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
117
+ golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
118
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
119
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
120
+ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
121
+ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
122
+ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
123
+ PROGRAMGYM_GO_SUM_EOF
124
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
125
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
126
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
127
+ *"|"*|*","*)
128
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
129
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
130
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
131
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
132
+ fi
133
+ ;;
134
+ esac
135
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
136
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
137
+ fi
138
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
139
+ import os
140
+ import signal
141
+ import subprocess
142
+ import sys
143
+ import time
144
+
145
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
146
+ if not command:
147
+ raise SystemExit(125)
148
+ environment = os.environ.copy()
149
+ environment["GOPROXY"] = proxy
150
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
151
+ try:
152
+ returncode = process.wait(timeout=float(timeout_text))
153
+ except subprocess.TimeoutExpired:
154
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
155
+ sentinel.write("expired\n")
156
+ try:
157
+ os.killpg(process.pid, signal.SIGTERM)
158
+ except ProcessLookupError:
159
+ pass
160
+ deadline = time.monotonic() + float(grace_text)
161
+ group_alive = True
162
+ while time.monotonic() < deadline:
163
+ process.poll()
164
+ try:
165
+ os.killpg(process.pid, 0)
166
+ except ProcessLookupError:
167
+ group_alive = False
168
+ break
169
+ time.sleep(0.05)
170
+ if group_alive:
171
+ try:
172
+ os.killpg(process.pid, signal.SIGKILL)
173
+ except ProcessLookupError:
174
+ pass
175
+ process.wait()
176
+ raise SystemExit(124)
177
+ if returncode < 0:
178
+ returncode = 128 - returncode
179
+ raise SystemExit(returncode)
180
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
181
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
182
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
183
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
184
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
185
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
186
+ return 1
187
+ else
188
+ exit 1
189
+ fi
190
+ fi
191
+ if ! command -v python3 >/dev/null 2>&1; then
192
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
193
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
194
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
195
+ return 1
196
+ else
197
+ exit 1
198
+ fi
199
+ fi
200
+ _programgym_go_with_nexus_timeout() {
201
+ local programgym_go_rc
202
+ local programgym_go_timeout_sentinel
203
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
204
+ return 1
205
+ fi
206
+ 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
207
+ programgym_go_rc=0
208
+ else
209
+ programgym_go_rc=$?
210
+ fi
211
+ programgym_go_timed_out=0
212
+ if [ -s "$programgym_go_timeout_sentinel" ]; then
213
+ programgym_go_timed_out=1
214
+ fi
215
+ rm -f "$programgym_go_timeout_sentinel"
216
+ if [ "$programgym_go_rc" -eq 0 ]; then
217
+ return 0
218
+ fi
219
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
220
+ printf '%s\n' "download.sh: primary Go request failed with rc=${programgym_go_rc}; GOPROXY has no explicit non-empty fallback remainder" >&2
221
+ return "$programgym_go_rc"
222
+ fi
223
+ if [ "$programgym_go_timed_out" -eq 1 ]; then
224
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
225
+ else
226
+ printf '%s\n' "download.sh: primary Go request failed with rc=${programgym_go_rc}; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
227
+ fi
228
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
229
+ }
230
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
231
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
232
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
233
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
234
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
235
+ return 1
236
+ else
237
+ exit 1
238
+ fi
239
+ fi
240
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
241
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
242
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
243
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
244
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
245
+ else
246
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
247
+ fi
248
+ export PATH="$GOROOT/bin:$PATH"
249
+ export GOTOOLCHAIN=local
250
+ 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
251
+ printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
252
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
253
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
254
+ return 1
255
+ else
256
+ exit 1
257
+ fi
258
+ fi
259
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
260
+ unset -f _programgym_go_with_nexus_timeout
261
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
262
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
263
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
264
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
265
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
barnybug--cli53.5581c5a/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a214901adb9d6913d82fdf68ee0c3594d4de215fc20aa964a5bc539e74de1cd7
3
+ size 60310286
barnybug--cli53.5581c5a/environment/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
barnybug--cli53.5581c5a/environment/harbor_configure_java_mirrors.sh ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ maven_url="${1%/}"
5
+ plugin_url="${2%/}"
6
+ jitpack_url="${3%/}"
7
+
8
+ install -d /workspace/.m2 /workspace/.gradle/init.d /opt/programgym/gradle-init
9
+ if [[ -n "$maven_url" ]]; then
10
+ cat >/workspace/.m2/settings.xml <<EOF
11
+ <?xml version="1.0" encoding="UTF-8"?>
12
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
13
+ <mirrors>
14
+ <mirror>
15
+ <id>programgym-maven</id>
16
+ <name>ProgramGym Maven mirror</name>
17
+ <url>${maven_url}</url>
18
+ <mirrorOf>*</mirrorOf>
19
+ </mirror>
20
+ </mirrors>
21
+ </settings>
22
+ EOF
23
+ fi
24
+
25
+ cat >/opt/programgym/gradle-init/programgym-mirrors.gradle <<'EOF'
26
+ def pbMaven = System.getenv('PROGRAMGYM_MAVEN_MIRROR_URL')
27
+ def pbPlugins = System.getenv('PROGRAMGYM_GRADLE_PLUGIN_REPOSITORY_URL')
28
+ def pbJitpack = System.getenv('PROGRAMGYM_JITPACK_REPOSITORY_URL')
29
+
30
+ settingsEvaluated { settings ->
31
+ settings.pluginManagement.repositories {
32
+ if (pbPlugins) { maven { url = uri(pbPlugins) } }
33
+ if (pbMaven) { maven { url = uri(pbMaven) } }
34
+ }
35
+ }
36
+
37
+ allprojects {
38
+ buildscript.repositories {
39
+ if (pbPlugins) { maven { url = uri(pbPlugins) } }
40
+ if (pbMaven) { maven { url = uri(pbMaven) } }
41
+ if (pbJitpack) { maven { url = uri(pbJitpack) } }
42
+ }
43
+ repositories {
44
+ if (pbMaven) { maven { url = uri(pbMaven) } }
45
+ if (pbJitpack) { maven { url = uri(pbJitpack) } }
46
+ }
47
+ }
48
+ EOF
49
+ cp /opt/programgym/gradle-init/programgym-mirrors.gradle \
50
+ /workspace/.gradle/init.d/programgym-mirrors.gradle
barnybug--cli53.5581c5a/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ if [[ -n "${PROGRAMGYM_MAVEN_MIRROR_URL:-}" ]]; then
6
+ sed -i -e "s|https://repo.maven.apache.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" -e "s|https://repo1.maven.org/maven2|${PROGRAMGYM_MAVEN_MIRROR_URL%/}|g" /workspace/download.sh
7
+ fi
8
+ if [[ -n "${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL:-}" ]]; then
9
+ sed -i -e "s|https://services.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" -e "s|https://downloads.gradle.org/distributions|${PROGRAMGYM_GRADLE_DISTRIBUTION_BASE_URL%/}|g" /workspace/download.sh
10
+ fi
11
+ if [[ -n "${PROGRAMGYM_JITPACK_REPOSITORY_URL:-}" ]]; then
12
+ sed -i -e "s|https://jitpack.io|${PROGRAMGYM_JITPACK_REPOSITORY_URL%/}|g" /workspace/download.sh
13
+ fi
14
+ source /workspace/download.sh
15
+ set +a
16
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
17
+ import os
18
+ import shlex
19
+
20
+ ignored = {
21
+ "ALL_PROXY",
22
+ "HTTP_PROXY",
23
+ "HTTPS_PROXY",
24
+ "NO_PROXY",
25
+ "OLDPWD",
26
+ "PIP_PROXY",
27
+ "PWD",
28
+ "SHLVL",
29
+ "_",
30
+ "all_proxy",
31
+ "http_proxy",
32
+ "https_proxy",
33
+ "no_proxy",
34
+ "pip_proxy",
35
+ }
36
+ for key in sorted(os.environ):
37
+ if key in ignored or key.startswith("BASH_FUNC_"):
38
+ continue
39
+ value = os.environ[key]
40
+ if "\n" in value:
41
+ continue
42
+ print(f"export {key}={shlex.quote(value)}")
43
+ PY
44
+ chmod 0644 /etc/profile.d/programgym_download_env.sh