Marquis03 commited on
Commit
355988b
·
verified ·
1 Parent(s): f60599c

Upload folder using huggingface_hub (part 38)

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 +84 -0
  2. plankcipher--kabmat.0251870/tests/Dockerfile +63 -0
  3. plankcipher--kabmat.0251870/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  4. plankcipher--kabmat.0251870/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  5. plankcipher--kabmat.0251870/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  6. plankcipher--kabmat.0251870/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  7. plankcipher--kabmat.0251870/tests/download.sh +37 -0
  8. plankcipher--kabmat.0251870/tests/executable +3 -0
  9. plankcipher--kabmat.0251870/tests/harbor_prepare_download_env.sh +34 -0
  10. plankcipher--kabmat.0251870/tests/programgym_evaluator.py +1201 -0
  11. plankcipher--kabmat.0251870/tests/programgym_task.json +649 -0
  12. plankcipher--kabmat.0251870/tests/test.sh +82 -0
  13. plankcipher--kabmat.0251870/tests/workspace.tar.gz +3 -0
  14. plibither8--2048.cpp.ad931d9/environment/Dockerfile +59 -0
  15. plibither8--2048.cpp.ad931d9/environment/download.sh +33 -0
  16. plibither8--2048.cpp.ad931d9/environment/executable +3 -0
  17. plibither8--2048.cpp.ad931d9/environment/harbor_prepare_download_env.sh +34 -0
  18. plibither8--2048.cpp.ad931d9/environment/programgym-gcc13.tar.gz +3 -0
  19. plibither8--2048.cpp.ad931d9/environment/workspace.tar.gz +3 -0
  20. plibither8--2048.cpp.ad931d9/instruction.md +98 -0
  21. plibither8--2048.cpp.ad931d9/solution/solve.sh +33 -0
  22. plibither8--2048.cpp.ad931d9/task.toml +69 -0
  23. plibither8--2048.cpp.ad931d9/tests/Dockerfile +67 -0
  24. plibither8--2048.cpp.ad931d9/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  25. plibither8--2048.cpp.ad931d9/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  26. plibither8--2048.cpp.ad931d9/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  27. plibither8--2048.cpp.ad931d9/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  28. plibither8--2048.cpp.ad931d9/tests/download.sh +33 -0
  29. plibither8--2048.cpp.ad931d9/tests/executable +3 -0
  30. plibither8--2048.cpp.ad931d9/tests/harbor_prepare_download_env.sh +34 -0
  31. plibither8--2048.cpp.ad931d9/tests/programgym-gcc13.tar.gz +3 -0
  32. plibither8--2048.cpp.ad931d9/tests/programgym_evaluator.py +1201 -0
  33. plibither8--2048.cpp.ad931d9/tests/programgym_task.json +1473 -0
  34. plibither8--2048.cpp.ad931d9/tests/test.sh +82 -0
  35. plibither8--2048.cpp.ad931d9/tests/workspace.tar.gz +3 -0
  36. pmp-library--pmp-library.2a2ad50/environment/Dockerfile +66 -0
  37. pmp-library--pmp-library.2a2ad50/environment/docker-compose.yaml +11 -0
  38. pmp-library--pmp-library.2a2ad50/environment/download.sh +56 -0
  39. pmp-library--pmp-library.2a2ad50/environment/executable +3 -0
  40. pmp-library--pmp-library.2a2ad50/environment/harbor_configure_apt_mirror.sh +37 -0
  41. pmp-library--pmp-library.2a2ad50/environment/harbor_prepare_download_env.sh +34 -0
  42. pmp-library--pmp-library.2a2ad50/environment/workspace.tar.gz +3 -0
  43. pmp-library--pmp-library.2a2ad50/instruction.md +98 -0
  44. pmp-library--pmp-library.2a2ad50/solution/solve.sh +33 -0
  45. pmp-library--pmp-library.2a2ad50/task.toml +69 -0
  46. pmp-library--pmp-library.2a2ad50/tests/Dockerfile +74 -0
  47. pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  48. pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  49. pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  50. pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_05.tar.gz +3 -0
.gitattributes CHANGED
@@ -2059,3 +2059,87 @@ pkg--browser.5ac0b6a/tests/executable filter=lfs diff=lfs merge=lfs -text
2059
  pksunkara--cargo-workspaces.4165/environment/executable filter=lfs diff=lfs merge=lfs -text
2060
  pksunkara--cargo-workspaces.4165/tests/executable filter=lfs diff=lfs merge=lfs -text
2061
  plankcipher--kabmat.0251870/environment/executable filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2059
  pksunkara--cargo-workspaces.4165/environment/executable filter=lfs diff=lfs merge=lfs -text
2060
  pksunkara--cargo-workspaces.4165/tests/executable filter=lfs diff=lfs merge=lfs -text
2061
  plankcipher--kabmat.0251870/environment/executable filter=lfs diff=lfs merge=lfs -text
