Datasets:
Upload folder using huggingface_hub (part 18)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +52 -0
- furkansenharputlu--f-license.b87/instruction.md +98 -0
- furkansenharputlu--f-license.b87/solution/solve.sh +33 -0
- furkansenharputlu--f-license.b87/task.toml +69 -0
- furkansenharputlu--f-license.b87/tests/Dockerfile +68 -0
- furkansenharputlu--f-license.b87/tests/blobs/tests/generated_module_01.tar.gz +3 -0
- furkansenharputlu--f-license.b87/tests/blobs/tests/generated_module_02.tar.gz +3 -0
- furkansenharputlu--f-license.b87/tests/blobs/tests/generated_module_03.tar.gz +3 -0
- furkansenharputlu--f-license.b87/tests/blobs/tests/generated_module_04.tar.gz +3 -0
- furkansenharputlu--f-license.b87/tests/download.sh +286 -0
- furkansenharputlu--f-license.b87/tests/executable +3 -0
- furkansenharputlu--f-license.b87/tests/programgym-go.tar.gz +3 -0
- furkansenharputlu--f-license.b87/tests/programgym_evaluator.py +1201 -0
- furkansenharputlu--f-license.b87/tests/programgym_task.json +645 -0
- furkansenharputlu--f-license.b87/tests/test.sh +82 -0
- furkansenharputlu--f-license.b87/tests/workspace.tar.gz +3 -0
- future-architect--tftarget.fc1f6/environment/Dockerfile +58 -0
- future-architect--tftarget.fc1f6/environment/download.sh +141 -0
- future-architect--tftarget.fc1f6/environment/executable +3 -0
- future-architect--tftarget.fc1f6/environment/programgym-go.tar.gz +3 -0
- future-architect--tftarget.fc1f6/environment/workspace.tar.gz +3 -0
- future-architect--tftarget.fc1f6/instruction.md +98 -0
- future-architect--tftarget.fc1f6/solution/solve.sh +33 -0
- future-architect--tftarget.fc1f6/task.toml +69 -0
- future-architect--tftarget.fc1f6/tests/Dockerfile +66 -0
- future-architect--tftarget.fc1f6/tests/blobs/tests/generated_module_01.tar.gz +3 -0
- future-architect--tftarget.fc1f6/tests/blobs/tests/generated_module_02.tar.gz +3 -0
- future-architect--tftarget.fc1f6/tests/blobs/tests/generated_module_03.tar.gz +3 -0
- future-architect--tftarget.fc1f6/tests/blobs/tests/generated_module_04.tar.gz +3 -0
- future-architect--tftarget.fc1f6/tests/download.sh +141 -0
- future-architect--tftarget.fc1f6/tests/executable +3 -0
- future-architect--tftarget.fc1f6/tests/programgym-go.tar.gz +3 -0
- future-architect--tftarget.fc1f6/tests/programgym_evaluator.py +1201 -0
- future-architect--tftarget.fc1f6/tests/programgym_task.json +550 -0
- future-architect--tftarget.fc1f6/tests/test.sh +82 -0
- future-architect--tftarget.fc1f6/tests/workspace.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/environment/Dockerfile +60 -0
- fzipp--gocyclo.7b6c7c5/environment/download.sh +31 -0
- fzipp--gocyclo.7b6c7c5/environment/executable +3 -0
- fzipp--gocyclo.7b6c7c5/environment/programgym-go.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/environment/workspace.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/instruction.md +98 -0
- fzipp--gocyclo.7b6c7c5/solution/solve.sh +33 -0
- fzipp--gocyclo.7b6c7c5/task.toml +69 -0
- fzipp--gocyclo.7b6c7c5/tests/Dockerfile +68 -0
- fzipp--gocyclo.7b6c7c5/tests/blobs/tests/generated_module_01.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/tests/blobs/tests/generated_module_02.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/tests/blobs/tests/generated_module_03.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/tests/blobs/tests/generated_module_04.tar.gz +3 -0
- fzipp--gocyclo.7b6c7c5/tests/download.sh +31 -0
.gitattributes
CHANGED
|
@@ -939,3 +939,55 @@ fumiyas--qrc.95a87f6/tests/executable filter=lfs diff=lfs merge=lfs -text
|
|
| 939 |
funktionio--funktion.81aeeb6/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 940 |
funktionio--funktion.81aeeb6/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 941 |
furkansenharputlu--f-license.b87/environment/executable filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 939 |
funktionio--funktion.81aeeb6/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 940 |
funktionio--funktion.81aeeb6/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 941 |
furkansenharputlu--f-license.b87/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 942 |
+
furkansenharputlu--f-license.b87/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 943 |
+
future-architect--tftarget.fc1f6/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 944 |
+
future-architect--tftarget.fc1f6/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 945 |
+
fzipp--gocyclo.7b6c7c5/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 946 |
+
fzipp--gocyclo.7b6c7c5/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 947 |
+
fzipp--pythia.12d26ae/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 948 |
+
fzipp--pythia.12d26ae/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 949 |
+
g-airport--tech-stack.9556c15/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 950 |
+
g-airport--tech-stack.9556c15/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 951 |
+
g-plane--zsh-yarn-autocompletion/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 952 |
+
g-plane--zsh-yarn-autocompletion/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 953 |
+
gabalpha--basilk.361f9bf/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 954 |
+
gabalpha--basilk.361f9bf/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 955 |
+
galeone--rts.fadaaac/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 956 |
+
galeone--rts.fadaaac/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 957 |
+
gamozolabs--elfloader.4e8118e/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 958 |
+
gamozolabs--elfloader.4e8118e/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 959 |
+
gamozolabs--mempeek.4fbd53d/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 960 |
+
gamozolabs--mempeek.4fbd53d/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 961 |
+
geekjourneyx--jina-cli.e59bcb2/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 962 |
+
geekjourneyx--jina-cli.e59bcb2/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 963 |
+
geektutu--high-performance-go.49/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 964 |
+
geektutu--high-performance-go.49/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 965 |
+
geertjohan--gomatrix.cfb8e33/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 966 |
+
geertjohan--gomatrix.cfb8e33/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 967 |
+
gennaro-tedesco--gh-s.02b37e9/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 968 |
+
gennaro-tedesco--gh-s.02b37e9/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 969 |
+
genuinetools--bane.d99999d/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 970 |
+
genuinetools--bane.d99999d/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 971 |
+
geo-team-red--geo-optimizer.fd99/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 972 |
+
geo-team-red--geo-optimizer.fd99/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 973 |
+
gepser--markdown-progress.0441c8/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 974 |
+
gepser--markdown-progress.0441c8/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 975 |
+
getanteon--anteon.5cf7df3/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 976 |
+
getanteon--anteon.5cf7df3/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 977 |
+
getstream--vg.0070ca7/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 978 |
+
getstream--vg.0070ca7/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 979 |
+
ggerganov--ggwave.060aec7/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 980 |
+
ggerganov--ggwave.060aec7/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 981 |
+
ggerganov--hnterm.9d09b17/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 982 |
+
ggerganov--hnterm.9d09b17/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 983 |
+
ggerganov--imtui.b7c0887/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 984 |
+
ggerganov--imtui.b7c0887/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 985 |
+
ghixu--acmmp.5b4c5fe/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 986 |
+
ghixu--acmmp.5b4c5fe/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 987 |
+
ghtz08--kugou-kgm-decoder.20ee46/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 988 |
+
ghtz08--kugou-kgm-decoder.20ee46/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 989 |
+
giacomo-b--cpprobotics.e2b5cda/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 990 |
+
giacomo-b--cpprobotics.e2b5cda/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 991 |
+
git-time-metric--gtm.019de99/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 992 |
+
git-time-metric--gtm.019de99/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 993 |
+
github-release--github-release.2/environment/executable filter=lfs diff=lfs merge=lfs -text
|
furkansenharputlu--f-license.b87/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
|
furkansenharputlu--f-license.b87/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
|
furkansenharputlu--f-license.b87/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/furkansenharputlu--f-license.b87"
|
| 25 |
+
description = "Synthetic ProgramGym cleanroom reconstruction task for furkansenharputlu/f-license"
|
| 26 |
+
authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
|
| 27 |
+
keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
|
| 28 |
+
|
| 29 |
+
[metadata]
|
| 30 |
+
source = "ProgramGym"
|
| 31 |
+
instance_id = "furkansenharputlu__f-license.b877db6"
|
| 32 |
+
repository = "furkansenharputlu/f-license"
|
| 33 |
+
commit = "b877db6c9d8043d5d8ccda08cb1f6a387ede2011"
|
| 34 |
+
language = "go"
|
| 35 |
+
difficulty = "easy"
|
| 36 |
+
difficulty_score = 1.9547247909790628
|
| 37 |
+
test_branches = 4
|
| 38 |
+
test_count = 454
|
| 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"
|
furkansenharputlu--f-license.b87/tests/Dockerfile
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
RUN ["bash","-lc","set -euo pipefail; cd /workspace; set -a; source /workspace/download.sh; set +a; python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh\nimport os\nimport re\nimport shlex\nignored = {\"OLDPWD\", \"PWD\", \"SHLVL\", \"_\"}\nvalid_name = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\nfor key in sorted(os.environ):\n if key in ignored or key.startswith(\"BASH_FUNC_\") or not valid_name.fullmatch(key):\n continue\n value = os.environ[key]\n if \"\\n\" in value:\n continue\n print(f\"export {key}={shlex.quote(value)}\")\nPY\n"]
|
| 45 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 46 |
+
RUN chmod 111 /workspace/executable
|
| 47 |
+
WORKDIR /workspace
|
| 48 |
+
# programgym-runtime-workspace-cleanup: v1
|
| 49 |
+
RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
|
| 50 |
+
# Harbor uses tests/ as the separate verifier build context. Start with the
|
| 51 |
+
# same toolchain as the agent, then remove every cleanroom workspace artifact.
|
| 52 |
+
RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
|
| 53 |
+
&& mkdir -p /workspace /tests
|
| 54 |
+
|
| 55 |
+
# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
|
| 56 |
+
# Installing a newer pytest alone leaves that apt package importable and creates
|
| 57 |
+
# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
|
| 58 |
+
# Install and constrain the verifier test runner as one coherent pip toolchain.
|
| 59 |
+
RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
|
| 60 |
+
ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
|
| 61 |
+
RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
|
| 62 |
+
'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
|
| 63 |
+
|
| 64 |
+
COPY test.sh /tests/test.sh
|
| 65 |
+
COPY programgym_evaluator.py /tests/programgym_evaluator.py
|
| 66 |
+
COPY programgym_task.json /tests/programgym_task.json
|
| 67 |
+
COPY blobs/ /tests/blobs/
|
| 68 |
+
RUN chmod +x /tests/test.sh
|
furkansenharputlu--f-license.b87/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:0007c2aed131ffbb9e1198f285586a7d7312b9f581e834c729085581c4dce4d9
|
| 3 |
+
size 52692201
|
furkansenharputlu--f-license.b87/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:54f71648297062d5eb0ffb9e87b9545187b81f00d90b0b9985f08d79b9eed36d
|
| 3 |
+
size 18932
|
furkansenharputlu--f-license.b87/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:748e80f942885413a88596762732d1e31a5bab8dcb63f15b1a572f22fcdadf23
|
| 3 |
+
size 49751045
|
furkansenharputlu--f-license.b87/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:627daf5e4b4a51ee42d2ef084cbc0c5cb7f94ffa441ee657c17cd951c3425157
|
| 3 |
+
size 29553
|
furkansenharputlu--f-license.b87/tests/download.sh
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
|
| 3 |
+
# Generated deterministically from repository module metadata; do not edit.
|
| 4 |
+
set -u
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 7 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
|
| 8 |
+
module github.com/furkansenharputlu/f-license
|
| 9 |
+
|
| 10 |
+
go 1.12
|
| 11 |
+
|
| 12 |
+
require (
|
| 13 |
+
github.com/dgrijalva/jwt-go v0.0.0-20190620180102-5e25c22bd5d6
|
| 14 |
+
github.com/gorilla/mux v0.0.0-20191121170500-49c01487a141
|
| 15 |
+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
| 16 |
+
github.com/sirupsen/logrus v1.4.2
|
| 17 |
+
github.com/spf13/cobra v0.0.3
|
| 18 |
+
github.com/spf13/pflag v1.0.5 // indirect
|
| 19 |
+
github.com/stretchr/testify v1.3.0
|
| 20 |
+
github.com/urfave/cli/v2 v2.2.0 // indirect
|
| 21 |
+
go.mongodb.org/mongo-driver v0.0.0-20200313205211-32aba96df4f5
|
| 22 |
+
)
|
| 23 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 24 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 25 |
+
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
| 26 |
+
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
|
| 27 |
+
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
| 28 |
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 29 |
+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
| 30 |
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 31 |
+
github.com/dgrijalva/jwt-go v0.0.0-20190620180102-5e25c22bd5d6 h1:ssJv98HqVfj15KU3jqZSy3ld8W+yxXxrDye5IKPjicc=
|
| 32 |
+
github.com/dgrijalva/jwt-go v0.0.0-20190620180102-5e25c22bd5d6/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
| 33 |
+
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
|
| 34 |
+
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
| 35 |
+
github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
|
| 36 |
+
github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
|
| 37 |
+
github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
|
| 38 |
+
github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
|
| 39 |
+
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
|
| 40 |
+
github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs=
|
| 41 |
+
github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
|
| 42 |
+
github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
|
| 43 |
+
github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk=
|
| 44 |
+
github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28=
|
| 45 |
+
github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo=
|
| 46 |
+
github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk=
|
| 47 |
+
github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw=
|
| 48 |
+
github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360=
|
| 49 |
+
github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg=
|
| 50 |
+
github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE=
|
| 51 |
+
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8=
|
| 52 |
+
github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
|
| 53 |
+
github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
|
| 54 |
+
github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
|
| 55 |
+
github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
|
| 56 |
+
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
|
| 57 |
+
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
|
| 58 |
+
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
|
| 59 |
+
github.com/golang/snappy v0.0.0-20190904063534-ff6b7dc882cf/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
| 60 |
+
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
| 61 |
+
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
| 62 |
+
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
| 63 |
+
github.com/gorilla/mux v0.0.0-20191121170500-49c01487a141 h1:5gvBId96cpobXRyRfJ8IjzMCS+DPRw7mBhn2Z433XMA=
|
| 64 |
+
github.com/gorilla/mux v0.0.0-20191121170500-49c01487a141/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
| 65 |
+
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
| 66 |
+
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
| 67 |
+
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
| 68 |
+
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
|
| 69 |
+
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
|
| 70 |
+
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
| 71 |
+
github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M=
|
| 72 |
+
github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
| 73 |
+
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
| 74 |
+
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
|
| 75 |
+
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
| 76 |
+
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
| 77 |
+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
| 78 |
+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
| 79 |
+
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
|
| 80 |
+
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
|
| 81 |
+
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
| 82 |
+
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
|
| 83 |
+
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
| 84 |
+
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
| 85 |
+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
| 86 |
+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
| 87 |
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
| 88 |
+
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
| 89 |
+
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
| 90 |
+
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
| 91 |
+
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
|
| 92 |
+
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
| 93 |
+
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
|
| 94 |
+
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
| 95 |
+
github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
| 96 |
+
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
| 97 |
+
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
| 98 |
+
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
| 99 |
+
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
|
| 100 |
+
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
| 101 |
+
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
| 102 |
+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
| 103 |
+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
| 104 |
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
| 105 |
+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
| 106 |
+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
| 107 |
+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
| 108 |
+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
| 109 |
+
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
| 110 |
+
github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4=
|
| 111 |
+
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
|
| 112 |
+
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
|
| 113 |
+
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
|
| 114 |
+
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo=
|
| 115 |
+
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
|
| 116 |
+
go.mongodb.org/mongo-driver v0.0.0-20200313205211-32aba96df4f5 h1:R06fu9zwH2rPcfXdVkMiRID2Jy7H1acCZDLefA0L/iA=
|
| 117 |
+
go.mongodb.org/mongo-driver v0.0.0-20200313205211-32aba96df4f5/go.mod h1:hmOoB+dRd+pUX0znSmmzTKnt2HyNhnN/lrwmYm9a9fA=
|
| 118 |
+
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
| 119 |
+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
| 120 |
+
golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
| 121 |
+
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
|
| 122 |
+
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
| 123 |
+
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
| 124 |
+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
| 125 |
+
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 126 |
+
golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 127 |
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 128 |
+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
|
| 129 |
+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 130 |
+
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 131 |
+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 132 |
+
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 133 |
+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 134 |
+
golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 135 |
+
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 136 |
+
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2 h1:T5DasATyLQfmbTpfEXx/IOL9vfjzW6up+ZDkmHvIf2s=
|
| 137 |
+
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 138 |
+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
| 139 |
+
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
| 140 |
+
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
| 141 |
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 142 |
+
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 143 |
+
golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
| 144 |
+
golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
| 145 |
+
golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
| 146 |
+
golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
| 147 |
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
| 148 |
+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
| 149 |
+
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
| 150 |
+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
| 151 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 152 |
+
PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
|
| 153 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
|
| 154 |
+
case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
|
| 155 |
+
*"|"*|*","*)
|
| 156 |
+
PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
|
| 157 |
+
PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
|
| 158 |
+
if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
|
| 159 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
|
| 160 |
+
fi
|
| 161 |
+
;;
|
| 162 |
+
esac
|
| 163 |
+
if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
|
| 164 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
|
| 165 |
+
fi
|
| 166 |
+
cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
|
| 167 |
+
import os
|
| 168 |
+
import signal
|
| 169 |
+
import subprocess
|
| 170 |
+
import sys
|
| 171 |
+
import time
|
| 172 |
+
|
| 173 |
+
sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
|
| 174 |
+
if not command:
|
| 175 |
+
raise SystemExit(125)
|
| 176 |
+
environment = os.environ.copy()
|
| 177 |
+
environment["GOPROXY"] = proxy
|
| 178 |
+
process = subprocess.Popen(command, env=environment, start_new_session=True)
|
| 179 |
+
try:
|
| 180 |
+
returncode = process.wait(timeout=float(timeout_text))
|
| 181 |
+
except subprocess.TimeoutExpired:
|
| 182 |
+
with open(sentinel_path, "w", encoding="utf-8") as sentinel:
|
| 183 |
+
sentinel.write("expired\n")
|
| 184 |
+
try:
|
| 185 |
+
os.killpg(process.pid, signal.SIGTERM)
|
| 186 |
+
except ProcessLookupError:
|
| 187 |
+
pass
|
| 188 |
+
deadline = time.monotonic() + float(grace_text)
|
| 189 |
+
group_alive = True
|
| 190 |
+
while time.monotonic() < deadline:
|
| 191 |
+
process.poll()
|
| 192 |
+
try:
|
| 193 |
+
os.killpg(process.pid, 0)
|
| 194 |
+
except ProcessLookupError:
|
| 195 |
+
group_alive = False
|
| 196 |
+
break
|
| 197 |
+
time.sleep(0.05)
|
| 198 |
+
if group_alive:
|
| 199 |
+
try:
|
| 200 |
+
os.killpg(process.pid, signal.SIGKILL)
|
| 201 |
+
except ProcessLookupError:
|
| 202 |
+
pass
|
| 203 |
+
process.wait()
|
| 204 |
+
raise SystemExit(124)
|
| 205 |
+
if returncode < 0:
|
| 206 |
+
returncode = 128 - returncode
|
| 207 |
+
raise SystemExit(returncode)
|
| 208 |
+
PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
|
| 209 |
+
PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
|
| 210 |
+
if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
|
| 211 |
+
printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
|
| 212 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 213 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 214 |
+
return 1
|
| 215 |
+
else
|
| 216 |
+
exit 1
|
| 217 |
+
fi
|
| 218 |
+
fi
|
| 219 |
+
if ! command -v python3 >/dev/null 2>&1; then
|
| 220 |
+
printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
|
| 221 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 222 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 223 |
+
return 1
|
| 224 |
+
else
|
| 225 |
+
exit 1
|
| 226 |
+
fi
|
| 227 |
+
fi
|
| 228 |
+
_programgym_go_with_nexus_timeout() {
|
| 229 |
+
local programgym_go_rc
|
| 230 |
+
local programgym_go_timeout_sentinel
|
| 231 |
+
if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
|
| 232 |
+
return 1
|
| 233 |
+
fi
|
| 234 |
+
if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
|
| 235 |
+
programgym_go_rc=0
|
| 236 |
+
else
|
| 237 |
+
programgym_go_rc=$?
|
| 238 |
+
fi
|
| 239 |
+
if [ ! -s "$programgym_go_timeout_sentinel" ]; then
|
| 240 |
+
rm -f "$programgym_go_timeout_sentinel"
|
| 241 |
+
return "$programgym_go_rc"
|
| 242 |
+
fi
|
| 243 |
+
rm -f "$programgym_go_timeout_sentinel"
|
| 244 |
+
if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
|
| 245 |
+
printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
|
| 246 |
+
return "$programgym_go_rc"
|
| 247 |
+
fi
|
| 248 |
+
printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
|
| 249 |
+
env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
|
| 250 |
+
}
|
| 251 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 252 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 253 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 254 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 255 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 256 |
+
return 1
|
| 257 |
+
else
|
| 258 |
+
exit 1
|
| 259 |
+
fi
|
| 260 |
+
fi
|
| 261 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 262 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 263 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 264 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 265 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 266 |
+
else
|
| 267 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 268 |
+
fi
|
| 269 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 270 |
+
export GOTOOLCHAIN=local
|
| 271 |
+
if ! (cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
|
| 272 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 273 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 274 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 275 |
+
return 1
|
| 276 |
+
else
|
| 277 |
+
exit 1
|
| 278 |
+
fi
|
| 279 |
+
fi
|
| 280 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 281 |
+
unset -f _programgym_go_with_nexus_timeout
|
| 282 |
+
unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
|
| 283 |
+
unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
|
| 284 |
+
unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
|
| 285 |
+
unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
|
| 286 |
+
unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
|
furkansenharputlu--f-license.b87/tests/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0066a5b61d1ca0ecf4efd0ed08727ffef12d51daf2d8ae887d500d39d91cf6bd
|
| 3 |
+
size 13635692
|
furkansenharputlu--f-license.b87/tests/programgym-go.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
|
| 3 |
+
size 59908810
|
furkansenharputlu--f-license.b87/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()
|
furkansenharputlu--f-license.b87/tests/programgym_task.json
ADDED
|
@@ -0,0 +1,645 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"branches": {
|
| 3 |
+
"generated_module_01": {
|
| 4 |
+
"ignore_reason": "",
|
| 5 |
+
"ignored": false,
|
| 6 |
+
"ignored_tests": [],
|
| 7 |
+
"tests": [
|
| 8 |
+
"eval.tests.test_admin_auth.test_admin_accepts_correct_secret",
|
| 9 |
+
"eval.tests.test_admin_auth.test_admin_accepts_secret_with_surrounding_method",
|
| 10 |
+
"eval.tests.test_admin_auth.test_admin_rejects_empty_secret_header",
|
| 11 |
+
"eval.tests.test_admin_auth.test_admin_rejects_partial_secret_prefix",
|
| 12 |
+
"eval.tests.test_admin_auth.test_admin_rejects_wrong_secret",
|
| 13 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header[/admin/licenses/000000000000000000000000]",
|
| 14 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header[/admin/licenses]",
|
| 15 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header_unsafe[DELETE-/admin/licenses/000000000000000000000000/delete]",
|
| 16 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header_unsafe[POST-/admin/licenses]",
|
| 17 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header_unsafe[PUT-/admin/licenses/000000000000000000000000/activate]",
|
| 18 |
+
"eval.tests.test_admin_auth.test_admin_requires_auth_missing_header_unsafe[PUT-/admin/licenses/000000000000000000000000/inactivate]",
|
| 19 |
+
"eval.tests.test_license_generate.test_cross_app_same_claims_are_distinct_licenses",
|
| 20 |
+
"eval.tests.test_license_generate.test_distinct_licenses_both_succeed",
|
| 21 |
+
"eval.tests.test_license_generate.test_duplicate_license_rejected",
|
| 22 |
+
"eval.tests.test_license_generate.test_generate_app_alg_overrides_header_alg",
|
| 23 |
+
"eval.tests.test_license_generate.test_generate_empty_body",
|
| 24 |
+
"eval.tests.test_license_generate.test_generate_explicit_hs512_alg_is_preserved",
|
| 25 |
+
"eval.tests.test_license_generate.test_generate_hs256_with_app",
|
| 26 |
+
"eval.tests.test_license_generate.test_generate_malformed_json_body",
|
| 27 |
+
"eval.tests.test_license_generate.test_generate_numeric_active_is_rejected_by_bool_field",
|
| 28 |
+
"eval.tests.test_license_generate.test_generate_rs256_via_app",
|
| 29 |
+
"eval.tests.test_license_generate.test_generate_unknown_app_rejected",
|
| 30 |
+
"eval.tests.test_license_generate.test_generate_uses_default_signature_without_app",
|
| 31 |
+
"eval.tests.test_license_generate.test_generate_with_empty_headers_map_defaults",
|
| 32 |
+
"eval.tests.test_license_generate.test_generated_token_signed_by_secret",
|
| 33 |
+
"eval.tests.test_license_lifecycle.test_activate_malformed_id_error[1]",
|
| 34 |
+
"eval.tests.test_license_lifecycle.test_activate_malformed_id_error[bogus]",
|
| 35 |
+
"eval.tests.test_license_lifecycle.test_activate_malformed_id_error[zz123]",
|
| 36 |
+
"eval.tests.test_license_lifecycle.test_activate_nonexistent_id_error",
|
| 37 |
+
"eval.tests.test_license_lifecycle.test_delete_malformed_id_error[1]",
|
| 38 |
+
"eval.tests.test_license_lifecycle.test_delete_malformed_id_error[bogus]",
|
| 39 |
+
"eval.tests.test_license_lifecycle.test_delete_malformed_id_error[zz123]",
|
| 40 |
+
"eval.tests.test_license_lifecycle.test_delete_nonexistent_id_error",
|
| 41 |
+
"eval.tests.test_license_lifecycle.test_delete_one_of_many_leaves_others",
|
| 42 |
+
"eval.tests.test_license_lifecycle.test_delete_then_recreate_same_payload_succeeds",
|
| 43 |
+
"eval.tests.test_license_lifecycle.test_full_lifecycle_activate_inactivate_delete",
|
| 44 |
+
"eval.tests.test_license_lifecycle.test_inactivate_malformed_id_error[1]",
|
| 45 |
+
"eval.tests.test_license_lifecycle.test_inactivate_malformed_id_error[bogus]",
|
| 46 |
+
"eval.tests.test_license_lifecycle.test_inactivate_malformed_id_error[zz123]",
|
| 47 |
+
"eval.tests.test_license_lifecycle.test_inactivate_nonexistent_id_error",
|
| 48 |
+
"eval.tests.test_license_lifecycle.test_inactive_license_created_and_verifies_invalid",
|
| 49 |
+
"eval.tests.test_license_lifecycle.test_recreate_inactive_license_verifies_invalid_again",
|
| 50 |
+
"eval.tests.test_license_query.test_get_all_empty_is_json_null",
|
| 51 |
+
"eval.tests.test_license_query.test_get_all_ids_unique_and_output_shape",
|
| 52 |
+
"eval.tests.test_license_query.test_get_all_returns_all_created",
|
| 53 |
+
"eval.tests.test_license_query.test_get_malformed_id_error_variants[0000000000000000000000000]",
|
| 54 |
+
"eval.tests.test_license_query.test_get_malformed_id_error_variants[0]",
|
| 55 |
+
"eval.tests.test_license_query.test_get_malformed_id_error_variants[1234]",
|
| 56 |
+
"eval.tests.test_license_query.test_get_malformed_id_error_variants[gggggggggggggggggggggggg]",
|
| 57 |
+
"eval.tests.test_license_query.test_get_malformed_id_error_variants[zz]",
|
| 58 |
+
"eval.tests.test_license_query.test_get_malformed_id_is_error",
|
| 59 |
+
"eval.tests.test_license_query.test_get_nonexistent_id_is_error",
|
| 60 |
+
"eval.tests.test_license_query.test_get_returns_created_license_fields",
|
| 61 |
+
"eval.tests.test_license_verify.test_verify_active_license_is_valid",
|
| 62 |
+
"eval.tests.test_license_verify.test_verify_active_rs256_reactivation_roundtrip",
|
| 63 |
+
"eval.tests.test_license_verify.test_verify_empty_string_token_is_not_found",
|
| 64 |
+
"eval.tests.test_license_verify.test_verify_inactive_license_is_invalid",
|
| 65 |
+
"eval.tests.test_license_verify.test_verify_inactive_rs256_license_is_invalid",
|
| 66 |
+
"eval.tests.test_license_verify.test_verify_missing_token_is_not_found",
|
| 67 |
+
"eval.tests.test_license_verify.test_verify_public_endpoint_does_not_require_auth",
|
| 68 |
+
"eval.tests.test_license_verify.test_verify_query_precedence_over_body",
|
| 69 |
+
"eval.tests.test_license_verify.test_verify_rs256_token_is_valid",
|
| 70 |
+
"eval.tests.test_license_verify.test_verify_runs_without_admin_auth_on_default_signature",
|
| 71 |
+
"eval.tests.test_license_verify.test_verify_tampered_token_is_not_found",
|
| 72 |
+
"eval.tests.test_license_verify.test_verify_token_via_query_string",
|
| 73 |
+
"eval.tests.test_license_verify.test_verify_unknown_token_is_not_found",
|
| 74 |
+
"eval.tests.test_license_verify.test_verify_works_after_reactivation",
|
| 75 |
+
"eval.tests.test_router_ping.test_admin_get_list_is_json_value",
|
| 76 |
+
"eval.tests.test_router_ping.test_error_response_is_json_content_type",
|
| 77 |
+
"eval.tests.test_router_ping.test_error_response_is_json_object_with_error_key",
|
| 78 |
+
"eval.tests.test_router_ping.test_ping_only_allowed_on_post",
|
| 79 |
+
"eval.tests.test_router_ping.test_ping_returns_empty_200",
|
| 80 |
+
"eval.tests.test_router_ping.test_ping_with_query_string_still_empty_200",
|
| 81 |
+
"eval.tests.test_router_ping.test_success_response_is_json_content_type",
|
| 82 |
+
"eval.tests.test_router_ping.test_unknown_admin_path_is_404",
|
| 83 |
+
"eval.tests.test_router_ping.test_unknown_top_level_path_is_404",
|
| 84 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_ping_return_405[HEAD]",
|
| 85 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_ping_return_405[OPTIONS]",
|
| 86 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_ping_return_405[PATCH]",
|
| 87 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_ping_return_405[PUT]",
|
| 88 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_verify_return_405[HEAD]",
|
| 89 |
+
"eval.tests.test_router_ping.test_unregistered_methods_on_verify_return_405[OPTIONS]",
|
| 90 |
+
"eval.tests.test_router_ping.test_wrong_method_on_list_licenses",
|
| 91 |
+
"eval.tests.test_router_ping.test_wrong_method_on_verify_is_405",
|
| 92 |
+
"eval.tests.test_tls.test_tls_admin_accepts_secret",
|
| 93 |
+
"eval.tests.test_tls.test_tls_admin_requires_auth",
|
| 94 |
+
"eval.tests.test_tls.test_tls_generate_and_verify",
|
| 95 |
+
"eval.tests.test_tls.test_tls_server_serves_ping",
|
| 96 |
+
"eval.tests.test_tls.test_tls_wrong_secret_returns_401"
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"generated_module_02": {
|
| 100 |
+
"ignore_reason": "",
|
| 101 |
+
"ignored": false,
|
| 102 |
+
"ignored_tests": [],
|
| 103 |
+
"tests": [
|
| 104 |
+
"eval.tests.test_config_admin_auth.test_admin_auth_over_https",
|
| 105 |
+
"eval.tests.test_config_admin_auth.test_admin_empty_secret_matches_missing_header",
|
| 106 |
+
"eval.tests.test_config_admin_auth.test_admin_mutated_secret_rejected",
|
| 107 |
+
"eval.tests.test_config_admin_auth.test_admin_requires_authorization_header",
|
| 108 |
+
"eval.tests.test_config_admin_auth.test_admin_secret_is_exact_config_value",
|
| 109 |
+
"eval.tests.test_config_admin_auth.test_admin_wrong_secret_rejected",
|
| 110 |
+
"eval.tests.test_config_apps_signature.test_config_app_with_missing_signature_loads",
|
| 111 |
+
"eval.tests.test_config_apps_signature.test_config_ignores_unknown_extra_keys",
|
| 112 |
+
"eval.tests.test_config_apps_signature.test_config_with_apps_and_default_signature_loads",
|
| 113 |
+
"eval.tests.test_config_apps_signature.test_config_with_default_signature_loads",
|
| 114 |
+
"eval.tests.test_config_apps_signature.test_config_with_hmac_app_loads",
|
| 115 |
+
"eval.tests.test_config_apps_signature.test_config_with_multiple_apps_loads",
|
| 116 |
+
"eval.tests.test_config_field_validation.test_admin_empty_string_header_vs_missing",
|
| 117 |
+
"eval.tests.test_config_field_validation.test_empty_config_file_is_unmarshal_error",
|
| 118 |
+
"eval.tests.test_config_field_validation.test_invalid_range_port_is_fatal[-1-address -1: invalid port]",
|
| 119 |
+
"eval.tests.test_config_field_validation.test_invalid_range_port_is_fatal[-5-address -5: invalid port]",
|
| 120 |
+
"eval.tests.test_config_field_validation.test_invalid_range_port_is_fatal[70000-invalid port]",
|
| 121 |
+
"eval.tests.test_config_field_validation.test_invalid_range_port_is_fatal[99999-address 99999: invalid port]",
|
| 122 |
+
"eval.tests.test_config_field_validation.test_json_array_config_is_unmarshal_error",
|
| 123 |
+
"eval.tests.test_config_field_validation.test_json_null_config_has_no_unmarshal_error",
|
| 124 |
+
"eval.tests.test_config_field_validation.test_port_upper_boundary_65535_binds",
|
| 125 |
+
"eval.tests.test_config_field_validation.test_tls_config_field_decodes_and_serves_https",
|
| 126 |
+
"eval.tests.test_config_field_validation.test_whitespace_only_config_is_unmarshal_error",
|
| 127 |
+
"eval.tests.test_config_field_validation.test_wrong_type_in_app_value_logs",
|
| 128 |
+
"eval.tests.test_config_field_validation.test_wrong_type_port_stays_alive_on_ephemeral",
|
| 129 |
+
"eval.tests.test_config_field_validation.test_wrong_type_scalar_field_logs_and_server_runs[admin_secret-123-Config.admin_secret of type string]",
|
| 130 |
+
"eval.tests.test_config_field_validation.test_wrong_type_scalar_field_logs_and_server_runs[admin_secret-value2-Config.admin_secret of type string]",
|
| 131 |
+
"eval.tests.test_config_field_validation.test_wrong_type_scalar_field_logs_and_server_runs[db_name-123-Config.db_name of type string]",
|
| 132 |
+
"eval.tests.test_config_field_validation.test_wrong_type_struct_field_logs_and_server_runs[apps-not-a-map-Config.apps of type map[string]*config.App]",
|
| 133 |
+
"eval.tests.test_config_field_validation.test_wrong_type_struct_field_logs_and_server_runs[apps-value3-Config.apps of type map[string]*config.App]",
|
| 134 |
+
"eval.tests.test_config_field_validation.test_wrong_type_struct_field_logs_and_server_runs[default_signature-nope-Config.default_signature of type config.Signature]",
|
| 135 |
+
"eval.tests.test_config_field_validation.test_wrong_type_struct_field_logs_and_server_runs[server_options-True-Config.server_options of type config.ServerOptions]",
|
| 136 |
+
"eval.tests.test_config_field_validation.test_wrong_type_tls_min_version_is_unmarshal_error",
|
| 137 |
+
"eval.tests.test_config_full_load.test_full_config_load_produces_no_unmarshal_error",
|
| 138 |
+
"eval.tests.test_config_full_load.test_full_config_with_tls_enabled_and_valid_keypair",
|
| 139 |
+
"eval.tests.test_config_full_load.test_full_sample_style_config_loads_and_serves",
|
| 140 |
+
"eval.tests.test_config_http_observable.test_admin_route_is_auth_gated_but_route_exists",
|
| 141 |
+
"eval.tests.test_config_http_observable.test_ping_only_accepts_post",
|
| 142 |
+
"eval.tests.test_config_http_observable.test_ping_rejects_put_and_delete",
|
| 143 |
+
"eval.tests.test_config_http_observable.test_root_path_is_unmatched",
|
| 144 |
+
"eval.tests.test_config_http_observable.test_unknown_route_returns_404",
|
| 145 |
+
"eval.tests.test_config_http_observable.test_verify_endpoint_registered",
|
| 146 |
+
"eval.tests.test_config_load_errors.test_invalid_json_config_logs_unmarshal_and_exits",
|
| 147 |
+
"eval.tests.test_config_load_errors.test_malformed_mongo_url_fatal",
|
| 148 |
+
"eval.tests.test_config_load_errors.test_missing_config_file_logs_and_exits",
|
| 149 |
+
"eval.tests.test_config_load_errors.test_port_field_wrong_type_keeps_server_running",
|
| 150 |
+
"eval.tests.test_config_load_errors.test_unparseable_mongo_url_fatal",
|
| 151 |
+
"eval.tests.test_config_port_conflict.test_duplicate_port_config_fails_to_bind",
|
| 152 |
+
"eval.tests.test_config_port_conflict.test_unique_ports_both_bind_successfully",
|
| 153 |
+
"eval.tests.test_config_server_options_edges.test_config_path_is_a_directory_errors",
|
| 154 |
+
"eval.tests.test_config_server_options_edges.test_tls_config_full_valid_block_decodes_and_serves_https",
|
| 155 |
+
"eval.tests.test_config_server_options_edges.test_tls_enabled_with_empty_cert_or_key_is_fatal[-/workspace/eval/test_resources/sample_private_key.pem]",
|
| 156 |
+
"eval.tests.test_config_server_options_edges.test_tls_enabled_with_empty_cert_or_key_is_fatal[/workspace/eval/test_resources/sample_public_key.pem-]",
|
| 157 |
+
"eval.tests.test_config_server_options_edges.test_top_level_unknown_tls_config_key_is_ignored",
|
| 158 |
+
"eval.tests.test_config_server_options_edges.test_variant_apps_and_default_signature_decode_and_serve[apps0-None]",
|
| 159 |
+
"eval.tests.test_config_server_options_edges.test_variant_apps_and_default_signature_decode_and_serve[apps1-default_signature1]",
|
| 160 |
+
"eval.tests.test_config_server_options_edges.test_variant_apps_and_default_signature_decode_and_serve[apps2-None]",
|
| 161 |
+
"eval.tests.test_config_server_startup.test_configured_port_number_is_used_in_listener_address",
|
| 162 |
+
"eval.tests.test_config_server_startup.test_intro_log_lines_written_to_stderr",
|
| 163 |
+
"eval.tests.test_config_server_startup.test_ping_endpoint_reachable_on_configured_port",
|
| 164 |
+
"eval.tests.test_config_server_startup.test_ping_returns_on_different_port_values",
|
| 165 |
+
"eval.tests.test_config_server_startup.test_server_binds_exact_configured_port",
|
| 166 |
+
"eval.tests.test_config_server_startup.test_zero_port_still_serves_on_ephemeral_port",
|
| 167 |
+
"eval.tests.test_config_tls_options.test_tls_disabled_serves_plain_http",
|
| 168 |
+
"eval.tests.test_config_tls_options.test_tls_enabled_invalid_cert_file_exits_with_error",
|
| 169 |
+
"eval.tests.test_config_tls_options.test_tls_enabled_invalid_key_file_exits_with_error",
|
| 170 |
+
"eval.tests.test_config_tls_options.test_tls_enabled_serves_https_with_valid_cert"
|
| 171 |
+
]
|
| 172 |
+
},
|
| 173 |
+
"generated_module_03": {
|
| 174 |
+
"ignore_reason": "",
|
| 175 |
+
"ignored": false,
|
| 176 |
+
"ignored_tests": [
|
| 177 |
+
{
|
| 178 |
+
"name": "eval.tests.test_lcs_authed_admin_routes.TestAdminListAuth.test_list_wrong_secret_header_rejected",
|
| 179 |
+
"reasons": [
|
| 180 |
+
{
|
| 181 |
+
"id": "assertion_disjunction",
|
| 182 |
+
"message": "pytest assertion accepts alternatives with or",
|
| 183 |
+
"path": "eval/tests/test_lcs_authed_admin_routes.py",
|
| 184 |
+
"repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.",
|
| 185 |
+
"severity": "error",
|
| 186 |
+
"stage": "static_lint"
|
| 187 |
+
}
|
| 188 |
+
]
|
| 189 |
+
}
|
| 190 |
+
],
|
| 191 |
+
"tests": [
|
| 192 |
+
"eval.tests.test_auth.test_admin_correct_auth_accepted",
|
| 193 |
+
"eval.tests.test_auth.test_admin_missing_auth_rejected",
|
| 194 |
+
"eval.tests.test_auth.test_admin_wrong_auth_rejected",
|
| 195 |
+
"eval.tests.test_auth.test_admin_wrong_secret_header_rejected",
|
| 196 |
+
"eval.tests.test_auth.test_public_verify_not_authed",
|
| 197 |
+
"eval.tests.test_crud.TestDeleteLicense.test_delete_bad_id_format",
|
| 198 |
+
"eval.tests.test_crud.TestDeleteLicense.test_delete_existing_license",
|
| 199 |
+
"eval.tests.test_crud.TestDeleteLicense.test_delete_non_existent_id",
|
| 200 |
+
"eval.tests.test_crud.TestDeleteLicense.test_delete_removes_license_from_verify",
|
| 201 |
+
"eval.tests.test_crud.TestGetLicense.test_get_bad_id_format",
|
| 202 |
+
"eval.tests.test_crud.TestGetLicense.test_get_by_id_returns_license",
|
| 203 |
+
"eval.tests.test_crud.TestGetLicense.test_get_returns_claims_and_headers",
|
| 204 |
+
"eval.tests.test_crud.TestGetLicense.test_get_unknown_valid_format_id",
|
| 205 |
+
"eval.tests.test_crud.TestListLicenses.test_list_orders_and_contains_full_licenses",
|
| 206 |
+
"eval.tests.test_crud.TestListLicenses.test_list_returns_generated_license_ids",
|
| 207 |
+
"eval.tests.test_fatal_keys.test_rsa_private_key_missing_is_fatal",
|
| 208 |
+
"eval.tests.test_fatal_keys.test_rsa_private_key_unparseable_is_fatal",
|
| 209 |
+
"eval.tests.test_fatal_keys.test_rsa_public_key_missing_is_fatal",
|
| 210 |
+
"eval.tests.test_fatal_keys.test_rsa_public_key_unparseable_is_fatal",
|
| 211 |
+
"eval.tests.test_generate.TestDefaultHMAC.test_empty_headers_object",
|
| 212 |
+
"eval.tests.test_generate.TestDefaultHMAC.test_hs256_default_explicit_alg",
|
| 213 |
+
"eval.tests.test_generate.TestDefaultHMAC.test_hs256_default_no_alg",
|
| 214 |
+
"eval.tests.test_generate.TestDefaultHMAC.test_hs384_default_signature",
|
| 215 |
+
"eval.tests.test_generate.TestDefaultHMAC.test_hs512_default_signature",
|
| 216 |
+
"eval.tests.test_generate.TestGenerateErrors.test_app_not_found",
|
| 217 |
+
"eval.tests.test_generate.TestGenerateErrors.test_duplicate_license_rejected",
|
| 218 |
+
"eval.tests.test_generate.TestGenerateErrors.test_empty_app_name_header_treated_as_default",
|
| 219 |
+
"eval.tests.test_generate.TestGenerateErrors.test_json_null_body",
|
| 220 |
+
"eval.tests.test_generate.TestNamedApp.test_app_alg_overrides_header_alg",
|
| 221 |
+
"eval.tests.test_generate.TestNamedApp.test_app_name_without_alg_uses_app_alg",
|
| 222 |
+
"eval.tests.test_generate.TestNamedApp.test_hs_app_alg_from_app",
|
| 223 |
+
"eval.tests.test_generate.TestNamedApp.test_rsa256_app",
|
| 224 |
+
"eval.tests.test_generate.TestNamedApp.test_rsa_app_signed",
|
| 225 |
+
"eval.tests.test_generate.TestTokenShape.test_distinct_claims_distinct_tokens",
|
| 226 |
+
"eval.tests.test_generate.TestTokenShape.test_generate_returns_id_and_token",
|
| 227 |
+
"eval.tests.test_generate.TestTokenShape.test_token_is_three_part_jwt",
|
| 228 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_default_signature_omitted_active_is_inactive_from_birth",
|
| 229 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_named_hs_app_omitted_active_is_inactive",
|
| 230 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_omitted_active_idempotent_dual_verify",
|
| 231 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_omitted_active_is_distinct_from_explicit_true",
|
| 232 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_omitted_active_license_can_be_activated",
|
| 233 |
+
"eval.tests.test_lcs_active_default.TestOmittedActiveDefault.test_rsa_app_omitted_active_is_inactive",
|
| 234 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminActivateAuth.test_activate_requires_auth",
|
| 235 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminDeleteAuth.test_delete_requires_auth",
|
| 236 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminGetByIDAuth.test_get_by_id_requires_auth",
|
| 237 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminGetByIDAuth.test_get_by_id_wrong_secret_rejected",
|
| 238 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminInactivateAuth.test_inactivate_requires_auth",
|
| 239 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminListAuth.test_list_requires_auth_but_succeeds_with_secret",
|
| 240 |
+
"eval.tests.test_lcs_authed_admin_routes.TestAdminListAuth.test_list_wrong_secret_header_rejected",
|
| 241 |
+
"eval.tests.test_lcs_authed_admin_routes.TestPingPublicRoute.test_ping_ignores_auth_status_yet_payload_empty",
|
| 242 |
+
"eval.tests.test_lcs_authed_admin_routes.TestPingPublicRoute.test_ping_is_public_and_returns_empty_200",
|
| 243 |
+
"eval.tests.test_lcs_claim_validation.TestActiveShortCircuitPrecedence.test_inactive_license_with_expired_exp_returns_200_false",
|
| 244 |
+
"eval.tests.test_lcs_claim_validation.TestActiveShortCircuitPrecedence.test_inactive_license_with_future_nbf_returns_200_false",
|
| 245 |
+
"eval.tests.test_lcs_claim_validation.TestClaimExpiration.test_expired_exp_on_named_apps_is_401[hs-app]",
|
| 246 |
+
"eval.tests.test_lcs_claim_validation.TestClaimExpiration.test_expired_exp_on_named_apps_is_401[rsa-app]",
|
| 247 |
+
"eval.tests.test_lcs_claim_validation.TestClaimExpiration.test_expired_exp_yields_401_token_is_expired",
|
| 248 |
+
"eval.tests.test_lcs_claim_validation.TestClaimExpiration.test_future_exp_is_valid",
|
| 249 |
+
"eval.tests.test_lcs_claim_validation.TestClaimExpiration.test_no_exp_claim_is_valid",
|
| 250 |
+
"eval.tests.test_lcs_claim_validation.TestClaimIssuedAt.test_future_iat_yields_401_used_before_issued",
|
| 251 |
+
"eval.tests.test_lcs_claim_validation.TestClaimNotBefore.test_future_nbf_overrides_future_exp",
|
| 252 |
+
"eval.tests.test_lcs_claim_validation.TestClaimNotBefore.test_future_nbf_yields_401_not_valid_yet",
|
| 253 |
+
"eval.tests.test_lcs_claim_validation.TestClaimNotBefore.test_past_nbf_is_valid",
|
| 254 |
+
"eval.tests.test_lcs_claim_validation.TestClaimNotBefore.test_rsa_future_nbf_is_401",
|
| 255 |
+
"eval.tests.test_lcs_claim_validation.TestClaimValidationStatePreservation.test_expired_license_still_listed_and_deletable",
|
| 256 |
+
"eval.tests.test_lcs_claim_validation.TestDefaultSignatureClaimValidation.test_default_hs_expired_exp_is_401",
|
| 257 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsMutationNotClobbered.test_twin_claims_distinct_tokens_but_shared_structure",
|
| 258 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsRoundTrip.test_rich_claims_embedded_in_jwt_payload",
|
| 259 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsRoundTrip.test_rich_claims_listed_in_get_all",
|
| 260 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsRoundTrip.test_rich_claims_preserved_through_get",
|
| 261 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsRoundTrip.test_rich_headers_preserved_through_get",
|
| 262 |
+
"eval.tests.test_lcs_claims_roundtrip.TestClaimsRoundTrip.test_rich_license_still_verifies",
|
| 263 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestDedupReleaseOnDelete.test_dedup_error_reports_existing_license_hex_id",
|
| 264 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestDedupReleaseOnDelete.test_dedup_prevents_recreate_without_delete",
|
| 265 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestDedupReleaseOnDelete.test_recreate_identical_license_after_delete",
|
| 266 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestDedupReleaseOnDelete.test_rsa_recreate_after_delete",
|
| 267 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestInterleavedLifecycleChain.test_claim_variation_keeps_tokens_distinct_throughout",
|
| 268 |
+
"eval.tests.test_lcs_dedup_lifecycle.TestInterleavedLifecycleChain.test_full_single_license_lifecycle_chain",
|
| 269 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSA.test_default_rsa_generate_and_verify[RS256]",
|
| 270 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSA.test_default_rsa_generate_and_verify[RS384]",
|
| 271 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSA.test_default_rsa_generate_and_verify[RS512]",
|
| 272 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSA.test_default_rsa_header_alg_preserved_exactly",
|
| 273 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSACycle.test_default_rsa_license_survives_get_roundtrip",
|
| 274 |
+
"eval.tests.test_lcs_default_signature.TestDefaultSignatureRSACycle.test_default_rsa_state_cycle",
|
| 275 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateAlgEdges.test_empty_string_alg_defaults_to_hs256",
|
| 276 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateAlgEdges.test_explicit_hs256_with_extra_header_fields",
|
| 277 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateDefaultApp.test_default_app_tokens_use_distinct_claims_distinct_tokens",
|
| 278 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateHeaderAbsence.test_generate_claims_only_with_nil_headers_token_signed",
|
| 279 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateHeaderAbsence.test_generate_no_headers_verify_response_shape",
|
| 280 |
+
"eval.tests.test_lcs_generate_edges.TestGenerateHeaderAbsence.test_generate_without_headers_field_uses_default",
|
| 281 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_app_lookup_is_exact_and_sensitive[ hs-app-leadspace-app]",
|
| 282 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_app_lookup_is_exact_and_sensitive[HS-APP-upper-app]",
|
| 283 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_app_lookup_is_exact_and_sensitive[hs-app -space-app]",
|
| 284 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_app_lookup_is_exact_and_sensitive[hs-app.app-cadence-app]",
|
| 285 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_app_lookup_is_exact_and_sensitive[hs_app-underscore-app]",
|
| 286 |
+
"eval.tests.test_lcs_input_coercion.TestAppKeySensitivity.test_exact_app_name_succeeds_even_with_bad_alg",
|
| 287 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_boolean_active_true_contrast",
|
| 288 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_inactive_coerced_license_can_be_activated",
|
| 289 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_non_boolean_active_coerces_to_inactive[0-act-numzero]",
|
| 290 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_non_boolean_active_coerces_to_inactive[1-act-numone]",
|
| 291 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_non_boolean_active_coerces_to_inactive[false-act-strfalse]",
|
| 292 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_non_boolean_active_coerces_to_inactive[true-act-strtrue]",
|
| 293 |
+
"eval.tests.test_lcs_input_coercion.TestNonBooleanActiveCoercion.test_non_boolean_active_coerces_to_inactive[yes-act-stryes]",
|
| 294 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_empty_claims_object_yields_empty_payload_not_null",
|
| 295 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_non_object_claims_yield_null_jwt_payload[3.5-flt-4]",
|
| 296 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_non_object_claims_yield_null_jwt_payload[42-int-3]",
|
| 297 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_non_object_claims_yield_null_jwt_payload[True-bool-5]",
|
| 298 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_non_object_claims_yield_null_jwt_payload[claims_value0-arr-1]",
|
| 299 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_non_object_claims_yield_null_jwt_payload[plain-string-str-2]",
|
| 300 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectClaims.test_null_claims_yield_null_payload_and_verify",
|
| 301 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectHeaders.test_non_object_headers_default_to_hs256[7]",
|
| 302 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectHeaders.test_non_object_headers_default_to_hs256[header-string]",
|
| 303 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectHeaders.test_non_object_headers_default_to_hs256[headers_value0]",
|
| 304 |
+
"eval.tests.test_lcs_malformed_fields.TestNonObjectHeaders.test_null_headers_default_to_hs256",
|
| 305 |
+
"eval.tests.test_lcs_malformed_fields.TestValidationShape.test_generate_disallows_unknown_app_after_none_failure",
|
| 306 |
+
"eval.tests.test_lcs_signing_panics.test_alg_header_non_string_panics_and_server_survives",
|
| 307 |
+
"eval.tests.test_lcs_signing_panics.test_alg_header_null_panics_and_server_survives",
|
| 308 |
+
"eval.tests.test_lcs_signing_panics.test_app_header_non_string_panics_and_server_survives",
|
| 309 |
+
"eval.tests.test_lcs_signing_panics.test_unknown_alg_panics_and_server_survives",
|
| 310 |
+
"eval.tests.test_lcs_state.TestVerifyInactiveFromBirth.test_inactive_from_birth_headers_and_claims_retainable",
|
| 311 |
+
"eval.tests.test_lcs_state.TestVerifyInactiveFromBirth.test_inactive_from_birth_returns_false",
|
| 312 |
+
"eval.tests.test_lcs_state.TestVerifyInactiveFromBirth.test_inactive_from_birth_then_activate_becomes_valid",
|
| 313 |
+
"eval.tests.test_lcs_state.TestVerifyInputClasses.test_query_parameter_token_equals_form_token",
|
| 314 |
+
"eval.tests.test_lcs_state.TestVerifyInputClasses.test_verify_extra_form_fields_are_ignored",
|
| 315 |
+
"eval.tests.test_lcs_state.TestVerifyInputClasses.test_verify_same_token_twice_is_stable",
|
| 316 |
+
"eval.tests.test_lcs_state.TestVerifyRsaState.test_rsa_full_cycle_with_query_verify",
|
| 317 |
+
"eval.tests.test_lcs_state.TestVerifyRsaState.test_rsa_inactive_from_birth_returns_false",
|
| 318 |
+
"eval.tests.test_lcs_state.TestVerifyRsaState.test_rsa_reactivate_after_inactivating_existing_active",
|
| 319 |
+
"eval.tests.test_lcs_unusual_algs.TestNamedAppOverridesInvalidAlg.test_none_alg_with_named_rsa_app_succeeds",
|
| 320 |
+
"eval.tests.test_lcs_unusual_algs.TestSigningMethodNone.test_none_alg_default_path_is_rejected",
|
| 321 |
+
"eval.tests.test_lcs_unusual_algs.TestSigningMethodNone.test_none_alg_error_rejects_repeated_identical_generation",
|
| 322 |
+
"eval.tests.test_lcs_unusual_algs.TestSigningMethodNone.test_none_alg_failure_leaves_server_functional",
|
| 323 |
+
"eval.tests.test_lcs_unusual_algs.TestSigningMethodNone.test_none_error_responses_are_consistent_json",
|
| 324 |
+
"eval.tests.test_lifecycle.TestLifecycleErrors.test_activate_bad_id_format",
|
| 325 |
+
"eval.tests.test_lifecycle.TestLifecycleErrors.test_activate_unknown_id",
|
| 326 |
+
"eval.tests.test_lifecycle.TestLifecycleErrors.test_inactivate_bad_id_format",
|
| 327 |
+
"eval.tests.test_lifecycle.TestLifecycleErrors.test_inactivate_unknown_id",
|
| 328 |
+
"eval.tests.test_lifecycle.TestLifecycleErrors.test_lifecycle_on_deleted_license",
|
| 329 |
+
"eval.tests.test_lifecycle.TestLifecycleTransitions.test_active_then_inactivate_then_never_valid",
|
| 330 |
+
"eval.tests.test_lifecycle.TestLifecycleTransitions.test_inactive_license_can_be_reactivated_via_activate",
|
| 331 |
+
"eval.tests.test_lifecycle.TestLifecycleTransitions.test_reactivate_restores_validity",
|
| 332 |
+
"eval.tests.test_server_startup.test_config_with_empty_mongo_url_fails_fast",
|
| 333 |
+
"eval.tests.test_server_startup.test_invalid_json_config_logs_and_fails",
|
| 334 |
+
"eval.tests.test_server_startup.test_missing_config_fails_fast",
|
| 335 |
+
"eval.tests.test_verify.TestVerifyAuthBoundary.test_verify_public_no_auth",
|
| 336 |
+
"eval.tests.test_verify.TestVerifyInactive.test_verify_inactive_returns_false",
|
| 337 |
+
"eval.tests.test_verify.TestVerifyUnknown.test_verify_garbage_token_not_found",
|
| 338 |
+
"eval.tests.test_verify.TestVerifyUnknown.test_verify_tampered_stored_token_not_found",
|
| 339 |
+
"eval.tests.test_verify.TestVerifyUnknown.test_verify_unknown_token_not_found",
|
| 340 |
+
"eval.tests.test_verify.TestVerifyUnknown.test_verify_without_token_param",
|
| 341 |
+
"eval.tests.test_verify.TestVerifyValid.test_verify_active_default_license",
|
| 342 |
+
"eval.tests.test_verify.TestVerifyValid.test_verify_active_hs_app_license",
|
| 343 |
+
"eval.tests.test_verify.TestVerifyValid.test_verify_active_rsa_license",
|
| 344 |
+
"eval.tests.test_verify.TestVerifyValid.test_verify_returns_explicit_false_key"
|
| 345 |
+
]
|
| 346 |
+
},
|
| 347 |
+
"generated_module_04": {
|
| 348 |
+
"ignore_reason": "",
|
| 349 |
+
"ignored": false,
|
| 350 |
+
"ignored_tests": [],
|
| 351 |
+
"tests": [
|
| 352 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_activate_already_active_reports_error",
|
| 353 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_activation_is_scoped_to_the_named_license",
|
| 354 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_activation_option_stated_in_route_is_respected",
|
| 355 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_inactivate_already_inactive_reports_error",
|
| 356 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_inactivate_then_activate_roundtrip",
|
| 357 |
+
"eval.tests.test_storage_activation.TestActivationTransitions.test_inactive_license_stays_inactive_until_activated",
|
| 358 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_app_configured_alg_overrides_client_alg",
|
| 359 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_defaults_to_hs256_when_alg_omitted",
|
| 360 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_inactive_license",
|
| 361 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_returns_id_and_token",
|
| 362 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_hmac_alg[HS256]",
|
| 363 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_hmac_alg[HS384]",
|
| 364 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_hmac_alg[HS512]",
|
| 365 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_rsa_alg[RS256]",
|
| 366 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_rsa_alg[RS384]",
|
| 367 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generate_with_each_rsa_alg[RS512]",
|
| 368 |
+
"eval.tests.test_storage_crud.TestCreateLicense.test_generated_license_is_persisted",
|
| 369 |
+
"eval.tests.test_storage_crud.TestDelete.test_delete_existing_license",
|
| 370 |
+
"eval.tests.test_storage_crud.TestDelete.test_delete_removes_only_target",
|
| 371 |
+
"eval.tests.test_storage_crud.TestDelete.test_delete_then_recreate_same_license",
|
| 372 |
+
"eval.tests.test_storage_crud.TestGetAll.test_get_all_empty_database",
|
| 373 |
+
"eval.tests.test_storage_crud.TestGetAll.test_get_all_multiple_licenses",
|
| 374 |
+
"eval.tests.test_storage_crud.TestGetAll.test_get_all_order_is_stable_after_fluent_writes",
|
| 375 |
+
"eval.tests.test_storage_crud.TestGetAll.test_get_all_single_license",
|
| 376 |
+
"eval.tests.test_storage_crud.TestGetByID.test_get_by_id_is_isolated_per_record",
|
| 377 |
+
"eval.tests.test_storage_crud.TestGetByID.test_get_by_id_roundtrip_fields",
|
| 378 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_distinct_subject_is_not_duplicate",
|
| 379 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_duplicate_check_per_app_is_global",
|
| 380 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_hash_collision_across_algorithms_does_not_dedupe",
|
| 381 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_identical_request_is_duplicate",
|
| 382 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_same_hash_but_distinct_id_reports_existing_id",
|
| 383 |
+
"eval.tests.test_storage_duplicate.TestDuplicateDetection.test_timestamped_claim_yields_distinct_license",
|
| 384 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_active_field_omitted_defaults_to_inactive",
|
| 385 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_delete_zero_value_license",
|
| 386 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_empty_claims_is_distinct_from_null_claims",
|
| 387 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_empty_object_stores_zero_value_license",
|
| 388 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_parse_empty_body_collides_with_empty_object[[]]",
|
| 389 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_parse_empty_body_collides_with_empty_object[]",
|
| 390 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_parse_empty_body_collides_with_empty_object[null]",
|
| 391 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_parse_empty_body_collides_with_empty_object[{bad json]",
|
| 392 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_zero_value_license_can_be_activated_afterwards",
|
| 393 |
+
"eval.tests.test_storage_edgecases.TestDegenerateBodies.test_zero_value_license_token_verifies_as_inactive",
|
| 394 |
+
"eval.tests.test_storage_edgecases.TestIdentityHash.test_active_flag_is_not_part_of_identity",
|
| 395 |
+
"eval.tests.test_storage_edgecases.TestIdentityHash.test_activeness_changes_via_routes_not_via_recreation",
|
| 396 |
+
"eval.tests.test_storage_edgecases.TestPingRoute.test_ping_requires_no_authorization",
|
| 397 |
+
"eval.tests.test_storage_edgecases.TestPingRoute.test_ping_returns_200_with_empty_body",
|
| 398 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_activate_requires_auth",
|
| 399 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_correct_secret_accepted",
|
| 400 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_delete_requires_auth",
|
| 401 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_generate_requires_auth",
|
| 402 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_get_all_requires_auth",
|
| 403 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_get_by_id_requires_auth",
|
| 404 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_verify_and_ping_are_unauthenticated",
|
| 405 |
+
"eval.tests.test_storage_errors.TestAuthGate.test_wrong_secret_rejected",
|
| 406 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_activate_rejects_malformed_hex[!!]",
|
| 407 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_activate_rejects_malformed_hex[garbage]",
|
| 408 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_activate_rejects_malformed_hex[zzz]",
|
| 409 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_delete_rejects_malformed_hex[bad]",
|
| 410 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_delete_rejects_malformed_hex[zzz]",
|
| 411 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_get_by_id_empty_id_is_not_routed",
|
| 412 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_get_by_id_rejects_malformed_hex[123]",
|
| 413 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_get_by_id_rejects_malformed_hex[nothex]",
|
| 414 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_get_by_id_rejects_malformed_hex[zzz]",
|
| 415 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_get_by_id_rejects_malformed_hex[zzzzzzzzzzzzzzzzzzzzzzzz]",
|
| 416 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_inactivate_rejects_malformed_hex[nope!!]",
|
| 417 |
+
"eval.tests.test_storage_errors.TestInvalidObjectID.test_inactivate_rejects_malformed_hex[zzz]",
|
| 418 |
+
"eval.tests.test_storage_errors.TestNonexistentRecord.test_activate_nonexistent",
|
| 419 |
+
"eval.tests.test_storage_errors.TestNonexistentRecord.test_delete_nonexistent",
|
| 420 |
+
"eval.tests.test_storage_errors.TestNonexistentRecord.test_get_by_id_for_another_servers_license_is_absent",
|
| 421 |
+
"eval.tests.test_storage_errors.TestNonexistentRecord.test_get_by_id_nonexistent",
|
| 422 |
+
"eval.tests.test_storage_errors.TestNonexistentRecord.test_inactivate_nonexistent",
|
| 423 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_headers_with_extra_fields_preserved",
|
| 424 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_minimal_body_headers_null",
|
| 425 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_multiple_licenses_per_app",
|
| 426 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_rich_claims_roundtrip",
|
| 427 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_unknown_app_is_rejected",
|
| 428 |
+
"eval.tests.test_storage_generation.TestGenerationInputShapes.test_unusable_alg_fails_generation[none-'none' signature type is not allowed]",
|
| 429 |
+
"eval.tests.test_storage_http_rsa_verify.TestRecreateVerifyChain.test_recreate_keeps_deterministic_token_and_reallocates_id",
|
| 430 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_delete_on_activate_route_405",
|
| 431 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_delete_on_list_route_405",
|
| 432 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_extra_path_segment_after_id_404",
|
| 433 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_get_and_post_coexist_on_collection_path",
|
| 434 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_get_on_activate_route_405",
|
| 435 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_get_on_get_single_route_ok",
|
| 436 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_get_on_ping_route_405",
|
| 437 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_get_on_verify_route_405",
|
| 438 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_put_on_create_route_405",
|
| 439 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_put_on_delete_route_405",
|
| 440 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_unknown_admin_route_404",
|
| 441 |
+
"eval.tests.test_storage_http_rsa_verify.TestRouterMethodBoundaries.test_unknown_root_route_404",
|
| 442 |
+
"eval.tests.test_storage_http_rsa_verify.TestRsaVerify.test_rsa_and_hmac_same_claims_do_not_collide",
|
| 443 |
+
"eval.tests.test_storage_http_rsa_verify.TestRsaVerify.test_verify_rsa_after_delete_not_found",
|
| 444 |
+
"eval.tests.test_storage_http_rsa_verify.TestRsaVerify.test_verify_rsa_inactive_license_is_invalid",
|
| 445 |
+
"eval.tests.test_storage_http_rsa_verify.TestRsaVerify.test_verify_rsa_license_is_valid",
|
| 446 |
+
"eval.tests.test_storage_http_rsa_verify.TestRsaVerify.test_verify_rsa_tampered_token_not_found",
|
| 447 |
+
"eval.tests.test_storage_http_rsa_verify.TestVerifyInputChannels.test_verify_form_encoded_body",
|
| 448 |
+
"eval.tests.test_storage_http_rsa_verify.TestVerifyInputChannels.test_verify_json_body_yields_empty_token",
|
| 449 |
+
"eval.tests.test_storage_http_rsa_verify.TestVerifyInputChannels.test_verify_prefers_form_token_over_query_when_both",
|
| 450 |
+
"eval.tests.test_storage_http_rsa_verify.TestVerifyInputChannels.test_verify_token_as_query_param",
|
| 451 |
+
"eval.tests.test_storage_identity_hex_ops.TestCustomOnlyHeaderDefaults.test_custom_only_header_defaults_hs256_and_preserves_field",
|
| 452 |
+
"eval.tests.test_storage_identity_hex_ops.TestCustomOnlyHeaderDefaults.test_custom_only_header_token_verifies_valid",
|
| 453 |
+
"eval.tests.test_storage_identity_hex_ops.TestDefaultInactivePlusTimeValidity.test_activate_default_inactive_then_verify_future_exp",
|
| 454 |
+
"eval.tests.test_storage_identity_hex_ops.TestDefaultInactivePlusTimeValidity.test_inactivate_reactivate_with_future_exp",
|
| 455 |
+
"eval.tests.test_storage_identity_hex_ops.TestDeleteIdempotency.test_delete_other_record_untouched_by_repeated_delete",
|
| 456 |
+
"eval.tests.test_storage_identity_hex_ops.TestDeleteIdempotency.test_delete_then_verify_and_read_both_absent",
|
| 457 |
+
"eval.tests.test_storage_identity_hex_ops.TestDeleteIdempotency.test_delete_twice_second_is_no_license_error",
|
| 458 |
+
"eval.tests.test_storage_identity_hex_ops.TestMixedTypeClaimsRoundtrip.test_boolean_null_float_claims_roundtrip",
|
| 459 |
+
"eval.tests.test_storage_identity_hex_ops.TestMixedTypeClaimsRoundtrip.test_mixed_types_verify_still_valid",
|
| 460 |
+
"eval.tests.test_storage_identity_hex_ops.TestObjectIDHexCaseInsensitivity.test_get_by_id_mixed_case_hex",
|
| 461 |
+
"eval.tests.test_storage_identity_hex_ops.TestObjectIDHexCaseInsensitivity.test_get_by_id_uppercase_hex",
|
| 462 |
+
"eval.tests.test_storage_identity_hex_ops.TestObjectIDHexCaseInsensitivity.test_upper_case_absent_id_still_not_found",
|
| 463 |
+
"eval.tests.test_storage_identity_hex_ops.TestObjectIDHexCaseInsensitivity.test_upper_hex_activate",
|
| 464 |
+
"eval.tests.test_storage_identity_hex_ops.TestObjectIDHexCaseInsensitivity.test_upper_hex_delete",
|
| 465 |
+
"eval.tests.test_storage_identity_hex_ops.TestRequestFieldOrderIdentityInvariance.test_claim_field_order_does_not_change_identity",
|
| 466 |
+
"eval.tests.test_storage_identity_hex_ops.TestRequestFieldOrderIdentityInvariance.test_field_order_does_not_change_retrieval_or_verify",
|
| 467 |
+
"eval.tests.test_storage_identity_hex_ops.TestRequestFieldOrderIdentityInvariance.test_header_field_order_does_not_change_identity",
|
| 468 |
+
"eval.tests.test_storage_identity_hex_ops.TestRsaActivationStateMachine.test_rsa_activate_gates_verify_like_hmac",
|
| 469 |
+
"eval.tests.test_storage_identity_hex_ops.TestRsaActivationStateMachine.test_rsa_activate_inactivate_roundtrip_guards",
|
| 470 |
+
"eval.tests.test_storage_identity_hex_ops.TestRsaActivationStateMachine.test_rsa_inactive_activate_respects_target",
|
| 471 |
+
"eval.tests.test_storage_identity_hex_ops.TestRsaVerifyQueryParamChannel.test_rsa_verify_tampered_token_via_query_param_not_found",
|
| 472 |
+
"eval.tests.test_storage_identity_hex_ops.TestRsaVerifyQueryParamChannel.test_rsa_verify_via_query_param_valid",
|
| 473 |
+
"eval.tests.test_storage_lifecycle.TestLicenseLifecycle.test_crud_does_not_mutate_claims",
|
| 474 |
+
"eval.tests.test_storage_lifecycle.TestLicenseLifecycle.test_full_lifecycle_roundtrip",
|
| 475 |
+
"eval.tests.test_storage_lifecycle.TestLicenseLifecycle.test_get_all_documents_roundtrip_all_fields",
|
| 476 |
+
"eval.tests.test_storage_lifecycle.TestLicenseLifecycle.test_many_record_scale",
|
| 477 |
+
"eval.tests.test_storage_schema_time_verify.TestCustomJwtHeadersRoundTrip.test_custom_header_is_part_of_token_identity",
|
| 478 |
+
"eval.tests.test_storage_schema_time_verify.TestCustomJwtHeadersRoundTrip.test_kid_and_typ_preserved_in_stored_record_and_token",
|
| 479 |
+
"eval.tests.test_storage_schema_time_verify.TestStoredLicenseJsonSchema.test_get_all_each_item_has_exact_schema",
|
| 480 |
+
"eval.tests.test_storage_schema_time_verify.TestStoredLicenseJsonSchema.test_get_by_id_exact_key_set_no_hash_leak",
|
| 481 |
+
"eval.tests.test_storage_schema_time_verify.TestStoredLicenseJsonSchema.test_get_by_id_schema_holds_for_rsa_record",
|
| 482 |
+
"eval.tests.test_storage_schema_time_verify.TestStoredLicenseJsonSchema.test_get_by_id_schema_holds_for_zero_value_license",
|
| 483 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_expired_token_returns_401",
|
| 484 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_fully_valid_token_with_exp_in_future_is_200",
|
| 485 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_inactive_gate_short_circuits_before_time_check",
|
| 486 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_not_yet_valid_token_returns_401",
|
| 487 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_time_invalid_401_is_distinct_from_not_found_500",
|
| 488 |
+
"eval.tests.test_storage_schema_time_verify.TestVerifyTimeValidityBranches.test_used_before_issued_token_returns_401",
|
| 489 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_active_license",
|
| 490 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_after_deletion_is_not_found",
|
| 491 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_after_inactivation_becomes_invalid",
|
| 492 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_empty_token",
|
| 493 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_garbage_token",
|
| 494 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_inactive_license_is_invalid",
|
| 495 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_tampered_token_not_found",
|
| 496 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_two_tokens_isolate_hashes",
|
| 497 |
+
"eval.tests.test_storage_verify.TestVerifyByToken.test_verify_unknown_token"
|
| 498 |
+
]
|
| 499 |
+
}
|
| 500 |
+
},
|
| 501 |
+
"commit": "b877db6c9d8043d5d8ccda08cb1f6a387ede2011",
|
| 502 |
+
"data_source": "synthetic_programgym",
|
| 503 |
+
"difficulty": "easy",
|
| 504 |
+
"difficulty_score": 1.9547247909790628,
|
| 505 |
+
"eval_clean_hashes": [
|
| 506 |
+
"0066a5b61d1ca0ecf4efd0ed08727ffef12d51daf2d8ae887d500d39d91cf6bd"
|
| 507 |
+
],
|
| 508 |
+
"input_record": {
|
| 509 |
+
"commit": "b877db6c9d8043d5d8ccda08cb1f6a387ede2011",
|
| 510 |
+
"commits": 65,
|
| 511 |
+
"contributors": 2,
|
| 512 |
+
"difficulty": "easy",
|
| 513 |
+
"difficulty_code_lines": 901,
|
| 514 |
+
"difficulty_has_tests": false,
|
| 515 |
+
"difficulty_product_code_lines": 901,
|
| 516 |
+
"difficulty_runtime_deps": 9,
|
| 517 |
+
"difficulty_score": 1.9547247909790628,
|
| 518 |
+
"difficulty_test_code_lines": 676,
|
| 519 |
+
"full_name": "furkansenharputlu/f-license",
|
| 520 |
+
"github_stars": 823,
|
| 521 |
+
"input_joern_zip": "go_joern/furkansenharputlu__f-license.zip",
|
| 522 |
+
"joern_status": true,
|
| 523 |
+
"joern_time": 11.188195175025612,
|
| 524 |
+
"language": "go",
|
| 525 |
+
"pb_match": [
|
| 526 |
+
{
|
| 527 |
+
"pb_fullname": "go-critic/go-critic",
|
| 528 |
+
"rank": 210,
|
| 529 |
+
"similarity": 0.5765098333358765
|
| 530 |
+
},
|
| 531 |
+
{
|
| 532 |
+
"pb_fullname": "mibk/dupl",
|
| 533 |
+
"rank": 120,
|
| 534 |
+
"similarity": 0.5922210216522217
|
| 535 |
+
},
|
| 536 |
+
{
|
| 537 |
+
"pb_fullname": "mgechev/revive",
|
| 538 |
+
"rank": 156,
|
| 539 |
+
"similarity": 0.6000899076461792
|
| 540 |
+
},
|
| 541 |
+
{
|
| 542 |
+
"pb_fullname": "mfridman/tparse",
|
| 543 |
+
"rank": 403,
|
| 544 |
+
"similarity": 0.5361348390579224
|
| 545 |
+
},
|
| 546 |
+
{
|
| 547 |
+
"pb_fullname": "gabotechs/dep-tree",
|
| 548 |
+
"rank": 732,
|
| 549 |
+
"similarity": 0.5047323703765869
|
| 550 |
+
},
|
| 551 |
+
{
|
| 552 |
+
"pb_fullname": "cweill/gotests",
|
| 553 |
+
"rank": 111,
|
| 554 |
+
"similarity": 0.5963588953018188
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"pb_fullname": "FiloSottile/age",
|
| 558 |
+
"rank": 43,
|
| 559 |
+
"similarity": 0.587710976600647
|
| 560 |
+
},
|
| 561 |
+
{
|
| 562 |
+
"pb_fullname": "boyter/scc",
|
| 563 |
+
"rank": 552,
|
| 564 |
+
"similarity": 0.506951093673706
|
| 565 |
+
},
|
| 566 |
+
{
|
| 567 |
+
"pb_fullname": "incu6us/goimports-reviser",
|
| 568 |
+
"rank": 415,
|
| 569 |
+
"similarity": 0.5123375654220581
|
| 570 |
+
},
|
| 571 |
+
{
|
| 572 |
+
"pb_fullname": "kyoh86/richgo",
|
| 573 |
+
"rank": 579,
|
| 574 |
+
"similarity": 0.5157592296600342
|
| 575 |
+
},
|
| 576 |
+
{
|
| 577 |
+
"pb_fullname": "TheZoraiz/ascii-image-converter",
|
| 578 |
+
"rank": 732,
|
| 579 |
+
"similarity": 0.4737927317619324
|
| 580 |
+
},
|
| 581 |
+
{
|
| 582 |
+
"pb_fullname": "hooklift/gowsdl",
|
| 583 |
+
"rank": 325,
|
| 584 |
+
"similarity": 0.5506505966186523
|
| 585 |
+
},
|
| 586 |
+
{
|
| 587 |
+
"pb_fullname": "psampaz/go-mod-outdated",
|
| 588 |
+
"rank": 571,
|
| 589 |
+
"similarity": 0.47886812686920166
|
| 590 |
+
},
|
| 591 |
+
{
|
| 592 |
+
"pb_fullname": "kisielk/errcheck",
|
| 593 |
+
"rank": 297,
|
| 594 |
+
"similarity": 0.5784422159194946
|
| 595 |
+
},
|
| 596 |
+
{
|
| 597 |
+
"pb_fullname": "tomarrell/wrapcheck",
|
| 598 |
+
"rank": 816,
|
| 599 |
+
"similarity": 0.49327823519706726
|
| 600 |
+
}
|
| 601 |
+
],
|
| 602 |
+
"repo_age": 6.69,
|
| 603 |
+
"repo_path": "go/furkansenharputlu__f-license",
|
| 604 |
+
"source": "commit:b877db6c9d8043d5d8ccda08cb1f6a387ede2011",
|
| 605 |
+
"status": "done",
|
| 606 |
+
"url": "https://github.com/furkansenharputlu/f-license"
|
| 607 |
+
},
|
| 608 |
+
"instance_id": "furkansenharputlu__f-license.b877db6",
|
| 609 |
+
"language": "go",
|
| 610 |
+
"module_iterations": [
|
| 611 |
+
{
|
| 612 |
+
"actual_iterations": 2,
|
| 613 |
+
"branch_name": "generated_module_01",
|
| 614 |
+
"iteration_limit": 5,
|
| 615 |
+
"module_index": 1,
|
| 616 |
+
"module_kind": "source",
|
| 617 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 618 |
+
},
|
| 619 |
+
{
|
| 620 |
+
"actual_iterations": 3,
|
| 621 |
+
"branch_name": "generated_module_02",
|
| 622 |
+
"iteration_limit": 5,
|
| 623 |
+
"module_index": 2,
|
| 624 |
+
"module_kind": "source",
|
| 625 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 626 |
+
},
|
| 627 |
+
{
|
| 628 |
+
"actual_iterations": 5,
|
| 629 |
+
"branch_name": "generated_module_03",
|
| 630 |
+
"iteration_limit": 5,
|
| 631 |
+
"module_index": 3,
|
| 632 |
+
"module_kind": "source",
|
| 633 |
+
"termination_reason": "max_iterations"
|
| 634 |
+
},
|
| 635 |
+
{
|
| 636 |
+
"actual_iterations": 5,
|
| 637 |
+
"branch_name": "generated_module_04",
|
| 638 |
+
"iteration_limit": 5,
|
| 639 |
+
"module_index": 4,
|
| 640 |
+
"module_kind": "source",
|
| 641 |
+
"termination_reason": "max_iterations"
|
| 642 |
+
}
|
| 643 |
+
],
|
| 644 |
+
"repository": "furkansenharputlu/f-license"
|
| 645 |
+
}
|
furkansenharputlu--f-license.b87/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
|
furkansenharputlu--f-license.b87/tests/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f91d1a7e2d55d2fe3515a3010b4499f51eb1227556374e6a153593e6625a0b7
|
| 3 |
+
size 5342
|
future-architect--tftarget.fc1f6/environment/Dockerfile
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
RUN ["bash","-lc","set -euo pipefail; cd /workspace; set -a; source /workspace/download.sh; set +a; python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh\nimport os\nimport re\nimport shlex\nignored = {\"OLDPWD\", \"PWD\", \"SHLVL\", \"_\"}\nvalid_name = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\nfor key in sorted(os.environ):\n if key in ignored or key.startswith(\"BASH_FUNC_\") or not valid_name.fullmatch(key):\n continue\n value = os.environ[key]\n if \"\\n\" in value:\n continue\n print(f\"export {key}={shlex.quote(value)}\")\nPY\n"]
|
| 45 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 46 |
+
RUN chmod 111 /workspace/executable
|
| 47 |
+
WORKDIR /workspace
|
| 48 |
+
# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
|
| 49 |
+
# Keep tool/runtime state under /home/agent and reserve /workspace for the
|
| 50 |
+
# submission handed to the separate verifier. Keep the reference executable
|
| 51 |
+
# execute-only; the oracle temporarily restores owner read permission.
|
| 52 |
+
RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
|
| 53 |
+
RUN mkdir -p /home/agent \
|
| 54 |
+
&& chown -R agent:agent /home/agent /workspace \
|
| 55 |
+
&& chown agent:agent /workspace/executable \
|
| 56 |
+
&& chmod 111 /workspace/executable
|
| 57 |
+
ENV HOME=/home/agent
|
| 58 |
+
WORKDIR /workspace
|
future-architect--tftarget.fc1f6/environment/download.sh
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
|
| 3 |
+
# Generated deterministically from repository module metadata; do not edit.
|
| 4 |
+
set -u
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 7 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
|
| 8 |
+
module github.com/future-architect/tftarget
|
| 9 |
+
|
| 10 |
+
go 1.20
|
| 11 |
+
|
| 12 |
+
require (
|
| 13 |
+
github.com/briandowns/spinner v1.23.0
|
| 14 |
+
github.com/google/go-cmp v0.5.9
|
| 15 |
+
github.com/gookit/color v1.5.3
|
| 16 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c
|
| 17 |
+
github.com/spf13/cobra v1.6.1
|
| 18 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
require (
|
| 22 |
+
github.com/fatih/color v1.7.0 // indirect
|
| 23 |
+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
| 24 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
| 25 |
+
github.com/mattn/go-colorable v0.1.2 // indirect
|
| 26 |
+
github.com/mattn/go-isatty v0.0.8 // indirect
|
| 27 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
| 28 |
+
github.com/spf13/pflag v1.0.5 // indirect
|
| 29 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
| 30 |
+
golang.org/x/sys v0.6.0 // indirect
|
| 31 |
+
golang.org/x/term v0.1.0 // indirect
|
| 32 |
+
golang.org/x/text v0.4.0 // indirect
|
| 33 |
+
)
|
| 34 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 35 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 36 |
+
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
|
| 37 |
+
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
|
| 38 |
+
github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A=
|
| 39 |
+
github.com/briandowns/spinner v1.23.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE=
|
| 40 |
+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
| 41 |
+
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
|
| 42 |
+
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
| 43 |
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 44 |
+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
| 45 |
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 46 |
+
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
| 47 |
+
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
| 48 |
+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
| 49 |
+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
| 50 |
+
github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE=
|
| 51 |
+
github.com/gookit/color v1.5.3/go.mod h1:NUzwzeehUfl7GIb36pqId+UGmRfQcU/WiiyTTeNjHtE=
|
| 52 |
+
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
|
| 53 |
+
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
|
| 54 |
+
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
|
| 55 |
+
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
| 56 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
| 57 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
| 58 |
+
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
|
| 59 |
+
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
| 60 |
+
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
|
| 61 |
+
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
| 62 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
|
| 63 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
| 64 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c h1:7DqCsnPn5K93iFCqLftLnHanJ0nubZwot1yqA/V5SCw=
|
| 65 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c/go.mod h1:QxH6cuRyrQKq/DMgmVAqatVsblDHbeztmBnIRgn9t/c=
|
| 66 |
+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
| 67 |
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
| 68 |
+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
| 69 |
+
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
| 70 |
+
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
|
| 71 |
+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
| 72 |
+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
| 73 |
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
| 74 |
+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
| 75 |
+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
| 76 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
| 77 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
| 78 |
+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
| 79 |
+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
| 80 |
+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
| 81 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
|
| 82 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
| 83 |
+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
| 84 |
+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
| 85 |
+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
| 86 |
+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
| 87 |
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 88 |
+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 89 |
+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 90 |
+
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 91 |
+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 92 |
+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 93 |
+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 94 |
+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 95 |
+
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
| 96 |
+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 97 |
+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
| 98 |
+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 99 |
+
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
|
| 100 |
+
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 101 |
+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
| 102 |
+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
| 103 |
+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
| 104 |
+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
| 105 |
+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
| 106 |
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 107 |
+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
| 108 |
+
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
| 109 |
+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
| 110 |
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
| 111 |
+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
| 112 |
+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
| 113 |
+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
| 114 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 115 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 116 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 117 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 118 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 119 |
+
return 1
|
| 120 |
+
else
|
| 121 |
+
exit 1
|
| 122 |
+
fi
|
| 123 |
+
fi
|
| 124 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 125 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 126 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 127 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 128 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 129 |
+
else
|
| 130 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 131 |
+
fi
|
| 132 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 133 |
+
export GOTOOLCHAIN=local
|
| 134 |
+
if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
|
| 135 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 136 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 137 |
+
return 1
|
| 138 |
+
else
|
| 139 |
+
exit 1
|
| 140 |
+
fi
|
| 141 |
+
fi
|
future-architect--tftarget.fc1f6/environment/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b66e3c21efe3bc245b2a5a586fc9cf72b007146d17d045e3d21e6d90acd3f6a1
|
| 3 |
+
size 6761602
|
future-architect--tftarget.fc1f6/environment/programgym-go.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
|
| 3 |
+
size 59908810
|
future-architect--tftarget.fc1f6/environment/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59d69efa7177f3ad7ea38b042a2eb08ab2f8463393dfd7dd2184de2f5b008540
|
| 3 |
+
size 194564
|
future-architect--tftarget.fc1f6/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
|
future-architect--tftarget.fc1f6/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
|
future-architect--tftarget.fc1f6/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/future-architect--tftarget.fc1f6"
|
| 25 |
+
description = "Synthetic ProgramGym cleanroom reconstruction task for future-architect/tftarget"
|
| 26 |
+
authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
|
| 27 |
+
keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
|
| 28 |
+
|
| 29 |
+
[metadata]
|
| 30 |
+
source = "ProgramGym"
|
| 31 |
+
instance_id = "future-architect__tftarget.fc1f6fb"
|
| 32 |
+
repository = "future-architect/tftarget"
|
| 33 |
+
commit = "fc1f6fbbda8bf33689e3886ab26d688762e6c7c8"
|
| 34 |
+
language = "go"
|
| 35 |
+
difficulty = "easy"
|
| 36 |
+
difficulty_score = 1.9679222067305173
|
| 37 |
+
test_branches = 4
|
| 38 |
+
test_count = 349
|
| 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"
|
future-architect--tftarget.fc1f6/tests/Dockerfile
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
RUN ["bash","-lc","set -euo pipefail; cd /workspace; set -a; source /workspace/download.sh; set +a; python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh\nimport os\nimport re\nimport shlex\nignored = {\"OLDPWD\", \"PWD\", \"SHLVL\", \"_\"}\nvalid_name = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\nfor key in sorted(os.environ):\n if key in ignored or key.startswith(\"BASH_FUNC_\") or not valid_name.fullmatch(key):\n continue\n value = os.environ[key]\n if \"\\n\" in value:\n continue\n print(f\"export {key}={shlex.quote(value)}\")\nPY\n"]
|
| 45 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 46 |
+
RUN chmod 111 /workspace/executable
|
| 47 |
+
WORKDIR /workspace
|
| 48 |
+
# Harbor uses tests/ as the separate verifier build context. Start with the
|
| 49 |
+
# same toolchain as the agent, then remove every cleanroom workspace artifact.
|
| 50 |
+
RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
|
| 51 |
+
&& mkdir -p /workspace /tests
|
| 52 |
+
|
| 53 |
+
# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
|
| 54 |
+
# Installing a newer pytest alone leaves that apt package importable and creates
|
| 55 |
+
# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
|
| 56 |
+
# Install and constrain the verifier test runner as one coherent pip toolchain.
|
| 57 |
+
RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
|
| 58 |
+
ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
|
| 59 |
+
RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
|
| 60 |
+
'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
|
| 61 |
+
|
| 62 |
+
COPY test.sh /tests/test.sh
|
| 63 |
+
COPY programgym_evaluator.py /tests/programgym_evaluator.py
|
| 64 |
+
COPY programgym_task.json /tests/programgym_task.json
|
| 65 |
+
COPY blobs/ /tests/blobs/
|
| 66 |
+
RUN chmod +x /tests/test.sh
|
future-architect--tftarget.fc1f6/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:76619f392c77aadeacdcb77f8ce7c74041d98fc3b0283217181ee60d4aa71acb
|
| 3 |
+
size 12087
|
future-architect--tftarget.fc1f6/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:9c8232a69cd6ffd4288c2f0cfc02d203055bf07d05ecd4b8112bff9790e0dd7c
|
| 3 |
+
size 12445
|
future-architect--tftarget.fc1f6/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:993cdc417487ed335f32d4b495cccc4e5d017a9c7075fa898fdee0d9671235b0
|
| 3 |
+
size 12428
|
future-architect--tftarget.fc1f6/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:c890d3ad0e9e8033d301667060ceec3e0ac78030a41c77dc63ba31d2d61280e2
|
| 3 |
+
size 12793
|
future-architect--tftarget.fc1f6/tests/download.sh
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
|
| 3 |
+
# Generated deterministically from repository module metadata; do not edit.
|
| 4 |
+
set -u
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 7 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
|
| 8 |
+
module github.com/future-architect/tftarget
|
| 9 |
+
|
| 10 |
+
go 1.20
|
| 11 |
+
|
| 12 |
+
require (
|
| 13 |
+
github.com/briandowns/spinner v1.23.0
|
| 14 |
+
github.com/google/go-cmp v0.5.9
|
| 15 |
+
github.com/gookit/color v1.5.3
|
| 16 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c
|
| 17 |
+
github.com/spf13/cobra v1.6.1
|
| 18 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
require (
|
| 22 |
+
github.com/fatih/color v1.7.0 // indirect
|
| 23 |
+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
| 24 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
| 25 |
+
github.com/mattn/go-colorable v0.1.2 // indirect
|
| 26 |
+
github.com/mattn/go-isatty v0.0.8 // indirect
|
| 27 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
| 28 |
+
github.com/spf13/pflag v1.0.5 // indirect
|
| 29 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
| 30 |
+
golang.org/x/sys v0.6.0 // indirect
|
| 31 |
+
golang.org/x/term v0.1.0 // indirect
|
| 32 |
+
golang.org/x/text v0.4.0 // indirect
|
| 33 |
+
)
|
| 34 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 35 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 36 |
+
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
|
| 37 |
+
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
|
| 38 |
+
github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A=
|
| 39 |
+
github.com/briandowns/spinner v1.23.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE=
|
| 40 |
+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
| 41 |
+
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
|
| 42 |
+
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
| 43 |
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 44 |
+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
| 45 |
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 46 |
+
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
| 47 |
+
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
| 48 |
+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
| 49 |
+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
| 50 |
+
github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE=
|
| 51 |
+
github.com/gookit/color v1.5.3/go.mod h1:NUzwzeehUfl7GIb36pqId+UGmRfQcU/WiiyTTeNjHtE=
|
| 52 |
+
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
|
| 53 |
+
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
|
| 54 |
+
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
|
| 55 |
+
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
| 56 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
| 57 |
+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
| 58 |
+
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
|
| 59 |
+
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
| 60 |
+
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
|
| 61 |
+
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
| 62 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
|
| 63 |
+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
| 64 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c h1:7DqCsnPn5K93iFCqLftLnHanJ0nubZwot1yqA/V5SCw=
|
| 65 |
+
github.com/orangekame3/survey v0.0.0-20230324163402-97bfc394a01c/go.mod h1:QxH6cuRyrQKq/DMgmVAqatVsblDHbeztmBnIRgn9t/c=
|
| 66 |
+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
| 67 |
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
| 68 |
+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
| 69 |
+
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
| 70 |
+
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
|
| 71 |
+
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
| 72 |
+
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
| 73 |
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
| 74 |
+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
| 75 |
+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
| 76 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
| 77 |
+
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
| 78 |
+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
| 79 |
+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
| 80 |
+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
| 81 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
|
| 82 |
+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
| 83 |
+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
| 84 |
+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
| 85 |
+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
| 86 |
+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
| 87 |
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 88 |
+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 89 |
+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 90 |
+
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 91 |
+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 92 |
+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 93 |
+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 94 |
+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 95 |
+
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
| 96 |
+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 97 |
+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
| 98 |
+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 99 |
+
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
|
| 100 |
+
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 101 |
+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
| 102 |
+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
| 103 |
+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
| 104 |
+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
| 105 |
+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
| 106 |
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 107 |
+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
| 108 |
+
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
| 109 |
+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
| 110 |
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
| 111 |
+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
| 112 |
+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
| 113 |
+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
| 114 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 115 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 116 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 117 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 118 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 119 |
+
return 1
|
| 120 |
+
else
|
| 121 |
+
exit 1
|
| 122 |
+
fi
|
| 123 |
+
fi
|
| 124 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 125 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 126 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 127 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 128 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 129 |
+
else
|
| 130 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 131 |
+
fi
|
| 132 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 133 |
+
export GOTOOLCHAIN=local
|
| 134 |
+
if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
|
| 135 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 136 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 137 |
+
return 1
|
| 138 |
+
else
|
| 139 |
+
exit 1
|
| 140 |
+
fi
|
| 141 |
+
fi
|
future-architect--tftarget.fc1f6/tests/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b66e3c21efe3bc245b2a5a586fc9cf72b007146d17d045e3d21e6d90acd3f6a1
|
| 3 |
+
size 6761602
|
future-architect--tftarget.fc1f6/tests/programgym-go.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
|
| 3 |
+
size 59908810
|
future-architect--tftarget.fc1f6/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()
|
future-architect--tftarget.fc1f6/tests/programgym_task.json
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"branches": {
|
| 3 |
+
"generated_module_01": {
|
| 4 |
+
"ignore_reason": "",
|
| 5 |
+
"ignored": false,
|
| 6 |
+
"ignored_tests": [],
|
| 7 |
+
"tests": [
|
| 8 |
+
"eval.tests.test_completion.test_completion_bash_no_descriptions_flag",
|
| 9 |
+
"eval.tests.test_completion.test_completion_bash_uses_v2_stub",
|
| 10 |
+
"eval.tests.test_completion.test_completion_generates_script_for_shell[bash]",
|
| 11 |
+
"eval.tests.test_completion.test_completion_generates_script_for_shell[fish]",
|
| 12 |
+
"eval.tests.test_completion.test_completion_generates_script_for_shell[powershell]",
|
| 13 |
+
"eval.tests.test_completion.test_completion_generates_script_for_shell[zsh]",
|
| 14 |
+
"eval.tests.test_completion.test_completion_help_lists_shells[bash]",
|
| 15 |
+
"eval.tests.test_completion.test_completion_help_lists_shells[fish]",
|
| 16 |
+
"eval.tests.test_completion.test_completion_help_lists_shells[zsh]",
|
| 17 |
+
"eval.tests.test_completion.test_completion_unknown_shell_shows_usage",
|
| 18 |
+
"eval.tests.test_completion.test_completion_zsh_is_compdef",
|
| 19 |
+
"eval.tests.test_completion.test_completion_zsh_no_descriptions_flag",
|
| 20 |
+
"eval.tests.test_errors_behavior.test_apply_argv_is_plain_then_confirm_needs_stdin",
|
| 21 |
+
"eval.tests.test_errors_behavior.test_destroy_argv_passes_destroy_option",
|
| 22 |
+
"eval.tests.test_errors_behavior.test_empty_filter_is_accepted_as_no_filter",
|
| 23 |
+
"eval.tests.test_errors_behavior.test_executable_error_propagates[apply]",
|
| 24 |
+
"eval.tests.test_errors_behavior.test_executable_error_propagates[destroy]",
|
| 25 |
+
"eval.tests.test_errors_behavior.test_executable_error_propagates[plan]",
|
| 26 |
+
"eval.tests.test_errors_behavior.test_invalid_filter_value_is_rejected",
|
| 27 |
+
"eval.tests.test_errors_behavior.test_invalid_filter_values_are_rejected[boom]",
|
| 28 |
+
"eval.tests.test_errors_behavior.test_invalid_filter_values_are_rejected[create ]",
|
| 29 |
+
"eval.tests.test_errors_behavior.test_invalid_filter_values_are_rejected[will be created]",
|
| 30 |
+
"eval.tests.test_errors_behavior.test_not_found_path_when_no_resources[apply]",
|
| 31 |
+
"eval.tests.test_errors_behavior.test_not_found_path_when_no_resources[destroy]",
|
| 32 |
+
"eval.tests.test_errors_behavior.test_not_found_path_when_no_resources[plan]",
|
| 33 |
+
"eval.tests.test_errors_behavior.test_parallel_boundary_values_forwarded[-1--1]",
|
| 34 |
+
"eval.tests.test_errors_behavior.test_parallel_boundary_values_forwarded[0-0]",
|
| 35 |
+
"eval.tests.test_errors_behavior.test_parallel_boundary_values_forwarded[1-1]",
|
| 36 |
+
"eval.tests.test_errors_behavior.test_parallel_equals_form_forwarded",
|
| 37 |
+
"eval.tests.test_errors_behavior.test_parallel_flag_is_passed_to_executable",
|
| 38 |
+
"eval.tests.test_errors_behavior.test_parallel_large_value_forwarded",
|
| 39 |
+
"eval.tests.test_errors_behavior.test_parallel_non_numeric_is_rejected",
|
| 40 |
+
"eval.tests.test_errors_behavior.test_plan_argv_no_destroy_flag",
|
| 41 |
+
"eval.tests.test_errors_behavior.test_valid_filter_values_reach_the_plan[create]",
|
| 42 |
+
"eval.tests.test_errors_behavior.test_valid_filter_values_reach_the_plan[destroy]",
|
| 43 |
+
"eval.tests.test_errors_behavior.test_valid_filter_values_reach_the_plan[replace]",
|
| 44 |
+
"eval.tests.test_errors_behavior.test_valid_filter_values_reach_the_plan[update]",
|
| 45 |
+
"eval.tests.test_executable_resolution.test_absolute_path_override_shown_as_default_in_subcommand_help",
|
| 46 |
+
"eval.tests.test_executable_resolution.test_default_executable_from_env_path",
|
| 47 |
+
"eval.tests.test_executable_resolution.test_default_executable_from_env_simple",
|
| 48 |
+
"eval.tests.test_executable_resolution.test_default_executable_from_env_tofu",
|
| 49 |
+
"eval.tests.test_executable_resolution.test_empty_env_value_falls_through_to_path_lookup",
|
| 50 |
+
"eval.tests.test_executable_resolution.test_executable_flag_after_subcommand_is_global",
|
| 51 |
+
"eval.tests.test_executable_resolution.test_executable_flag_long_form_overrides",
|
| 52 |
+
"eval.tests.test_executable_resolution.test_executable_flag_overrides_env_at_runtime",
|
| 53 |
+
"eval.tests.test_executable_resolution.test_executable_long_equals_form_overrides",
|
| 54 |
+
"eval.tests.test_executable_resolution.test_executable_long_flag_after_subcommand_is_global",
|
| 55 |
+
"eval.tests.test_executable_resolution.test_executable_shorthand_equals_form_overrides",
|
| 56 |
+
"eval.tests.test_executable_resolution.test_no_executable_blocks_any_subcommand",
|
| 57 |
+
"eval.tests.test_executable_resolution.test_no_executable_blocks_version_too",
|
| 58 |
+
"eval.tests.test_executable_resolution.test_no_executable_env_and_none_on_path_errors",
|
| 59 |
+
"eval.tests.test_executable_resolution.test_nonexistent_path_env_accepted_for_version",
|
| 60 |
+
"eval.tests.test_executable_resolution.test_whitespace_only_env_default_surfaces_in_help",
|
| 61 |
+
"eval.tests.test_executable_resolution.test_whitespace_only_env_value_is_used_verbatim",
|
| 62 |
+
"eval.tests.test_path_resolution.test_path_neither_binary_still_errors_to_else_branch",
|
| 63 |
+
"eval.tests.test_path_resolution.test_path_resolution_defaults_to_terraform",
|
| 64 |
+
"eval.tests.test_path_resolution.test_path_resolution_defaults_to_tofu_when_no_terraform",
|
| 65 |
+
"eval.tests.test_path_resolution.test_path_resolved_default_forwards_parallel[terraform-7]",
|
| 66 |
+
"eval.tests.test_path_resolution.test_path_resolved_default_forwards_parallel[tofu-4]",
|
| 67 |
+
"eval.tests.test_path_resolution.test_path_resolved_destroy_uses_destroy_option",
|
| 68 |
+
"eval.tests.test_path_resolution.test_path_resolved_executable_drives_apply_plan[terraform]",
|
| 69 |
+
"eval.tests.test_path_resolution.test_path_resolved_executable_drives_apply_plan[tofu]",
|
| 70 |
+
"eval.tests.test_path_resolution.test_path_terraform_takes_precedence_over_tofu",
|
| 71 |
+
"eval.tests.test_root_help.test_completion_subcommand_help",
|
| 72 |
+
"eval.tests.test_root_help.test_help_destroy_positional_form",
|
| 73 |
+
"eval.tests.test_root_help.test_help_plan_positional_form",
|
| 74 |
+
"eval.tests.test_root_help.test_help_subcommand_template",
|
| 75 |
+
"eval.tests.test_root_help.test_plan_extra_positional_args_still_run_plan",
|
| 76 |
+
"eval.tests.test_root_help.test_root_executed_without_subcommand_prints_help",
|
| 77 |
+
"eval.tests.test_root_help.test_root_help_lists_all_subcommands",
|
| 78 |
+
"eval.tests.test_root_help.test_root_help_lists_executable_flag",
|
| 79 |
+
"eval.tests.test_root_help.test_root_help_shows_flags_section",
|
| 80 |
+
"eval.tests.test_root_help.test_root_help_shows_short_and_long",
|
| 81 |
+
"eval.tests.test_root_help.test_short_help_alias",
|
| 82 |
+
"eval.tests.test_root_help.test_subcommand_help_is_available",
|
| 83 |
+
"eval.tests.test_root_help.test_subcommand_rejects_unknown_flag",
|
| 84 |
+
"eval.tests.test_root_help.test_unknown_flag_exact_naming",
|
| 85 |
+
"eval.tests.test_root_help.test_unknown_flag_exits_nonzero",
|
| 86 |
+
"eval.tests.test_root_help.test_unknown_shorthand_flag",
|
| 87 |
+
"eval.tests.test_root_help.test_unknown_subcommand_exits_nonzero",
|
| 88 |
+
"eval.tests.test_root_help.test_version_flag_any_position",
|
| 89 |
+
"eval.tests.test_version.test_help_does_not_invoke_terraform_executable",
|
| 90 |
+
"eval.tests.test_version.test_version_flag_forms[--version=true]",
|
| 91 |
+
"eval.tests.test_version.test_version_flag_forms[--version]",
|
| 92 |
+
"eval.tests.test_version.test_version_flag_forms[-v]",
|
| 93 |
+
"eval.tests.test_version.test_version_long_flag",
|
| 94 |
+
"eval.tests.test_version.test_version_number_is_zero_zero_nine",
|
| 95 |
+
"eval.tests.test_version.test_version_prints_to_stdout_only",
|
| 96 |
+
"eval.tests.test_version.test_version_short_flag",
|
| 97 |
+
"eval.tests.test_version.test_version_shows_built_on_date_suffix",
|
| 98 |
+
"eval.tests.test_version.test_version_takes_precedence_over_subcommand_need"
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
"generated_module_02": {
|
| 102 |
+
"ignore_reason": "",
|
| 103 |
+
"ignored": false,
|
| 104 |
+
"ignored_tests": [],
|
| 105 |
+
"tests": [
|
| 106 |
+
"eval.tests.test_apply_destroy_flow.test_apply_aborts_without_auto_approve_when_answer_not_yes",
|
| 107 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[ no]",
|
| 108 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[1]",
|
| 109 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[YES]",
|
| 110 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[Yes]",
|
| 111 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[]",
|
| 112 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[true]",
|
| 113 |
+
"eval.tests.test_apply_destroy_flow.test_apply_accepts_only_lowercase_yes[y]",
|
| 114 |
+
"eval.tests.test_apply_destroy_flow.test_apply_yes_appends_auto_approve_to_target_command",
|
| 115 |
+
"eval.tests.test_apply_destroy_flow.test_apply_yes_with_whitespace_is_accepted_by_trims",
|
| 116 |
+
"eval.tests.test_apply_destroy_flow.test_destroy_aborts_with_destroy_exit_selected",
|
| 117 |
+
"eval.tests.test_apply_destroy_flow.test_destroy_plan_invocation_uses_destroy_flag",
|
| 118 |
+
"eval.tests.test_apply_destroy_flow.test_destroy_yes_appends_auto_approve",
|
| 119 |
+
"eval.tests.test_apply_destroy_flow.test_plan_subcommand_does_not_use_destroy_flag",
|
| 120 |
+
"eval.tests.test_apply_destroy_summary.test_apply_blank_confirm_answer_is_not_yes",
|
| 121 |
+
"eval.tests.test_apply_destroy_summary.test_apply_items_page_size_still_selects_and_confirms",
|
| 122 |
+
"eval.tests.test_apply_destroy_summary.test_apply_matrix_targets_and_auto_approve_chain",
|
| 123 |
+
"eval.tests.test_apply_destroy_summary.test_apply_no_summary_suppresses_selected_block",
|
| 124 |
+
"eval.tests.test_apply_destroy_summary.test_apply_yes_with_default_summary_prints_selected_block",
|
| 125 |
+
"eval.tests.test_apply_destroy_summary.test_apply_yes_with_surrounding_whitespace_confirms",
|
| 126 |
+
"eval.tests.test_apply_destroy_summary.test_destroy_blank_confirm_answer_is_not_yes",
|
| 127 |
+
"eval.tests.test_apply_destroy_summary.test_destroy_default_extraction_selects_created_resource",
|
| 128 |
+
"eval.tests.test_apply_destroy_summary.test_destroy_yes_with_default_summary_prints_selected_block",
|
| 129 |
+
"eval.tests.test_apply_destroy_summary.test_destroy_yes_with_trailing_whitespace_confirms",
|
| 130 |
+
"eval.tests.test_args_surface.test_filter_plural_created_rejected_across_subcommands",
|
| 131 |
+
"eval.tests.test_args_surface.test_filter_value_ignores_plural_suffix",
|
| 132 |
+
"eval.tests.test_args_surface.test_short_filter_flag_is_equivalent_to_long",
|
| 133 |
+
"eval.tests.test_args_surface.test_short_items_flag_allows_selection",
|
| 134 |
+
"eval.tests.test_args_surface.test_short_parallel_flag_propagates_to_target",
|
| 135 |
+
"eval.tests.test_args_surface.test_short_summary_false_suppresses_summary",
|
| 136 |
+
"eval.tests.test_config_and_args.test_env_set_uses_default_executable",
|
| 137 |
+
"eval.tests.test_config_and_args.test_executable_flag_overrides_env_default",
|
| 138 |
+
"eval.tests.test_config_and_args.test_failing_plan_command_surfaces_error_output",
|
| 139 |
+
"eval.tests.test_config_and_args.test_missing_executable_in_path_and_env_exits_with_error",
|
| 140 |
+
"eval.tests.test_config_and_args.test_nonexistent_executable_plan_fails",
|
| 141 |
+
"eval.tests.test_config_and_args.test_plan_help_lists_module_flags",
|
| 142 |
+
"eval.tests.test_config_and_args.test_root_help_lists_subcommands",
|
| 143 |
+
"eval.tests.test_config_and_args.test_unknown_long_flag_rejected_with_exact_error",
|
| 144 |
+
"eval.tests.test_config_and_args.test_unknown_shorthand_flag_rejected_with_exact_error",
|
| 145 |
+
"eval.tests.test_config_and_args.test_version_flag_reports_version_and_exits_zero",
|
| 146 |
+
"eval.tests.test_extract_resource.test_default_extraction_reaches_middle_option",
|
| 147 |
+
"eval.tests.test_extract_resource.test_filter_extracts_exact_action_only[create--target=aws_s3_bucket.data_bucket]",
|
| 148 |
+
"eval.tests.test_extract_resource.test_filter_extracts_exact_action_only[destroy--target=aws_security_group.www]",
|
| 149 |
+
"eval.tests.test_extract_resource.test_filter_extracts_exact_action_only[replace--target=aws_db_instance.database]",
|
| 150 |
+
"eval.tests.test_extract_resource.test_filter_extracts_exact_action_only[update--target=aws_lambda_function.api_handler]",
|
| 151 |
+
"eval.tests.test_extract_resource.test_no_filter_extracts_all_default_actions",
|
| 152 |
+
"eval.tests.test_extract_resource.test_non_default_action_excluded_by_create_filter",
|
| 153 |
+
"eval.tests.test_extract_resource.test_non_default_action_excluded_by_default_filter",
|
| 154 |
+
"eval.tests.test_extract_resource.test_plan_with_no_resources_is_not_found",
|
| 155 |
+
"eval.tests.test_filter_validation.test_empty_filter_is_valid_no_filter",
|
| 156 |
+
"eval.tests.test_filter_validation.test_filter_error_message_mentions_valid_values_and_plan_prefix",
|
| 157 |
+
"eval.tests.test_filter_validation.test_invalid_filter_apply_command_rejects_identically",
|
| 158 |
+
"eval.tests.test_filter_validation.test_invalid_filter_destroy_command_rejects_identically",
|
| 159 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[1]",
|
| 160 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[CREATE]",
|
| 161 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[Create]",
|
| 162 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[all]",
|
| 163 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[bogus]",
|
| 164 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[create ]",
|
| 165 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[delete]",
|
| 166 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[destroy,create]",
|
| 167 |
+
"eval.tests.test_filter_validation.test_invalid_filter_rejected[none]",
|
| 168 |
+
"eval.tests.test_filter_validation.test_valid_filter_passes_validation_and_reaches_plan[create]",
|
| 169 |
+
"eval.tests.test_filter_validation.test_valid_filter_passes_validation_and_reaches_plan[destroy]",
|
| 170 |
+
"eval.tests.test_filter_validation.test_valid_filter_passes_validation_and_reaches_plan[replace]",
|
| 171 |
+
"eval.tests.test_filter_validation.test_valid_filter_passes_validation_and_reaches_plan[update]",
|
| 172 |
+
"eval.tests.test_flag_argument_validation.test_items_non_integer_rejected_with_exact_error",
|
| 173 |
+
"eval.tests.test_flag_argument_validation.test_missing_executable_value_on_apply",
|
| 174 |
+
"eval.tests.test_flag_argument_validation.test_missing_filter_value_rejected",
|
| 175 |
+
"eval.tests.test_flag_argument_validation.test_negative_parallel_is_accepted_and_reaches_plan",
|
| 176 |
+
"eval.tests.test_flag_argument_validation.test_parallel_non_integer_rejected_with_exact_error",
|
| 177 |
+
"eval.tests.test_flag_argument_validation.test_short_parallel_non_integer_rejected",
|
| 178 |
+
"eval.tests.test_flag_argument_validation.test_zero_parallel_reaches_plan",
|
| 179 |
+
"eval.tests.test_gen_target_matrix.test_bracket_create_filter_skips_update_resource",
|
| 180 |
+
"eval.tests.test_gen_target_matrix.test_bracket_subscript_matrix_yields_distinct_targets",
|
| 181 |
+
"eval.tests.test_gen_target_matrix.test_bracket_subscript_resource_extracted_as_single_target",
|
| 182 |
+
"eval.tests.test_gen_target_matrix.test_bracket_update_filter_extracts_update_resource",
|
| 183 |
+
"eval.tests.test_gen_target_matrix.test_matrix_of_all_four_default_actions_produces_four_targets",
|
| 184 |
+
"eval.tests.test_gen_target_matrix.test_matrix_summary_lists_every_selected_item",
|
| 185 |
+
"eval.tests.test_plan_flow.test_confirming_without_selection_prints_resource_not_selected",
|
| 186 |
+
"eval.tests.test_plan_flow.test_default_parallelism_is_10",
|
| 187 |
+
"eval.tests.test_plan_flow.test_items_flag_does_not_break_selection",
|
| 188 |
+
"eval.tests.test_plan_flow.test_multiple_resources_generate_matrix_of_targets",
|
| 189 |
+
"eval.tests.test_plan_flow.test_plan_command_propagates_parallelism",
|
| 190 |
+
"eval.tests.test_plan_flow.test_selecting_exit_option_cancels_plan",
|
| 191 |
+
"eval.tests.test_plan_flow.test_single_resource_generates_single_target",
|
| 192 |
+
"eval.tests.test_plan_flow.test_summary_false_suppresses_summary_block",
|
| 193 |
+
"eval.tests.test_plan_flow.test_summary_lists_each_selected_item_once",
|
| 194 |
+
"eval.tests.test_plan_flow.test_summary_prints_selected_resources_header_and_items"
|
| 195 |
+
]
|
| 196 |
+
},
|
| 197 |
+
"generated_module_03": {
|
| 198 |
+
"ignore_reason": "",
|
| 199 |
+
"ignored": false,
|
| 200 |
+
"ignored_tests": [],
|
| 201 |
+
"tests": [
|
| 202 |
+
"eval.tests.test_apply.test_apply_empty_selection_resource_not_selected",
|
| 203 |
+
"eval.tests.test_apply.test_apply_filter_create_targets_only_created",
|
| 204 |
+
"eval.tests.test_apply.test_apply_help_lists_subcommand_flags",
|
| 205 |
+
"eval.tests.test_apply.test_apply_invalid_filter_reports_error_exit_1",
|
| 206 |
+
"eval.tests.test_apply.test_apply_no_resources_prints_not_found",
|
| 207 |
+
"eval.tests.test_apply.test_apply_parallel_flag_forwarded_with_autoapprove",
|
| 208 |
+
"eval.tests.test_apply.test_apply_select_exit_option",
|
| 209 |
+
"eval.tests.test_apply.test_apply_select_multi_resource_confirm_all",
|
| 210 |
+
"eval.tests.test_apply.test_apply_select_resource_answer_garbage_is_not_yes",
|
| 211 |
+
"eval.tests.test_apply.test_apply_select_resource_answer_no_runs_target_but_no_approve",
|
| 212 |
+
"eval.tests.test_apply.test_apply_select_resource_answer_yes_runs_confirm_and_summary",
|
| 213 |
+
"eval.tests.test_apply.test_apply_summary_false_hides_summary_after_yes",
|
| 214 |
+
"eval.tests.test_apply.test_apply_survey_eof_raises_select_error",
|
| 215 |
+
"eval.tests.test_apply.test_apply_terraform_error_propagates",
|
| 216 |
+
"eval.tests.test_cli.test_apply_registered_via_root",
|
| 217 |
+
"eval.tests.test_cli.test_destroy_registered_via_root",
|
| 218 |
+
"eval.tests.test_cli.test_executable_flag_controls_harness_subprocess",
|
| 219 |
+
"eval.tests.test_cli.test_executable_flag_help_reachable_without_subcommand",
|
| 220 |
+
"eval.tests.test_cli.test_no_terraform_executable_error",
|
| 221 |
+
"eval.tests.test_cli.test_root_help_documents_executable_flag",
|
| 222 |
+
"eval.tests.test_cli.test_root_help_lists_all_subcommands",
|
| 223 |
+
"eval.tests.test_cli.test_root_no_args_prints_help",
|
| 224 |
+
"eval.tests.test_cli.test_unknown_subcommand_errors_exit_1",
|
| 225 |
+
"eval.tests.test_cli.test_version_flag_prints_version_string",
|
| 226 |
+
"eval.tests.test_cli.test_version_short_flag",
|
| 227 |
+
"eval.tests.test_destroy.test_destroy_answer_yes_with_filter_targets_only_matching",
|
| 228 |
+
"eval.tests.test_destroy.test_destroy_empty_selection_resource_not_selected",
|
| 229 |
+
"eval.tests.test_destroy.test_destroy_help_lists_subcommand_flags",
|
| 230 |
+
"eval.tests.test_destroy.test_destroy_invalid_filter_reports_error_exit_1",
|
| 231 |
+
"eval.tests.test_destroy.test_destroy_no_resources_prints_not_found",
|
| 232 |
+
"eval.tests.test_destroy.test_destroy_parallel_flag_forwarded",
|
| 233 |
+
"eval.tests.test_destroy.test_destroy_plan_harvest_uses_destroy_option",
|
| 234 |
+
"eval.tests.test_destroy.test_destroy_select_exit_option",
|
| 235 |
+
"eval.tests.test_destroy.test_destroy_select_multi_resource_confirm_all",
|
| 236 |
+
"eval.tests.test_destroy.test_destroy_select_resource_answer_no_skips_confirm",
|
| 237 |
+
"eval.tests.test_destroy.test_destroy_select_resource_answer_yes_runs_confirm_and_summary",
|
| 238 |
+
"eval.tests.test_destroy.test_destroy_summary_false_hides_summary",
|
| 239 |
+
"eval.tests.test_destroy.test_destroy_survey_eof_raises_select_error",
|
| 240 |
+
"eval.tests.test_destroy.test_destroy_terraform_error_propagates",
|
| 241 |
+
"eval.tests.test_plan.test_plan_custom_plan_file_resource_selected",
|
| 242 |
+
"eval.tests.test_plan.test_plan_empty_selection_prints_resource_not_selected",
|
| 243 |
+
"eval.tests.test_plan.test_plan_executable_flag_selects_terraform_without_env",
|
| 244 |
+
"eval.tests.test_plan.test_plan_filter_create_limits_options",
|
| 245 |
+
"eval.tests.test_plan.test_plan_filter_destroy_limits_options",
|
| 246 |
+
"eval.tests.test_plan.test_plan_filter_replace_limits_options",
|
| 247 |
+
"eval.tests.test_plan.test_plan_filter_update_limits_options",
|
| 248 |
+
"eval.tests.test_plan.test_plan_filter_valid_value_accepts_flag",
|
| 249 |
+
"eval.tests.test_plan.test_plan_filter_with_no_matching_resources_not_found",
|
| 250 |
+
"eval.tests.test_plan.test_plan_help_lists_subcommand_flags",
|
| 251 |
+
"eval.tests.test_plan.test_plan_invalid_filter_reports_error_and_exit_1",
|
| 252 |
+
"eval.tests.test_plan.test_plan_multiple_same_action_resources_with_filter",
|
| 253 |
+
"eval.tests.test_plan.test_plan_no_resources_prints_not_found",
|
| 254 |
+
"eval.tests.test_plan.test_plan_parallel_flag_is_forwarded",
|
| 255 |
+
"eval.tests.test_plan.test_plan_resource_not_in_filter_excluded_from_summary",
|
| 256 |
+
"eval.tests.test_plan.test_plan_select_exit_option_prints_exit_selected",
|
| 257 |
+
"eval.tests.test_plan.test_plan_select_multi_resource_builds_target_matrix",
|
| 258 |
+
"eval.tests.test_plan.test_plan_select_single_resource_runs_target_and_summary",
|
| 259 |
+
"eval.tests.test_plan.test_plan_summary_false_suppresses_summary",
|
| 260 |
+
"eval.tests.test_plan.test_plan_summary_section_matches_golden",
|
| 261 |
+
"eval.tests.test_plan.test_plan_summary_true_still_prints_summary",
|
| 262 |
+
"eval.tests.test_plan.test_plan_survey_eof_raises_select_error",
|
| 263 |
+
"eval.tests.test_plan.test_plan_target_command_failure_after_selection_exits_1",
|
| 264 |
+
"eval.tests.test_plan.test_plan_terraform_error_propagates_and_exit_1"
|
| 265 |
+
]
|
| 266 |
+
},
|
| 267 |
+
"generated_module_04": {
|
| 268 |
+
"ignore_reason": "",
|
| 269 |
+
"ignored": false,
|
| 270 |
+
"ignored_tests": [],
|
| 271 |
+
"tests": [
|
| 272 |
+
"eval.tests.test_action_filters.test_default_action_pattern_admits_all_four_actions[created-will be created]",
|
| 273 |
+
"eval.tests.test_action_filters.test_default_action_pattern_admits_all_four_actions[destroyed-will be destroyed]",
|
| 274 |
+
"eval.tests.test_action_filters.test_default_action_pattern_admits_all_four_actions[replaced-must be replaced]",
|
| 275 |
+
"eval.tests.test_action_filters.test_default_action_pattern_admits_all_four_actions[updated-will be updated in-place]",
|
| 276 |
+
"eval.tests.test_action_filters.test_default_action_pattern_drops_unknown_action",
|
| 277 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[ ]",
|
| 278 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[ destroy]",
|
| 279 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[CREATE]",
|
| 280 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[creat]",
|
| 281 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[create ]",
|
| 282 |
+
"eval.tests.test_action_filters.test_each_command_rejects_invalid_filter[none]",
|
| 283 |
+
"eval.tests.test_action_filters.test_empty_filter_means_no_filter[apply]",
|
| 284 |
+
"eval.tests.test_action_filters.test_empty_filter_means_no_filter[destroy]",
|
| 285 |
+
"eval.tests.test_action_filters.test_empty_filter_means_no_filter[plan]",
|
| 286 |
+
"eval.tests.test_action_filters.test_filters_narrow_action_set[create-aws_instance.created will be created-hidden_tokens0]",
|
| 287 |
+
"eval.tests.test_action_filters.test_filters_narrow_action_set[destroy-aws_instance.destroyed will be destroyed-hidden_tokens1]",
|
| 288 |
+
"eval.tests.test_action_filters.test_filters_narrow_action_set[replace-aws_instance.replaced must be replaced-hidden_tokens3]",
|
| 289 |
+
"eval.tests.test_action_filters.test_filters_narrow_action_set[update-aws_instance.updated will be updated in-place-hidden_tokens2]",
|
| 290 |
+
"eval.tests.test_action_filters.test_invalid_filter_names_all_valid_keys",
|
| 291 |
+
"eval.tests.test_action_filters.test_valid_filter_values_reach_the_selector[create]",
|
| 292 |
+
"eval.tests.test_action_filters.test_valid_filter_values_reach_the_selector[destroy]",
|
| 293 |
+
"eval.tests.test_action_filters.test_valid_filter_values_reach_the_selector[replace]",
|
| 294 |
+
"eval.tests.test_action_filters.test_valid_filter_values_reach_the_selector[update]",
|
| 295 |
+
"eval.tests.test_color_tokens.test_exit_option_is_not_green",
|
| 296 |
+
"eval.tests.test_color_tokens.test_exit_option_renders_red",
|
| 297 |
+
"eval.tests.test_color_tokens.test_exit_selected_renders_green[apply]",
|
| 298 |
+
"eval.tests.test_color_tokens.test_exit_selected_renders_green[destroy]",
|
| 299 |
+
"eval.tests.test_color_tokens.test_exit_selected_renders_green[plan]",
|
| 300 |
+
"eval.tests.test_color_tokens.test_not_executed_renders_green[apply-apply exit selected]",
|
| 301 |
+
"eval.tests.test_color_tokens.test_not_executed_renders_green[destroy-destroy exit selected]",
|
| 302 |
+
"eval.tests.test_color_tokens.test_not_found_renders_green[apply]",
|
| 303 |
+
"eval.tests.test_color_tokens.test_not_found_renders_green[destroy]",
|
| 304 |
+
"eval.tests.test_color_tokens.test_not_found_renders_green[plan]",
|
| 305 |
+
"eval.tests.test_color_tokens.test_resouce_not_selected_renders_green[apply]",
|
| 306 |
+
"eval.tests.test_color_tokens.test_resouce_not_selected_renders_green[destroy]",
|
| 307 |
+
"eval.tests.test_color_tokens.test_resouce_not_selected_renders_green[plan]",
|
| 308 |
+
"eval.tests.test_confirmation.test_apply_declines_confirmation_prints_not_executed[YES\\n-apply]",
|
| 309 |
+
"eval.tests.test_confirmation.test_apply_declines_confirmation_prints_not_executed[no\\n-apply]",
|
| 310 |
+
"eval.tests.test_confirmation.test_apply_declines_confirmation_prints_not_executed[x\\n-apply]",
|
| 311 |
+
"eval.tests.test_confirmation.test_decline_with_garbage_still_not_executed[ no \\n]",
|
| 312 |
+
"eval.tests.test_confirmation.test_decline_with_garbage_still_not_executed[0\\n]",
|
| 313 |
+
"eval.tests.test_confirmation.test_decline_with_garbage_still_not_executed[\\n]",
|
| 314 |
+
"eval.tests.test_confirmation.test_decline_with_garbage_still_not_executed[yes please\\n]",
|
| 315 |
+
"eval.tests.test_confirmation.test_destroy_declines_confirmation_prints_not_executed",
|
| 316 |
+
"eval.tests.test_confirmation.test_yes_proceeds_past_not_executed[ yes\\n]",
|
| 317 |
+
"eval.tests.test_confirmation.test_yes_proceeds_past_not_executed[ yes \\n]",
|
| 318 |
+
"eval.tests.test_confirmation.test_yes_proceeds_past_not_executed[yes\\n]",
|
| 319 |
+
"eval.tests.test_empty_selection.test_empty_selection_does_not_run_target[apply]",
|
| 320 |
+
"eval.tests.test_empty_selection.test_empty_selection_does_not_run_target[destroy]",
|
| 321 |
+
"eval.tests.test_empty_selection.test_empty_selection_does_not_run_target[plan]",
|
| 322 |
+
"eval.tests.test_empty_selection.test_empty_selection_reports_not_selected[apply]",
|
| 323 |
+
"eval.tests.test_empty_selection.test_empty_selection_reports_not_selected[destroy]",
|
| 324 |
+
"eval.tests.test_empty_selection.test_empty_selection_reports_not_selected[plan]",
|
| 325 |
+
"eval.tests.test_empty_selection.test_message_uses_green_color_token[apply]",
|
| 326 |
+
"eval.tests.test_empty_selection.test_message_uses_green_color_token[destroy]",
|
| 327 |
+
"eval.tests.test_empty_selection.test_message_uses_green_color_token[plan]",
|
| 328 |
+
"eval.tests.test_exit_options.test_exit_option_is_colored_red[apply]",
|
| 329 |
+
"eval.tests.test_exit_options.test_exit_option_is_colored_red[destroy]",
|
| 330 |
+
"eval.tests.test_exit_options.test_exit_option_is_colored_red[plan]",
|
| 331 |
+
"eval.tests.test_exit_options.test_exit_option_is_first_selectable_option[apply]",
|
| 332 |
+
"eval.tests.test_exit_options.test_exit_option_is_first_selectable_option[destroy]",
|
| 333 |
+
"eval.tests.test_exit_options.test_exit_option_is_first_selectable_option[plan]",
|
| 334 |
+
"eval.tests.test_exit_options.test_selecting_exit_does_not_run_target[apply]",
|
| 335 |
+
"eval.tests.test_exit_options.test_selecting_exit_does_not_run_target[destroy]",
|
| 336 |
+
"eval.tests.test_exit_options.test_selecting_exit_does_not_run_target[plan]",
|
| 337 |
+
"eval.tests.test_exit_options.test_selecting_exit_outputs_exit_selected[apply]",
|
| 338 |
+
"eval.tests.test_exit_options.test_selecting_exit_outputs_exit_selected[destroy]",
|
| 339 |
+
"eval.tests.test_exit_options.test_selecting_exit_outputs_exit_selected[plan]",
|
| 340 |
+
"eval.tests.test_flow.test_apply_confirm_yes_shows_auto_approve_and_summary",
|
| 341 |
+
"eval.tests.test_flow.test_apply_runs_target_command_for_selected_resource",
|
| 342 |
+
"eval.tests.test_flow.test_multiple_selected_resources_all_targeted",
|
| 343 |
+
"eval.tests.test_flow.test_parallelism_flag_reaches_target_command",
|
| 344 |
+
"eval.tests.test_flow.test_selector_lists_exit_option_first",
|
| 345 |
+
"eval.tests.test_not_found.test_no_matching_resources_reports_not_found[apply]",
|
| 346 |
+
"eval.tests.test_not_found.test_no_matching_resources_reports_not_found[destroy]",
|
| 347 |
+
"eval.tests.test_not_found.test_no_matching_resources_reports_not_found[plan]",
|
| 348 |
+
"eval.tests.test_not_found.test_not_found_skips_selector_and_target[apply]",
|
| 349 |
+
"eval.tests.test_not_found.test_not_found_skips_selector_and_target[destroy]",
|
| 350 |
+
"eval.tests.test_not_found.test_not_found_skips_selector_and_target[plan]",
|
| 351 |
+
"eval.tests.test_not_found.test_not_found_uses_green_color_token[apply]",
|
| 352 |
+
"eval.tests.test_not_found.test_not_found_uses_green_color_token[destroy]",
|
| 353 |
+
"eval.tests.test_not_found.test_not_found_uses_green_color_token[plan]",
|
| 354 |
+
"eval.tests.test_plan_action_option.test_initial_terraform_plan_invocation[apply--no-color --parallelism=10]",
|
| 355 |
+
"eval.tests.test_plan_action_option.test_initial_terraform_plan_invocation[destroy--destroy -no-color --parallelism=10]",
|
| 356 |
+
"eval.tests.test_plan_action_option.test_initial_terraform_plan_invocation[plan--no-color --parallelism=10]",
|
| 357 |
+
"eval.tests.test_plan_action_option.test_plan_never_includes_destroy_for_non_destroy_commands[apply]",
|
| 358 |
+
"eval.tests.test_plan_action_option.test_plan_never_includes_destroy_for_non_destroy_commands[destroy]",
|
| 359 |
+
"eval.tests.test_plan_action_option.test_plan_never_includes_destroy_for_non_destroy_commands[plan]",
|
| 360 |
+
"eval.tests.test_plan_action_option.test_plan_parallelism_flag_reaches_initial_plan[apply]",
|
| 361 |
+
"eval.tests.test_plan_action_option.test_plan_parallelism_flag_reaches_initial_plan[destroy]",
|
| 362 |
+
"eval.tests.test_plan_action_option.test_plan_parallelism_flag_reaches_initial_plan[plan]",
|
| 363 |
+
"eval.tests.test_plan_command_flow.test_plan_parallel_flag_reaches_target_command",
|
| 364 |
+
"eval.tests.test_plan_command_flow.test_plan_runs_target_command_for_selected_resource",
|
| 365 |
+
"eval.tests.test_plan_command_flow.test_plan_summary_explicit_true_still_renders",
|
| 366 |
+
"eval.tests.test_plan_command_flow.test_plan_summary_false_flag_suppresses_summary",
|
| 367 |
+
"eval.tests.test_plan_command_flow.test_plan_summary_rendered_by_default",
|
| 368 |
+
"eval.tests.test_plan_command_flow.test_plan_target_command_uses_default_parallelism",
|
| 369 |
+
"eval.tests.test_spinner.test_braille_spin_character_is_used[apply]",
|
| 370 |
+
"eval.tests.test_spinner.test_braille_spin_character_is_used[destroy]",
|
| 371 |
+
"eval.tests.test_spinner.test_braille_spin_character_is_used[plan]",
|
| 372 |
+
"eval.tests.test_spinner.test_spinner_is_stopped_before_prompt[apply]",
|
| 373 |
+
"eval.tests.test_spinner.test_spinner_is_stopped_before_prompt[destroy]",
|
| 374 |
+
"eval.tests.test_spinner.test_spinner_is_stopped_before_prompt[plan]",
|
| 375 |
+
"eval.tests.test_spinner.test_spinner_suffix_follows_green_braille_glyph[apply]",
|
| 376 |
+
"eval.tests.test_spinner.test_spinner_suffix_follows_green_braille_glyph[destroy]",
|
| 377 |
+
"eval.tests.test_spinner.test_spinner_suffix_follows_green_braille_glyph[plan]"
|
| 378 |
+
]
|
| 379 |
+
}
|
| 380 |
+
},
|
| 381 |
+
"commit": "fc1f6fbbda8bf33689e3886ab26d688762e6c7c8",
|
| 382 |
+
"data_source": "synthetic_programgym",
|
| 383 |
+
"difficulty": "easy",
|
| 384 |
+
"difficulty_score": 1.9679222067305173,
|
| 385 |
+
"eval_clean_hashes": [
|
| 386 |
+
"b66e3c21efe3bc245b2a5a586fc9cf72b007146d17d045e3d21e6d90acd3f6a1"
|
| 387 |
+
],
|
| 388 |
+
"input_record": {
|
| 389 |
+
"commit": "fc1f6fbbda8bf33689e3886ab26d688762e6c7c8",
|
| 390 |
+
"commits": 68,
|
| 391 |
+
"contributors": 5,
|
| 392 |
+
"difficulty": "easy",
|
| 393 |
+
"difficulty_code_lines": 516,
|
| 394 |
+
"difficulty_has_tests": false,
|
| 395 |
+
"difficulty_product_code_lines": 516,
|
| 396 |
+
"difficulty_runtime_deps": 17,
|
| 397 |
+
"difficulty_score": 1.9679222067305173,
|
| 398 |
+
"difficulty_test_code_lines": 223,
|
| 399 |
+
"full_name": "future-architect/tftarget",
|
| 400 |
+
"github_stars": 275,
|
| 401 |
+
"input_joern_zip": "go_joern/future-architect__tftarget.zip",
|
| 402 |
+
"joern_status": true,
|
| 403 |
+
"joern_time": 5.293462170986459,
|
| 404 |
+
"language": "go",
|
| 405 |
+
"pb_match": [
|
| 406 |
+
{
|
| 407 |
+
"pb_fullname": "sclevine/yj",
|
| 408 |
+
"rank": 254,
|
| 409 |
+
"similarity": 0.5144113302230835
|
| 410 |
+
},
|
| 411 |
+
{
|
| 412 |
+
"pb_fullname": "antonmedv/walk",
|
| 413 |
+
"rank": 890,
|
| 414 |
+
"similarity": 0.4559027850627899
|
| 415 |
+
},
|
| 416 |
+
{
|
| 417 |
+
"pb_fullname": "mikefarah/yq",
|
| 418 |
+
"rank": 377,
|
| 419 |
+
"similarity": 0.5390952229499817
|
| 420 |
+
},
|
| 421 |
+
{
|
| 422 |
+
"pb_fullname": "guumaster/hostctl",
|
| 423 |
+
"rank": 597,
|
| 424 |
+
"similarity": 0.45988714694976807
|
| 425 |
+
},
|
| 426 |
+
{
|
| 427 |
+
"pb_fullname": "JohannesKaufmann/html-to-markdown",
|
| 428 |
+
"rank": 941,
|
| 429 |
+
"similarity": 0.4669204354286194
|
| 430 |
+
},
|
| 431 |
+
{
|
| 432 |
+
"pb_fullname": "gabotechs/dep-tree",
|
| 433 |
+
"rank": 608,
|
| 434 |
+
"similarity": 0.511379063129425
|
| 435 |
+
},
|
| 436 |
+
{
|
| 437 |
+
"pb_fullname": "jesseduffield/lazygit",
|
| 438 |
+
"rank": 957,
|
| 439 |
+
"similarity": 0.4828704297542572
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"pb_fullname": "rs/jplot",
|
| 443 |
+
"rank": 655,
|
| 444 |
+
"similarity": 0.49310019612312317
|
| 445 |
+
},
|
| 446 |
+
{
|
| 447 |
+
"pb_fullname": "multiprocessio/dsq",
|
| 448 |
+
"rank": 972,
|
| 449 |
+
"similarity": 0.45329365134239197
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"pb_fullname": "skeema/skeema",
|
| 453 |
+
"rank": 647,
|
| 454 |
+
"similarity": 0.4963502287864685
|
| 455 |
+
},
|
| 456 |
+
{
|
| 457 |
+
"pb_fullname": "naggie/dstask",
|
| 458 |
+
"rank": 253,
|
| 459 |
+
"similarity": 0.5222502946853638
|
| 460 |
+
},
|
| 461 |
+
{
|
| 462 |
+
"pb_fullname": "noborus/trdsql",
|
| 463 |
+
"rank": 504,
|
| 464 |
+
"similarity": 0.5043389797210693
|
| 465 |
+
},
|
| 466 |
+
{
|
| 467 |
+
"pb_fullname": "noborus/ov",
|
| 468 |
+
"rank": 992,
|
| 469 |
+
"similarity": 0.48054277896881104
|
| 470 |
+
},
|
| 471 |
+
{
|
| 472 |
+
"pb_fullname": "eliukblau/pixterm",
|
| 473 |
+
"rank": 998,
|
| 474 |
+
"similarity": 0.4858798682689667
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"pb_fullname": "cheat/cheat",
|
| 478 |
+
"rank": 658,
|
| 479 |
+
"similarity": 0.4993581175804138
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"pb_fullname": "ariga/atlas",
|
| 483 |
+
"rank": 269,
|
| 484 |
+
"similarity": 0.5403250455856323
|
| 485 |
+
},
|
| 486 |
+
{
|
| 487 |
+
"pb_fullname": "antonmedv/fx",
|
| 488 |
+
"rank": 639,
|
| 489 |
+
"similarity": 0.4841502606868744
|
| 490 |
+
},
|
| 491 |
+
{
|
| 492 |
+
"pb_fullname": "dundee/gdu",
|
| 493 |
+
"rank": 722,
|
| 494 |
+
"similarity": 0.48723718523979187
|
| 495 |
+
},
|
| 496 |
+
{
|
| 497 |
+
"pb_fullname": "tomnomnom/gron",
|
| 498 |
+
"rank": 692,
|
| 499 |
+
"similarity": 0.4819084405899048
|
| 500 |
+
},
|
| 501 |
+
{
|
| 502 |
+
"pb_fullname": "hairyhenderson/gomplate",
|
| 503 |
+
"rank": 986,
|
| 504 |
+
"similarity": 0.5008914470672607
|
| 505 |
+
}
|
| 506 |
+
],
|
| 507 |
+
"repo_age": 3.36,
|
| 508 |
+
"repo_path": "go/future-architect__tftarget",
|
| 509 |
+
"source": "commit:fc1f6fbbda8bf33689e3886ab26d688762e6c7c8",
|
| 510 |
+
"status": "done",
|
| 511 |
+
"url": "https://github.com/future-architect/tftarget"
|
| 512 |
+
},
|
| 513 |
+
"instance_id": "future-architect__tftarget.fc1f6fb",
|
| 514 |
+
"language": "go",
|
| 515 |
+
"module_iterations": [
|
| 516 |
+
{
|
| 517 |
+
"actual_iterations": 3,
|
| 518 |
+
"branch_name": "generated_module_01",
|
| 519 |
+
"iteration_limit": 5,
|
| 520 |
+
"module_index": 1,
|
| 521 |
+
"module_kind": "source",
|
| 522 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 523 |
+
},
|
| 524 |
+
{
|
| 525 |
+
"actual_iterations": 2,
|
| 526 |
+
"branch_name": "generated_module_02",
|
| 527 |
+
"iteration_limit": 5,
|
| 528 |
+
"module_index": 2,
|
| 529 |
+
"module_kind": "source",
|
| 530 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 531 |
+
},
|
| 532 |
+
{
|
| 533 |
+
"actual_iterations": 3,
|
| 534 |
+
"branch_name": "generated_module_03",
|
| 535 |
+
"iteration_limit": 5,
|
| 536 |
+
"module_index": 3,
|
| 537 |
+
"module_kind": "source",
|
| 538 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 539 |
+
},
|
| 540 |
+
{
|
| 541 |
+
"actual_iterations": 2,
|
| 542 |
+
"branch_name": "generated_module_04",
|
| 543 |
+
"iteration_limit": 5,
|
| 544 |
+
"module_index": 4,
|
| 545 |
+
"module_kind": "source",
|
| 546 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 547 |
+
}
|
| 548 |
+
],
|
| 549 |
+
"repository": "future-architect/tftarget"
|
| 550 |
+
}
|
future-architect--tftarget.fc1f6/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
|
future-architect--tftarget.fc1f6/tests/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59d69efa7177f3ad7ea38b042a2eb08ab2f8463393dfd7dd2184de2f5b008540
|
| 3 |
+
size 194564
|
fzipp--gocyclo.7b6c7c5/environment/Dockerfile
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
RUN ["bash","-lc","set -euo pipefail; cd /workspace; set -a; source /workspace/download.sh; set +a; python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh\nimport os\nimport re\nimport shlex\nignored = {\"OLDPWD\", \"PWD\", \"SHLVL\", \"_\"}\nvalid_name = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\nfor key in sorted(os.environ):\n if key in ignored or key.startswith(\"BASH_FUNC_\") or not valid_name.fullmatch(key):\n continue\n value = os.environ[key]\n if \"\\n\" in value:\n continue\n print(f\"export {key}={shlex.quote(value)}\")\nPY\n"]
|
| 45 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 46 |
+
RUN chmod 111 /workspace/executable
|
| 47 |
+
WORKDIR /workspace
|
| 48 |
+
# programgym-runtime-workspace-cleanup: v1
|
| 49 |
+
RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
|
| 50 |
+
# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
|
| 51 |
+
# Keep tool/runtime state under /home/agent and reserve /workspace for the
|
| 52 |
+
# submission handed to the separate verifier. Keep the reference executable
|
| 53 |
+
# execute-only; the oracle temporarily restores owner read permission.
|
| 54 |
+
RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
|
| 55 |
+
RUN mkdir -p /home/agent \
|
| 56 |
+
&& chown -R agent:agent /home/agent /workspace \
|
| 57 |
+
&& chown agent:agent /workspace/executable \
|
| 58 |
+
&& chmod 111 /workspace/executable
|
| 59 |
+
ENV HOME=/home/agent
|
| 60 |
+
WORKDIR /workspace
|
fzipp--gocyclo.7b6c7c5/environment/download.sh
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
|
| 3 |
+
# Generated deterministically from repository module metadata; do not edit.
|
| 4 |
+
set -u
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 7 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
|
| 8 |
+
module github.com/fzipp/gocyclo
|
| 9 |
+
|
| 10 |
+
go 1.21
|
| 11 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 12 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 13 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 14 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 15 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 16 |
+
return 1
|
| 17 |
+
else
|
| 18 |
+
exit 1
|
| 19 |
+
fi
|
| 20 |
+
fi
|
| 21 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 22 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 23 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 24 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 25 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 26 |
+
else
|
| 27 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 28 |
+
fi
|
| 29 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 30 |
+
export GOTOOLCHAIN=local
|
| 31 |
+
# No external Go module dependencies to prefetch.
|
fzipp--gocyclo.7b6c7c5/environment/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f384182ab060428937b4b35828aa1a19618bd79a5c9e86e4a0bbe3d38d56d147
|
| 3 |
+
size 3542954
|
fzipp--gocyclo.7b6c7c5/environment/programgym-go.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
|
| 3 |
+
size 59908810
|
fzipp--gocyclo.7b6c7c5/environment/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf580caef004cd34279f6e895756294ed42ff648e3d50d392a99592e4ecf15bb
|
| 3 |
+
size 3521
|
fzipp--gocyclo.7b6c7c5/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
|
fzipp--gocyclo.7b6c7c5/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
|
fzipp--gocyclo.7b6c7c5/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/fzipp--gocyclo.7b6c7c5"
|
| 25 |
+
description = "Synthetic ProgramGym cleanroom reconstruction task for fzipp/gocyclo"
|
| 26 |
+
authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
|
| 27 |
+
keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
|
| 28 |
+
|
| 29 |
+
[metadata]
|
| 30 |
+
source = "ProgramGym"
|
| 31 |
+
instance_id = "fzipp__gocyclo.7b6c7c5"
|
| 32 |
+
repository = "fzipp/gocyclo"
|
| 33 |
+
commit = "7b6c7c5e29f1e2abfde310b3210309272745fc45"
|
| 34 |
+
language = "go"
|
| 35 |
+
difficulty = "easy"
|
| 36 |
+
difficulty_score = 0.8182258936139557
|
| 37 |
+
test_branches = 4
|
| 38 |
+
test_count = 241
|
| 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"
|
fzipp--gocyclo.7b6c7c5/tests/Dockerfile
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
RUN ["bash","-lc","set -euo pipefail; cd /workspace; set -a; source /workspace/download.sh; set +a; python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh\nimport os\nimport re\nimport shlex\nignored = {\"OLDPWD\", \"PWD\", \"SHLVL\", \"_\"}\nvalid_name = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\nfor key in sorted(os.environ):\n if key in ignored or key.startswith(\"BASH_FUNC_\") or not valid_name.fullmatch(key):\n continue\n value = os.environ[key]\n if \"\\n\" in value:\n continue\n print(f\"export {key}={shlex.quote(value)}\")\nPY\n"]
|
| 45 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 46 |
+
RUN chmod 111 /workspace/executable
|
| 47 |
+
WORKDIR /workspace
|
| 48 |
+
# programgym-runtime-workspace-cleanup: v1
|
| 49 |
+
RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
|
| 50 |
+
# Harbor uses tests/ as the separate verifier build context. Start with the
|
| 51 |
+
# same toolchain as the agent, then remove every cleanroom workspace artifact.
|
| 52 |
+
RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
|
| 53 |
+
&& mkdir -p /workspace /tests
|
| 54 |
+
|
| 55 |
+
# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
|
| 56 |
+
# Installing a newer pytest alone leaves that apt package importable and creates
|
| 57 |
+
# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
|
| 58 |
+
# Install and constrain the verifier test runner as one coherent pip toolchain.
|
| 59 |
+
RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
|
| 60 |
+
ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
|
| 61 |
+
RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \
|
| 62 |
+
'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
|
| 63 |
+
|
| 64 |
+
COPY test.sh /tests/test.sh
|
| 65 |
+
COPY programgym_evaluator.py /tests/programgym_evaluator.py
|
| 66 |
+
COPY programgym_task.json /tests/programgym_task.json
|
| 67 |
+
COPY blobs/ /tests/blobs/
|
| 68 |
+
RUN chmod +x /tests/test.sh
|
fzipp--gocyclo.7b6c7c5/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:ff2788084ff4d23ca875fe63a727c668b8ee12354e41e7b222bf8c505057ba25
|
| 3 |
+
size 8798
|
fzipp--gocyclo.7b6c7c5/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:6474d1c6d9f62e0fd7316099a66f871f141398476adfd8c602896457b69ec9c0
|
| 3 |
+
size 8915
|
fzipp--gocyclo.7b6c7c5/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:0ecc5fea196fede5967c902a7b5e754160d772b23d39f9308ed32e449f8e1016
|
| 3 |
+
size 5748
|
fzipp--gocyclo.7b6c7c5/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:73d6e3507a644284275765c59e35c1f1186095341086357f6e6b63a356cb6eee
|
| 3 |
+
size 12032
|
fzipp--gocyclo.7b6c7c5/tests/download.sh
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
|
| 3 |
+
# Generated deterministically from repository module metadata; do not edit.
|
| 4 |
+
set -u
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 7 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
|
| 8 |
+
module github.com/fzipp/gocyclo
|
| 9 |
+
|
| 10 |
+
go 1.21
|
| 11 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 12 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 13 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 14 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 15 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 16 |
+
return 1
|
| 17 |
+
else
|
| 18 |
+
exit 1
|
| 19 |
+
fi
|
| 20 |
+
fi
|
| 21 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 22 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 23 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 24 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 25 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 26 |
+
else
|
| 27 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 28 |
+
fi
|
| 29 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 30 |
+
export GOTOOLCHAIN=local
|
| 31 |
+
# No external Go module dependencies to prefetch.
|