2062
+ plankcipher--kabmat.0251870/tests/executable filter=lfs diff=lfs merge=lfs -text
2063
+ plibither8--2048.cpp.ad931d9/environment/executable filter=lfs diff=lfs merge=lfs -text
2064
+ plibither8--2048.cpp.ad931d9/tests/executable filter=lfs diff=lfs merge=lfs -text
2065
+ pmp-library--pmp-library.2a2ad50/environment/executable filter=lfs diff=lfs merge=lfs -text
2066
+ pmp-library--pmp-library.2a2ad50/tests/executable filter=lfs diff=lfs merge=lfs -text
2067
+ polachok--fahrenheit.3f2f133/environment/executable filter=lfs diff=lfs merge=lfs -text
2068
+ polachok--fahrenheit.3f2f133/tests/executable filter=lfs diff=lfs merge=lfs -text
2069
+ posener--complete.9a4745a/environment/executable filter=lfs diff=lfs merge=lfs -text
2070
+ posener--complete.9a4745a/tests/executable filter=lfs diff=lfs merge=lfs -text
2071
+ pottava--aws-s3-proxy.e0c3c78/environment/executable filter=lfs diff=lfs merge=lfs -text
2072
+ pottava--aws-s3-proxy.e0c3c78/tests/executable filter=lfs diff=lfs merge=lfs -text
2073
+ powergridmodel--power-grid-model/environment/executable filter=lfs diff=lfs merge=lfs -text
2074
+ powergridmodel--power-grid-model/tests/executable filter=lfs diff=lfs merge=lfs -text
2075
+ prbonn--vdbfusion.1b22ae8/environment/executable filter=lfs diff=lfs merge=lfs -text
2076
+ prbonn--vdbfusion.1b22ae8/tests/executable filter=lfs diff=lfs merge=lfs -text
2077
+ presburger--qmc-decoder.fb1e04b/environment/executable filter=lfs diff=lfs merge=lfs -text
2078
+ presburger--qmc-decoder.fb1e04b/tests/executable filter=lfs diff=lfs merge=lfs -text
2079
+ preshing--plywood.0bdafdc/environment/executable filter=lfs diff=lfs merge=lfs -text
2080
+ preshing--plywood.0bdafdc/tests/executable filter=lfs diff=lfs merge=lfs -text
2081
+ priseborough--inertialnav.037c5c/environment/executable filter=lfs diff=lfs merge=lfs -text
2082
+ priseborough--inertialnav.037c5c/tests/executable filter=lfs diff=lfs merge=lfs -text
2083
+ probonopd--linuxdeployqt.7e7a01d/environment/executable filter=lfs diff=lfs merge=lfs -text
2084
+ probonopd--linuxdeployqt.7e7a01d/tests/executable filter=lfs diff=lfs merge=lfs -text
2085
+ procursusteam--ldid.c50e84e/environment/executable filter=lfs diff=lfs merge=lfs -text
2086
+ procursusteam--ldid.c50e84e/tests/executable filter=lfs diff=lfs merge=lfs -text
2087
+ prograda--skybolt.0589ee5/environment/executable filter=lfs diff=lfs merge=lfs -text
2088
+ prograda--skybolt.0589ee5/tests/executable filter=lfs diff=lfs merge=lfs -text
2089
+ programatik29--rust-web-benchmar/environment/executable filter=lfs diff=lfs merge=lfs -text
2090
+ programatik29--rust-web-benchmar/tests/executable filter=lfs diff=lfs merge=lfs -text
2091
+ programmingrust--mandelbrot.2ba8/environment/executable filter=lfs diff=lfs merge=lfs -text
2092
+ programmingrust--mandelbrot.2ba8/tests/executable filter=lfs diff=lfs merge=lfs -text
2093
+ progrium--go-basher.53c8165/environment/executable filter=lfs diff=lfs merge=lfs -text
2094
+ progrium--go-basher.53c8165/tests/executable filter=lfs diff=lfs merge=lfs -text
2095
+ projectchrono--chrono.d8a4949/environment/executable filter=lfs diff=lfs merge=lfs -text
2096
+ projectchrono--chrono.d8a4949/tests/executable filter=lfs diff=lfs merge=lfs -text
2097
+ projectdiscovery--wappalyzergo.e/environment/executable filter=lfs diff=lfs merge=lfs -text
2098
+ projectdiscovery--wappalyzergo.e/tests/executable filter=lfs diff=lfs merge=lfs -text
2099
+ projectm-visualizer--projectm.4d/environment/executable filter=lfs diff=lfs merge=lfs -text
2100
+ projectm-visualizer--projectm.4d/tests/executable filter=lfs diff=lfs merge=lfs -text
2101
+ prometheus--prom2json.8ccc6fa/environment/executable filter=lfs diff=lfs merge=lfs -text
2102
+ prometheus--prom2json.8ccc6fa/tests/executable filter=lfs diff=lfs merge=lfs -text
2103
+ proofrock--ws4sqlite.eb139e3/environment/executable filter=lfs diff=lfs merge=lfs -text
2104
+ proofrock--ws4sqlite.eb139e3/tests/executable filter=lfs diff=lfs merge=lfs -text
2105
+ proxytunnel--proxytunnel.66fa1e2/environment/executable filter=lfs diff=lfs merge=lfs -text
2106
+ proxytunnel--proxytunnel.66fa1e2/tests/executable filter=lfs diff=lfs merge=lfs -text
2107
+ prydonius--karn.7307672/environment/executable filter=lfs diff=lfs merge=lfs -text
2108
+ prydonius--karn.7307672/tests/executable filter=lfs diff=lfs merge=lfs -text
2109
+ psopt--psopt.f367497/environment/executable filter=lfs diff=lfs merge=lfs -text
2110
+ psopt--psopt.f367497/tests/executable filter=lfs diff=lfs merge=lfs -text
2111
+ puerkitobio--fetchbot.b01e8f8/environment/executable filter=lfs diff=lfs merge=lfs -text
2112
+ puerkitobio--fetchbot.b01e8f8/tests/executable filter=lfs diff=lfs merge=lfs -text
2113
+ pwaller--go2ll-talk.a577581/environment/executable filter=lfs diff=lfs merge=lfs -text
2114
+ pwaller--go2ll-talk.a577581/tests/executable filter=lfs diff=lfs merge=lfs -text
2115
+ pwnesia--dnstake.3d9d96e/environment/executable filter=lfs diff=lfs merge=lfs -text
2116
+ pwnesia--dnstake.3d9d96e/tests/executable filter=lfs diff=lfs merge=lfs -text
2117
+ pwnwriter--kanha.df75df5/environment/executable filter=lfs diff=lfs merge=lfs -text
2118
+ pwnwriter--kanha.df75df5/tests/executable filter=lfs diff=lfs merge=lfs -text
2119
+ q191201771--naza.185b380/environment/executable filter=lfs diff=lfs merge=lfs -text
2120
+ q191201771--naza.185b380/tests/executable filter=lfs diff=lfs merge=lfs -text
2121
+ qaware--protocurl.cf82eeb/environment/executable filter=lfs diff=lfs merge=lfs -text
2122
+ qaware--protocurl.cf82eeb/tests/executable filter=lfs diff=lfs merge=lfs -text
2123
+ qihoo360--mysql-sniffer.86e06b8/environment/executable filter=lfs diff=lfs merge=lfs -text
2124
+ qihoo360--mysql-sniffer.86e06b8/tests/executable filter=lfs diff=lfs merge=lfs -text
2125
+ qihoo360--phptrace.16ea058/environment/executable filter=lfs diff=lfs merge=lfs -text
2126
+ qihoo360--phptrace.16ea058/tests/executable filter=lfs diff=lfs merge=lfs -text
2127
+ qntfy--kazaam.f202606/environment/executable filter=lfs diff=lfs merge=lfs -text
2128
+ qntfy--kazaam.f202606/tests/executable filter=lfs diff=lfs merge=lfs -text
2129
+ quasilyte--phpgrep.11a7680/environment/executable filter=lfs diff=lfs merge=lfs -text
2130
+ quasilyte--phpgrep.11a7680/tests/executable filter=lfs diff=lfs merge=lfs -text
2131
+ quest-kit--quest.9d7618d/environment/executable filter=lfs diff=lfs merge=lfs -text
2132
+ quest-kit--quest.9d7618d/tests/executable filter=lfs diff=lfs merge=lfs -text
2133
+ quickwit-oss--whichlang.6c1c8b6/environment/executable filter=lfs diff=lfs merge=lfs -text
2134
+ quickwit-oss--whichlang.6c1c8b6/tests/executable filter=lfs diff=lfs merge=lfs -text
2135
+ quininer--unzrip.14ba4b4/environment/executable filter=lfs diff=lfs merge=lfs -text
2136
+ quininer--unzrip.14ba4b4/tests/executable filter=lfs diff=lfs merge=lfs -text
2137
+ quinny--guitareffects.1e974a2/environment/executable filter=lfs diff=lfs merge=lfs -text
2138
+ quinny--guitareffects.1e974a2/tests/executable filter=lfs diff=lfs merge=lfs -text
2139
+ r4d10n--retrogram-rtlsdr.931cb5d/environment/executable filter=lfs diff=lfs merge=lfs -text
2140
+ r4d10n--retrogram-rtlsdr.931cb5d/tests/executable filter=lfs diff=lfs merge=lfs -text
2141
+ race604--clock-tui.97d7c02/environment/executable filter=lfs diff=lfs merge=lfs -text
2142
+ race604--clock-tui.97d7c02/tests/executable filter=lfs diff=lfs merge=lfs -text
2143
+ radj307--arrcon.0859b1b/environment/executable filter=lfs diff=lfs merge=lfs -text
2144
+ radj307--arrcon.0859b1b/tests/executable filter=lfs diff=lfs merge=lfs -text
2145
+ rails--rails-new.0c97c81/environment/executable filter=lfs diff=lfs merge=lfs -text
plankcipher--kabmat.0251870/tests/Dockerfile ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 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/*
28
+ ARG CMAKE_VERSION=3.31.12
29
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
30
+ ARG GCC_VERSION=13.3.0
31
+ 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; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; 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
32
+ WORKDIR /workspace
33
+ ADD workspace.tar.gz /workspace/
34
+ COPY executable /workspace/executable
35
+ COPY download.sh /workspace/download.sh
36
+ RUN chmod 755 /workspace/download.sh
37
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
38
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
39
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
40
+ && rm -f /workspace/download.sh \
41
+ && rm -f /tmp/harbor_prepare_download_env.sh
42
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
43
+ RUN chmod 111 /workspace/executable
44
+ WORKDIR /workspace
45
+ # Harbor uses tests/ as the separate verifier build context. Start with the
46
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
47
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
48
+ && mkdir -p /workspace /tests
49
+
50
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
51
+ # Installing a newer pytest alone leaves that apt package importable and creates
52
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
53
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
54
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
55
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
56
+ RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
57
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
58
+
59
+ COPY test.sh /tests/test.sh
60
+ 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
plankcipher--kabmat.0251870/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:473bf8a9b3f6d13769ccad32fd64eef19e61a59c55650c278f7b64cd629817e7
3
+ size 13306
plankcipher--kabmat.0251870/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:d02269d91a9fcc4ffc59544c97090da3deded2280de0339aa94b4a0e1cb501e1
3
+ size 16315
plankcipher--kabmat.0251870/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:84b4ac25827d645fded4c65d5b9090299ddb4f9da3352f5bc192d3fadbb390eb
3
+ size 17902
plankcipher--kabmat.0251870/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d6651bcc5017057d3c88374dc89aea3c510ec5a9a3ffcc9e6d151f301d4121d
3
+ size 22849
plankcipher--kabmat.0251870/tests/download.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # download.sh - standalone, source-safe dependency setup for building kabmat.
3
+ #
4
+ # kabmat is a C++17 ncurses TUI program. Its only external dependency is the
5
+ # ncurses development library (provides <ncurses.h> and -lncurses). The rest is
6
+ # the C++ standard library plus the sources already shipped in the repository.
7
+ #
8
+ # This script only ensures the ncurses dev package is present and exports the
9
+ # environment build.sh relies on. It performs NO compilation, linking, or tests.
10
+ #
11
+ # It is sourced via `source /source_ro/download.sh` from the repository root
12
+ # while the container still has network access. It must be idempotent and safe
13
+ # to run in source mode (no exit in normal control flow, no positional args).
14
+
15
+ # ---- export environment for build.sh ----
16
+ # Nothing extra is required beyond the standard compiler/toolchain in the
17
+ # build image, but we export an explicit marker for clarity.
18
+ export PROGRAMGYM_NCURSES_READY=1
19
+
20
+ # ---- ensure ncurses dev library (provides <ncurses.h> and libncurses) ----
21
+ # Base image already ships libncurses-dev 6.3, so this is normally a no-op.
22
+ # Install explicitly only when it is missing, so we never depend on a
23
+ # pre-existing repository build file. dpkg -s returns nonzero when the
24
+ # package is not installed; branch on that explicitly.
25
+ export PROGRAMGYM_NCURSES_DEV_PRESENT=0
26
+ dpkg -s libncurses-dev
27
+ if [ "$?" -eq 0 ]; then
28
+ PROGRAMGYM_NCURSES_DEV_PRESENT=1
29
+ printf '%s\n' "libncurses-dev already present"
30
+ else
31
+ DEBIAN_FRONTEND=noninteractive apt-get update
32
+ DEBIAN_FRONTEND=noninteractive apt-get install -y libncurses-dev
33
+ PROGRAMGYM_NCURSES_DEV_PRESENT=1
34
+ fi
35
+
36
+ # Language-neutral signal that the dependency environment is prepared.
37
+ export KABMAT_DEPS_PREPARED=1
plankcipher--kabmat.0251870/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6d799a17f3f36b45fffdd73b4d8b66790f5b93683feacb38c2e7d97f625735f
3
+ size 3427032
plankcipher--kabmat.0251870/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
plankcipher--kabmat.0251870/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()
plankcipher--kabmat.0251870/tests/programgym_task.json ADDED
@@ -0,0 +1,649 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_argument_pairing.test_data_file_card_without_column_error",
9
+ "eval.tests.test_argument_pairing.test_data_file_read_error_precedes_options",
10
+ "eval.tests.test_argument_pairing.test_empty_data_file_still_reaches_parser",
11
+ "eval.tests.test_argument_pairing.test_no_value_then_value_flag",
12
+ "eval.tests.test_argument_pairing.test_option_value_looks_like_flag",
13
+ "eval.tests.test_argument_pairing.test_parser_reachable_only_when_data_file_present",
14
+ "eval.tests.test_argument_pairing.test_triple_no_value_flags",
15
+ "eval.tests.test_argument_pairing.test_two_no_value_flags_both_processed",
16
+ "eval.tests.test_argument_pairing.test_value_pairs_interleaved",
17
+ "eval.tests.test_argument_pairing.test_value_then_no_value_flag",
18
+ "eval.tests.test_create_mode.test_create_appends_board_to_data_file",
19
+ "eval.tests.test_create_mode.test_create_does_not_disable_tui_by_itself",
20
+ "eval.tests.test_create_mode.test_create_duplicate_board_appends_again",
21
+ "eval.tests.test_create_mode.test_create_empty_name_rejected",
22
+ "eval.tests.test_create_mode.test_create_flag_like_value_consumed",
23
+ "eval.tests.test_create_mode.test_create_internal_spaces_preserved",
24
+ "eval.tests.test_create_mode.test_create_into_empty_data_file",
25
+ "eval.tests.test_create_mode.test_create_long_flag_equivalent",
26
+ "eval.tests.test_create_mode.test_create_space_only_name_rejected[ ]",
27
+ "eval.tests.test_create_mode.test_create_space_only_name_rejected[ ]",
28
+ "eval.tests.test_create_mode.test_create_space_only_name_rejected[ ]",
29
+ "eval.tests.test_create_mode.test_create_space_only_name_rejected[ ]",
30
+ "eval.tests.test_create_mode.test_create_tab_only_name_is_not_trimmed",
31
+ "eval.tests.test_create_mode.test_create_then_list_roundtrip",
32
+ "eval.tests.test_create_mode.test_create_trims_leading_and_trailing_whitespace",
33
+ "eval.tests.test_delete_mode.test_delete_does_not_disable_tui_by_itself",
34
+ "eval.tests.test_delete_mode.test_delete_duplicate_name_removes_all_occurrences",
35
+ "eval.tests.test_delete_mode.test_delete_empty_name_reports_error",
36
+ "eval.tests.test_delete_mode.test_delete_long_flag_equivalent",
37
+ "eval.tests.test_delete_mode.test_delete_nonexistent_board_reports_error",
38
+ "eval.tests.test_delete_mode.test_delete_only_board_leaves_empty_file",
39
+ "eval.tests.test_delete_mode.test_delete_removes_board_from_data_file",
40
+ "eval.tests.test_delete_mode.test_delete_then_create_reuses_name",
41
+ "eval.tests.test_delete_mode.test_delete_then_list_reflects_removal",
42
+ "eval.tests.test_error_paths.test_both_messages_for_bad_first_arg",
43
+ "eval.tests.test_error_paths.test_combined_equals_form_is_unknown",
44
+ "eval.tests.test_error_paths.test_error_precedes_board_operation",
45
+ "eval.tests.test_error_paths.test_missing_value_not_mistaken_for_termination",
46
+ "eval.tests.test_error_paths.test_short_flag_with_long_value",
47
+ "eval.tests.test_error_paths.test_single_dash_alone_is_unknown",
48
+ "eval.tests.test_error_paths.test_unknown_option_rejected[----]",
49
+ "eval.tests.test_error_paths.test_unknown_option_rejected[--]",
50
+ "eval.tests.test_error_paths.test_unknown_option_rejected[--bogus]",
51
+ "eval.tests.test_error_paths.test_unknown_option_rejected[-9]",
52
+ "eval.tests.test_error_paths.test_unknown_option_rejected[-x]",
53
+ "eval.tests.test_error_paths.test_unknown_option_rejected[blah]",
54
+ "eval.tests.test_error_paths.test_unknown_option_reported_with_backticks",
55
+ "eval.tests.test_error_paths.test_value_option_missing_value[--create]",
56
+ "eval.tests.test_error_paths.test_value_option_missing_value[--delete]",
57
+ "eval.tests.test_error_paths.test_value_option_missing_value[--open]",
58
+ "eval.tests.test_error_paths.test_value_option_missing_value[-c]",
59
+ "eval.tests.test_error_paths.test_value_option_missing_value[-d]",
60
+ "eval.tests.test_error_paths.test_value_option_missing_value[-o]",
61
+ "eval.tests.test_list_mode.test_list_after_create_reflects_new_board",
62
+ "eval.tests.test_list_mode.test_list_boards_with_description_lines",
63
+ "eval.tests.test_list_mode.test_list_does_not_modify_data_file",
64
+ "eval.tests.test_list_mode.test_list_does_not_print_version_banner",
65
+ "eval.tests.test_list_mode.test_list_empty_data_file_prints_nothing",
66
+ "eval.tests.test_list_mode.test_list_long_flag_equivalent",
67
+ "eval.tests.test_list_mode.test_list_many_boards_keeps_order_and_no_blank_lines",
68
+ "eval.tests.test_list_mode.test_list_prints_all_boards_in_order",
69
+ "eval.tests.test_list_mode.test_list_single_board",
70
+ "eval.tests.test_long_flag_forms.test_all_long_spellings_recognized_as_cli_combination",
71
+ "eval.tests.test_long_flag_forms.test_card_at_bottom_long_form_keeps_tui",
72
+ "eval.tests.test_long_flag_forms.test_card_at_bottom_long_form_then_text",
73
+ "eval.tests.test_long_flag_forms.test_card_at_bottom_long_form_then_version",
74
+ "eval.tests.test_long_flag_forms.test_create_consumes_long_flag_token_as_value",
75
+ "eval.tests.test_long_flag_forms.test_create_long_form_missing_value_exact",
76
+ "eval.tests.test_long_flag_forms.test_create_long_spelling_consumes_short_flag_value",
77
+ "eval.tests.test_long_flag_forms.test_delete_long_form_missing_value_exact",
78
+ "eval.tests.test_long_flag_forms.test_long_flags_no_value_missing_only_value_options",
79
+ "eval.tests.test_long_flag_forms.test_open_long_form_missing_value_exact",
80
+ "eval.tests.test_long_flag_forms.test_short_card_at_bottom_equivalence_to_long",
81
+ "eval.tests.test_long_flag_forms.test_text_long_form_combined_with_create",
82
+ "eval.tests.test_long_flag_forms.test_text_long_form_selects_cli_mode",
83
+ "eval.tests.test_multi_operation_sequences.test_delete_matches_exact_name_not_prefix",
84
+ "eval.tests.test_multi_operation_sequences.test_delete_then_create_then_list_sequence",
85
+ "eval.tests.test_multi_operation_sequences.test_list_duplicate_boards_shows_all",
86
+ "eval.tests.test_multi_operation_sequences.test_open_global_prefix_no_match",
87
+ "eval.tests.test_multi_operation_sequences.test_open_then_create_in_one_traversal",
88
+ "eval.tests.test_multi_operation_sequences.test_repeated_create_flags_append_in_order",
89
+ "eval.tests.test_multi_operation_sequences.test_text_help_version_combined_cli",
90
+ "eval.tests.test_multi_operation_sequences.test_value_flags_alternate_with_no_value_flags",
91
+ "eval.tests.test_open_mode.test_open_does_not_modify_data_file",
92
+ "eval.tests.test_open_mode.test_open_empty_name_reports_error",
93
+ "eval.tests.test_open_mode.test_open_existing_board_selects_tui_by_default",
94
+ "eval.tests.test_open_mode.test_open_existing_board_then_cli_mode",
95
+ "eval.tests.test_open_mode.test_open_latest_occurrence_first_match",
96
+ "eval.tests.test_open_mode.test_open_long_flag_equivalent",
97
+ "eval.tests.test_open_mode.test_open_nonexistent_board_reports_error",
98
+ "eval.tests.test_open_mode.test_open_then_list_is_read_only",
99
+ "eval.tests.test_tui_selection.test_bare_no_arg_selects_tui",
100
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args0]",
101
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args1]",
102
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args2]",
103
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args3]",
104
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args4]",
105
+ "eval.tests.test_tui_selection.test_cli_mode_options_exit_zero_headless[args5]",
106
+ "eval.tests.test_tui_selection.test_create_roundtrip_visible_in_tui_pty",
107
+ "eval.tests.test_tui_selection.test_create_then_text_switch_in_one_run",
108
+ "eval.tests.test_tui_selection.test_text_selector_overrides_tui_flag",
109
+ "eval.tests.test_tui_selection.test_tui_launches_via_pty_with_existing_board",
110
+ "eval.tests.test_tui_selection.test_tui_launches_via_pty_with_no_args",
111
+ "eval.tests.test_tui_selection.test_tui_options_fail_headless_after_state_change[args0-seed0]",
112
+ "eval.tests.test_tui_selection.test_tui_options_fail_headless_after_state_change[args1-seed1]",
113
+ "eval.tests.test_tui_selection.test_tui_options_fail_headless_after_state_change[args2-seed2]",
114
+ "eval.tests.test_tui_selection.test_tui_options_fail_headless_after_state_change[args3-seed3]",
115
+ "eval.tests.test_tui_selection.test_tui_options_fail_headless_after_state_change[args4-seed4]",
116
+ "eval.tests.test_tui_selection.test_version_selector_overrides_tui_flag",
117
+ "eval.tests.test_version_help.test_help_does_not_modify_data_file",
118
+ "eval.tests.test_version_help.test_help_does_not_read_board_list",
119
+ "eval.tests.test_version_help.test_help_first_line_is_version_banner",
120
+ "eval.tests.test_version_help.test_help_lists_every_option",
121
+ "eval.tests.test_version_help.test_help_prints_usage_and_exits_zero[--help]",
122
+ "eval.tests.test_version_help.test_help_prints_usage_and_exits_zero[-h]",
123
+ "eval.tests.test_version_help.test_help_usage_line_pairs_short_and_long",
124
+ "eval.tests.test_version_help.test_help_with_trailing_options_still_disables_tui",
125
+ "eval.tests.test_version_help.test_version_combined_with_create_sets_cli_mode",
126
+ "eval.tests.test_version_help.test_version_does_not_list_boards",
127
+ "eval.tests.test_version_help.test_version_exact_banner",
128
+ "eval.tests.test_version_help.test_version_prints_name_and_version[--version]",
129
+ "eval.tests.test_version_help.test_version_prints_name_and_version[-v]"
130
+ ]
131
+ },
132
+ "generated_module_02": {
133
+ "ignore_reason": "",
134
+ "ignored": false,
135
+ "ignored_tests": [],
136
+ "tests": [
137
+ "eval.tests.test_board_tui_moves.test_create_column_trims_title_spaces",
138
+ "eval.tests.test_board_tui_moves.test_create_column_via_tui_appends",
139
+ "eval.tests.test_board_tui_moves.test_create_column_with_empty_title_is_noop",
140
+ "eval.tests.test_board_tui_moves.test_delete_all_columns_leaves_board_only",
141
+ "eval.tests.test_board_tui_moves.test_delete_confirm_with_enter",
142
+ "eval.tests.test_board_tui_moves.test_delete_focused_column_cancel_leaves_file_intact",
143
+ "eval.tests.test_board_tui_moves.test_delete_focused_column_with_confirm",
144
+ "eval.tests.test_board_tui_moves.test_delete_last_column_confirmed",
145
+ "eval.tests.test_board_tui_moves.test_move_card_from_middle_column_to_next",
146
+ "eval.tests.test_board_tui_moves.test_move_card_out_of_single_card_column_empties_it",
147
+ "eval.tests.test_board_tui_moves.test_move_card_to_next_column_at_last_column_is_noop",
148
+ "eval.tests.test_board_tui_moves.test_move_card_to_next_column_card_at_bottom",
149
+ "eval.tests.test_board_tui_moves.test_move_card_to_next_column_long_flag_card_at_bottom",
150
+ "eval.tests.test_board_tui_moves.test_move_card_to_next_column_relocates",
151
+ "eval.tests.test_board_tui_moves.test_move_card_to_prev_column_at_first_column_is_noop",
152
+ "eval.tests.test_board_tui_moves.test_move_card_to_prev_column_card_at_bottom",
153
+ "eval.tests.test_board_tui_moves.test_move_card_to_prev_column_relocates",
154
+ "eval.tests.test_board_tui_moves.test_move_column_left_at_first_column_is_noop",
155
+ "eval.tests.test_board_tui_moves.test_move_column_left_reorders_persisted_columns",
156
+ "eval.tests.test_board_tui_moves.test_move_column_left_via_ctrl_h_alias",
157
+ "eval.tests.test_board_tui_moves.test_move_column_right_at_last_column_is_noop",
158
+ "eval.tests.test_board_tui_moves.test_move_column_right_reorders_persisted_columns",
159
+ "eval.tests.test_board_tui_moves.test_move_column_right_via_ctrl_n_alias",
160
+ "eval.tests.test_board_tui_moves.test_move_columns_swap_enumeration_both_ways[\\x0c]",
161
+ "eval.tests.test_board_tui_moves.test_move_columns_swap_enumeration_both_ways[\\x0e]",
162
+ "eval.tests.test_board_tui_moves.test_rename_focused_column_rewrites_title",
163
+ "eval.tests.test_board_tui_moves.test_rename_focused_when_multiple_columns_targets_correct_one",
164
+ "eval.tests.test_card_checklist_ops.test_add_item_appends_at_end_of_existing",
165
+ "eval.tests.test_card_checklist_ops.test_add_item_empty_content_is_noop",
166
+ "eval.tests.test_card_checklist_ops.test_add_item_to_empty_checklist",
167
+ "eval.tests.test_card_checklist_ops.test_add_item_trims_surrounding_spaces",
168
+ "eval.tests.test_card_checklist_ops.test_add_two_items_preserves_append_order",
169
+ "eval.tests.test_card_checklist_ops.test_checklist_done_flag_persisted_roundtrip",
170
+ "eval.tests.test_card_checklist_ops.test_delete_all_items_leaves_card_only",
171
+ "eval.tests.test_card_checklist_ops.test_delete_first_item",
172
+ "eval.tests.test_card_checklist_ops.test_delete_last_item",
173
+ "eval.tests.test_card_checklist_ops.test_delete_middle_item_preserves_surrounding_order",
174
+ "eval.tests.test_card_checklist_ops.test_edit_card_content_via_cardinfo",
175
+ "eval.tests.test_card_checklist_ops.test_edit_item_content",
176
+ "eval.tests.test_card_checklist_ops.test_edit_item_preserves_done_state",
177
+ "eval.tests.test_card_checklist_ops.test_edit_item_trims_new_content",
178
+ "eval.tests.test_card_checklist_ops.test_edit_second_item_targets_correct_one",
179
+ "eval.tests.test_card_checklist_ops.test_move_item_down_at_bottom_boundary_is_noop",
180
+ "eval.tests.test_card_checklist_ops.test_move_item_down_multiple_positions",
181
+ "eval.tests.test_card_checklist_ops.test_move_item_down_swaps_with_below",
182
+ "eval.tests.test_card_checklist_ops.test_move_item_up_at_top_boundary_is_noop",
183
+ "eval.tests.test_card_checklist_ops.test_move_item_up_multiple_positions",
184
+ "eval.tests.test_card_checklist_ops.test_move_item_up_swaps_with_above",
185
+ "eval.tests.test_card_checklist_ops.test_move_up_then_down_roundtrip",
186
+ "eval.tests.test_card_checklist_ops.test_stateful_add_toggle_move_chain",
187
+ "eval.tests.test_card_checklist_ops.test_stateful_move_then_delete_chain",
188
+ "eval.tests.test_card_checklist_ops.test_toggle_item_done_off",
189
+ "eval.tests.test_card_checklist_ops.test_toggle_item_done_on",
190
+ "eval.tests.test_card_checklist_ops.test_toggle_second_item_only_changes_that_item",
191
+ "eval.tests.test_card_checklist_ops.test_toggle_then_delete_stateful",
192
+ "eval.tests.test_cli_and_boards.test_boards_with_trailing_newline_preserve_names",
193
+ "eval.tests.test_cli_and_boards.test_card_at_bottom_flag_parses_without_value",
194
+ "eval.tests.test_cli_and_boards.test_card_at_bottom_short_flag_does_not_consume_next",
195
+ "eval.tests.test_cli_and_boards.test_create_board_appends_to_data_file",
196
+ "eval.tests.test_cli_and_boards.test_create_board_long_flag",
197
+ "eval.tests.test_cli_and_boards.test_create_board_trims_surrounding_spaces",
198
+ "eval.tests.test_cli_and_boards.test_create_board_with_empty_string_is_error",
199
+ "eval.tests.test_cli_and_boards.test_create_board_with_only_spaces_is_error",
200
+ "eval.tests.test_cli_and_boards.test_create_board_with_tab_survives_and_is_listed",
201
+ "eval.tests.test_cli_and_boards.test_create_boards_accumulate_in_append_order",
202
+ "eval.tests.test_cli_and_boards.test_delete_board_long_flag",
203
+ "eval.tests.test_cli_and_boards.test_delete_board_removes_from_data",
204
+ "eval.tests.test_cli_and_boards.test_delete_created_board_leaves_empty",
205
+ "eval.tests.test_cli_and_boards.test_delete_does_not_trim_lookup_name",
206
+ "eval.tests.test_cli_and_boards.test_delete_nonexistent_board_is_error",
207
+ "eval.tests.test_cli_and_boards.test_delete_only_board_leaves_empty_file",
208
+ "eval.tests.test_cli_and_boards.test_help_flag_prints_usage_and_options",
209
+ "eval.tests.test_cli_and_boards.test_help_takes_no_value_arg",
210
+ "eval.tests.test_cli_and_boards.test_list_after_appending_boards",
211
+ "eval.tests.test_cli_and_boards.test_list_empty_boards_produces_no_output",
212
+ "eval.tests.test_cli_and_boards.test_list_lists_board_names_in_order",
213
+ "eval.tests.test_cli_and_boards.test_list_survives_existing_columns_and_cards",
214
+ "eval.tests.test_cli_and_boards.test_long_version_flag_prints_version",
215
+ "eval.tests.test_cli_and_boards.test_missing_data_file_aborts_even_for_version",
216
+ "eval.tests.test_cli_and_boards.test_multiple_boards_name_listing_is_deterministic",
217
+ "eval.tests.test_cli_and_boards.test_open_created_board_succeeds_state_transition",
218
+ "eval.tests.test_cli_and_boards.test_open_existing_board_is_ok_text",
219
+ "eval.tests.test_cli_and_boards.test_open_nonexistent_board_is_error",
220
+ "eval.tests.test_cli_and_boards.test_open_then_list_lists_all_boards",
221
+ "eval.tests.test_cli_and_boards.test_open_unknown_than_missing_value",
222
+ "eval.tests.test_cli_and_boards.test_record_created_board_exists_in_list",
223
+ "eval.tests.test_cli_and_boards.test_short_help_flag_prints_usage",
224
+ "eval.tests.test_cli_and_boards.test_unknown_option_is_error",
225
+ "eval.tests.test_cli_and_boards.test_unknown_option_lists_argument",
226
+ "eval.tests.test_cli_and_boards.test_value_option_missing_value_create",
227
+ "eval.tests.test_cli_and_boards.test_value_option_missing_value_is_error",
228
+ "eval.tests.test_cli_and_boards.test_version_disables_tui_entry",
229
+ "eval.tests.test_cli_and_boards.test_version_flag_prints_version",
230
+ "eval.tests.test_cli_and_boards.test_version_output_exact_home_isolation_consistent",
231
+ "eval.tests.test_cli_and_boards.test_version_then_list_combined",
232
+ "eval.tests.test_column_card_inplace_moves.test_card_moved_up_after_down_net_reorder",
233
+ "eval.tests.test_column_card_inplace_moves.test_four_card_column_boundaries_and_middle",
234
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_at_bottom_boundary_is_noop",
235
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_first_card_pushed_to_bottom",
236
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_in_second_column",
237
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_in_single_card_column_is_noop",
238
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_last_card_after_G_is_noop",
239
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_second_card_moves_over_one",
240
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_swaps_focused_card_with_below",
241
+ "eval.tests.test_column_card_inplace_moves.test_move_card_down_then_up_preserves_other_columns",
242
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_at_top_boundary_is_noop",
243
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_first_card_after_g_is_noop",
244
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_in_second_column",
245
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_in_single_card_column_is_noop",
246
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_last_card_climbs_to_top",
247
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_last_card_single_step",
248
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_swaps_focused_card_with_above",
249
+ "eval.tests.test_column_card_inplace_moves.test_move_card_up_third_card_moves_over_one",
250
+ "eval.tests.test_column_card_inplace_moves.test_move_up_then_down_restores_column_order",
251
+ "eval.tests.test_column_card_inplace_moves.test_with_card_at_bottom_in_column_move_is_verbatim",
252
+ "eval.tests.test_datafile_parse_errors.test_error_does_not_modify_data_file",
253
+ "eval.tests.test_datafile_parse_errors.test_malformed_line_number_tracks_nesting",
254
+ "eval.tests.test_datafile_parse_errors.test_malformed_nesting_is_load_error[ Col\\n-1-reading a column without a board]",
255
+ "eval.tests.test_datafile_parse_errors.test_malformed_nesting_is_load_error[Board\\n orphan desc\\n-2-reading a description without a card]",
256
+ "eval.tests.test_datafile_parse_errors.test_malformed_nesting_is_load_error[Board\\n +orphan\\n-2-reading a checklist item without a card]",
257
+ "eval.tests.test_datafile_parse_errors.test_malformed_nesting_is_load_error[Board\\n orphan card\\n-2-reading a card without a column]",
258
+ "eval.tests.test_datafile_parse_errors.test_malformed_then_fixed_load_is_ok",
259
+ "eval.tests.test_datafile_parse_errors.test_missing_data_file_reports_read_error",
260
+ "eval.tests.test_datafile_parse_errors.test_multiple_sequential_malformed_lines_first_reported",
261
+ "eval.tests.test_helpers_trim.test_blank_line_parses_as_nested_item_error",
262
+ "eval.tests.test_helpers_trim.test_create_preserves_interior_spaces",
263
+ "eval.tests.test_helpers_trim.test_create_preserves_tab_characters",
264
+ "eval.tests.test_helpers_trim.test_create_trims_surrounding_spaces_in_stored_name",
265
+ "eval.tests.test_helpers_trim.test_delete_finds_trimmed_stored_name",
266
+ "eval.tests.test_helpers_trim.test_delete_uses_raw_argument_no_trim",
267
+ "eval.tests.test_helpers_trim.test_leading_space_board_line_is_parse_error",
268
+ "eval.tests.test_helpers_trim.test_list_shows_trimmed_board_name",
269
+ "eval.tests.test_helpers_trim.test_order_of_board_without_trim_preserved",
270
+ "eval.tests.test_persistence.test_backup_created_on_writeback",
271
+ "eval.tests.test_persistence.test_backup_not_created_without_writeback",
272
+ "eval.tests.test_persistence.test_card_description_and_checklist_writer_order",
273
+ "eval.tests.test_persistence.test_card_trailing_spaces_trimmed_on_roundtrip",
274
+ "eval.tests.test_persistence.test_checklist_done_flag_roundtrip",
275
+ "eval.tests.test_persistence.test_checklist_only_card_roundtrip",
276
+ "eval.tests.test_persistence.test_data_dir_created_by_make_expected",
277
+ "eval.tests.test_persistence.test_deleting_middle_board_preserves_others",
278
+ "eval.tests.test_persistence.test_description_without_trailing_card_content",
279
+ "eval.tests.test_persistence.test_empty_card_content_roundtrip",
280
+ "eval.tests.test_persistence.test_empty_description_roundtrip",
281
+ "eval.tests.test_persistence.test_many_boards_roundtrip_preserves_all",
282
+ "eval.tests.test_persistence.test_multiline_description_roundtrip",
283
+ "eval.tests.test_persistence.test_multiple_boards_roundtrip_order",
284
+ "eval.tests.test_persistence.test_multiple_cards_in_column_roundtrip",
285
+ "eval.tests.test_persistence.test_multiple_columns_roundtrip_order",
286
+ "eval.tests.test_persistence.test_single_empty_name_board_roundtrip",
287
+ "eval.tests.test_persistence.test_writeback_columns_titles_roundtrip_unchanged",
288
+ "eval.tests.test_persistence.test_writeback_roundtrip_preserves_full_structure",
289
+ "eval.tests.test_persistence.test_writeback_updates_backup_each_time",
290
+ "eval.tests.test_persistence.test_written_data_is_parseable_again"
291
+ ]
292
+ },
293
+ "generated_module_03": {
294
+ "ignore_reason": "",
295
+ "ignored": false,
296
+ "ignored_tests": [],
297
+ "tests": [
298
+ "eval.tests.test_board_deep.TestDeepColumnMoves.test_move_non_first_card_up_within_column",
299
+ "eval.tests.test_board_deep.TestDeepColumnMoves.test_three_column_move_card_to_next_column_bottom",
300
+ "eval.tests.test_board_deep.TestDeepColumnMoves.test_three_column_move_card_to_next_column_top",
301
+ "eval.tests.test_board_deep.TestDeepColumnNavigation.test_move_leftmost_column_right_once",
302
+ "eval.tests.test_board_deep.TestDeepColumnNavigation.test_move_rightmost_column_left_twice",
303
+ "eval.tests.test_board_deep.TestEmptyBoard.test_create_first_column_in_empty_board",
304
+ "eval.tests.test_board_deep.TestEmptyBoard.test_empty_board_renders_create_hint_and_exits",
305
+ "eval.tests.test_board_navigation.TestBoardHelp.test_board_question_mark_help_closes_cleanly",
306
+ "eval.tests.test_board_navigation.TestFocusNavigation.test_l_then_h_returns_focus_without_mutation",
307
+ "eval.tests.test_board_navigation.TestFocusNavigation.test_move_card_on_last_column_is_noop",
308
+ "eval.tests.test_board_navigation.TestFocusNavigation.test_move_card_up_in_last_position_is_noop",
309
+ "eval.tests.test_board_navigation.TestFocusNavigation.test_pan_across_many_columns_then_quit",
310
+ "eval.tests.test_board_navigation.TestOpenNonFirstBoard.test_open_board_from_menu_by_g_and_enter",
311
+ "eval.tests.test_board_screen.TestBoardRendering.test_open_missing_board_fatal",
312
+ "eval.tests.test_board_screen.TestBoardRendering.test_q_from_cli_board_exits",
313
+ "eval.tests.test_board_screen.TestBoardRendering.test_renders_header_and_columns",
314
+ "eval.tests.test_board_screen.TestCardFocusGJ.test_g_and_G_focus_first_last_no_mutation",
315
+ "eval.tests.test_board_screen.TestCreateCard.test_c_cancel_adds_no_card",
316
+ "eval.tests.test_board_screen.TestCreateCard.test_c_creates_card_in_focused_column",
317
+ "eval.tests.test_board_screen.TestCreateCard.test_c_empty_content_does_not_add",
318
+ "eval.tests.test_board_screen.TestCreateColumn.test_uppercase_c_cancel_no_column",
319
+ "eval.tests.test_board_screen.TestCreateColumn.test_uppercase_c_creates_column",
320
+ "eval.tests.test_board_screen.TestDeleteCard.test_d_cancel_keeps_card",
321
+ "eval.tests.test_board_screen.TestDeleteCard.test_d_confirm_deletes_focused_card",
322
+ "eval.tests.test_board_screen.TestDeleteColumn.test_D_cancel_keeps_column",
323
+ "eval.tests.test_board_screen.TestDeleteColumn.test_D_confirm_deletes_column_and_cards",
324
+ "eval.tests.test_board_screen.TestEditCard.test_e_cancel_keeps_content",
325
+ "eval.tests.test_board_screen.TestEditCard.test_e_edits_focused_card_content",
326
+ "eval.tests.test_board_screen.TestEditCard.test_e_submit_with_selects_second_field_tab",
327
+ "eval.tests.test_board_screen.TestMoveCardAcrossColumns.test_H_at_first_column_is_noop",
328
+ "eval.tests.test_board_screen.TestMoveCardAcrossColumns.test_H_moves_card_to_prev_column",
329
+ "eval.tests.test_board_screen.TestMoveCardAcrossColumns.test_L_b_flag_moves_card_to_bottom",
330
+ "eval.tests.test_board_screen.TestMoveCardAcrossColumns.test_L_moves_card_to_next_column_top",
331
+ "eval.tests.test_board_screen.TestMoveCardWithinColumn.test_J_moves_focused_card_down",
332
+ "eval.tests.test_board_screen.TestMoveCardWithinColumn.test_K_moves_focused_card_up",
333
+ "eval.tests.test_board_screen.TestMoveCardWithinColumn.test_K_on_top_card_is_noop",
334
+ "eval.tests.test_board_screen.TestMoveColumn.test_ctrl_h_at_leftmost_is_noop",
335
+ "eval.tests.test_board_screen.TestMoveColumn.test_ctrl_h_moves_column_left",
336
+ "eval.tests.test_board_screen.TestMoveColumn.test_ctrl_l_moves_column_right",
337
+ "eval.tests.test_board_screen.TestMoveColumn.test_ctrl_n_alias_moves_column_right",
338
+ "eval.tests.test_board_screen.TestRenameColumn.test_e_uppercase_renames_column",
339
+ "eval.tests.test_cli_entry.TestArgErrors.test_create_missing_value_exits_nonzero",
340
+ "eval.tests.test_cli_entry.TestArgErrors.test_unknown_option_exits_nonzero",
341
+ "eval.tests.test_cli_entry.TestCreateViaCli.test_create_adds_board_line_to_data[long]",
342
+ "eval.tests.test_cli_entry.TestCreateViaCli.test_create_adds_board_line_to_data[short]",
343
+ "eval.tests.test_cli_entry.TestCreateViaCli.test_create_empty_name_errors",
344
+ "eval.tests.test_cli_entry.TestDeleteViaCli.test_delete_last_remaining_board_leaves_empty_file",
345
+ "eval.tests.test_cli_entry.TestDeleteViaCli.test_delete_removes_board_line[long]",
346
+ "eval.tests.test_cli_entry.TestDeleteViaCli.test_delete_removes_board_line[short]",
347
+ "eval.tests.test_cli_entry.TestDeleteViaCli.test_delete_unknown_board_errors",
348
+ "eval.tests.test_cli_entry.TestHelpVersion.test_help_prints_usage[long]",
349
+ "eval.tests.test_cli_entry.TestHelpVersion.test_help_prints_usage[short]",
350
+ "eval.tests.test_cli_entry.TestHelpVersion.test_version_prints_name_and_version[--version]",
351
+ "eval.tests.test_cli_entry.TestHelpVersion.test_version_prints_name_and_version[-v]",
352
+ "eval.tests.test_cli_entry.TestList.test_list_empty_shows_nothing",
353
+ "eval.tests.test_cli_entry.TestList.test_list_prints_each_board[long]",
354
+ "eval.tests.test_cli_entry.TestList.test_list_prints_each_board[short]",
355
+ "eval.tests.test_cli_entry.TestNoColor.test_no_color_aborts_with_message_and_exit_1",
356
+ "eval.tests.test_cli_entry.TestScreenSelection.test_no_default_board_renders_main_menu",
357
+ "eval.tests.test_cli_entry.TestScreenSelection.test_open_board_renders_board_header",
358
+ "eval.tests.test_cli_entry.TestScreenSelection.test_open_nonexistent_board_is_fatal",
359
+ "eval.tests.test_cli_entry.TestTextDisablesTui.test_text_with_create_is_headless_noninteractive",
360
+ "eval.tests.test_datafile_format.TestBackupFile.test_mutation_writes_backup",
361
+ "eval.tests.test_datafile_format.TestBackupFile.test_read_only_flags_do_not_touch_backup",
362
+ "eval.tests.test_datafile_format.TestDataFormat.test_full_schema_roundtrip_with_desc_and_checklist",
363
+ "eval.tests.test_datafile_format.TestDataFormat.test_indent_schema_preserved_after_write",
364
+ "eval.tests.test_datafile_format.TestMalformedDataFile.test_card_without_column_is_fatal",
365
+ "eval.tests.test_datafile_format.TestMalformedDataFile.test_column_without_board_is_fatal",
366
+ "eval.tests.test_datafile_format.TestMalformedDataFile.test_missing_data_file_is_fatal",
367
+ "eval.tests.test_mainmenu.TestCreateBoard.test_c_creates_board_persisted",
368
+ "eval.tests.test_mainmenu.TestCreateBoard.test_c_empty_name_does_not_create",
369
+ "eval.tests.test_mainmenu.TestCreateBoard.test_c_with_cancel_does_not_create",
370
+ "eval.tests.test_mainmenu.TestDeleteBoard.test_d_cancel_keeps_board",
371
+ "eval.tests.test_mainmenu.TestDeleteBoard.test_d_confirm_deletes",
372
+ "eval.tests.test_mainmenu.TestDeleteBoard.test_d_delete_enter_confirms",
373
+ "eval.tests.test_mainmenu.TestDeleteBoard.test_d_with_esc_cancel_keeps_board",
374
+ "eval.tests.test_mainmenu.TestDeleteBoard.test_delete_second_board_by_index",
375
+ "eval.tests.test_mainmenu.TestHelp.test_help_opens_and_closes_with_q",
376
+ "eval.tests.test_mainmenu.TestMenuRendering.test_empty_menu_still_exits_cleanly",
377
+ "eval.tests.test_mainmenu.TestMenuRendering.test_lists_boards_in_menu",
378
+ "eval.tests.test_mainmenu.TestMoveBoard.test_J_on_last_board_is_noop",
379
+ "eval.tests.test_mainmenu.TestMoveBoard.test_j_moves_highlighted_board_down",
380
+ "eval.tests.test_mainmenu.TestMoveBoard.test_k_at_top_does_not_wrap",
381
+ "eval.tests.test_mainmenu.TestMoveBoard.test_k_moves_highlighted_board_up",
382
+ "eval.tests.test_mainmenu.TestNavigationGJK.test_g_and_G_do_not_mutate",
383
+ "eval.tests.test_mainmenu.TestOpenBoardFromMenu.test_enter_opens_then_q_returns_to_menu",
384
+ "eval.tests.test_mainmenu.TestOpenBoardFromMenu.test_enter_then_qq_exits_zero",
385
+ "eval.tests.test_mainmenu.TestOpenBoardFromMenu.test_rename_last_board_then_open_it_from_menu",
386
+ "eval.tests.test_mainmenu.TestQuit.test_q_quits_main_menu",
387
+ "eval.tests.test_mainmenu.TestRename.test_e_aliases_rename",
388
+ "eval.tests.test_mainmenu.TestRename.test_r_renames_highlighted_board",
389
+ "eval.tests.test_mainmenu.TestRename.test_rename_cancel_keeps_name",
390
+ "eval.tests.test_screen_edge_cases.TestColumnLifecycle.test_create_column_then_add_card_roundtrip",
391
+ "eval.tests.test_screen_edge_cases.TestColumnLifecycle.test_rename_column_to_long_title_and_preserve_cards",
392
+ "eval.tests.test_screen_edge_cases.TestMoveCardToChosenRow.test_move_middle_card_to_next_column_bottom",
393
+ "eval.tests.test_screen_edge_cases.TestMoveCardToChosenRow.test_move_middle_card_to_next_column_top",
394
+ "eval.tests.test_screen_edge_cases.TestNavigationNoMutation.test_long_column_jump_first_last_focus",
395
+ "eval.tests.test_screen_edge_cases.TestNavigationNoMutation.test_menu_scrolls_and_highlights_many_boards",
396
+ "eval.tests.test_screen_edge_cases.TestOpenByO.test_open_board_with_spaces_and_unicode_content",
397
+ "eval.tests.test_screen_edge_cases.TestOpenByO.test_open_second_board_with_two_columns",
398
+ "eval.tests.test_screen_edge_cases.TestUnmappedKeyNoop.test_unmapped_key_on_board_is_noop",
399
+ "eval.tests.test_screen_edge_cases.TestUnmappedKeyNoop.test_unmapped_key_on_menu_is_noop",
400
+ "eval.tests.test_screen_extended_cases.TestBoardCreateInSecondColumn.test_create_card_in_second_column",
401
+ "eval.tests.test_screen_extended_cases.TestBoardDeleteOnlyCard.test_delete_only_card_in_column_leaves_empty_column",
402
+ "eval.tests.test_screen_extended_cases.TestBoardDeleteSecondColumn.test_delete_second_column_by_confirmation",
403
+ "eval.tests.test_screen_extended_cases.TestBoardEditLastCard.test_edit_last_card_after_g_jump",
404
+ "eval.tests.test_screen_extended_cases.TestBoardMoveCardToPrevColumnBottom.test_h_moves_card_to_prev_column_at_bottom_with_b",
405
+ "eval.tests.test_screen_extended_cases.TestBoardRenameSecondColumn.test_rename_second_column_preserves_its_card",
406
+ "eval.tests.test_screen_extended_cases.TestMenuBoardReorder.test_move_first_board_down_carries_cards",
407
+ "eval.tests.test_screen_extended_cases.TestMenuBoardReorder.test_move_middle_board_to_front_carries_cards",
408
+ "eval.tests.test_screen_extended_cases.TestMenuDeleteLastBoard.test_delete_last_remaining_board_from_menu",
409
+ "eval.tests.test_screen_extended_cases.TestMenuEmptyBoardCreate.test_create_first_board_on_empty_menu",
410
+ "eval.tests.test_screen_extended_cases.TestMenuLongNameDelete.test_delete_long_named_board_confirms_and_keeps_neighbor"
411
+ ]
412
+ },
413
+ "generated_module_04": {
414
+ "ignore_reason": "",
415
+ "ignored": false,
416
+ "ignored_tests": [],
417
+ "tests": [
418
+ "eval.tests.test_card_column_move.test_card_move_down_within_column",
419
+ "eval.tests.test_card_column_move.test_card_move_second_card_up",
420
+ "eval.tests.test_card_column_move.test_card_move_up_within_column",
421
+ "eval.tests.test_card_column_move.test_card_moved_to_next_column_lands_on_bottom_with_flag",
422
+ "eval.tests.test_card_column_move.test_card_moved_to_next_column_lands_on_top_by_default",
423
+ "eval.tests.test_card_column_move.test_card_moved_to_prev_column",
424
+ "eval.tests.test_card_column_move.test_column_reorder_left_with_ctrl_h",
425
+ "eval.tests.test_card_column_move.test_column_reorder_right_with_ctrl_l",
426
+ "eval.tests.test_card_column_move.test_edit_then_move_keeps_other_columns_intact",
427
+ "eval.tests.test_card_column_move.test_focus_last_then_move_persists_reorder_on_long_column",
428
+ "eval.tests.test_card_column_move.test_move_card_down_on_long_column_then_up",
429
+ "eval.tests.test_card_column_move.test_moving_card_right_at_rightmost_column_is_noop",
430
+ "eval.tests.test_card_info.test_add_description_via_tab_switch",
431
+ "eval.tests.test_card_info.test_add_multiline_description_persists_line_by_line",
432
+ "eval.tests.test_card_info.test_description_editing_on_a_card_that_has_one",
433
+ "eval.tests.test_card_info.test_edit_card_cancel_keeps_original",
434
+ "eval.tests.test_card_info.test_edit_card_content_updates_data",
435
+ "eval.tests.test_card_info.test_edit_second_card_uses_focus_navigation",
436
+ "eval.tests.test_card_info.test_submit_empty_content_keeps_original_card",
437
+ "eval.tests.test_checklist.test_add_checklist_item_via_inner_input",
438
+ "eval.tests.test_checklist.test_checklist_closed_without_modification_keeps_state",
439
+ "eval.tests.test_checklist.test_checklist_refuses_to_open_for_blank_new_card",
440
+ "eval.tests.test_checklist.test_delete_highlighted_item",
441
+ "eval.tests.test_checklist.test_move_item_down_swaps_neighbours",
442
+ "eval.tests.test_checklist.test_move_item_up_after_highlighting_down",
443
+ "eval.tests.test_checklist.test_toggle_first_item_marks_done_to_not_done",
444
+ "eval.tests.test_checklist.test_toggle_marks_undone_to_done_back_and_persists_all",
445
+ "eval.tests.test_checklist.test_toggle_second_item_after_moving_highlight",
446
+ "eval.tests.test_checklist_nav_edit.test_checklist_add_item_to_empty_list",
447
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_first_item_content",
448
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_on_done_item_keeps_done_flag",
449
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_preserves_sibling_items",
450
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_scrolled_item_after_j_to_boundary",
451
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_second_item_after_j",
452
+ "eval.tests.test_checklist_nav_edit.test_checklist_edit_submit_blank_keeps_original_content",
453
+ "eval.tests.test_checklist_nav_edit.test_checklist_empty_hint_renders_c_to_add",
454
+ "eval.tests.test_checklist_nav_edit.test_checklist_g_highlight_last_then_toggle_last",
455
+ "eval.tests.test_checklist_nav_edit.test_checklist_gj_repositions_onto_second_item",
456
+ "eval.tests.test_checklist_nav_edit.test_checklist_k_at_top_wraps_and_toggles_first_item",
457
+ "eval.tests.test_checklist_nav_edit.test_checklist_many_items_j_to_boundary_preserves_whole_list",
458
+ "eval.tests.test_checklist_nav_edit.test_checklist_many_items_j_to_boundary_scrolls_down",
459
+ "eval.tests.test_checklist_nav_edit.test_checklist_nav_on_empty_list_is_noop",
460
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[G]",
461
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[g]",
462
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[j]",
463
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[jj]",
464
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[k]",
465
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[kjgG]",
466
+ "eval.tests.test_checklist_nav_edit.test_checklist_navigation_leaves_items_untouched[kk]",
467
+ "eval.tests.test_confirm_dialog.test_delete_board_cancelled_keeps_board",
468
+ "eval.tests.test_confirm_dialog.test_delete_board_confirmed_removes_board",
469
+ "eval.tests.test_confirm_dialog.test_delete_card_cancelled_with_esc_keeps_card",
470
+ "eval.tests.test_confirm_dialog.test_delete_card_cancelled_with_n_keeps_card",
471
+ "eval.tests.test_confirm_dialog.test_delete_card_confirmed_removes_card",
472
+ "eval.tests.test_confirm_dialog.test_delete_column_cancelled_keeps_column",
473
+ "eval.tests.test_confirm_dialog.test_delete_column_confirmed_removes_column",
474
+ "eval.tests.test_confirm_dialog.test_delete_second_board_after_highlighting_down",
475
+ "eval.tests.test_confirm_dialog.test_delete_second_card_after_moving_focus",
476
+ "eval.tests.test_harness_cli.test_cli_create_board_appends_to_data_file",
477
+ "eval.tests.test_harness_cli.test_cli_created_board_opens_in_tui",
478
+ "eval.tests.test_harness_cli.test_cli_delete_board_removes_from_data_file",
479
+ "eval.tests.test_harness_cli.test_data_file_missing_is_a_fatal_error",
480
+ "eval.tests.test_harness_cli.test_delete_nonexistent_board_is_rejected",
481
+ "eval.tests.test_harness_cli.test_empty_board_name_is_rejected",
482
+ "eval.tests.test_harness_cli.test_executable_env_is_exported",
483
+ "eval.tests.test_harness_cli.test_help_flag_lists_matching_usage_blocks",
484
+ "eval.tests.test_harness_cli.test_list_lists_boards_in_data_file_order",
485
+ "eval.tests.test_harness_cli.test_missing_option_value_is_rejected",
486
+ "eval.tests.test_harness_cli.test_open_nonexistent_board_is_rejected",
487
+ "eval.tests.test_harness_cli.test_unknown_option_is_rejected",
488
+ "eval.tests.test_harness_cli.test_version_flag_prints_name_and_version",
489
+ "eval.tests.test_header_footer.test_board_opened_via_cli_create_renders_name_in_header",
490
+ "eval.tests.test_header_footer.test_footer_insert_marker_is_absent_before_editing",
491
+ "eval.tests.test_header_footer.test_footer_renders_normal_mode_marker",
492
+ "eval.tests.test_header_footer.test_footer_renders_on_empty_board_via_main_menu",
493
+ "eval.tests.test_header_footer.test_footer_renders_program_info_and_help_hint",
494
+ "eval.tests.test_header_footer.test_footer_shows_insert_marker_when_input_enters_insert_mode",
495
+ "eval.tests.test_header_footer.test_header_renders_board_name_on_board_screen",
496
+ "eval.tests.test_header_footer.test_header_shows_board_name_over_a_board_with_many_cards",
497
+ "eval.tests.test_help_window.test_help_does_not_mutate_board_data",
498
+ "eval.tests.test_help_window.test_help_is_reachable_from_main_menu",
499
+ "eval.tests.test_help_window.test_help_is_rendered_under_large_terminal",
500
+ "eval.tests.test_help_window.test_help_opens_and_closes_on_board_screen",
501
+ "eval.tests.test_help_window.test_help_scrolls_and_returns_cleanly",
502
+ "eval.tests.test_helpers_text.test_boards_menu_title_centred_text_is_rendered",
503
+ "eval.tests.test_helpers_text.test_card_content_with_embedded_spaces_truncated_correctly",
504
+ "eval.tests.test_helpers_text.test_empty_column_shows_centred_create_card_hint",
505
+ "eval.tests.test_helpers_text.test_empty_data_board_ignores_focus_moves",
506
+ "eval.tests.test_helpers_text.test_focus_navigation_keys_do_not_corrupt_data",
507
+ "eval.tests.test_helpers_text.test_long_card_content_survives_edit_untouched",
508
+ "eval.tests.test_helpers_text.test_long_card_content_truncates_on_screen_but_full_in_data",
509
+ "eval.tests.test_helpers_text.test_long_checklist_item_truncates_on_screen_but_full_in_data",
510
+ "eval.tests.test_helpers_text.test_no_columns_shows_centred_create_column_hint",
511
+ "eval.tests.test_helpers_text.test_single_column_board_opens_and_quits_cleanly",
512
+ "eval.tests.test_input_field.test_append_at_end_enters_insert_mode",
513
+ "eval.tests.test_input_field.test_cancel_create_column_commits_nothing",
514
+ "eval.tests.test_input_field.test_create_board_via_menu_input",
515
+ "eval.tests.test_input_field.test_create_card_cancel_with_esc_commits_nothing",
516
+ "eval.tests.test_input_field.test_create_card_cancel_with_q_commits_nothing",
517
+ "eval.tests.test_input_field.test_create_card_commits_typed_content",
518
+ "eval.tests.test_input_field.test_create_column_via_input",
519
+ "eval.tests.test_input_field.test_create_empty_card_is_not_committed",
520
+ "eval.tests.test_input_field.test_input_preserves_long_content_in_data_file",
521
+ "eval.tests.test_input_field.test_input_value_trims_surrounding_spaces",
522
+ "eval.tests.test_input_field.test_rename_board_via_menu_input",
523
+ "eval.tests.test_input_field.test_rename_column_via_input_clears_previous",
524
+ "eval.tests.test_input_multiline.test_delete_all_lines_removes_description",
525
+ "eval.tests.test_input_multiline.test_dollar_then_append_appends_at_line_end",
526
+ "eval.tests.test_input_multiline.test_esc_insert_returns_normal_without_losing_text",
527
+ "eval.tests.test_input_multiline.test_esc_normal_mode_cancels_whole_edit",
528
+ "eval.tests.test_input_multiline.test_gG_capital_a_appends_to_last_line",
529
+ "eval.tests.test_input_multiline.test_gG_last_line_then_d_deletes_last_line",
530
+ "eval.tests.test_input_multiline.test_g_first_line_then_d_deletes_first_line",
531
+ "eval.tests.test_input_multiline.test_gj_i_inserts_into_second_line",
532
+ "eval.tests.test_input_multiline.test_gj_second_line_then_d_deletes_second_line",
533
+ "eval.tests.test_input_multiline.test_gj_zero_insert_at_second_line_start",
534
+ "eval.tests.test_input_multiline.test_insert_backspace_at_line_start_jumps_to_previous_line",
535
+ "eval.tests.test_input_multiline.test_insert_backspace_deletes_character_before_cursor",
536
+ "eval.tests.test_input_multiline.test_insert_stays_on_one_line_past_width_boundary",
537
+ "eval.tests.test_input_multiline.test_jk_navigation_positions_insert_on_second_line",
538
+ "eval.tests.test_input_multiline.test_k_up_then_clear_line_with_s",
539
+ "eval.tests.test_input_multiline.test_l_at_line_end_is_clamped_and_inserts",
540
+ "eval.tests.test_input_multiline.test_l_navigation_moves_right_before_insert",
541
+ "eval.tests.test_input_multiline.test_long_overflow_one_past_boundary",
542
+ "eval.tests.test_input_multiline.test_many_lines_scroll_persists_all_lines",
543
+ "eval.tests.test_input_multiline.test_multiline_enter_at_line_start_creates_empty_line",
544
+ "eval.tests.test_input_multiline.test_multiline_enter_inserts_newlines",
545
+ "eval.tests.test_input_multiline.test_multiline_enter_splits_remainder_onto_next_line",
546
+ "eval.tests.test_input_multiline.test_multiline_typing_persists_single_line",
547
+ "eval.tests.test_input_multiline.test_normal_a_inserts_one_character_right",
548
+ "eval.tests.test_input_multiline.test_normal_capital_a_appends_at_line_end",
549
+ "eval.tests.test_input_multiline.test_normal_capital_i_inserts_at_line_start",
550
+ "eval.tests.test_input_multiline.test_normal_dollar_moves_to_line_end_before_insert",
551
+ "eval.tests.test_input_multiline.test_normal_h_left_then_insert_lands_mid_string",
552
+ "eval.tests.test_input_multiline.test_normal_s_clears_current_line_then_rewrite",
553
+ "eval.tests.test_input_multiline.test_normal_zero_moves_to_line_start_before_insert",
554
+ "eval.tests.test_input_multiline.test_overflow_content_survives_in_full",
555
+ "eval.tests.test_input_multiline.test_overflow_exactly_at_width_boundary"
556
+ ]
557
+ }
558
+ },
559
+ "commit": "02518704976d108a356d685bf351de17142dd76f",
560
+ "data_source": "synthetic_programgym",
561
+ "difficulty": "easy",
562
+ "difficulty_score": 1.6039018317316716,
563
+ "eval_clean_hashes": [
564
+ "e6d799a17f3f36b45fffdd73b4d8b66790f5b93683feacb38c2e7d97f625735f"
565
+ ],
566
+ "input_record": {
567
+ "commit": "02518704976d108a356d685bf351de17142dd76f",
568
+ "difficulty": "easy",
569
+ "difficulty_code_lines": 4017,
570
+ "difficulty_has_tests": false,
571
+ "difficulty_product_code_lines": 4017,
572
+ "difficulty_runtime_deps": 0,
573
+ "difficulty_score": 1.6039018317316716,
574
+ "difficulty_test_code_lines": 0,
575
+ "full_name": "PlankCipher/kabmat",
576
+ "input_joern_zip": "cpp_joern/PlankCipher__kabmat.zip",
577
+ "joern_status": true,
578
+ "joern_time": 9.324898783117533,
579
+ "language": "cpp",
580
+ "pb_match": [
581
+ {
582
+ "pb_fullname": "ArthurSonzogni/json-tui",
583
+ "rank": 37,
584
+ "similarity": 0.5563327074050903
585
+ },
586
+ {
587
+ "pb_fullname": "ninja-build/ninja",
588
+ "rank": 108,
589
+ "similarity": 0.4919590353965759
590
+ },
591
+ {
592
+ "pb_fullname": "tstack/lnav",
593
+ "rank": 151,
594
+ "similarity": 0.48726242780685425
595
+ },
596
+ {
597
+ "pb_fullname": "NikolaDucak/caps-log",
598
+ "rank": 15,
599
+ "similarity": 0.5313165187835693
600
+ },
601
+ {
602
+ "pb_fullname": "HaliteChallenge/Halite",
603
+ "rank": 569,
604
+ "similarity": 0.4429938793182373
605
+ }
606
+ ],
607
+ "repo_path": "cpp/PlankCipher__kabmat",
608
+ "source": "commit:02518704976d108a356d685bf351de17142dd76f",
609
+ "status": "done",
610
+ "url": "https://github.com/PlankCipher/kabmat"
611
+ },
612
+ "instance_id": "PlankCipher__kabmat.0251870",
613
+ "language": "cpp",
614
+ "module_iterations": [
615
+ {
616
+ "actual_iterations": 3,
617
+ "branch_name": "generated_module_01",
618
+ "iteration_limit": 5,
619
+ "module_index": 1,
620
+ "module_kind": "source",
621
+ "termination_reason": "module_coverage_threshold_reached"
622
+ },
623
+ {
624
+ "actual_iterations": 4,
625
+ "branch_name": "generated_module_02",
626
+ "iteration_limit": 5,
627
+ "module_index": 2,
628
+ "module_kind": "source",
629
+ "termination_reason": "module_coverage_threshold_reached"
630
+ },
631
+ {
632
+ "actual_iterations": 4,
633
+ "branch_name": "generated_module_03",
634
+ "iteration_limit": 5,
635
+ "module_index": 3,
636
+ "module_kind": "source",
637
+ "termination_reason": "module_coverage_threshold_reached"
638
+ },
639
+ {
640
+ "actual_iterations": 4,
641
+ "branch_name": "generated_module_04",
642
+ "iteration_limit": 5,
643
+ "module_index": 4,
644
+ "module_kind": "source",
645
+ "termination_reason": "module_coverage_threshold_reached"
646
+ }
647
+ ],
648
+ "repository": "PlankCipher/kabmat"
649
+ }
plankcipher--kabmat.0251870/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
plankcipher--kabmat.0251870/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24ecad89959c11d277a7f47f55e1bc3e31814cc97952fff9c5785c2ae7446d34
3
+ size 4588
plibither8--2048.cpp.ad931d9/environment/Dockerfile ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 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/*
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
+ COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz
32
+ ARG GCC_VERSION=13.3.0
33
+ 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
34
+ # programgym_quota_aware_nproc=1
35
+ 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
36
+ WORKDIR /workspace
37
+ ADD workspace.tar.gz /workspace/
38
+ COPY executable /workspace/executable
39
+ COPY download.sh /workspace/download.sh
40
+ RUN chmod 755 /workspace/download.sh
41
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
42
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
43
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
44
+ && rm -f /workspace/download.sh \
45
+ && rm -f /tmp/harbor_prepare_download_env.sh
46
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
47
+ RUN chmod 111 /workspace/executable
48
+ WORKDIR /workspace
49
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
50
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
51
+ # submission handed to the separate verifier. Keep the reference executable
52
+ # execute-only; the oracle temporarily restores owner read permission.
53
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
54
+ RUN mkdir -p /home/agent \
55
+ && chown -R agent:agent /home/agent /workspace \
56
+ && chown agent:agent /workspace/executable \
57
+ && chmod 111 /workspace/executable
58
+ ENV HOME=/home/agent
59
+ WORKDIR /workspace
plibither8--2048.cpp.ad931d9/environment/download.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # ProgramGym download stage for plibither8/2048.cpp (C++).
3
+ #
4
+ # The selected product executable (the 2048 terminal game) is a self-contained
5
+ # C++17 console program. It depends only on a C++17 compiler and a CMake build
6
+ # driver, both already present in the base image. There are no third-party
7
+ # libraries to prefetch and no apt packages required to build or run it.
8
+ #
9
+ # Consequently this script is intentionally minimal: its only responsibility is
10
+ # to export the environment variables that build.sh relies on. It performs no
11
+ # compilation, linking, testing, or other build step.
12
+ #
13
+ # This file is *sourced* (e.g. `source /source_ro/download.sh`), not executed,
14
+ # so it never calls `exit` in normal control flow and it leaves exported
15
+ # variables in the current shell.
16
+ #
17
+ # The image ships an xPack GCC 13.3 toolchain whose runtime libstdc++
18
+ # (GLIBCXX up to 3.4.32) is newer than the base system libstdc++.so.6
19
+ # (GLIBCXX up to 3.4.30). A binary linked against the xPack runtime would fail
20
+ # to load on the base system with "GLIBCXX_3.4.32 not found". We therefore pin
21
+ # the build to the Ubuntu system compiler /usr/bin/g++-11 (libstdc++ 6.0.29,
22
+ # forward-compatible with the base 6.0.30 runtime). The pin is exported here
23
+ # and consumed by build.sh.
24
+
25
+ # Export the system compiler that produces base-runtime-compatible binaries.
26
+ export PB_CXX_COMPILER="${PB_CXX_COMPILER:-/usr/bin/g++-11}"
27
+
28
+ # Build output directory used by build.sh (conventional 'build').
29
+ export PB_BUILD_DIR="${PB_BUILD_DIR:-build}"
30
+
31
+ # Build driver expected in the base image; build.sh verifies it exists before
32
+ # running any build step. No build command is executed here.
33
+ export PB_CMAKE_BIN="${PB_CMAKE_BIN:-/usr/local/bin/cmake}"
plibither8--2048.cpp.ad931d9/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edf3bf8a1e77cc813759a8fb24fca7cf8eac24f9c0978650cd45190bb60ff021
3
+ size 288616
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d33816f896d4d268ccea358368a7ae1d311563458fb85d7ba696ccd1861da2d7
3
+ size 4361
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/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/plibither8--2048.cpp.ad931d9"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for plibither8/2048.cpp"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "plibither8__2048.cpp.ad931d9"
32
+ repository = "plibither8/2048.cpp"
33
+ commit = "ad931d991e27819463dbd3d27a05411ea3cee061"
34
+ language = "cpp"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.5947239464097467
37
+ test_branches = 4
38
+ test_count = 207
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"
plibither8--2048.cpp.ad931d9/tests/Dockerfile ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 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/*
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
+ COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz
32
+ ARG GCC_VERSION=13.3.0
33
+ 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
34
+ # programgym_quota_aware_nproc=1
35
+ 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
36
+ WORKDIR /workspace
37
+ ADD workspace.tar.gz /workspace/
38
+ COPY executable /workspace/executable
39
+ COPY download.sh /workspace/download.sh
40
+ RUN chmod 755 /workspace/download.sh
41
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
42
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
43
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
44
+ && rm -f /workspace/download.sh \
45
+ && rm -f /tmp/harbor_prepare_download_env.sh
46
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
47
+ RUN chmod 111 /workspace/executable
48
+ WORKDIR /workspace
49
+ # Harbor uses tests/ as the separate verifier build context. Start with the
50
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
51
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
52
+ && mkdir -p /workspace /tests
53
+
54
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
55
+ # Installing a newer pytest alone leaves that apt package importable and creates
56
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
57
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
58
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
59
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
60
+ RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
61
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
62
+
63
+ COPY test.sh /tests/test.sh
64
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
65
+ COPY programgym_task.json /tests/programgym_task.json
66
+ COPY blobs/ /tests/blobs/
67
+ RUN chmod +x /tests/test.sh
plibither8--2048.cpp.ad931d9/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:0187f80d8feb3f65c170d75d32d775816312fb95ae4e3b47acd59b1d2c2644c2
3
+ size 6960
plibither8--2048.cpp.ad931d9/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:0bb367171bd06a88e396f6130bdb6a132c26a2bf426ec5c79aa9cbd7915330bf
3
+ size 13445
plibither8--2048.cpp.ad931d9/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:b993f03efc53e158668659e9c6dca886b887e2909a35cc045f1d47c7e3098abb
3
+ size 17744
plibither8--2048.cpp.ad931d9/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:147085a7d7dccb8f5374796cdd6e5567f74ae1cdafdaf73b0153871badeecad2
3
+ size 17947
plibither8--2048.cpp.ad931d9/tests/download.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # ProgramGym download stage for plibither8/2048.cpp (C++).
3
+ #
4
+ # The selected product executable (the 2048 terminal game) is a self-contained
5
+ # C++17 console program. It depends only on a C++17 compiler and a CMake build
6
+ # driver, both already present in the base image. There are no third-party
7
+ # libraries to prefetch and no apt packages required to build or run it.
8
+ #
9
+ # Consequently this script is intentionally minimal: its only responsibility is
10
+ # to export the environment variables that build.sh relies on. It performs no
11
+ # compilation, linking, testing, or other build step.
12
+ #
13
+ # This file is *sourced* (e.g. `source /source_ro/download.sh`), not executed,
14
+ # so it never calls `exit` in normal control flow and it leaves exported
15
+ # variables in the current shell.
16
+ #
17
+ # The image ships an xPack GCC 13.3 toolchain whose runtime libstdc++
18
+ # (GLIBCXX up to 3.4.32) is newer than the base system libstdc++.so.6
19
+ # (GLIBCXX up to 3.4.30). A binary linked against the xPack runtime would fail
20
+ # to load on the base system with "GLIBCXX_3.4.32 not found". We therefore pin
21
+ # the build to the Ubuntu system compiler /usr/bin/g++-11 (libstdc++ 6.0.29,
22
+ # forward-compatible with the base 6.0.30 runtime). The pin is exported here
23
+ # and consumed by build.sh.
24
+
25
+ # Export the system compiler that produces base-runtime-compatible binaries.
26
+ export PB_CXX_COMPILER="${PB_CXX_COMPILER:-/usr/bin/g++-11}"
27
+
28
+ # Build output directory used by build.sh (conventional 'build').
29
+ export PB_BUILD_DIR="${PB_BUILD_DIR:-build}"
30
+
31
+ # Build driver expected in the base image; build.sh verifies it exists before
32
+ # running any build step. No build command is executed here.
33
+ export PB_CMAKE_BIN="${PB_CMAKE_BIN:-/usr/local/bin/cmake}"
plibither8--2048.cpp.ad931d9/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edf3bf8a1e77cc813759a8fb24fca7cf8eac24f9c0978650cd45190bb60ff021
3
+ size 288616
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/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()
plibither8--2048.cpp.ad931d9/tests/programgym_task.json ADDED
@@ -0,0 +1,1473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [
7
+ {
8
+ "name": "eval.tests.test_new_game.test_competition_note_printed_for_board_input",
9
+ "reasons": [
10
+ {
11
+ "id": "generic_keyword_oracle",
12
+ "message": "pytest test uses a generic keyword oracle",
13
+ "path": "eval/tests/test_new_game.py",
14
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
15
+ "severity": "error",
16
+ "stage": "static_lint"
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "name": "eval.tests.test_new_game.test_empty_tile_renders_four_spaces",
22
+ "reasons": [
23
+ {
24
+ "id": "short_substring",
25
+ "message": "pytest test uses a too-short substring oracle",
26
+ "path": "eval/tests/test_new_game.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_new_game.test_fresh_board_renders_exactly_two_tiles",
35
+ "reasons": [
36
+ {
37
+ "detail": "assert -15 == 0",
38
+ "id": "gold_fail",
39
+ "message": "test failed against the reference executable",
40
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
41
+ "severity": "error",
42
+ "stage": "gold_execution"
43
+ },
44
+ {
45
+ "id": "golden_docstring",
46
+ "message": "pytest test docstring mentions golden data that is not used in the body",
47
+ "path": "eval/tests/test_new_game.py",
48
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
49
+ "severity": "error",
50
+ "stage": "static_lint"
51
+ },
52
+ {
53
+ "id": "golden_no_equality",
54
+ "message": "pytest test references golden data without equality comparison",
55
+ "path": "eval/tests/test_new_game.py",
56
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
57
+ "severity": "error",
58
+ "stage": "static_lint"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "name": "eval.tests.test_new_game.test_fresh_board_scoreboard_initial_zero",
64
+ "reasons": [
65
+ {
66
+ "id": "short_substring",
67
+ "message": "pytest test uses a too-short substring oracle",
68
+ "path": "eval/tests/test_new_game.py",
69
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
70
+ "severity": "error",
71
+ "stage": "static_lint"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "name": "eval.tests.test_new_game.test_fresh_save_any_playsize_has_two_tiles",
77
+ "reasons": [
78
+ {
79
+ "detail": "ValueError: too many values to unpack (expected 2)",
80
+ "id": "gold_fail",
81
+ "message": "test failed against the reference executable",
82
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
83
+ "severity": "error",
84
+ "stage": "gold_execution"
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[10]",
90
+ "reasons": [
91
+ {
92
+ "detail": "AssertionError: row separator count wrong assert 18 == (10 - 1) + where 18 = <built-in method count of str object at 0x561a444c8470>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500",
93
+ "id": "gold_fail",
94
+ "message": "test failed against the reference executable",
95
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
96
+ "severity": "error",
97
+ "stage": "gold_execution"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[3]",
103
+ "reasons": [
104
+ {
105
+ "detail": "AssertionError: row separator count wrong assert 4 == (3 - 1) + where 4 = <built-in method count of str object at 0x55b2bf187610>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524') + where <built-in method count of str objec",
106
+ "id": "gold_fail",
107
+ "message": "test failed against the reference executable",
108
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
109
+ "severity": "error",
110
+ "stage": "gold_execution"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[4]",
116
+ "reasons": [
117
+ {
118
+ "detail": "assert -15 == 0",
119
+ "id": "gold_fail",
120
+ "message": "test failed against the reference executable",
121
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
122
+ "severity": "error",
123
+ "stage": "gold_execution"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[5]",
129
+ "reasons": [
130
+ {
131
+ "detail": "AssertionError: row separator count wrong assert 8 == (5 - 1) + where 8 = <built-in method count of str object at 0x55d3bdb7d790>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524') + where <built-in method coun",
132
+ "id": "gold_fail",
133
+ "message": "test failed against the reference executable",
134
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
135
+ "severity": "error",
136
+ "stage": "gold_execution"
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[6]",
142
+ "reasons": [
143
+ {
144
+ "detail": "AssertionError: row separator count wrong assert 10 == (6 - 1) + where 10 = <built-in method count of str object at 0x55b98c93da30>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524') + where <built-in me",
145
+ "id": "gold_fail",
146
+ "message": "test failed against the reference executable",
147
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
148
+ "severity": "error",
149
+ "stage": "gold_execution"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[7]",
155
+ "reasons": [
156
+ {
157
+ "detail": "AssertionError: row separator count wrong assert 12 == (7 - 1) + where 12 = <built-in method count of str object at 0x55802f5f7260>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524') + where <buil",
158
+ "id": "gold_fail",
159
+ "message": "test failed against the reference executable",
160
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
161
+ "severity": "error",
162
+ "stage": "gold_execution"
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[8]",
168
+ "reasons": [
169
+ {
170
+ "detail": "AssertionError: row separator count wrong assert 14 == (8 - 1) + where 14 = <built-in method count of str object at 0x564bf106dc10>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524') + wher",
171
+ "id": "gold_fail",
172
+ "message": "test failed against the reference executable",
173
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
174
+ "severity": "error",
175
+ "stage": "gold_execution"
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "name": "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[9]",
181
+ "reasons": [
182
+ {
183
+ "detail": "AssertionError: row separator count wrong assert 16 == (9 - 1) + where 16 = <built-in method count of str object at 0x55d89e2b6010>(' \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524')",
184
+ "id": "gold_fail",
185
+ "message": "test failed against the reference executable",
186
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
187
+ "severity": "error",
188
+ "stage": "gold_execution"
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "name": "eval.tests.test_new_game.test_menu_choice_1_starts_solo_game",
194
+ "reasons": [
195
+ {
196
+ "detail": "assert -15 == 0",
197
+ "id": "gold_fail",
198
+ "message": "test failed against the reference executable",
199
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
200
+ "severity": "error",
201
+ "stage": "gold_execution"
202
+ },
203
+ {
204
+ "id": "generic_keyword_oracle",
205
+ "message": "pytest test uses a generic keyword oracle",
206
+ "path": "eval/tests/test_new_game.py",
207
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
208
+ "severity": "error",
209
+ "stage": "static_lint"
210
+ }
211
+ ]
212
+ }
213
+ ],
214
+ "tests": [
215
+ "eval.tests.test_new_game.test_board_renders_input_command_legend",
216
+ "eval.tests.test_new_game.test_competition_note_printed_for_board_input",
217
+ "eval.tests.test_new_game.test_empty_tile_renders_four_spaces",
218
+ "eval.tests.test_new_game.test_fresh_board_renders_exactly_two_tiles",
219
+ "eval.tests.test_new_game.test_fresh_board_scoreboard_initial_zero",
220
+ "eval.tests.test_new_game.test_fresh_save_any_playsize_has_two_tiles",
221
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[10]",
222
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[3]",
223
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[4]",
224
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[5]",
225
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[6]",
226
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[7]",
227
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[8]",
228
+ "eval.tests.test_new_game.test_grid_bar_lines_for_playsize[9]",
229
+ "eval.tests.test_new_game.test_menu_choice_1_starts_solo_game"
230
+ ]
231
+ },
232
+ "generated_module_02": {
233
+ "ignore_reason": "",
234
+ "ignored": false,
235
+ "ignored_tests": [
236
+ {
237
+ "name": "eval.tests.test_game_flow.test_1234_keys_are_invalid_mid_game",
238
+ "reasons": [
239
+ {
240
+ "id": "generic_keyword_oracle",
241
+ "message": "pytest test uses a generic keyword oracle",
242
+ "path": "eval/tests/test_game_flow.py",
243
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
244
+ "severity": "error",
245
+ "stage": "static_lint"
246
+ }
247
+ ]
248
+ },
249
+ {
250
+ "name": "eval.tests.test_game_flow.test_input_controls_overlay_matches_golden",
251
+ "reasons": [
252
+ {
253
+ "id": "missing_fixture_assets",
254
+ "message": "pytest test references fixture assets that are not packaged",
255
+ "path": "eval/tests/test_game_flow.py",
256
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
257
+ "severity": "error",
258
+ "stage": "static_lint"
259
+ },
260
+ {
261
+ "id": "golden_no_equality",
262
+ "message": "pytest test references golden data without equality comparison",
263
+ "path": "eval/tests/test_game_flow.py",
264
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
265
+ "severity": "error",
266
+ "stage": "static_lint"
267
+ }
268
+ ]
269
+ },
270
+ {
271
+ "name": "eval.tests.test_game_flow.test_invalid_key_draws_board_error_prompt",
272
+ "reasons": [
273
+ {
274
+ "id": "generic_keyword_oracle",
275
+ "message": "pytest test uses a generic keyword oracle",
276
+ "path": "eval/tests/test_game_flow.py",
277
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
278
+ "severity": "error",
279
+ "stage": "static_lint"
280
+ }
281
+ ]
282
+ },
283
+ {
284
+ "name": "eval.tests.test_game_flow.test_return_to_menu_hotkey_redraws_main_menu",
285
+ "reasons": [
286
+ {
287
+ "id": "short_substring",
288
+ "message": "pytest test uses a too-short substring oracle",
289
+ "path": "eval/tests/test_game_flow.py",
290
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
291
+ "severity": "error",
292
+ "stage": "static_lint"
293
+ },
294
+ {
295
+ "id": "generic_keyword_oracle",
296
+ "message": "pytest test uses a generic keyword oracle",
297
+ "path": "eval/tests/test_game_flow.py",
298
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
299
+ "severity": "error",
300
+ "stage": "static_lint"
301
+ }
302
+ ]
303
+ },
304
+ {
305
+ "name": "eval.tests.test_game_flow.test_save_then_continue_lists_saved_file",
306
+ "reasons": [
307
+ {
308
+ "id": "short_substring",
309
+ "message": "pytest test uses a too-short substring oracle",
310
+ "path": "eval/tests/test_game_flow.py",
311
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
312
+ "severity": "error",
313
+ "stage": "static_lint"
314
+ },
315
+ {
316
+ "id": "generic_keyword_oracle",
317
+ "message": "pytest test uses a generic keyword oracle",
318
+ "path": "eval/tests/test_game_flow.py",
319
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
320
+ "severity": "error",
321
+ "stage": "static_lint"
322
+ }
323
+ ]
324
+ },
325
+ {
326
+ "name": "eval.tests.test_input_handling.test_vim_direction_registers_a_move[Vim_down]",
327
+ "reasons": [
328
+ {
329
+ "detail": "AssertionError: a Vim direction key must advance MOVES by at least one assert 0 >= 1 + where 0 = max_moves('\\n /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n /\\\\\\\\\\\\//////...gest Ti",
330
+ "id": "gold_fail",
331
+ "message": "test failed against the reference executable",
332
+ "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.",
333
+ "severity": "error",
334
+ "stage": "gold_execution"
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ "name": "eval.tests.test_main_menu.test_menu_highscore_option_renders_stats",
340
+ "reasons": [
341
+ {
342
+ "id": "assertion_disjunction",
343
+ "message": "pytest assertion accepts alternatives with or",
344
+ "path": "eval/tests/test_main_menu.py",
345
+ "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
346
+ "severity": "error",
347
+ "stage": "static_lint"
348
+ },
349
+ {
350
+ "id": "short_substring",
351
+ "message": "pytest test uses a too-short substring oracle",
352
+ "path": "eval/tests/test_main_menu.py",
353
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
354
+ "severity": "error",
355
+ "stage": "static_lint"
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ "name": "eval.tests.test_main_menu.test_menu_invalid_choice_reprompts",
361
+ "reasons": [
362
+ {
363
+ "id": "generic_keyword_oracle",
364
+ "message": "pytest test uses a generic keyword oracle",
365
+ "path": "eval/tests/test_main_menu.py",
366
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
367
+ "severity": "error",
368
+ "stage": "static_lint"
369
+ }
370
+ ]
371
+ },
372
+ {
373
+ "name": "eval.tests.test_main_menu.test_menu_letter_choice_invalid",
374
+ "reasons": [
375
+ {
376
+ "id": "generic_keyword_oracle",
377
+ "message": "pytest test uses a generic keyword oracle",
378
+ "path": "eval/tests/test_main_menu.py",
379
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
380
+ "severity": "error",
381
+ "stage": "static_lint"
382
+ }
383
+ ]
384
+ },
385
+ {
386
+ "name": "eval.tests.test_main_menu.test_menu_new_game_option_enters_width_prompt",
387
+ "reasons": [
388
+ {
389
+ "id": "generic_keyword_oracle",
390
+ "message": "pytest test uses a generic keyword oracle",
391
+ "path": "eval/tests/test_main_menu.py",
392
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
393
+ "severity": "error",
394
+ "stage": "static_lint"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ "name": "eval.tests.test_main_menu.test_menu_prompt_ascii_art",
400
+ "reasons": [
401
+ {
402
+ "id": "short_substring",
403
+ "message": "pytest test uses a too-short substring oracle",
404
+ "path": "eval/tests/test_main_menu.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
+ },
411
+ {
412
+ "name": "eval.tests.test_main_menu.test_menu_welcome_screen_matches_golden",
413
+ "reasons": [
414
+ {
415
+ "id": "missing_fixture_assets",
416
+ "message": "pytest test references fixture assets that are not packaged",
417
+ "path": "eval/tests/test_main_menu.py",
418
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
419
+ "severity": "error",
420
+ "stage": "static_lint"
421
+ },
422
+ {
423
+ "id": "golden_no_equality",
424
+ "message": "pytest test references golden data without equality comparison",
425
+ "path": "eval/tests/test_main_menu.py",
426
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
427
+ "severity": "error",
428
+ "stage": "static_lint"
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ "name": "eval.tests.test_pregame.test_board_size_prompt_matches_golden",
434
+ "reasons": [
435
+ {
436
+ "id": "missing_fixture_assets",
437
+ "message": "pytest test references fixture assets that are not packaged",
438
+ "path": "eval/tests/test_pregame.py",
439
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
440
+ "severity": "error",
441
+ "stage": "static_lint"
442
+ },
443
+ {
444
+ "id": "golden_no_equality",
445
+ "message": "pytest test references golden data without equality comparison",
446
+ "path": "eval/tests/test_pregame.py",
447
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
448
+ "severity": "error",
449
+ "stage": "static_lint"
450
+ }
451
+ ]
452
+ }
453
+ ],
454
+ "tests": [
455
+ "eval.tests.test_game_flow.test_1234_keys_are_invalid_mid_game",
456
+ "eval.tests.test_game_flow.test_input_controls_overlay_matches_golden",
457
+ "eval.tests.test_game_flow.test_invalid_key_draws_board_error_prompt",
458
+ "eval.tests.test_game_flow.test_return_to_menu_hotkey_redraws_main_menu",
459
+ "eval.tests.test_game_flow.test_save_hotkey_prompts_and_creates_save_file",
460
+ "eval.tests.test_game_flow.test_save_then_continue_lists_saved_file",
461
+ "eval.tests.test_input_handling.test_ansi_arrow_does_not_leak_following_char_into_wasd",
462
+ "eval.tests.test_input_handling.test_ansi_arrow_registers_a_move[ANSI_down]",
463
+ "eval.tests.test_input_handling.test_ansi_arrow_registers_a_move[ANSI_left]",
464
+ "eval.tests.test_input_handling.test_ansi_arrow_registers_a_move[ANSI_right]",
465
+ "eval.tests.test_input_handling.test_ansi_arrow_registers_a_move[ANSI_up]",
466
+ "eval.tests.test_input_handling.test_esc_followed_by_non_bracket_is_invalid",
467
+ "eval.tests.test_input_handling.test_single_move_advances_counter_exactly_once[wasd_down_exact_one]",
468
+ "eval.tests.test_input_handling.test_single_move_advances_counter_exactly_once[wasd_up_exact_one]",
469
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[digit_1]",
470
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[letter_x]",
471
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[repeated_unbound_E]",
472
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[space]",
473
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[symbols]",
474
+ "eval.tests.test_input_handling.test_unrecognised_key_shows_invalid_prompt[unbound_key_q]",
475
+ "eval.tests.test_input_handling.test_vim_direction_registers_a_move[Vim_down]",
476
+ "eval.tests.test_input_handling.test_vim_direction_registers_a_move[Vim_left]",
477
+ "eval.tests.test_input_handling.test_vim_direction_registers_a_move[Vim_right]",
478
+ "eval.tests.test_input_handling.test_vim_direction_registers_a_move[Vim_up]",
479
+ "eval.tests.test_input_handling.test_wasd_direction_registers_a_move[WASD_down]",
480
+ "eval.tests.test_input_handling.test_wasd_direction_registers_a_move[WASD_left]",
481
+ "eval.tests.test_input_handling.test_wasd_direction_registers_a_move[WASD_right]",
482
+ "eval.tests.test_input_handling.test_wasd_direction_registers_a_move[WASD_up]",
483
+ "eval.tests.test_input_semantics.test_ansi_bracket_followed_by_non_arrow_is_invalid[pad_1]",
484
+ "eval.tests.test_input_semantics.test_ansi_bracket_followed_by_non_arrow_is_invalid[pad_q]",
485
+ "eval.tests.test_input_semantics.test_ansi_bracket_followed_by_non_arrow_is_invalid[pad_tilde]",
486
+ "eval.tests.test_input_semantics.test_ansi_bracket_followed_by_non_arrow_is_invalid[pad_x]",
487
+ "eval.tests.test_input_semantics.test_ansi_escapeseq_with_non_bracket_second_byte_invalid[pad_capQ]",
488
+ "eval.tests.test_input_semantics.test_ansi_escapeseq_with_non_bracket_second_byte_invalid[pad_z]",
489
+ "eval.tests.test_input_semantics.test_complete_ansi_arrow_is_a_valid_move_not_error",
490
+ "eval.tests.test_input_semantics.test_interleaved_invalid_keys_are_flagged_but_valid_keys_count",
491
+ "eval.tests.test_input_semantics.test_invalid_then_valid_recovers_to_a_real_move",
492
+ "eval.tests.test_input_semantics.test_long_same_direction_repeat_keeps_moving",
493
+ "eval.tests.test_input_semantics.test_mixed_direction_sequence_recognises_all_keys[mixed_wasd_vim]",
494
+ "eval.tests.test_input_semantics.test_mixed_direction_sequence_recognises_all_keys[vim_all_four]",
495
+ "eval.tests.test_input_semantics.test_mixed_direction_sequence_recognises_all_keys[wasd_all_four]",
496
+ "eval.tests.test_input_semantics.test_mixed_direction_sequence_recognises_all_keys[wasd_permuted]",
497
+ "eval.tests.test_input_semantics.test_mixed_direction_sequence_recognises_all_keys[wasd_reverse]",
498
+ "eval.tests.test_input_semantics.test_multi_move_then_return_to_menu_and_exit",
499
+ "eval.tests.test_input_semantics.test_save_after_one_move_records_move_count",
500
+ "eval.tests.test_input_semantics.test_save_hotkey_writes_statistics_line[save_hotkey_P]",
501
+ "eval.tests.test_input_semantics.test_save_hotkey_writes_statistics_line[save_hotkey_Z]",
502
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_Vim_down]",
503
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_Vim_left]",
504
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_Vim_right]",
505
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_Vim_up]",
506
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_WASD_down]",
507
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_WASD_left]",
508
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_WASD_right]",
509
+ "eval.tests.test_input_semantics.test_uppercase_bindings_register_a_move[cap_WASD_up]",
510
+ "eval.tests.test_input_semantics.test_zero_moves_before_any_direction_key",
511
+ "eval.tests.test_main_menu.test_continue_option_without_saves",
512
+ "eval.tests.test_main_menu.test_exit_option_exit_code_across_runs",
513
+ "eval.tests.test_main_menu.test_menu_exit_option[exit_option_zero]",
514
+ "eval.tests.test_main_menu.test_menu_highscore_option_renders_stats",
515
+ "eval.tests.test_main_menu.test_menu_invalid_choice_reprompts",
516
+ "eval.tests.test_main_menu.test_menu_letter_choice_invalid",
517
+ "eval.tests.test_main_menu.test_menu_new_game_option_enters_width_prompt",
518
+ "eval.tests.test_main_menu.test_menu_options_listed",
519
+ "eval.tests.test_main_menu.test_menu_prompt_ascii_art",
520
+ "eval.tests.test_main_menu.test_menu_welcome_screen_matches_golden",
521
+ "eval.tests.test_pregame.test_board_size_error_then_valid_launches",
522
+ "eval.tests.test_pregame.test_board_size_prompt_matches_golden",
523
+ "eval.tests.test_pregame.test_board_size_prompt_shown_after_new_game",
524
+ "eval.tests.test_pregame.test_board_size_zero_returns_to_menu",
525
+ "eval.tests.test_pregame.test_continue_missing_save_reports_none",
526
+ "eval.tests.test_pregame.test_invalid_board_sizes_error[negative]",
527
+ "eval.tests.test_pregame.test_invalid_board_sizes_error[non_numeric]",
528
+ "eval.tests.test_pregame.test_invalid_board_sizes_error[too_big_11]",
529
+ "eval.tests.test_pregame.test_invalid_board_sizes_error[too_small_2]",
530
+ "eval.tests.test_pregame.test_valid_10x10_board_launches_game",
531
+ "eval.tests.test_pregame.test_valid_3x3_board_launches_game"
532
+ ]
533
+ },
534
+ "generated_module_03": {
535
+ "ignore_reason": "",
536
+ "ignored": false,
537
+ "ignored_tests": [
538
+ {
539
+ "name": "eval.tests.test_continue_game_listing_menu.test_continue_filename_with_embedded_space_loads",
540
+ "reasons": [
541
+ {
542
+ "id": "short_substring",
543
+ "message": "pytest test uses a too-short substring oracle",
544
+ "path": "eval/tests/test_continue_game_listing_menu.py",
545
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
546
+ "severity": "error",
547
+ "stage": "static_lint"
548
+ }
549
+ ]
550
+ },
551
+ {
552
+ "name": "eval.tests.test_continue_game_listing_menu.test_continue_non_txt_extension_loads",
553
+ "reasons": [
554
+ {
555
+ "id": "short_substring",
556
+ "message": "pytest test uses a too-short substring oracle",
557
+ "path": "eval/tests/test_continue_game_listing_menu.py",
558
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
559
+ "severity": "error",
560
+ "stage": "static_lint"
561
+ }
562
+ ]
563
+ },
564
+ {
565
+ "name": "eval.tests.test_continue_oldgame.test_continue_empty_directory_reports_no_saves",
566
+ "reasons": [
567
+ {
568
+ "id": "generic_keyword_oracle",
569
+ "message": "pytest test uses a generic keyword oracle",
570
+ "path": "eval/tests/test_continue_oldgame.py",
571
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
572
+ "severity": "error",
573
+ "stage": "static_lint"
574
+ }
575
+ ]
576
+ },
577
+ {
578
+ "name": "eval.tests.test_continue_oldgame.test_continue_high_index_rejected",
579
+ "reasons": [
580
+ {
581
+ "id": "generic_keyword_oracle",
582
+ "message": "pytest test uses a generic keyword oracle",
583
+ "path": "eval/tests/test_continue_oldgame.py",
584
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
585
+ "severity": "error",
586
+ "stage": "static_lint"
587
+ }
588
+ ]
589
+ },
590
+ {
591
+ "name": "eval.tests.test_continue_oldgame.test_continue_negative_index_rejected",
592
+ "reasons": [
593
+ {
594
+ "id": "generic_keyword_oracle",
595
+ "message": "pytest test uses a generic keyword oracle",
596
+ "path": "eval/tests/test_continue_oldgame.py",
597
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
598
+ "severity": "error",
599
+ "stage": "static_lint"
600
+ }
601
+ ]
602
+ },
603
+ {
604
+ "name": "eval.tests.test_continue_oldgame.test_continue_returns_to_main_menu_after_reject",
605
+ "reasons": [
606
+ {
607
+ "id": "generic_keyword_oracle",
608
+ "message": "pytest test uses a generic keyword oracle",
609
+ "path": "eval/tests/test_continue_oldgame.py",
610
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
611
+ "severity": "error",
612
+ "stage": "static_lint"
613
+ }
614
+ ]
615
+ },
616
+ {
617
+ "name": "eval.tests.test_continue_oldgame.test_continue_zero_index_rejected",
618
+ "reasons": [
619
+ {
620
+ "id": "generic_keyword_oracle",
621
+ "message": "pytest test uses a generic keyword oracle",
622
+ "path": "eval/tests/test_continue_oldgame.py",
623
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
624
+ "severity": "error",
625
+ "stage": "static_lint"
626
+ }
627
+ ]
628
+ },
629
+ {
630
+ "name": "eval.tests.test_golden_frames.test_main_menu_options_frame_matches_golden",
631
+ "reasons": [
632
+ {
633
+ "id": "missing_fixture_assets",
634
+ "message": "pytest test references fixture assets that are not packaged",
635
+ "path": "eval/tests/test_golden_frames.py",
636
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
637
+ "severity": "error",
638
+ "stage": "static_lint"
639
+ }
640
+ ]
641
+ },
642
+ {
643
+ "name": "eval.tests.test_golden_frames.test_pregame_board_prompt_frame_matches_golden",
644
+ "reasons": [
645
+ {
646
+ "id": "missing_fixture_assets",
647
+ "message": "pytest test references fixture assets that are not packaged",
648
+ "path": "eval/tests/test_golden_frames.py",
649
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
650
+ "severity": "error",
651
+ "stage": "static_lint"
652
+ }
653
+ ]
654
+ },
655
+ {
656
+ "name": "eval.tests.test_golden_frames.test_pregame_error_banner_frame_matches_golden",
657
+ "reasons": [
658
+ {
659
+ "id": "missing_fixture_assets",
660
+ "message": "pytest test references fixture assets that are not packaged",
661
+ "path": "eval/tests/test_golden_frames.py",
662
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
663
+ "severity": "error",
664
+ "stage": "static_lint"
665
+ }
666
+ ]
667
+ },
668
+ {
669
+ "name": "eval.tests.test_golden_frames.test_scoreboard_multi_row_frame_matches_golden",
670
+ "reasons": [
671
+ {
672
+ "id": "missing_fixture_assets",
673
+ "message": "pytest test references fixture assets that are not packaged",
674
+ "path": "eval/tests/test_golden_frames.py",
675
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
676
+ "severity": "error",
677
+ "stage": "static_lint"
678
+ }
679
+ ]
680
+ },
681
+ {
682
+ "name": "eval.tests.test_golden_frames.test_scoreboard_single_row_frame_matches_golden",
683
+ "reasons": [
684
+ {
685
+ "id": "missing_fixture_assets",
686
+ "message": "pytest test references fixture assets that are not packaged",
687
+ "path": "eval/tests/test_golden_frames.py",
688
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
689
+ "severity": "error",
690
+ "stage": "static_lint"
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "name": "eval.tests.test_highscores_display.test_scores_missing_files_shows_both_fallbacks",
696
+ "reasons": [
697
+ {
698
+ "id": "short_substring",
699
+ "message": "pytest test uses a too-short substring oracle",
700
+ "path": "eval/tests/test_highscores_display.py",
701
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
702
+ "severity": "error",
703
+ "stage": "static_lint"
704
+ }
705
+ ]
706
+ },
707
+ {
708
+ "name": "eval.tests.test_highscores_display.test_scores_returns_to_main_menu_after_keypress",
709
+ "reasons": [
710
+ {
711
+ "id": "generic_keyword_oracle",
712
+ "message": "pytest test uses a generic keyword oracle",
713
+ "path": "eval/tests/test_highscores_display.py",
714
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
715
+ "severity": "error",
716
+ "stage": "static_lint"
717
+ }
718
+ ]
719
+ },
720
+ {
721
+ "name": "eval.tests.test_main_menu.test_main_menu_error_banner_is_colour_red",
722
+ "reasons": [
723
+ {
724
+ "id": "short_substring",
725
+ "message": "pytest test uses a too-short substring oracle",
726
+ "path": "eval/tests/test_main_menu.py",
727
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
728
+ "severity": "error",
729
+ "stage": "static_lint"
730
+ },
731
+ {
732
+ "id": "generic_keyword_oracle",
733
+ "message": "pytest test uses a generic keyword oracle",
734
+ "path": "eval/tests/test_main_menu.py",
735
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
736
+ "severity": "error",
737
+ "stage": "static_lint"
738
+ }
739
+ ]
740
+ },
741
+ {
742
+ "name": "eval.tests.test_main_menu.test_main_menu_exit_accepts_trailing_whitespace",
743
+ "reasons": [
744
+ {
745
+ "id": "generic_keyword_oracle",
746
+ "message": "pytest test uses a generic keyword oracle",
747
+ "path": "eval/tests/test_main_menu.py",
748
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
749
+ "severity": "error",
750
+ "stage": "static_lint"
751
+ }
752
+ ]
753
+ },
754
+ {
755
+ "name": "eval.tests.test_main_menu.test_main_menu_option_three_reaches_scoreboard_and_return",
756
+ "reasons": [
757
+ {
758
+ "id": "generic_keyword_oracle",
759
+ "message": "pytest test uses a generic keyword oracle",
760
+ "path": "eval/tests/test_main_menu.py",
761
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
762
+ "severity": "error",
763
+ "stage": "static_lint"
764
+ }
765
+ ]
766
+ },
767
+ {
768
+ "name": "eval.tests.test_main_menu.test_main_menu_option_two_empty_saves_returns_to_menu",
769
+ "reasons": [
770
+ {
771
+ "id": "generic_keyword_oracle",
772
+ "message": "pytest test uses a generic keyword oracle",
773
+ "path": "eval/tests/test_main_menu.py",
774
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
775
+ "severity": "error",
776
+ "stage": "static_lint"
777
+ }
778
+ ]
779
+ },
780
+ {
781
+ "name": "eval.tests.test_main_menu.test_main_menu_two_invalid_choices_produce_two_banners",
782
+ "reasons": [
783
+ {
784
+ "id": "generic_keyword_oracle",
785
+ "message": "pytest test uses a generic keyword oracle",
786
+ "path": "eval/tests/test_main_menu.py",
787
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
788
+ "severity": "error",
789
+ "stage": "static_lint"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "name": "eval.tests.test_main_menu.test_main_menu_valid_choice_does_not_error",
795
+ "reasons": [
796
+ {
797
+ "id": "generic_keyword_oracle",
798
+ "message": "pytest test uses a generic keyword oracle",
799
+ "path": "eval/tests/test_main_menu.py",
800
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
801
+ "severity": "error",
802
+ "stage": "static_lint"
803
+ }
804
+ ]
805
+ },
806
+ {
807
+ "name": "eval.tests.test_pregame_menu.test_pregame_back_to_menu_then_exit_flow",
808
+ "reasons": [
809
+ {
810
+ "id": "generic_keyword_oracle",
811
+ "message": "pytest test uses a generic keyword oracle",
812
+ "path": "eval/tests/test_pregame_menu.py",
813
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
814
+ "severity": "error",
815
+ "stage": "static_lint"
816
+ }
817
+ ]
818
+ },
819
+ {
820
+ "name": "eval.tests.test_pregame_menu.test_pregame_large_then_valid_still_works",
821
+ "reasons": [
822
+ {
823
+ "id": "generic_keyword_oracle",
824
+ "message": "pytest test uses a generic keyword oracle",
825
+ "path": "eval/tests/test_pregame_menu.py",
826
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
827
+ "severity": "error",
828
+ "stage": "static_lint"
829
+ }
830
+ ]
831
+ },
832
+ {
833
+ "name": "eval.tests.test_pregame_menu.test_pregame_negative_than_valid_sequence",
834
+ "reasons": [
835
+ {
836
+ "id": "generic_keyword_oracle",
837
+ "message": "pytest test uses a generic keyword oracle",
838
+ "path": "eval/tests/test_pregame_menu.py",
839
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
840
+ "severity": "error",
841
+ "stage": "static_lint"
842
+ }
843
+ ]
844
+ },
845
+ {
846
+ "name": "eval.tests.test_pregame_menu.test_pregame_size_four_is_competition_mode_shows_best_score",
847
+ "reasons": [
848
+ {
849
+ "id": "generic_keyword_oracle",
850
+ "message": "pytest test uses a generic keyword oracle",
851
+ "path": "eval/tests/test_pregame_menu.py",
852
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
853
+ "severity": "error",
854
+ "stage": "static_lint"
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ "name": "eval.tests.test_pregame_menu.test_pregame_zero_returns_to_main_menu",
860
+ "reasons": [
861
+ {
862
+ "id": "generic_keyword_oracle",
863
+ "message": "pytest test uses a generic keyword oracle",
864
+ "path": "eval/tests/test_pregame_menu.py",
865
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
866
+ "severity": "error",
867
+ "stage": "static_lint"
868
+ }
869
+ ]
870
+ },
871
+ {
872
+ "name": "eval.tests.test_pregame_setup_navigation.test_continue_invalid_then_valid_still_loads",
873
+ "reasons": [
874
+ {
875
+ "id": "generic_keyword_oracle",
876
+ "message": "pytest test uses a generic keyword oracle",
877
+ "path": "eval/tests/test_pregame_setup_navigation.py",
878
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
879
+ "severity": "error",
880
+ "stage": "static_lint"
881
+ }
882
+ ]
883
+ },
884
+ {
885
+ "name": "eval.tests.test_pregame_setup_navigation.test_pregame_after_highscores_screen_flow",
886
+ "reasons": [
887
+ {
888
+ "id": "generic_keyword_oracle",
889
+ "message": "pytest test uses a generic keyword oracle",
890
+ "path": "eval/tests/test_pregame_setup_navigation.py",
891
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
892
+ "severity": "error",
893
+ "stage": "static_lint"
894
+ }
895
+ ]
896
+ },
897
+ {
898
+ "name": "eval.tests.test_pregame_setup_navigation.test_pregame_back_then_continue_with_saves",
899
+ "reasons": [
900
+ {
901
+ "id": "generic_keyword_oracle",
902
+ "message": "pytest test uses a generic keyword oracle",
903
+ "path": "eval/tests/test_pregame_setup_navigation.py",
904
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
905
+ "severity": "error",
906
+ "stage": "static_lint"
907
+ }
908
+ ]
909
+ },
910
+ {
911
+ "name": "eval.tests.test_pregame_setup_navigation.test_pregame_overflowing_numeric_size_rejected",
912
+ "reasons": [
913
+ {
914
+ "id": "generic_keyword_oracle",
915
+ "message": "pytest test uses a generic keyword oracle",
916
+ "path": "eval/tests/test_pregame_setup_navigation.py",
917
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
918
+ "severity": "error",
919
+ "stage": "static_lint"
920
+ }
921
+ ]
922
+ },
923
+ {
924
+ "name": "eval.tests.test_pregame_setup_navigation.test_pregame_three_bad_sizes_draw_three_banners",
925
+ "reasons": [
926
+ {
927
+ "id": "generic_keyword_oracle",
928
+ "message": "pytest test uses a generic keyword oracle",
929
+ "path": "eval/tests/test_pregame_setup_navigation.py",
930
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
931
+ "severity": "error",
932
+ "stage": "static_lint"
933
+ }
934
+ ]
935
+ }
936
+ ],
937
+ "tests": [
938
+ "eval.tests.test_continue_game_listing_menu.test_continue_filename_with_embedded_space_loads",
939
+ "eval.tests.test_continue_game_listing_menu.test_continue_leading_zero_index_selects_row_five",
940
+ "eval.tests.test_continue_game_listing_menu.test_continue_non_txt_extension_loads",
941
+ "eval.tests.test_continue_game_listing_menu.test_continue_ten_saves_indexed_one_to_ten",
942
+ "eval.tests.test_continue_game_listing_menu.test_continue_two_digit_index_selects_row_ten",
943
+ "eval.tests.test_continue_oldgame.test_continue_empty_directory_reports_no_saves",
944
+ "eval.tests.test_continue_oldgame.test_continue_five_saves_indexed_one_to_five",
945
+ "eval.tests.test_continue_oldgame.test_continue_high_index_rejected",
946
+ "eval.tests.test_continue_oldgame.test_continue_index_two_selects_listed_row",
947
+ "eval.tests.test_continue_oldgame.test_continue_lists_every_regular_save",
948
+ "eval.tests.test_continue_oldgame.test_continue_loads_five_by_five_save",
949
+ "eval.tests.test_continue_oldgame.test_continue_loads_three_by_three_save",
950
+ "eval.tests.test_continue_oldgame.test_continue_missing_directory_reports_not_exists",
951
+ "eval.tests.test_continue_oldgame.test_continue_negative_index_rejected",
952
+ "eval.tests.test_continue_oldgame.test_continue_regular_files_only_skips_subdirs",
953
+ "eval.tests.test_continue_oldgame.test_continue_rejected_then_second_continue_loads",
954
+ "eval.tests.test_continue_oldgame.test_continue_returns_to_main_menu_after_reject",
955
+ "eval.tests.test_continue_oldgame.test_continue_selection_loads_stored_score_and_grid",
956
+ "eval.tests.test_continue_oldgame.test_continue_single_save_lists_and_loads",
957
+ "eval.tests.test_continue_oldgame.test_continue_zero_index_rejected",
958
+ "eval.tests.test_golden_frames.test_main_menu_options_frame_matches_golden",
959
+ "eval.tests.test_golden_frames.test_pregame_board_prompt_frame_matches_golden",
960
+ "eval.tests.test_golden_frames.test_pregame_error_banner_frame_matches_golden",
961
+ "eval.tests.test_golden_frames.test_scoreboard_multi_row_frame_matches_golden",
962
+ "eval.tests.test_golden_frames.test_scoreboard_single_row_frame_matches_golden",
963
+ "eval.tests.test_highscores_display.test_scores_best_score_takes_saved_max",
964
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[0-0s]",
965
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[120-2m 0s]",
966
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[3599-59m 59s]",
967
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[3600-1h 0s]",
968
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[3601-1h 0m 1s]",
969
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[3661-1h 1m 1s]",
970
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[59-59s]",
971
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[60-1m 0s]",
972
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[61-1m 1s]",
973
+ "eval.tests.test_highscores_display.test_scores_duration_formatting[7265-2h 1m 5s]",
974
+ "eval.tests.test_highscores_display.test_scores_many_rows_indexed_one_to_n",
975
+ "eval.tests.test_highscores_display.test_scores_missing_files_shows_both_fallbacks",
976
+ "eval.tests.test_highscores_display.test_scores_renders_index_number",
977
+ "eval.tests.test_highscores_display.test_scores_renders_moves_and_largest_tile",
978
+ "eval.tests.test_highscores_display.test_scores_returns_to_main_menu_after_keypress",
979
+ "eval.tests.test_highscores_display.test_scores_single_row_exact_fields",
980
+ "eval.tests.test_highscores_display.test_scores_sorted_descending_by_score",
981
+ "eval.tests.test_highscores_display.test_scores_statistics_renders_panel_values",
982
+ "eval.tests.test_highscores_display.test_scores_stats_missing_shows_statistics_fallback_only",
983
+ "eval.tests.test_highscores_display.test_scores_win_and_loss_labels",
984
+ "eval.tests.test_highscores_display.test_scores_zero_best_score_renders",
985
+ "eval.tests.test_main_menu.test_main_menu_bytes_zero_one_two_are_invalid",
986
+ "eval.tests.test_main_menu.test_main_menu_error_banner_is_colour_red",
987
+ "eval.tests.test_main_menu.test_main_menu_exit_accepts_trailing_whitespace",
988
+ "eval.tests.test_main_menu.test_main_menu_exit_option_terminates_cleanly",
989
+ "eval.tests.test_main_menu.test_main_menu_exit_with_leading_newlines",
990
+ "eval.tests.test_main_menu.test_main_menu_invalid_choice_redraws_with_error",
991
+ "eval.tests.test_main_menu.test_main_menu_many_invalid_choices_each_banner_once",
992
+ "eval.tests.test_main_menu.test_main_menu_option_three_reaches_scoreboard_and_return",
993
+ "eval.tests.test_main_menu.test_main_menu_option_two_empty_saves_returns_to_menu",
994
+ "eval.tests.test_main_menu.test_main_menu_two_invalid_choices_produce_two_banners",
995
+ "eval.tests.test_main_menu.test_main_menu_valid_choice_does_not_error",
996
+ "eval.tests.test_pregame_competition_modes.test_competition_four_best_score_seeded_values[1]",
997
+ "eval.tests.test_pregame_competition_modes.test_competition_four_best_score_seeded_values[999999]",
998
+ "eval.tests.test_pregame_competition_modes.test_competition_four_best_score_seeded_values[999]",
999
+ "eval.tests.test_pregame_competition_modes.test_competition_four_best_score_zero_without_stats",
1000
+ "eval.tests.test_pregame_competition_modes.test_competition_four_reads_seeded_best_score",
1001
+ "eval.tests.test_pregame_competition_modes.test_competition_small_seed_still_renders_best_score",
1002
+ "eval.tests.test_pregame_competition_modes.test_non_competition_sizes_omit_best_score_even_with_stats[10]",
1003
+ "eval.tests.test_pregame_competition_modes.test_non_competition_sizes_omit_best_score_even_with_stats[3]",
1004
+ "eval.tests.test_pregame_competition_modes.test_non_competition_sizes_omit_best_score_even_with_stats[5]",
1005
+ "eval.tests.test_pregame_competition_modes.test_non_competition_sizes_omit_best_score_even_with_stats[6]",
1006
+ "eval.tests.test_pregame_competition_modes.test_non_competition_sizes_omit_best_score_even_with_stats[8]",
1007
+ "eval.tests.test_pregame_menu.test_pregame_back_to_menu_then_exit_flow",
1008
+ "eval.tests.test_pregame_menu.test_pregame_large_then_valid_still_works",
1009
+ "eval.tests.test_pregame_menu.test_pregame_negative_than_valid_sequence",
1010
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[1.5]",
1011
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[@]",
1012
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[abc]",
1013
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[four]",
1014
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[q]",
1015
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[size]",
1016
+ "eval.tests.test_pregame_menu.test_pregame_non_numeric_size_shows_error[xx]",
1017
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[-5]",
1018
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[11]",
1019
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[12]",
1020
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[1]",
1021
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[2]",
1022
+ "eval.tests.test_pregame_menu.test_pregame_out_of_range_size_shows_error[999]",
1023
+ "eval.tests.test_pregame_menu.test_pregame_reentrant_invalid_then_valid",
1024
+ "eval.tests.test_pregame_menu.test_pregame_size_five_omits_best_score",
1025
+ "eval.tests.test_pregame_menu.test_pregame_size_four_is_competition_mode_shows_best_score",
1026
+ "eval.tests.test_pregame_menu.test_pregame_size_three_is_not_competition",
1027
+ "eval.tests.test_pregame_menu.test_pregame_two_rejects_then_valid",
1028
+ "eval.tests.test_pregame_menu.test_pregame_valid_six_launches_five_junction_grid",
1029
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_maximum_ten_has_nine_junctions",
1030
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_minimum_three_has_two_junctions",
1031
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[10]",
1032
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[3]",
1033
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[4]",
1034
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[5]",
1035
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[6]",
1036
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[7]",
1037
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[8]",
1038
+ "eval.tests.test_pregame_menu.test_pregame_valid_size_starts_that_sized_board[9]",
1039
+ "eval.tests.test_pregame_menu.test_pregame_zero_returns_to_main_menu",
1040
+ "eval.tests.test_pregame_setup_navigation.test_continue_all_five_saves_listed_once_and_index3",
1041
+ "eval.tests.test_pregame_setup_navigation.test_continue_invalid_then_valid_still_loads",
1042
+ "eval.tests.test_pregame_setup_navigation.test_continue_selects_parsed_index_two",
1043
+ "eval.tests.test_pregame_setup_navigation.test_pregame_after_highscores_screen_flow",
1044
+ "eval.tests.test_pregame_setup_navigation.test_pregame_back_then_continue_with_saves",
1045
+ "eval.tests.test_pregame_setup_navigation.test_pregame_blank_line_before_size_is_skipped",
1046
+ "eval.tests.test_pregame_setup_navigation.test_pregame_leading_plus_sign_size_accepted",
1047
+ "eval.tests.test_pregame_setup_navigation.test_pregame_leading_whitespace_before_size_accepted",
1048
+ "eval.tests.test_pregame_setup_navigation.test_pregame_max_size_ten_immediate_launch",
1049
+ "eval.tests.test_pregame_setup_navigation.test_pregame_overflowing_numeric_size_rejected",
1050
+ "eval.tests.test_pregame_setup_navigation.test_pregame_prompt_reachable_again_after_back",
1051
+ "eval.tests.test_pregame_setup_navigation.test_pregame_size_token_with_leading_zero",
1052
+ "eval.tests.test_pregame_setup_navigation.test_pregame_size_token_with_tab_whitespace",
1053
+ "eval.tests.test_pregame_setup_navigation.test_pregame_size_token_with_trailing_garbage",
1054
+ "eval.tests.test_pregame_setup_navigation.test_pregame_three_bad_sizes_draw_three_banners"
1055
+ ]
1056
+ },
1057
+ "generated_module_04": {
1058
+ "ignore_reason": "",
1059
+ "ignored": false,
1060
+ "ignored_tests": [
1061
+ {
1062
+ "name": "eval.tests.test_continue_game_selection.test_continue_game_choice_above_range_is_invalid",
1063
+ "reasons": [
1064
+ {
1065
+ "id": "generic_keyword_oracle",
1066
+ "message": "pytest test uses a generic keyword oracle",
1067
+ "path": "eval/tests/test_continue_game_selection.py",
1068
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1069
+ "severity": "error",
1070
+ "stage": "static_lint"
1071
+ }
1072
+ ]
1073
+ },
1074
+ {
1075
+ "name": "eval.tests.test_continue_game_selection.test_continue_game_choice_zero_is_invalid",
1076
+ "reasons": [
1077
+ {
1078
+ "id": "generic_keyword_oracle",
1079
+ "message": "pytest test uses a generic keyword oracle",
1080
+ "path": "eval/tests/test_continue_game_selection.py",
1081
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1082
+ "severity": "error",
1083
+ "stage": "static_lint"
1084
+ }
1085
+ ]
1086
+ },
1087
+ {
1088
+ "name": "eval.tests.test_continue_game_selection.test_continue_game_lists_saved_files",
1089
+ "reasons": [
1090
+ {
1091
+ "id": "short_substring",
1092
+ "message": "pytest test uses a too-short substring oracle",
1093
+ "path": "eval/tests/test_continue_game_selection.py",
1094
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1095
+ "severity": "error",
1096
+ "stage": "static_lint"
1097
+ },
1098
+ {
1099
+ "id": "generic_keyword_oracle",
1100
+ "message": "pytest test uses a generic keyword oracle",
1101
+ "path": "eval/tests/test_continue_game_selection.py",
1102
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1103
+ "severity": "error",
1104
+ "stage": "static_lint"
1105
+ }
1106
+ ]
1107
+ },
1108
+ {
1109
+ "name": "eval.tests.test_in_game_save_resource.test_save_big_score_roundtrip",
1110
+ "reasons": [
1111
+ {
1112
+ "id": "no_assertions",
1113
+ "message": "pytest test contains no assert statements",
1114
+ "path": "eval/tests/test_in_game_save_resource.py",
1115
+ "repair_hint": "Add concrete assert statements over observable executable behavior.",
1116
+ "severity": "error",
1117
+ "stage": "static_lint"
1118
+ }
1119
+ ]
1120
+ },
1121
+ {
1122
+ "name": "eval.tests.test_in_game_save_resource.test_save_file_lives_under_saved_game_files_dir",
1123
+ "reasons": [
1124
+ {
1125
+ "id": "short_substring",
1126
+ "message": "pytest test uses a too-short substring oracle",
1127
+ "path": "eval/tests/test_in_game_save_resource.py",
1128
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1129
+ "severity": "error",
1130
+ "stage": "static_lint"
1131
+ }
1132
+ ]
1133
+ },
1134
+ {
1135
+ "name": "eval.tests.test_in_game_save_resource.test_save_hotkey_p_creates_file",
1136
+ "reasons": [
1137
+ {
1138
+ "id": "short_substring",
1139
+ "message": "pytest test uses a too-short substring oracle",
1140
+ "path": "eval/tests/test_in_game_save_resource.py",
1141
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1142
+ "severity": "error",
1143
+ "stage": "static_lint"
1144
+ }
1145
+ ]
1146
+ },
1147
+ {
1148
+ "name": "eval.tests.test_in_game_save_resource.test_save_hotkey_z_creates_file_and_banner",
1149
+ "reasons": [
1150
+ {
1151
+ "id": "short_substring",
1152
+ "message": "pytest test uses a too-short substring oracle",
1153
+ "path": "eval/tests/test_in_game_save_resource.py",
1154
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1155
+ "severity": "error",
1156
+ "stage": "static_lint"
1157
+ }
1158
+ ]
1159
+ },
1160
+ {
1161
+ "name": "eval.tests.test_in_game_save_resource.test_save_overwrite_replaces_different_previous_score",
1162
+ "reasons": [
1163
+ {
1164
+ "id": "no_assertions",
1165
+ "message": "pytest test contains no assert statements",
1166
+ "path": "eval/tests/test_in_game_save_resource.py",
1167
+ "repair_hint": "Add concrete assert statements over observable executable behavior.",
1168
+ "severity": "error",
1169
+ "stage": "static_lint"
1170
+ }
1171
+ ]
1172
+ },
1173
+ {
1174
+ "name": "eval.tests.test_in_game_save_resource.test_save_reproduces_score_roundtrip",
1175
+ "reasons": [
1176
+ {
1177
+ "id": "no_assertions",
1178
+ "message": "pytest test contains no assert statements",
1179
+ "path": "eval/tests/test_in_game_save_resource.py",
1180
+ "repair_hint": "Add concrete assert statements over observable executable behavior.",
1181
+ "severity": "error",
1182
+ "stage": "static_lint"
1183
+ }
1184
+ ]
1185
+ },
1186
+ {
1187
+ "name": "eval.tests.test_in_game_save_resource.test_save_whitespace_filename_truncated_at_space",
1188
+ "reasons": [
1189
+ {
1190
+ "id": "short_substring",
1191
+ "message": "pytest test uses a too-short substring oracle",
1192
+ "path": "eval/tests/test_in_game_save_resource.py",
1193
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1194
+ "severity": "error",
1195
+ "stage": "static_lint"
1196
+ }
1197
+ ]
1198
+ },
1199
+ {
1200
+ "name": "eval.tests.test_in_game_save_resource.test_save_zero_score_roundtrip",
1201
+ "reasons": [
1202
+ {
1203
+ "id": "no_assertions",
1204
+ "message": "pytest test contains no assert statements",
1205
+ "path": "eval/tests/test_in_game_save_resource.py",
1206
+ "repair_hint": "Add concrete assert statements over observable executable behavior.",
1207
+ "severity": "error",
1208
+ "stage": "static_lint"
1209
+ }
1210
+ ]
1211
+ },
1212
+ {
1213
+ "name": "eval.tests.test_save_stats.test_competition_best_score_row_shows_loaded_best",
1214
+ "reasons": [
1215
+ {
1216
+ "id": "short_substring",
1217
+ "message": "pytest test uses a too-short substring oracle",
1218
+ "path": "eval/tests/test_save_stats.py",
1219
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1220
+ "severity": "error",
1221
+ "stage": "static_lint"
1222
+ }
1223
+ ]
1224
+ },
1225
+ {
1226
+ "name": "eval.tests.test_save_stats.test_competition_save_name_prompt_and_saved_message",
1227
+ "reasons": [
1228
+ {
1229
+ "id": "short_substring",
1230
+ "message": "pytest test uses a too-short substring oracle",
1231
+ "path": "eval/tests/test_save_stats.py",
1232
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1233
+ "severity": "error",
1234
+ "stage": "static_lint"
1235
+ }
1236
+ ]
1237
+ },
1238
+ {
1239
+ "name": "eval.tests.test_save_stats.test_competition_save_statistics_block_golden",
1240
+ "reasons": [
1241
+ {
1242
+ "id": "missing_fixture_assets",
1243
+ "message": "pytest test references fixture assets that are not packaged",
1244
+ "path": "eval/tests/test_save_stats.py",
1245
+ "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
1246
+ "severity": "error",
1247
+ "stage": "static_lint"
1248
+ }
1249
+ ]
1250
+ },
1251
+ {
1252
+ "name": "eval.tests.test_save_stats.test_competition_save_writes_scores_and_statistics",
1253
+ "reasons": [
1254
+ {
1255
+ "id": "short_substring",
1256
+ "message": "pytest test uses a too-short substring oracle",
1257
+ "path": "eval/tests/test_save_stats.py",
1258
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1259
+ "severity": "error",
1260
+ "stage": "static_lint"
1261
+ }
1262
+ ]
1263
+ },
1264
+ {
1265
+ "name": "eval.tests.test_scoreboard.test_scoreboard_block_present_when_populated",
1266
+ "reasons": [
1267
+ {
1268
+ "id": "short_substring",
1269
+ "message": "pytest test uses a too-short substring oracle",
1270
+ "path": "eval/tests/test_scoreboard.py",
1271
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1272
+ "severity": "error",
1273
+ "stage": "static_lint"
1274
+ }
1275
+ ]
1276
+ },
1277
+ {
1278
+ "name": "eval.tests.test_scoreboard.test_statistics_shows_loaded_values",
1279
+ "reasons": [
1280
+ {
1281
+ "id": "short_substring",
1282
+ "message": "pytest test uses a too-short substring oracle",
1283
+ "path": "eval/tests/test_scoreboard.py",
1284
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1285
+ "severity": "error",
1286
+ "stage": "static_lint"
1287
+ }
1288
+ ]
1289
+ },
1290
+ {
1291
+ "name": "eval.tests.test_statistics.test_statistics_best_score_uses_loaded_best",
1292
+ "reasons": [
1293
+ {
1294
+ "id": "short_substring",
1295
+ "message": "pytest test uses a too-short substring oracle",
1296
+ "path": "eval/tests/test_statistics.py",
1297
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1298
+ "severity": "error",
1299
+ "stage": "static_lint"
1300
+ }
1301
+ ]
1302
+ },
1303
+ {
1304
+ "name": "eval.tests.test_statistics.test_statistics_win_count_row",
1305
+ "reasons": [
1306
+ {
1307
+ "id": "short_substring",
1308
+ "message": "pytest test uses a too-short substring oracle",
1309
+ "path": "eval/tests/test_statistics.py",
1310
+ "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.",
1311
+ "severity": "error",
1312
+ "stage": "static_lint"
1313
+ },
1314
+ {
1315
+ "id": "generic_keyword_oracle",
1316
+ "message": "pytest test uses a generic keyword oracle",
1317
+ "path": "eval/tests/test_statistics.py",
1318
+ "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
1319
+ "severity": "error",
1320
+ "stage": "static_lint"
1321
+ }
1322
+ ]
1323
+ }
1324
+ ],
1325
+ "tests": [
1326
+ "eval.tests.test_continue_game_selection.test_continue_game_absence_of_scores_does_not_error",
1327
+ "eval.tests.test_continue_game_selection.test_continue_game_choice_above_range_is_invalid",
1328
+ "eval.tests.test_continue_game_selection.test_continue_game_choice_zero_is_invalid",
1329
+ "eval.tests.test_continue_game_selection.test_continue_game_empty_directory_reports_no_saved_games",
1330
+ "eval.tests.test_continue_game_selection.test_continue_game_lists_all_saved_files",
1331
+ "eval.tests.test_continue_game_selection.test_continue_game_lists_saved_files",
1332
+ "eval.tests.test_continue_game_selection.test_continue_game_missing_directory_reports_and_returns",
1333
+ "eval.tests.test_in_game_save_resource.test_save_big_score_roundtrip",
1334
+ "eval.tests.test_in_game_save_resource.test_save_file_lives_under_saved_game_files_dir",
1335
+ "eval.tests.test_in_game_save_resource.test_save_hotkey_p_creates_file",
1336
+ "eval.tests.test_in_game_save_resource.test_save_hotkey_z_creates_file_and_banner",
1337
+ "eval.tests.test_in_game_save_resource.test_save_overwrite_replaces_different_previous_score",
1338
+ "eval.tests.test_in_game_save_resource.test_save_overwrite_replaces_existing_same_name",
1339
+ "eval.tests.test_in_game_save_resource.test_save_reproduces_score_roundtrip",
1340
+ "eval.tests.test_in_game_save_resource.test_save_varied_filenames_accepted[alnum2x]",
1341
+ "eval.tests.test_in_game_save_resource.test_save_varied_filenames_accepted[digits123]",
1342
+ "eval.tests.test_in_game_save_resource.test_save_varied_filenames_accepted[plain]",
1343
+ "eval.tests.test_in_game_save_resource.test_save_varied_filenames_accepted[under_score]",
1344
+ "eval.tests.test_in_game_save_resource.test_save_varied_filenames_accepted[with-dash]",
1345
+ "eval.tests.test_in_game_save_resource.test_save_whitespace_filename_truncated_at_space",
1346
+ "eval.tests.test_in_game_save_resource.test_save_zero_score_roundtrip",
1347
+ "eval.tests.test_save_stats.test_competition_best_score_row_shows_loaded_best",
1348
+ "eval.tests.test_save_stats.test_competition_save_name_prompt_and_saved_message",
1349
+ "eval.tests.test_save_stats.test_competition_save_no_prior_stats_uses_zero_defaults",
1350
+ "eval.tests.test_save_stats.test_competition_save_persists_varied_names[Bob]",
1351
+ "eval.tests.test_save_stats.test_competition_save_persists_varied_names[Player123]",
1352
+ "eval.tests.test_save_stats.test_competition_save_persists_varied_names[a_b-c]",
1353
+ "eval.tests.test_save_stats.test_competition_save_persists_varied_names[x]",
1354
+ "eval.tests.test_save_stats.test_competition_save_statistics_block_golden",
1355
+ "eval.tests.test_save_stats.test_competition_save_writes_scores_and_statistics",
1356
+ "eval.tests.test_save_stats.test_competition_uses_player_name_in_score_row",
1357
+ "eval.tests.test_save_stats.test_save_appends_to_existing_scores_file",
1358
+ "eval.tests.test_save_stats.test_save_end_game_stats_accumulates_seeded_aggregates",
1359
+ "eval.tests.test_save_stats.test_save_end_game_stats_best_score_kept_when_higher",
1360
+ "eval.tests.test_save_stats.test_save_end_game_stats_best_score_zero_when_no_prior",
1361
+ "eval.tests.test_scoreboard.test_no_saved_scores_and_statistics",
1362
+ "eval.tests.test_scoreboard.test_scoreboard_block_present_when_populated",
1363
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_all_wins]",
1364
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_59s]",
1365
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_fractional]",
1366
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_hours]",
1367
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_minutes]",
1368
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_negative]",
1369
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_durations_zero_sec]",
1370
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_empty_missing]",
1371
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_garbage_line]",
1372
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_giant_score]",
1373
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_long_name]",
1374
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_many_entries]",
1375
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_negative_score]",
1376
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_no_wins]",
1377
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_partial_score_line]",
1378
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_scores_empty_stats_present]",
1379
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_scores_missing_stats_present]",
1380
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_scores_trailing_no_newline]",
1381
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_single_nowin]",
1382
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_single_win]",
1383
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_stats_missing_scores_present]",
1384
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_three_desc]",
1385
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_tie_scores]",
1386
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_two_sorted]",
1387
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_win_field_two]",
1388
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_win_field_zero]",
1389
+ "eval.tests.test_scoreboard.test_scoreboard_golden[view_zero_scores]",
1390
+ "eval.tests.test_scoreboard.test_scoreboard_rank_numbering_sequential",
1391
+ "eval.tests.test_scoreboard.test_statistics_shows_loaded_values",
1392
+ "eval.tests.test_statistics.test_statistics_best_score_uses_loaded_best",
1393
+ "eval.tests.test_statistics.test_statistics_golden[stats_extra_fields]",
1394
+ "eval.tests.test_statistics.test_statistics_golden[stats_hour_duration]",
1395
+ "eval.tests.test_statistics.test_statistics_golden[stats_large]",
1396
+ "eval.tests.test_statistics.test_statistics_golden[stats_missing_fields]",
1397
+ "eval.tests.test_statistics.test_statistics_golden[stats_negative]",
1398
+ "eval.tests.test_statistics.test_statistics_golden[stats_zero]",
1399
+ "eval.tests.test_statistics.test_statistics_win_count_row"
1400
+ ]
1401
+ }
1402
+ },
1403
+ "commit": "ad931d991e27819463dbd3d27a05411ea3cee061",
1404
+ "data_source": "synthetic_programgym",
1405
+ "difficulty": "easy",
1406
+ "difficulty_score": 1.5947239464097467,
1407
+ "eval_clean_hashes": [
1408
+ "edf3bf8a1e77cc813759a8fb24fca7cf8eac24f9c0978650cd45190bb60ff021"
1409
+ ],
1410
+ "input_record": {
1411
+ "commit": "ad931d991e27819463dbd3d27a05411ea3cee061",
1412
+ "difficulty": "easy",
1413
+ "difficulty_code_lines": 3933,
1414
+ "difficulty_has_tests": false,
1415
+ "difficulty_product_code_lines": 3933,
1416
+ "difficulty_runtime_deps": 0,
1417
+ "difficulty_score": 1.5947239464097467,
1418
+ "difficulty_test_code_lines": 0,
1419
+ "full_name": "plibither8/2048.cpp",
1420
+ "input_joern_zip": "cpp_joern/plibither8__2048.cpp.zip",
1421
+ "joern_status": true,
1422
+ "joern_time": 12.397318531060591,
1423
+ "language": "cpp",
1424
+ "pb_match": [
1425
+ {
1426
+ "pb_fullname": "HaliteChallenge/Halite",
1427
+ "rank": 46,
1428
+ "similarity": 0.5354514718055725
1429
+ }
1430
+ ],
1431
+ "repo_path": "cpp/plibither8__2048.cpp",
1432
+ "source": "commit:ad931d991e27819463dbd3d27a05411ea3cee061",
1433
+ "status": "done",
1434
+ "url": "https://github.com/plibither8/2048.cpp"
1435
+ },
1436
+ "instance_id": "plibither8__2048.cpp.ad931d9",
1437
+ "language": "cpp",
1438
+ "module_iterations": [
1439
+ {
1440
+ "actual_iterations": 5,
1441
+ "branch_name": "generated_module_01",
1442
+ "iteration_limit": 5,
1443
+ "module_index": 1,
1444
+ "module_kind": "source",
1445
+ "termination_reason": "max_iterations"
1446
+ },
1447
+ {
1448
+ "actual_iterations": 5,
1449
+ "branch_name": "generated_module_02",
1450
+ "iteration_limit": 5,
1451
+ "module_index": 2,
1452
+ "module_kind": "source",
1453
+ "termination_reason": "max_iterations"
1454
+ },
1455
+ {
1456
+ "actual_iterations": 5,
1457
+ "branch_name": "generated_module_03",
1458
+ "iteration_limit": 5,
1459
+ "module_index": 3,
1460
+ "module_kind": "source",
1461
+ "termination_reason": "max_iterations"
1462
+ },
1463
+ {
1464
+ "actual_iterations": 5,
1465
+ "branch_name": "generated_module_04",
1466
+ "iteration_limit": 5,
1467
+ "module_index": 4,
1468
+ "module_kind": "source",
1469
+ "termination_reason": "max_iterations"
1470
+ }
1471
+ ],
1472
+ "repository": "plibither8/2048.cpp"
1473
+ }
plibither8--2048.cpp.ad931d9/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
plibither8--2048.cpp.ad931d9/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d33816f896d4d268ccea358368a7ae1d311563458fb85d7ba696ccd1861da2d7
3
+ size 4361
pmp-library--pmp-library.2a2ad50/environment/Dockerfile ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ 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/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ 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; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; 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
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
57
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
58
+ # submission handed to the separate verifier. Keep the reference executable
59
+ # execute-only; the oracle temporarily restores owner read permission.
60
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
61
+ RUN mkdir -p /home/agent \
62
+ && chown -R agent:agent /home/agent /workspace \
63
+ && chown agent:agent /workspace/executable \
64
+ && chmod 111 /workspace/executable
65
+ ENV HOME=/home/agent
66
+ WORKDIR /workspace
pmp-library--pmp-library.2a2ad50/environment/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
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_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
pmp-library--pmp-library.2a2ad50/environment/download.sh ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #
3
+ # ProgramGym download stage for pmp-library.
4
+ #
5
+ # Sourced via `source /source_ro/download.sh` while the container still has
6
+ # network access. The repository source tree is NOT available at this stage,
7
+ # so this script is completely standalone: all dependency information is
8
+ # declared inline below.
9
+ #
10
+ # The selected target is the `mconvert` example tool, which links only the
11
+ # core `pmp` mesh-processing library. Its only build-time dependencies are:
12
+ # - a C++20 compiler (gcc/g++ 13.3.0 already installed in the base image)
13
+ # - CMake >= 3.16.3 (3.31.12 already installed)
14
+ # - make (4.3 already installed)
15
+ # - Eigen 3.4.0, bundled in the repository at external/eigen-3.4.0
16
+ # - OpenMP (libgomp), provided by the system and found at configure time
17
+ #
18
+ # No third-party download or apt package is required, so this script only
19
+ # verifies the toolchain and exports the environment that build.sh relies on.
20
+
21
+ # Fail explicitly when this sourced script encounters an error. This branch
22
+ # keeps the script valid both when sourced (return 1) and when executed
23
+ # directly (exit 1), without using any /dev/null redirection.
24
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
25
+ pmp_fail() { return 1; }
26
+ else
27
+ pmp_fail() { exit 1; }
28
+ fi
29
+
30
+ missing=""
31
+ for tool in gcc g++ cmake make; do
32
+ tool_path="$(command -v "$tool")"
33
+ if [ -z "$tool_path" ]; then
34
+ missing="${missing} ${tool}"
35
+ fi
36
+ done
37
+
38
+ if [ -n "$missing" ]; then
39
+ printf '%s\n' "required build toolchain missing:${missing}" >&2
40
+ pmp_fail
41
+ fi
42
+
43
+ # The base image ships an xPack GCC 13.3.0 whose libstdc++ exports symbols
44
+ # newer than the system libstdc++ (GLIBCXX_3.4.31/3.4.32 not present in the
45
+ # distro's 3.4.30). build.sh therefore links libstdc++ and libgcc statically
46
+ # so that ./executable runs on the system C++ runtime. Export a marker here
47
+ # so build.sh can rely on the toolchain behaviour.
48
+ export PMP_XPACK_GCC_STATIC_RUNTIME=1
49
+
50
+ # Let build.sh run the cmake build with a sensible parallel job count.
51
+ if [ -z "${PMP_BUILD_JOBS-}" ]; then
52
+ export PMP_BUILD_JOBS=4
53
+ fi
54
+
55
+ # No build, compile, link, test, or packaging step is performed here. The
56
+ # script ends normally and never calls exit, so it is safe to source.
pmp-library--pmp-library.2a2ad50/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1633936db2dad27b65fa2ca048053bdd2c7941a998da751185905f4c9c894bc4
3
+ size 3010984
pmp-library--pmp-library.2a2ad50/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
pmp-library--pmp-library.2a2ad50/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
pmp-library--pmp-library.2a2ad50/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f674b5efa7a94f2f8a646a60ff53644e5ec10fc1d404132f3cc8b58dcaa43d98
3
+ size 2911
pmp-library--pmp-library.2a2ad50/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
pmp-library--pmp-library.2a2ad50/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
pmp-library--pmp-library.2a2ad50/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/pmp-library--pmp-library.2a2ad50"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for pmp-library/pmp-library"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "pmp-library__pmp-library.2a2ad50"
32
+ repository = "pmp-library/pmp-library"
33
+ commit = "2a2ad502743724ba90e09af816364c84032f9015"
34
+ language = "cpp"
35
+ difficulty = "medium"
36
+ difficulty_score = 3.9705449139928914
37
+ test_branches = 6
38
+ test_count = 607
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"
pmp-library--pmp-library.2a2ad50/tests/Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV PAGER=cat
35
+ ENV MANPAGER=cat
36
+ ENV LESS=-R
37
+ ENV TQDM_DISABLE=1
38
+ 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/*
39
+ ARG CMAKE_VERSION=3.31.12
40
+ RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version
41
+ ARG GCC_VERSION=13.3.0
42
+ 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; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; 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
43
+ WORKDIR /workspace
44
+ ADD workspace.tar.gz /workspace/
45
+ COPY executable /workspace/executable
46
+ COPY download.sh /workspace/download.sh
47
+ RUN chmod 755 /workspace/download.sh
48
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
49
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
50
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
51
+ && rm -f /workspace/download.sh \
52
+ && rm -f /tmp/harbor_prepare_download_env.sh
53
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
54
+ RUN chmod 111 /workspace/executable
55
+ WORKDIR /workspace
56
+ # Harbor uses tests/ as the separate verifier build context. Start with the
57
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
58
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
59
+ && mkdir -p /workspace /tests
60
+
61
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
62
+ # Installing a newer pytest alone leaves that apt package importable and creates
63
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
64
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
65
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
66
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
67
+ RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
68
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
69
+
70
+ COPY test.sh /tests/test.sh
71
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
72
+ COPY programgym_task.json /tests/programgym_task.json
73
+ COPY blobs/ /tests/blobs/
74
+ RUN chmod +x /tests/test.sh
pmp-library--pmp-library.2a2ad50/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:6856f4db2f0582c6f1f7f38de7a8114bb86c1df6b550576cdd72feec755eec91
3
+ size 57311
pmp-library--pmp-library.2a2ad50/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:707152d094cfbeef4321944f625a48acfeccd88a3995098335afa2d92ac3a1ea
3
+ size 32839
pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9bfaaf87e8c6518a1d983d6aafe38ecbfbf680f8cc5049b5ea4b8d23669112e
3
+ size 26369
pmp-library--pmp-library.2a2ad50/tests/blobs/tests/generated_module_05.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32f16e18f7973ab5a61c22553ae359eeb1db615a71ad7ea60c2123c07c4ee783
3
+ size 24529