Datasets:
Upload folder using huggingface_hub (part 46)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +93 -0
- transformrs--ata.a644a6c/tests/blobs/tests/generated_upstream.tar.gz +3 -0
- transformrs--ata.a644a6c/tests/download.sh +85 -0
- transformrs--ata.a644a6c/tests/executable +3 -0
- transformrs--ata.a644a6c/tests/harbor_prepare_download_env.sh +37 -0
- transformrs--ata.a644a6c/tests/programgym_evaluator.py +1201 -0
- transformrs--ata.a644a6c/tests/programgym_task.json +1333 -0
- transformrs--ata.a644a6c/tests/test.sh +82 -0
- transformrs--ata.a644a6c/tests/workspace.tar.gz +3 -0
- trap-bytes--403jump.772eba8/environment/Dockerfile +60 -0
- trap-bytes--403jump.772eba8/environment/download.sh +18 -0
- trap-bytes--403jump.772eba8/environment/executable +3 -0
- trap-bytes--403jump.772eba8/environment/programgym-go.tar.gz +3 -0
- trap-bytes--403jump.772eba8/environment/workspace.tar.gz +3 -0
- trap-bytes--403jump.772eba8/instruction.md +98 -0
- trap-bytes--403jump.772eba8/solution/solve.sh +33 -0
- trap-bytes--403jump.772eba8/task.toml +69 -0
- trap-bytes--403jump.772eba8/tests/Dockerfile +68 -0
- trap-bytes--403jump.772eba8/tests/blobs/tests/generated_module_01.tar.gz +3 -0
- trap-bytes--403jump.772eba8/tests/blobs/tests/generated_module_02.tar.gz +3 -0
- trap-bytes--403jump.772eba8/tests/blobs/tests/generated_module_03.tar.gz +3 -0
- trap-bytes--403jump.772eba8/tests/blobs/tests/generated_module_04.tar.gz +3 -0
- trap-bytes--403jump.772eba8/tests/download.sh +18 -0
- trap-bytes--403jump.772eba8/tests/executable +3 -0
- trap-bytes--403jump.772eba8/tests/programgym-go.tar.gz +3 -0
- trap-bytes--403jump.772eba8/tests/programgym_evaluator.py +1201 -0
- trap-bytes--403jump.772eba8/tests/programgym_task.json +323 -0
- trap-bytes--403jump.772eba8/tests/test.sh +82 -0
- trap-bytes--403jump.772eba8/tests/workspace.tar.gz +3 -0
- trap-bytes--gourlex.bd2143d/environment/Dockerfile +60 -0
- trap-bytes--gourlex.bd2143d/environment/download.sh +44 -0
- trap-bytes--gourlex.bd2143d/environment/executable +3 -0
- trap-bytes--gourlex.bd2143d/environment/programgym-go.tar.gz +3 -0
- trap-bytes--gourlex.bd2143d/environment/workspace.tar.gz +3 -0
- trap-bytes--gourlex.bd2143d/instruction.md +98 -0
- trap-bytes--gourlex.bd2143d/solution/solve.sh +33 -0
- trap-bytes--gourlex.bd2143d/task.toml +69 -0
- trap-bytes--gourlex.bd2143d/tests/Dockerfile +68 -0
- trap-bytes--gourlex.bd2143d/tests/blobs/tests/generated_module_01.tar.gz +3 -0
- trap-bytes--gourlex.bd2143d/tests/download.sh +44 -0
- trap-bytes--gourlex.bd2143d/tests/executable +3 -0
- trap-bytes--gourlex.bd2143d/tests/programgym-go.tar.gz +3 -0
- trap-bytes--gourlex.bd2143d/tests/programgym_evaluator.py +1201 -0
- trap-bytes--gourlex.bd2143d/tests/programgym_task.json +216 -0
- trap-bytes--gourlex.bd2143d/tests/test.sh +82 -0
- trap-bytes--gourlex.bd2143d/tests/workspace.tar.gz +3 -0
- trashhalo--imgcat.8ed8c30/environment/Dockerfile +64 -0
- trashhalo--imgcat.8ed8c30/environment/download.sh +220 -0
- trashhalo--imgcat.8ed8c30/environment/executable +3 -0
- trashhalo--imgcat.8ed8c30/environment/harbor_prepare_download_env.sh +34 -0
.gitattributes
CHANGED
|
@@ -2707,3 +2707,96 @@ traccar--traccar-geocoder.0f8287/tests/executable filter=lfs diff=lfs merge=lfs
|
|
| 2707 |
trailofbits--pe-parse.a98bacf/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2708 |
trailofbits--pe-parse.a98bacf/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2709 |
transformrs--ata.a644a6c/environment/executable filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2707 |
trailofbits--pe-parse.a98bacf/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2708 |
trailofbits--pe-parse.a98bacf/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2709 |
transformrs--ata.a644a6c/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2710 |
+
transformrs--ata.a644a6c/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2711 |
+
trap-bytes--403jump.772eba8/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2712 |
+
trap-bytes--403jump.772eba8/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2713 |
+
trap-bytes--gourlex.bd2143d/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2714 |
+
trap-bytes--gourlex.bd2143d/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2715 |
+
trashhalo--imgcat.8ed8c30/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2716 |
+
trashhalo--imgcat.8ed8c30/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2717 |
+
trevorsundberg--h264-mp4-encoder/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2718 |
+
trevorsundberg--h264-mp4-encoder/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2719 |
+
trilogy-libraries--trilogy.26c6f/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2720 |
+
trilogy-libraries--trilogy.26c6f/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2721 |
+
truthhun--converter.3f6d982/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2722 |
+
truthhun--converter.3f6d982/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2723 |
+
tsattler--multicamerapose.ace0a6/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2724 |
+
tsattler--multicamerapose.ace0a6/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2725 |
+
tsattler--ransaclib.b952083/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2726 |
+
tsattler--ransaclib.b952083/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2727 |
+
tshakalekholoane--bat.86e6104/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2728 |
+
tshakalekholoane--bat.86e6104/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2729 |
+
tsliwowicz--go-wrk.806f06b/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2730 |
+
tsliwowicz--go-wrk.806f06b/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2731 |
+
tsoding--markut.7256f27/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2732 |
+
tsoding--markut.7256f27/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2733 |
+
tsoding--snitch.da4c8d5/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2734 |
+
tsoding--snitch.da4c8d5/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2735 |
+
tsoding--tula.e77e05a/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2736 |
+
tsoding--tula.e77e05a/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2737 |
+
tspooner--rl_markets.2de4cbb/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2738 |
+
tspooner--rl_markets.2de4cbb/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2739 |
+
tudelft3d--3dfier.b77ab96/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2740 |
+
tudelft3d--3dfier.b77ab96/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2741 |
+
tumftm--openlidarmap.a2a4f4a/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2742 |
+
tumftm--openlidarmap.a2a4f4a/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2743 |
+
tvrzna--emptty.9beb781/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2744 |
+
tvrzna--emptty.9beb781/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2745 |
+
tweedegolf--mailcrab.f631533/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2746 |
+
tweedegolf--mailcrab.f631533/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2747 |
+
twistlock--authz.2fa4df2/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2748 |
+
twistlock--authz.2fa4df2/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2749 |
+
twpayne--go-jsonstruct.3bc2d7b/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2750 |
+
twpayne--go-jsonstruct.3bc2d7b/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2751 |
+
txn2--txeh.b1816bc/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2752 |
+
txn2--txeh.b1816bc/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2753 |
+
tylerbrock--saw.00fd4b4/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2754 |
+
tylerbrock--saw.00fd4b4/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2755 |
+
tylertreat--comcast.145d021/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2756 |
+
tylertreat--comcast.145d021/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2757 |
+
tylous--zipexec.f8d661f/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2758 |
+
tylous--zipexec.f8d661f/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2759 |
+
uber--arachne.c5fcff7/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2760 |
+
uber--arachne.c5fcff7/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2761 |
+
uber--astro.a16ed4d/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2762 |
+
uber--astro.a16ed4d/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2763 |
+
uber--ringpop-go.dc480c0/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2764 |
+
uber--ringpop-go.dc480c0/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2765 |
+
uber-go--sally.b6c35a1/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2766 |
+
uber-go--sally.b6c35a1/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2767 |
+
ugeneunipro--ugene.e177f75/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2768 |
+
ugeneunipro--ugene.e177f75/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2769 |
+
umair9747--genzai.b2e2fec/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2770 |
+
umair9747--genzai.b2e2fec/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2771 |
+
umskt--umskt.77c7eb5/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2772 |
+
umskt--umskt.77c7eb5/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2773 |
+
umutcamliyurt--pingrat.d6714b8/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2774 |
+
umutcamliyurt--pingrat.d6714b8/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2775 |
+
umutphp--awesome-cli.fb83c2f/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2776 |
+
umutphp--awesome-cli.fb83c2f/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2777 |
+
undeadsec--dockerspy.030b422/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2778 |
+
undeadsec--dockerspy.030b422/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2779 |
+
uneedcrydear--yolov8-opencv-onnx/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2780 |
+
uneedcrydear--yolov8-opencv-onnx/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2781 |
+
unixpickle--gobfuscate.1379633/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2782 |
+
unixpickle--gobfuscate.1379633/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2783 |
+
unknwon--bra.1e3013e/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2784 |
+
unknwon--bra.1e3013e/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2785 |
+
upmc-enterprises--kubernetes-sec/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2786 |
+
upmc-enterprises--kubernetes-sec/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2787 |
+
upmc-enterprises--registry-creds/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2788 |
+
upmc-enterprises--registry-creds/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2789 |
+
uptrace--opentelemetry-go-extra/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2790 |
+
uptrace--opentelemetry-go-extra/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2791 |
+
usnistgov--frvt.18c2f84/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2792 |
+
usnistgov--frvt.18c2f84/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2793 |
+
utilforever--cubbyflow.5b786fe/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2794 |
+
utilforever--cubbyflow.5b786fe/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2795 |
+
utilforever--rosettastone.09f434/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2796 |
+
utilforever--rosettastone.09f434/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2797 |
+
utkarshkukreti--markup.rs.41d541/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2798 |
+
utkarshkukreti--markup.rs.41d541/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2799 |
+
utkusen--urlhunter.39f2051/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2800 |
+
utkusen--urlhunter.39f2051/tests/executable filter=lfs diff=lfs merge=lfs -text
|
| 2801 |
+
uudashr--gocognit.5b8ec1c/environment/executable filter=lfs diff=lfs merge=lfs -text
|
| 2802 |
+
uudashr--gocognit.5b8ec1c/tests/executable filter=lfs diff=lfs merge=lfs -text
|
transformrs--ata.a644a6c/tests/blobs/tests/generated_upstream.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b698e8768158c3d32070d511c8f7bef95641b9b422fca93860e784f4f248f9e
|
| 3 |
+
size 3367
|
transformrs--ata.a644a6c/tests/download.sh
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
#
|
| 3 |
+
# download.sh - standalone dependency-prefetch for the `trf` Rust binary.
|
| 4 |
+
#
|
| 5 |
+
# This script is SOURCED (`source /source_ro/download.sh`) during the networked
|
| 6 |
+
# download stage when ONLY this file is present (no repository source tree).
|
| 7 |
+
# It must therefore be self-contained: every dependency, manifest, and config
|
| 8 |
+
# needed to prefetch Cargo dependencies is inlined here. It performs no
|
| 9 |
+
# compilation, linking, tests, or packaging. It only fetches the dependency set
|
| 10 |
+
# into the shared default Cargo registry cache (~/.cargo/registry) so that the
|
| 11 |
+
# later offline `build.sh` (`cargo build --offline`) can resolve everything from
|
| 12 |
+
# cache with no network.
|
| 13 |
+
#
|
| 14 |
+
# The generated manifest mirrors the repository Cargo.toml exactly (same name,
|
| 15 |
+
# version, edition, and dependency set) so that resolution during prefetch
|
| 16 |
+
# produces the same version graph as the offline build, guaranteeing every
|
| 17 |
+
# needed crate is present in the cache.
|
| 18 |
+
|
| 19 |
+
# This file is intended to be sourced (`source /source_ro/download.sh`). In
|
| 20 |
+
# normal control flow it never exits; it only exports variables and runs
|
| 21 |
+
# dependency-prefetch commands.
|
| 22 |
+
|
| 23 |
+
# Create an isolated temporary directory to hold the generated manifest. Use
|
| 24 |
+
# mktemp so no repository file is required to exist.
|
| 25 |
+
gen_dir="$(mktemp -d /tmp/trf-download.XXXXXX)" || {
|
| 26 |
+
echo "failed to create temporary directory for download manifest" >&2
|
| 27 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 28 |
+
return 1
|
| 29 |
+
else
|
| 30 |
+
exit 1
|
| 31 |
+
fi
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
# Minimal stub for the default bin target referenced implicitly by the generated
|
| 35 |
+
# manifest. Prefetch does not compile, but declaring the default bin needs a
|
| 36 |
+
# src/main.rs to exist for a clean resolve.
|
| 37 |
+
mkdir -p "$gen_dir/src"
|
| 38 |
+
printf 'fn main() {}\n' > "$gen_dir/src/main.rs"
|
| 39 |
+
|
| 40 |
+
# Write the generated Cargo.toml, mirroring the repository dependency set.
|
| 41 |
+
cat > "$gen_dir/Cargo.toml" <<'CARGO_EOF'
|
| 42 |
+
[package]
|
| 43 |
+
name = "trf"
|
| 44 |
+
version = "1.0.0"
|
| 45 |
+
edition = "2021"
|
| 46 |
+
authors = ["Rik Huijzer"]
|
| 47 |
+
license = "MIT"
|
| 48 |
+
|
| 49 |
+
[dependencies]
|
| 50 |
+
anyhow = "1"
|
| 51 |
+
clap = { version = "4.5.29", features = ["derive"] }
|
| 52 |
+
futures-util = "0.3.31"
|
| 53 |
+
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
| 54 |
+
tracing-subscriber = "0.3"
|
| 55 |
+
tracing = "0.1"
|
| 56 |
+
transformrs = "0.6"
|
| 57 |
+
|
| 58 |
+
[dev-dependencies]
|
| 59 |
+
assert_cmd = "2"
|
| 60 |
+
predicates = "3"
|
| 61 |
+
pretty_assertions = "1"
|
| 62 |
+
tempfile = "3"
|
| 63 |
+
toml = "0.8"
|
| 64 |
+
CARGO_EOF
|
| 65 |
+
|
| 66 |
+
# Prefetch every Cargo dependency (normal + dev) into the shared default cargo
|
| 67 |
+
# registry cache. Run Cargo exclusively against the generated manifest in the
|
| 68 |
+
# temporary directory -- never from /source_ro or the repository root, and never
|
| 69 |
+
# with a bare fetch invocation (always with --manifest-path).
|
| 70 |
+
if ! cargo fetch --manifest-path "$gen_dir/Cargo.toml"; then
|
| 71 |
+
echo "dependency prefetch failed for generated manifest at $gen_dir/Cargo.toml" >&2
|
| 72 |
+
rm -rf "$gen_dir"
|
| 73 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 74 |
+
return 1
|
| 75 |
+
else
|
| 76 |
+
exit 1
|
| 77 |
+
fi
|
| 78 |
+
fi
|
| 79 |
+
|
| 80 |
+
rm -rf "$gen_dir"
|
| 81 |
+
|
| 82 |
+
# Environment variables that build.sh relies on: force fully-offline Cargo and a
|
| 83 |
+
# deterministic target directory so the built binary lands in ./executable.
|
| 84 |
+
export CARGO_NET_OFFLINE=true
|
| 85 |
+
export CARGO_TARGET_DIR=target
|
transformrs--ata.a644a6c/tests/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45f705817278818f19d66c76c7744a7240937ca7a7004a47a4511b3901697a90
|
| 3 |
+
size 7530688
|
transformrs--ata.a644a6c/tests/harbor_prepare_download_env.sh
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
command -v cargo
|
| 4 |
+
command -v rustc
|
| 5 |
+
command -v rustup
|
| 6 |
+
cd /workspace
|
| 7 |
+
set -a
|
| 8 |
+
source /tmp/programgym-download.sh
|
| 9 |
+
set +a
|
| 10 |
+
python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
|
| 11 |
+
import os
|
| 12 |
+
import shlex
|
| 13 |
+
|
| 14 |
+
ignored = {
|
| 15 |
+
"ALL_PROXY",
|
| 16 |
+
"HTTP_PROXY",
|
| 17 |
+
"HTTPS_PROXY",
|
| 18 |
+
"NO_PROXY",
|
| 19 |
+
"OLDPWD",
|
| 20 |
+
"PIP_PROXY",
|
| 21 |
+
"PWD",
|
| 22 |
+
"SHLVL",
|
| 23 |
+
"_",
|
| 24 |
+
"all_proxy",
|
| 25 |
+
"http_proxy",
|
| 26 |
+
"https_proxy",
|
| 27 |
+
"no_proxy",
|
| 28 |
+
"pip_proxy",
|
| 29 |
+
}
|
| 30 |
+
for key in sorted(os.environ):
|
| 31 |
+
if key in ignored or key.startswith("BASH_FUNC_"):
|
| 32 |
+
continue
|
| 33 |
+
value = os.environ[key]
|
| 34 |
+
if "\n" in value:
|
| 35 |
+
continue
|
| 36 |
+
print(f"export {key}={shlex.quote(value)}")
|
| 37 |
+
PY
|
transformrs--ata.a644a6c/tests/programgym_evaluator.py
ADDED
|
@@ -0,0 +1,1201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|
transformrs--ata.a644a6c/tests/programgym_task.json
ADDED
|
@@ -0,0 +1,1333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"branches": {
|
| 3 |
+
"generated_module_01": {
|
| 4 |
+
"ignore_reason": "",
|
| 5 |
+
"ignored": false,
|
| 6 |
+
"ignored_tests": [],
|
| 7 |
+
"tests": [
|
| 8 |
+
"eval.tests.test_arg_errors.test_duplicate_option_rejected",
|
| 9 |
+
"eval.tests.test_arg_errors.test_equals_value_for_string_option_is_accepted",
|
| 10 |
+
"eval.tests.test_arg_errors.test_help_subcommand_rejects_flag_like_arg",
|
| 11 |
+
"eval.tests.test_arg_errors.test_help_subcommand_with_trailing_unknown_arg",
|
| 12 |
+
"eval.tests.test_arg_errors.test_help_with_unknown_subcommand_errors",
|
| 13 |
+
"eval.tests.test_arg_errors.test_missing_model_value_message",
|
| 14 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv0]",
|
| 15 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv1]",
|
| 16 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv2]",
|
| 17 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv3]",
|
| 18 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv4]",
|
| 19 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv5]",
|
| 20 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv6]",
|
| 21 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv7]",
|
| 22 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv8]",
|
| 23 |
+
"eval.tests.test_arg_errors.test_missing_option_value_errors[argv9]",
|
| 24 |
+
"eval.tests.test_arg_errors.test_missing_output_value_message",
|
| 25 |
+
"eval.tests.test_arg_errors.test_no_subcommand_is_parse_error_displaying_usage",
|
| 26 |
+
"eval.tests.test_arg_errors.test_trailing_positional_after_subcommand_rejected",
|
| 27 |
+
"eval.tests.test_arg_errors.test_tts_trailing_positional_rejected",
|
| 28 |
+
"eval.tests.test_arg_errors.test_two_consecutive_missing_values_reports_first",
|
| 29 |
+
"eval.tests.test_arg_errors.test_typo_subcommand_rejected[CHAT]",
|
| 30 |
+
"eval.tests.test_arg_errors.test_typo_subcommand_rejected[Tts]",
|
| 31 |
+
"eval.tests.test_arg_errors.test_typo_subcommand_rejected[XTS]",
|
| 32 |
+
"eval.tests.test_arg_errors.test_typo_subcommand_rejected[chatExtra]",
|
| 33 |
+
"eval.tests.test_arg_errors.test_typo_subcommand_rejected[tt]",
|
| 34 |
+
"eval.tests.test_arg_errors.test_unknown_chat_flag_rejected[--chat]",
|
| 35 |
+
"eval.tests.test_arg_errors.test_unknown_chat_flag_rejected[--model-p]",
|
| 36 |
+
"eval.tests.test_arg_errors.test_unknown_chat_flag_rejected[--zzz]",
|
| 37 |
+
"eval.tests.test_arg_errors.test_unknown_chat_flag_rejected[-x]",
|
| 38 |
+
"eval.tests.test_arg_errors.test_unknown_subcommand_reported",
|
| 39 |
+
"eval.tests.test_arg_errors.test_unknown_tts_flag_rejected[--qqq]",
|
| 40 |
+
"eval.tests.test_arg_errors.test_unknown_tts_flag_rejected[--verbatim]",
|
| 41 |
+
"eval.tests.test_arg_errors.test_unknown_tts_flag_rejected[-q]",
|
| 42 |
+
"eval.tests.test_arg_errors.test_verbose_takes_no_value",
|
| 43 |
+
"eval.tests.test_arg_errors.test_verbose_with_unknown_subcommand",
|
| 44 |
+
"eval.tests.test_env_format.test_arbitrary_provider_names_not_counted",
|
| 45 |
+
"eval.tests.test_env_format.test_blank_lines_between_keys_ignored",
|
| 46 |
+
"eval.tests.test_env_format.test_comment_and_crlf_combined_mixed_count",
|
| 47 |
+
"eval.tests.test_env_format.test_comment_lines_ignored[chat]",
|
| 48 |
+
"eval.tests.test_env_format.test_comment_lines_ignored[tts]",
|
| 49 |
+
"eval.tests.test_env_format.test_comment_only_env_found_zero",
|
| 50 |
+
"eval.tests.test_env_format.test_comment_prefix_line_not_a_key",
|
| 51 |
+
"eval.tests.test_env_format.test_crlf_single_key_passes_gate",
|
| 52 |
+
"eval.tests.test_env_format.test_crlf_three_keys_found_three[chat]",
|
| 53 |
+
"eval.tests.test_env_format.test_crlf_three_keys_found_three[tts]",
|
| 54 |
+
"eval.tests.test_env_format.test_crlf_two_keys_found_two",
|
| 55 |
+
"eval.tests.test_env_format.test_empty_value_counts_one",
|
| 56 |
+
"eval.tests.test_env_format.test_leading_blank_lines_single_key_passes_gate",
|
| 57 |
+
"eval.tests.test_env_format.test_lowercase_key_name_not_counted",
|
| 58 |
+
"eval.tests.test_env_format.test_name_with_whitespace_is_not_counted[leading-spaces]",
|
| 59 |
+
"eval.tests.test_env_format.test_name_with_whitespace_is_not_counted[space-before-equals]",
|
| 60 |
+
"eval.tests.test_env_format.test_name_with_whitespace_is_not_counted[tab-after-name]",
|
| 61 |
+
"eval.tests.test_env_format.test_value_containing_equals_counts_one",
|
| 62 |
+
"eval.tests.test_env_format.test_value_whitespace_quotes_still_counts[OPENAI_KEY= spaced \\n]",
|
| 63 |
+
"eval.tests.test_env_format.test_value_whitespace_quotes_still_counts[OPENAI_KEY=\"quoted\"\\n]",
|
| 64 |
+
"eval.tests.test_env_format.test_value_whitespace_quotes_still_counts[OPENAI_KEY=\\tsk-a\\n]",
|
| 65 |
+
"eval.tests.test_env_format.test_whitespaced_name_excluded_keeps_other_count",
|
| 66 |
+
"eval.tests.test_env_var_keys.test_duplicate_provider_env_var_plus_envfile_counts_once",
|
| 67 |
+
"eval.tests.test_env_var_keys.test_env_var_plus_envfile_found_two",
|
| 68 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-10-env]",
|
| 69 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-11-env]",
|
| 70 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-12-env]",
|
| 71 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-2-env]",
|
| 72 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-3-env]",
|
| 73 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-4-env]",
|
| 74 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-5-env]",
|
| 75 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-6-env]",
|
| 76 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-7-env]",
|
| 77 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-8-env]",
|
| 78 |
+
"eval.tests.test_env_var_keys.test_n_env_vars_reported[count-9-env]",
|
| 79 |
+
"eval.tests.test_env_var_keys.test_no_provider_env_found_zero[chat]",
|
| 80 |
+
"eval.tests.test_env_var_keys.test_no_provider_env_found_zero[tts]",
|
| 81 |
+
"eval.tests.test_env_var_keys.test_two_env_vars_found_two",
|
| 82 |
+
"eval.tests.test_env_var_keys.test_unrecognized_env_var_found_zero[chat]",
|
| 83 |
+
"eval.tests.test_env_var_keys.test_unrecognized_env_var_found_zero[tts]",
|
| 84 |
+
"eval.tests.test_help_version.test_chat_help_description",
|
| 85 |
+
"eval.tests.test_help_version.test_chat_help_exit_zero",
|
| 86 |
+
"eval.tests.test_help_version.test_chat_help_lists_language_code_option",
|
| 87 |
+
"eval.tests.test_help_version.test_chat_help_lists_model_option",
|
| 88 |
+
"eval.tests.test_help_version.test_chat_help_lists_output_option",
|
| 89 |
+
"eval.tests.test_help_version.test_chat_help_lists_raw_json_option",
|
| 90 |
+
"eval.tests.test_help_version.test_chat_help_lists_stream_option",
|
| 91 |
+
"eval.tests.test_help_version.test_chat_help_usage_line",
|
| 92 |
+
"eval.tests.test_help_version.test_help_before_subcommand_is_valid",
|
| 93 |
+
"eval.tests.test_help_version.test_help_subcommand_chat",
|
| 94 |
+
"eval.tests.test_help_version.test_help_subcommand_top_level",
|
| 95 |
+
"eval.tests.test_help_version.test_help_subcommand_tts",
|
| 96 |
+
"eval.tests.test_help_version.test_long_and_short_help_exit_zero[--help]",
|
| 97 |
+
"eval.tests.test_help_version.test_long_and_short_help_exit_zero[-h]",
|
| 98 |
+
"eval.tests.test_help_version.test_long_help_about_line",
|
| 99 |
+
"eval.tests.test_help_version.test_long_help_lists_chat_and_tts_commands",
|
| 100 |
+
"eval.tests.test_help_version.test_long_help_lists_help_option",
|
| 101 |
+
"eval.tests.test_help_version.test_long_help_lists_help_subcommand",
|
| 102 |
+
"eval.tests.test_help_version.test_long_help_lists_verbose_option",
|
| 103 |
+
"eval.tests.test_help_version.test_long_help_lists_version_option",
|
| 104 |
+
"eval.tests.test_help_version.test_long_help_usage_line",
|
| 105 |
+
"eval.tests.test_help_version.test_short_help_has_usage_and_commands",
|
| 106 |
+
"eval.tests.test_help_version.test_tts_help_description",
|
| 107 |
+
"eval.tests.test_help_version.test_tts_help_exit_zero",
|
| 108 |
+
"eval.tests.test_help_version.test_tts_help_lists_language_code_option",
|
| 109 |
+
"eval.tests.test_help_version.test_tts_help_lists_model_option",
|
| 110 |
+
"eval.tests.test_help_version.test_tts_help_lists_output_format_option",
|
| 111 |
+
"eval.tests.test_help_version.test_tts_help_lists_output_option",
|
| 112 |
+
"eval.tests.test_help_version.test_tts_help_lists_voice_option",
|
| 113 |
+
"eval.tests.test_help_version.test_tts_help_usage_line",
|
| 114 |
+
"eval.tests.test_help_version.test_version_long_and_short[--version]",
|
| 115 |
+
"eval.tests.test_help_version.test_version_long_and_short[-V]",
|
| 116 |
+
"eval.tests.test_help_version.test_version_only_prints_single_line",
|
| 117 |
+
"eval.tests.test_key_gate.test_count_excludes_unrecognized_lines",
|
| 118 |
+
"eval.tests.test_key_gate.test_count_includes_all_recognized_at_any_order",
|
| 119 |
+
"eval.tests.test_key_gate.test_duplicate_key_name_counts_once",
|
| 120 |
+
"eval.tests.test_key_gate.test_empty_env_file_found_zero[chat]",
|
| 121 |
+
"eval.tests.test_key_gate.test_empty_env_file_found_zero[tts]",
|
| 122 |
+
"eval.tests.test_key_gate.test_gate_message_is_on_stderr_not_stdout",
|
| 123 |
+
"eval.tests.test_key_gate.test_malformed_lines_without_equals_not_counted",
|
| 124 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-10]",
|
| 125 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-11]",
|
| 126 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-12]",
|
| 127 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-3]",
|
| 128 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-4]",
|
| 129 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-5]",
|
| 130 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-6]",
|
| 131 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-7]",
|
| 132 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-8]",
|
| 133 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[chat-count-9]",
|
| 134 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-10]",
|
| 135 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-11]",
|
| 136 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-12]",
|
| 137 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-3]",
|
| 138 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-4]",
|
| 139 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-5]",
|
| 140 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-6]",
|
| 141 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-7]",
|
| 142 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-8]",
|
| 143 |
+
"eval.tests.test_key_gate.test_n_recognized_keys_reported[tts-count-9]",
|
| 144 |
+
"eval.tests.test_key_gate.test_no_env_file_found_zero[chat]",
|
| 145 |
+
"eval.tests.test_key_gate.test_no_env_file_found_zero[tts]",
|
| 146 |
+
"eval.tests.test_key_gate.test_only_unrecognized_key_found_zero[chat]",
|
| 147 |
+
"eval.tests.test_key_gate.test_only_unrecognized_key_found_zero[tts]",
|
| 148 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-amazon+openai]",
|
| 149 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-azure+hyperbolic]",
|
| 150 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-deepinfra+google]",
|
| 151 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-fireworks+google]",
|
| 152 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-friendliai+nebius]",
|
| 153 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-google+groq]",
|
| 154 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-novita+other]",
|
| 155 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[chat-openai+deepinfra]",
|
| 156 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-amazon+openai]",
|
| 157 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-azure+hyperbolic]",
|
| 158 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-deepinfra+google]",
|
| 159 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-fireworks+google]",
|
| 160 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-friendliai+nebius]",
|
| 161 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-google+groq]",
|
| 162 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-novita+other]",
|
| 163 |
+
"eval.tests.test_key_gate.test_two_keys_found_two[tts-openai+deepinfra]",
|
| 164 |
+
"eval.tests.test_key_gate.test_value_fields_do_not_affect_count",
|
| 165 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[chat-DEEPINFRA_KEY=sk-one]",
|
| 166 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[chat-GOOGLE_KEY=sk-one]",
|
| 167 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[chat-GROQ_KEY=sk-one]",
|
| 168 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[chat-OPENAI_KEY=sk-one]",
|
| 169 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[tts-AZURE_KEY=sk-one]",
|
| 170 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[tts-HYPERBOLIC_KEY=sk-one]",
|
| 171 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[tts-OPENAI_KEY=sk-one]",
|
| 172 |
+
"eval.tests.test_one_key_passthrough.test_exactly_one_key_passes_gate[tts-OTHER_KEY=sk-one]",
|
| 173 |
+
"eval.tests.test_one_key_passthrough.test_one_key_plus_unrecognized_is_still_one[DEEPINFRA_KEY=sk-one-chat]",
|
| 174 |
+
"eval.tests.test_one_key_passthrough.test_one_key_plus_unrecognized_is_still_one[DEEPINFRA_KEY=sk-one-tts]",
|
| 175 |
+
"eval.tests.test_one_key_passthrough.test_one_key_plus_unrecognized_is_still_one[OPENAI_KEY=sk-one-chat]",
|
| 176 |
+
"eval.tests.test_one_key_passthrough.test_one_key_plus_unrecognized_is_still_one[OPENAI_KEY=sk-one-tts]",
|
| 177 |
+
"eval.tests.test_one_key_passthrough.test_verbose_one_key_passes_gate",
|
| 178 |
+
"eval.tests.test_verbose_and_stdin.test_gate_stderr_presence_irrespective_of_stdin[chat]",
|
| 179 |
+
"eval.tests.test_verbose_and_stdin.test_gate_stderr_presence_irrespective_of_stdin[tts]",
|
| 180 |
+
"eval.tests.test_verbose_and_stdin.test_large_stdin_consumed_without_error",
|
| 181 |
+
"eval.tests.test_verbose_and_stdin.test_no_stdin_content_leaks_to_stdout",
|
| 182 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[ spaces and tabs\\t-chat]",
|
| 183 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[ spaces and tabs\\t-tts]",
|
| 184 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[-chat]",
|
| 185 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[-tts]",
|
| 186 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[\\n\\n\\n-chat]",
|
| 187 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[\\n\\n\\n-tts]",
|
| 188 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[h\\xc3\\xa9llo w\\xc3\\xb6rld \\xc3\\xbcn\\xc3\\xafcode \\xf0\\x9f\\x8e\\x89-chat]",
|
| 189 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[h\\xc3\\xa9llo w\\xc3\\xb6rld \\xc3\\xbcn\\xc3\\xafcode \\xf0\\x9f\\x8e\\x89-tts]",
|
| 190 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[hello world-chat]",
|
| 191 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[hello world-tts]",
|
| 192 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[line1\\nline2\\nline3\\n-chat]",
|
| 193 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[line1\\nline2\\nline3\\n-tts]",
|
| 194 |
+
"eval.tests.test_verbose_and_stdin.test_stdin_is_read_before_key_gate[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-tts]",
|
| 196 |
+
"eval.tests.test_verbose_and_stdin.test_verbose_accepted_before_subcommand[chat]",
|
| 197 |
+
"eval.tests.test_verbose_and_stdin.test_verbose_accepted_before_subcommand[tts]",
|
| 198 |
+
"eval.tests.test_verbose_and_stdin.test_verbose_after_subcommand_rejected"
|
| 199 |
+
]
|
| 200 |
+
},
|
| 201 |
+
"generated_module_02": {
|
| 202 |
+
"ignore_reason": "",
|
| 203 |
+
"ignored": false,
|
| 204 |
+
"ignored_tests": [
|
| 205 |
+
{
|
| 206 |
+
"name": "eval.tests.test_chat_args_edge.test_chat_help_matches_golden_exactly",
|
| 207 |
+
"reasons": [
|
| 208 |
+
{
|
| 209 |
+
"id": "missing_fixture_assets",
|
| 210 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 211 |
+
"path": "eval/tests/test_chat_args_edge.py",
|
| 212 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 213 |
+
"severity": "error",
|
| 214 |
+
"stage": "static_lint"
|
| 215 |
+
}
|
| 216 |
+
]
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"name": "eval.tests.test_chat_args_edge.test_root_help_matches_golden_exactly",
|
| 220 |
+
"reasons": [
|
| 221 |
+
{
|
| 222 |
+
"id": "missing_fixture_assets",
|
| 223 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 224 |
+
"path": "eval/tests/test_chat_args_edge.py",
|
| 225 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 226 |
+
"severity": "error",
|
| 227 |
+
"stage": "static_lint"
|
| 228 |
+
}
|
| 229 |
+
]
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"name": "eval.tests.test_chat_cli.test_chat_help_is_self_documenting_on_stdout",
|
| 233 |
+
"reasons": [
|
| 234 |
+
{
|
| 235 |
+
"id": "missing_fixture_assets",
|
| 236 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 237 |
+
"path": "eval/tests/test_chat_cli.py",
|
| 238 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 239 |
+
"severity": "error",
|
| 240 |
+
"stage": "static_lint"
|
| 241 |
+
}
|
| 242 |
+
]
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"name": "eval.tests.test_chat_cli.test_chat_short_help_is_compact_summary",
|
| 246 |
+
"reasons": [
|
| 247 |
+
{
|
| 248 |
+
"id": "missing_fixture_assets",
|
| 249 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 250 |
+
"path": "eval/tests/test_chat_cli.py",
|
| 251 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 252 |
+
"severity": "error",
|
| 253 |
+
"stage": "static_lint"
|
| 254 |
+
}
|
| 255 |
+
]
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"name": "eval.tests.test_chat_more_branches.test_root_short_help_matches_golden_on_stdout",
|
| 259 |
+
"reasons": [
|
| 260 |
+
{
|
| 261 |
+
"id": "missing_fixture_assets",
|
| 262 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 263 |
+
"path": "eval/tests/test_chat_more_branches.py",
|
| 264 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 265 |
+
"severity": "error",
|
| 266 |
+
"stage": "static_lint"
|
| 267 |
+
}
|
| 268 |
+
]
|
| 269 |
+
},
|
| 270 |
+
{
|
| 271 |
+
"name": "eval.tests.test_chat_version_help.test_help_chat_prints_chat_help",
|
| 272 |
+
"reasons": [
|
| 273 |
+
{
|
| 274 |
+
"id": "missing_fixture_assets",
|
| 275 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 276 |
+
"path": "eval/tests/test_chat_version_help.py",
|
| 277 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 278 |
+
"severity": "error",
|
| 279 |
+
"stage": "static_lint"
|
| 280 |
+
}
|
| 281 |
+
]
|
| 282 |
+
},
|
| 283 |
+
{
|
| 284 |
+
"name": "eval.tests.test_chat_version_help.test_help_help_subcommand",
|
| 285 |
+
"reasons": [
|
| 286 |
+
{
|
| 287 |
+
"id": "missing_fixture_assets",
|
| 288 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 289 |
+
"path": "eval/tests/test_chat_version_help.py",
|
| 290 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 291 |
+
"severity": "error",
|
| 292 |
+
"stage": "static_lint"
|
| 293 |
+
}
|
| 294 |
+
]
|
| 295 |
+
},
|
| 296 |
+
{
|
| 297 |
+
"name": "eval.tests.test_chat_version_help.test_help_subcommand_prints_root_help",
|
| 298 |
+
"reasons": [
|
| 299 |
+
{
|
| 300 |
+
"id": "missing_fixture_assets",
|
| 301 |
+
"message": "pytest test references fixture assets that are not packaged",
|
| 302 |
+
"path": "eval/tests/test_chat_version_help.py",
|
| 303 |
+
"repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.",
|
| 304 |
+
"severity": "error",
|
| 305 |
+
"stage": "static_lint"
|
| 306 |
+
}
|
| 307 |
+
]
|
| 308 |
+
}
|
| 309 |
+
],
|
| 310 |
+
"tests": [
|
| 311 |
+
"eval.tests.test_chat_args_edge.test_chat_help_matches_golden_exactly",
|
| 312 |
+
"eval.tests.test_chat_args_edge.test_combined_all_chat_flags_parse_and_stream",
|
| 313 |
+
"eval.tests.test_chat_args_edge.test_empty_model_equals_is_accepted_and_empty",
|
| 314 |
+
"eval.tests.test_chat_args_edge.test_empty_option_equals_is_accepted_and_streams[--language-code=]",
|
| 315 |
+
"eval.tests.test_chat_args_edge.test_empty_option_equals_is_accepted_and_streams[--output=]",
|
| 316 |
+
"eval.tests.test_chat_args_edge.test_empty_option_equals_is_accepted_and_streams[-o=]",
|
| 317 |
+
"eval.tests.test_chat_args_edge.test_equals_in_model_value_roundtrips_verbatim",
|
| 318 |
+
"eval.tests.test_chat_args_edge.test_language_code_equal_and_space_value_forms_parse[--language-code=en---language-code en]",
|
| 319 |
+
"eval.tests.test_chat_args_edge.test_model_and_output_in_any_order_parse",
|
| 320 |
+
"eval.tests.test_chat_args_edge.test_model_equal_and_space_value_forms_equivalent[--model=openai/gpt-5---model openai/gpt-5]",
|
| 321 |
+
"eval.tests.test_chat_args_edge.test_model_flag_then_stream_is_missing_value",
|
| 322 |
+
"eval.tests.test_chat_args_edge.test_output_file_not_created_in_streaming_mode",
|
| 323 |
+
"eval.tests.test_chat_args_edge.test_output_value_with_equals_and_special_chars_accepted[-leading-dash]",
|
| 324 |
+
"eval.tests.test_chat_args_edge.test_output_value_with_equals_and_special_chars_accepted[a=b=c]",
|
| 325 |
+
"eval.tests.test_chat_args_edge.test_output_value_with_equals_and_special_chars_accepted[dir/sub/file.txt]",
|
| 326 |
+
"eval.tests.test_chat_args_edge.test_output_value_with_equals_and_special_chars_accepted[foo==bar]",
|
| 327 |
+
"eval.tests.test_chat_args_edge.test_raw_json_with_output_together_stream",
|
| 328 |
+
"eval.tests.test_chat_args_edge.test_repeated_bool_flag_cannot_be_used_multiple_times[--raw-json---raw-json---raw-json]",
|
| 329 |
+
"eval.tests.test_chat_args_edge.test_repeated_bool_flag_cannot_be_used_multiple_times[--stream---stream---stream]",
|
| 330 |
+
"eval.tests.test_chat_args_edge.test_repeated_model_with_two_values_conflicts",
|
| 331 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[--language-code---language-code---language-code <LANGUAGE_CODE>]",
|
| 332 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[--model---model---model <MODEL>]",
|
| 333 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[--model---model=x---model <MODEL>]",
|
| 334 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[--output---output---output <OUTPUT>]",
|
| 335 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[--output--o---output <OUTPUT>]",
|
| 336 |
+
"eval.tests.test_chat_args_edge.test_repeated_value_option_without_value_is_missing_gate[-o--o---output <OUTPUT>]",
|
| 337 |
+
"eval.tests.test_chat_args_edge.test_root_help_matches_golden_exactly",
|
| 338 |
+
"eval.tests.test_chat_args_edge.test_root_no_subcommand_prints_help_to_stderr",
|
| 339 |
+
"eval.tests.test_chat_args_edge.test_short_output_flag_accepts_value_and_streams",
|
| 340 |
+
"eval.tests.test_chat_args_edge.test_value_option_then_another_flag_is_missing_value[--language-code]",
|
| 341 |
+
"eval.tests.test_chat_args_edge.test_value_option_then_another_flag_is_missing_value[--model]",
|
| 342 |
+
"eval.tests.test_chat_args_edge.test_value_option_then_another_flag_is_missing_value[--output]",
|
| 343 |
+
"eval.tests.test_chat_args_edge.test_value_option_then_another_flag_is_missing_value[-o]",
|
| 344 |
+
"eval.tests.test_chat_cli.test_chat_accepts_equals_model_value",
|
| 345 |
+
"eval.tests.test_chat_cli.test_chat_accepts_model_value",
|
| 346 |
+
"eval.tests.test_chat_cli.test_chat_help_is_self_documenting_on_stdout",
|
| 347 |
+
"eval.tests.test_chat_cli.test_chat_help_lists_each_option[--language-code]",
|
| 348 |
+
"eval.tests.test_chat_cli.test_chat_help_lists_each_option[--model]",
|
| 349 |
+
"eval.tests.test_chat_cli.test_chat_help_lists_each_option[--output]",
|
| 350 |
+
"eval.tests.test_chat_cli.test_chat_help_lists_each_option[--raw-json]",
|
| 351 |
+
"eval.tests.test_chat_cli.test_chat_help_lists_each_option[--stream]",
|
| 352 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ --language-code <LANGUAGE_CODE>]",
|
| 353 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ --model <MODEL>]",
|
| 354 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ --raw-json]",
|
| 355 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ --stream]",
|
| 356 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ Language code (optional)]",
|
| 357 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ Model to use (optional)]",
|
| 358 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ Stream output]",
|
| 359 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[ -o, --output <OUTPUT>]",
|
| 360 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[OpenAI-compatible chat.]",
|
| 361 |
+
"eval.tests.test_chat_cli.test_chat_long_help_contains[Usage: executable chat [OPTIONS]]",
|
| 362 |
+
"eval.tests.test_chat_cli.test_chat_model_rejects_missing_value",
|
| 363 |
+
"eval.tests.test_chat_cli.test_chat_output_rejects_missing_value",
|
| 364 |
+
"eval.tests.test_chat_cli.test_chat_raw_json_no_value",
|
| 365 |
+
"eval.tests.test_chat_cli.test_chat_raw_json_rejects_any_value[false]",
|
| 366 |
+
"eval.tests.test_chat_cli.test_chat_raw_json_rejects_any_value[true]",
|
| 367 |
+
"eval.tests.test_chat_cli.test_chat_raw_json_rejects_any_value[yes]",
|
| 368 |
+
"eval.tests.test_chat_cli.test_chat_rejects_unknown_flag[--bogus]",
|
| 369 |
+
"eval.tests.test_chat_cli.test_chat_rejects_unknown_flag[--no-such-option]",
|
| 370 |
+
"eval.tests.test_chat_cli.test_chat_rejects_unknown_flag[--unknown]",
|
| 371 |
+
"eval.tests.test_chat_cli.test_chat_rejects_unknown_flag[-x]",
|
| 372 |
+
"eval.tests.test_chat_cli.test_chat_rejects_unknown_flag_usage",
|
| 373 |
+
"eval.tests.test_chat_cli.test_chat_requires_value_for_option[--language-code-error: a value is required for '--language-code <LANGUAGE_CODE>' but none was supplied\\n\\nFor more information, try '--help'.\\n]",
|
| 374 |
+
"eval.tests.test_chat_cli.test_chat_requires_value_for_option[--model-error: a value is required for '--model <MODEL>' but none was supplied\\n\\nFor more information, try '--help'.\\n]",
|
| 375 |
+
"eval.tests.test_chat_cli.test_chat_requires_value_for_option[--output-error: a value is required for '--output <OUTPUT>' but none was supplied\\n\\nFor more information, try '--help'.\\n]",
|
| 376 |
+
"eval.tests.test_chat_cli.test_chat_requires_value_for_option[-o-error: a value is required for '--output <OUTPUT>' but none was supplied\\n\\nFor more information, try '--help'.\\n]",
|
| 377 |
+
"eval.tests.test_chat_cli.test_chat_short_help_is_compact_summary",
|
| 378 |
+
"eval.tests.test_chat_cli.test_chat_stream_flag_rejects_any_value[false]",
|
| 379 |
+
"eval.tests.test_chat_cli.test_chat_stream_flag_rejects_any_value[off]",
|
| 380 |
+
"eval.tests.test_chat_cli.test_chat_stream_flag_rejects_any_value[on]",
|
| 381 |
+
"eval.tests.test_chat_cli.test_chat_stream_flag_rejects_any_value[true]",
|
| 382 |
+
"eval.tests.test_chat_cli.test_chat_stream_flag_rejects_any_value[yes]",
|
| 383 |
+
"eval.tests.test_chat_cli.test_chat_stream_rejects_boolean_value_on",
|
| 384 |
+
"eval.tests.test_chat_cli.test_unknown_subcommand",
|
| 385 |
+
"eval.tests.test_chat_cli.test_verbosity_flag_belongs_to_root",
|
| 386 |
+
"eval.tests.test_chat_keys.test_chat_accepts_single_key_from_env",
|
| 387 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[AMAZON_KEY]",
|
| 388 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[AZURE_KEY]",
|
| 389 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[DEEPINFRA_KEY]",
|
| 390 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[FIREWORKS_KEY]",
|
| 391 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[FRIENDLIAI_KEY]",
|
| 392 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[GOOGLE_KEY]",
|
| 393 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[GROQ_KEY]",
|
| 394 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[HYPERBOLIC_KEY]",
|
| 395 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[NEBIUS_KEY]",
|
| 396 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[NOVITA_KEY]",
|
| 397 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[OPENAI_KEY]",
|
| 398 |
+
"eval.tests.test_chat_keys.test_chat_provider_key_accepts_empty_value[OTHER_KEY]",
|
| 399 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[AMAZON_KEY]",
|
| 400 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[AZURE_KEY]",
|
| 401 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[DEEPINFRA_KEY]",
|
| 402 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[FIREWORKS_KEY]",
|
| 403 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[FRIENDLIAI_KEY]",
|
| 404 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[GOOGLE_KEY]",
|
| 405 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[GROQ_KEY]",
|
| 406 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[HYPERBOLIC_KEY]",
|
| 407 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[NEBIUS_KEY]",
|
| 408 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[NOVITA_KEY]",
|
| 409 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[OPENAI_KEY]",
|
| 410 |
+
"eval.tests.test_chat_keys.test_chat_single_key_proceeds_for_each_provider[OTHER_KEY]",
|
| 411 |
+
"eval.tests.test_chat_keys.test_chat_two_keys_via_env_and_dotenv",
|
| 412 |
+
"eval.tests.test_chat_keys.test_chat_with_two_keys_fails[OPENAI_KEY-DEEPINFRA_KEY]",
|
| 413 |
+
"eval.tests.test_chat_keys.test_chat_with_two_keys_fails[OPENAI_KEY-GOOGLE_KEY]",
|
| 414 |
+
"eval.tests.test_chat_keys.test_chat_with_two_keys_fails[OPENAI_KEY-NEBIUS_KEY]",
|
| 415 |
+
"eval.tests.test_chat_keys.test_chat_without_any_key_fails",
|
| 416 |
+
"eval.tests.test_chat_keys.test_chat_without_any_key_prints_nothing_on_stdout",
|
| 417 |
+
"eval.tests.test_chat_keys.test_chat_zero_keys_message_format",
|
| 418 |
+
"eval.tests.test_chat_keys.test_dotenv_env_variable_takes_precedence_over_missing_file",
|
| 419 |
+
"eval.tests.test_chat_keys.test_dotenv_key_is_loaded[DEEPINFRA_KEY=\"di-from-file\"]",
|
| 420 |
+
"eval.tests.test_chat_keys.test_dotenv_key_is_loaded[OPENAI_KEY=\"sk-from-file\"]",
|
| 421 |
+
"eval.tests.test_chat_keys.test_dotenv_key_is_loaded[OPENAI_KEY=sk-from-file]",
|
| 422 |
+
"eval.tests.test_chat_keys.test_dotenv_missing_file_yields_zero_keys",
|
| 423 |
+
"eval.tests.test_chat_keys.test_dotenv_same_name_as_env_key_is_still_one_key[OPENAI_KEY=\"dotenv-value\"\\n]",
|
| 424 |
+
"eval.tests.test_chat_keys.test_dotenv_same_name_as_env_key_is_still_one_key[OPENAI_KEY=dotenv-value\\n]",
|
| 425 |
+
"eval.tests.test_chat_keys.test_dotenv_with_unrelated_vars_only_fails",
|
| 426 |
+
"eval.tests.test_chat_keys.test_dotenv_without_any_key_fails[# comment only\\n]",
|
| 427 |
+
"eval.tests.test_chat_keys.test_dotenv_without_any_key_fails[PATH=/usr/bin\\n]",
|
| 428 |
+
"eval.tests.test_chat_keys.test_dotenv_without_any_key_fails[\\n]",
|
| 429 |
+
"eval.tests.test_chat_keys.test_one_recognized_and_one_unrecognized_key_is_single_key",
|
| 430 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[AMAZON_KEY]",
|
| 431 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[AZURE_KEY]",
|
| 432 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[DEEPINFRA_KEY]",
|
| 433 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[FIREWORKS_KEY]",
|
| 434 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[FRIENDLIAI_KEY]",
|
| 435 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[GOOGLE_KEY]",
|
| 436 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[GROQ_KEY]",
|
| 437 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[HYPERBOLIC_KEY]",
|
| 438 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[NEBIUS_KEY]",
|
| 439 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[NOVITA_KEY]",
|
| 440 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[OPENAI_KEY]",
|
| 441 |
+
"eval.tests.test_chat_keys.test_recognized_provider_key_is_scanned[OTHER_KEY]",
|
| 442 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[CEREBRAS_KEY]",
|
| 443 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[MISTRAL_KEY]",
|
| 444 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[SAMBA_KEY]",
|
| 445 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[SAMBA_NOVA_KEY]",
|
| 446 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[TOGETHERAI_KEY]",
|
| 447 |
+
"eval.tests.test_chat_keys.test_unrecognized_provider_key_counts_as_no_key[TOGETHER_AI_KEY]",
|
| 448 |
+
"eval.tests.test_chat_model.test_default_model_for_provider[GOOGLE_KEY-models/gemini-1.5-flash]",
|
| 449 |
+
"eval.tests.test_chat_model.test_default_model_for_provider[OPENAI_KEY-gpt-4o-mini]",
|
| 450 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[AMAZON_KEY]",
|
| 451 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[AZURE_KEY]",
|
| 452 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[DEEPINFRA_KEY]",
|
| 453 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[FIREWORKS_KEY]",
|
| 454 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[FRIENDLIAI_KEY]",
|
| 455 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[GROQ_KEY]",
|
| 456 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[HYPERBOLIC_KEY]",
|
| 457 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[NEBIUS_KEY]",
|
| 458 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[NOVITA_KEY]",
|
| 459 |
+
"eval.tests.test_chat_model.test_default_model_generic_arm[OTHER_KEY]",
|
| 460 |
+
"eval.tests.test_chat_model.test_empty_stdin_yields_empty_user_message",
|
| 461 |
+
"eval.tests.test_chat_model.test_long_model_value_roundtrips",
|
| 462 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[DEEPINFRA_KEY-a]",
|
| 463 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[DEEPINFRA_KEY-deepseek-ai/DeepSeek-R1-Distill-Llama-70B]",
|
| 464 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[DEEPINFRA_KEY-gpt-4-turbo]",
|
| 465 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[DEEPINFRA_KEY-gpt-4o]",
|
| 466 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[DEEPINFRA_KEY-my-org/my-model]",
|
| 467 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[GOOGLE_KEY-a]",
|
| 468 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[GOOGLE_KEY-deepseek-ai/DeepSeek-R1-Distill-Llama-70B]",
|
| 469 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[GOOGLE_KEY-gpt-4-turbo]",
|
| 470 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[GOOGLE_KEY-gpt-4o]",
|
| 471 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[GOOGLE_KEY-my-org/my-model]",
|
| 472 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[OPENAI_KEY-a]",
|
| 473 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[OPENAI_KEY-deepseek-ai/DeepSeek-R1-Distill-Llama-70B]",
|
| 474 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[OPENAI_KEY-gpt-4-turbo]",
|
| 475 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[OPENAI_KEY-gpt-4o]",
|
| 476 |
+
"eval.tests.test_chat_model.test_model_flag_overrides_default[OPENAI_KEY-my-org/my-model]",
|
| 477 |
+
"eval.tests.test_chat_model.test_model_flag_spaced_form[another/model-name]",
|
| 478 |
+
"eval.tests.test_chat_model.test_model_flag_spaced_form[gpt-4-turbo]",
|
| 479 |
+
"eval.tests.test_chat_model.test_model_flag_special_characters",
|
| 480 |
+
"eval.tests.test_chat_model.test_other_chat_flags_parse_with_model_request[--language-code en]",
|
| 481 |
+
"eval.tests.test_chat_model.test_other_chat_flags_parse_with_model_request[--raw-json]",
|
| 482 |
+
"eval.tests.test_chat_model.test_other_chat_flags_parse_with_model_request[-o out.txt]",
|
| 483 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[AMAZON_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 484 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[AZURE_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 485 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[DEEPINFRA_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 486 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[FIREWORKS_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 487 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[FRIENDLIAI_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 488 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[GOOGLE_KEY-models/gemini-1.5-flash]",
|
| 489 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[GROQ_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 490 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[HYPERBOLIC_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 491 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[NEBIUS_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 492 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[NOVITA_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 493 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[OPENAI_KEY-gpt-4o-mini]",
|
| 494 |
+
"eval.tests.test_chat_model.test_per_provider_default_model[OTHER_KEY-meta-llama/Llama-3.3-70B-Instruct]",
|
| 495 |
+
"eval.tests.test_chat_model.test_request_contains_user_message",
|
| 496 |
+
"eval.tests.test_chat_model.test_request_payload_is_valid_json",
|
| 497 |
+
"eval.tests.test_chat_model.test_request_role_is_user_singleton[DEEPINFRA_KEY]",
|
| 498 |
+
"eval.tests.test_chat_model.test_request_role_is_user_singleton[GOOGLE_KEY]",
|
| 499 |
+
"eval.tests.test_chat_model.test_request_role_is_user_singleton[OPENAI_KEY]",
|
| 500 |
+
"eval.tests.test_chat_model.test_request_stream_field_true_by_default",
|
| 501 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[ leading and trailing spaces ]",
|
| 502 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[line one\\nline two]",
|
| 503 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[multiple words with spaces]",
|
| 504 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[single-word]",
|
| 505 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[trailing-newline\\n]",
|
| 506 |
+
"eval.tests.test_chat_model.test_stdin_content_forwarded[unicode: \\xfcn\\xefcode & symbols!]",
|
| 507 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[\\xa9 \\xfcn\\xefcode preserved]",
|
| 508 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[``backticks`` and {braces}]",
|
| 509 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[back\\\\slash and \\x00? no-null]",
|
| 510 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[quotes \" and apostrophe' mixed]",
|
| 511 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[say \"quoted\" text]",
|
| 512 |
+
"eval.tests.test_chat_model.test_stdin_json_special_chars_keep_payload_valid[tab\\there and\\nnewline]",
|
| 513 |
+
"eval.tests.test_chat_model.test_streaming_panic_names_module_file",
|
| 514 |
+
"eval.tests.test_chat_model.test_streaming_panic_reports_provider_chat_url[DEEPINFRA_KEY-https://api.deepinfra.com/v1/openai/chat/completions]",
|
| 515 |
+
"eval.tests.test_chat_model.test_streaming_panic_reports_provider_chat_url[GOOGLE_KEY-https://generativelanguage.googleapis.com/v1beta/openai/chat/completions]",
|
| 516 |
+
"eval.tests.test_chat_model.test_streaming_panic_reports_provider_chat_url[NEBIUS_KEY-https://api.nebi.us/v1/openai/chat/completions]",
|
| 517 |
+
"eval.tests.test_chat_model.test_streaming_panic_reports_provider_chat_url[OPENAI_KEY-https://api.openai.com/v1/chat/completions]",
|
| 518 |
+
"eval.tests.test_chat_model.test_streaming_request_fails_fast_over_bad_proxy[DEEPINFRA_KEY]",
|
| 519 |
+
"eval.tests.test_chat_model.test_streaming_request_fails_fast_over_bad_proxy[OPENAI_KEY]",
|
| 520 |
+
"eval.tests.test_chat_model.test_streaming_verbose_emits_debug_to_stderr[DEEPINFRA_KEY]",
|
| 521 |
+
"eval.tests.test_chat_model.test_streaming_verbose_emits_debug_to_stderr[GOOGLE_KEY]",
|
| 522 |
+
"eval.tests.test_chat_model.test_streaming_verbose_emits_debug_to_stderr[NEBIUS_KEY]",
|
| 523 |
+
"eval.tests.test_chat_model.test_streaming_verbose_emits_debug_to_stderr[OPENAI_KEY]",
|
| 524 |
+
"eval.tests.test_chat_model.test_streaming_without_full_verbose_still_panics[DEEPINFRA_KEY]",
|
| 525 |
+
"eval.tests.test_chat_model.test_streaming_without_full_verbose_still_panics[GOOGLE_KEY]",
|
| 526 |
+
"eval.tests.test_chat_model.test_streaming_without_full_verbose_still_panics[NEBIUS_KEY]",
|
| 527 |
+
"eval.tests.test_chat_model.test_streaming_without_full_verbose_still_panics[OPENAI_KEY]",
|
| 528 |
+
"eval.tests.test_chat_more_branches.test_bare_bool_flags_any_order_stream[order0]",
|
| 529 |
+
"eval.tests.test_chat_more_branches.test_bare_bool_flags_any_order_stream[order1]",
|
| 530 |
+
"eval.tests.test_chat_more_branches.test_bare_raw_json_flag_parses_and_streams",
|
| 531 |
+
"eval.tests.test_chat_more_branches.test_bare_stream_and_raw_json_together_stream",
|
| 532 |
+
"eval.tests.test_chat_more_branches.test_bare_stream_flag_parses_and_streams",
|
| 533 |
+
"eval.tests.test_chat_more_branches.test_bare_stream_with_model_flag_streams",
|
| 534 |
+
"eval.tests.test_chat_more_branches.test_root_short_help_differs_from_expanded",
|
| 535 |
+
"eval.tests.test_chat_more_branches.test_root_short_help_matches_golden_on_stdout",
|
| 536 |
+
"eval.tests.test_chat_more_branches.test_root_verbose_flag_with_help_is_help",
|
| 537 |
+
"eval.tests.test_chat_version_help.test_help_chat_prints_chat_help",
|
| 538 |
+
"eval.tests.test_chat_version_help.test_help_help_subcommand",
|
| 539 |
+
"eval.tests.test_chat_version_help.test_help_subcommand_prints_root_help",
|
| 540 |
+
"eval.tests.test_chat_version_help.test_root_version_output[--version]",
|
| 541 |
+
"eval.tests.test_chat_version_help.test_root_version_output[-V]",
|
| 542 |
+
"eval.tests.test_chat_version_help.test_version_writes_nothing_to_stderr"
|
| 543 |
+
]
|
| 544 |
+
},
|
| 545 |
+
"generated_module_03": {
|
| 546 |
+
"ignore_reason": "",
|
| 547 |
+
"ignored": false,
|
| 548 |
+
"ignored_tests": [
|
| 549 |
+
{
|
| 550 |
+
"name": "eval.tests.test_error_paths.test_stdin_utf8_panic_is_in_main_not_tts",
|
| 551 |
+
"reasons": [
|
| 552 |
+
{
|
| 553 |
+
"id": "generic_keyword_oracle",
|
| 554 |
+
"message": "pytest test uses a generic keyword oracle",
|
| 555 |
+
"path": "eval/tests/test_error_paths.py",
|
| 556 |
+
"repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
|
| 557 |
+
"severity": "error",
|
| 558 |
+
"stage": "static_lint"
|
| 559 |
+
}
|
| 560 |
+
]
|
| 561 |
+
},
|
| 562 |
+
{
|
| 563 |
+
"name": "eval.tests.test_request_message.test_empty_stdin_length_zero",
|
| 564 |
+
"reasons": [
|
| 565 |
+
{
|
| 566 |
+
"id": "generic_keyword_oracle",
|
| 567 |
+
"message": "pytest test uses a generic keyword oracle",
|
| 568 |
+
"path": "eval/tests/test_request_message.py",
|
| 569 |
+
"repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
|
| 570 |
+
"severity": "error",
|
| 571 |
+
"stage": "static_lint"
|
| 572 |
+
}
|
| 573 |
+
]
|
| 574 |
+
},
|
| 575 |
+
{
|
| 576 |
+
"name": "eval.tests.test_request_message.test_invalid_utf8_only_after_valid_prefix_panics",
|
| 577 |
+
"reasons": [
|
| 578 |
+
{
|
| 579 |
+
"id": "generic_keyword_oracle",
|
| 580 |
+
"message": "pytest test uses a generic keyword oracle",
|
| 581 |
+
"path": "eval/tests/test_request_message.py",
|
| 582 |
+
"repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
|
| 583 |
+
"severity": "error",
|
| 584 |
+
"stage": "static_lint"
|
| 585 |
+
}
|
| 586 |
+
]
|
| 587 |
+
},
|
| 588 |
+
{
|
| 589 |
+
"name": "eval.tests.test_request_message.test_invalid_utf8_stdin_panics_before_length_line",
|
| 590 |
+
"reasons": [
|
| 591 |
+
{
|
| 592 |
+
"id": "generic_keyword_oracle",
|
| 593 |
+
"message": "pytest test uses a generic keyword oracle",
|
| 594 |
+
"path": "eval/tests/test_request_message.py",
|
| 595 |
+
"repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.",
|
| 596 |
+
"severity": "error",
|
| 597 |
+
"stage": "static_lint"
|
| 598 |
+
}
|
| 599 |
+
]
|
| 600 |
+
}
|
| 601 |
+
],
|
| 602 |
+
"tests": [
|
| 603 |
+
"eval.tests.test_config_defaults.test_deepinfra_all_overrides_exact",
|
| 604 |
+
"eval.tests.test_config_defaults.test_deepinfra_control_char_text_roundtrip[\\x00]",
|
| 605 |
+
"eval.tests.test_config_defaults.test_deepinfra_control_char_text_roundtrip[a\\x00b\\x1f\\t]",
|
| 606 |
+
"eval.tests.test_config_defaults.test_deepinfra_control_char_text_roundtrip[tab\\there\\rand\\r]",
|
| 607 |
+
"eval.tests.test_config_defaults.test_deepinfra_default_output_format_mp3",
|
| 608 |
+
"eval.tests.test_config_defaults.test_deepinfra_default_payload_exact",
|
| 609 |
+
"eval.tests.test_config_defaults.test_deepinfra_has_output_format_openai_and_google_do_not_by_default",
|
| 610 |
+
"eval.tests.test_config_defaults.test_deepinfra_ignores_language_code_flag",
|
| 611 |
+
"eval.tests.test_config_defaults.test_deepinfra_model_override",
|
| 612 |
+
"eval.tests.test_config_defaults.test_deepinfra_negative_number_output_format_via_equals",
|
| 613 |
+
"eval.tests.test_config_defaults.test_deepinfra_no_default_model_or_voice_keys",
|
| 614 |
+
"eval.tests.test_config_defaults.test_deepinfra_output_format_opus",
|
| 615 |
+
"eval.tests.test_config_defaults.test_deepinfra_output_format_override",
|
| 616 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[ - ]",
|
| 617 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[ padded - padded ]",
|
| 618 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[-]",
|
| 619 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[caf\\xc3\\xa9 \\xe2\\x98\\x83-caf\\xe9 \\u2603]",
|
| 620 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[line1\\nline2-line1\\nline2]",
|
| 621 |
+
"eval.tests.test_config_defaults.test_deepinfra_text_fidelity[say \"hi\" & <bye>-say \"hi\" & <bye>]",
|
| 622 |
+
"eval.tests.test_config_defaults.test_deepinfra_unicode_snowman_text_field",
|
| 623 |
+
"eval.tests.test_config_defaults.test_deepinfra_uses_text_keyname",
|
| 624 |
+
"eval.tests.test_config_defaults.test_deepinfra_voice_override_preset_voice",
|
| 625 |
+
"eval.tests.test_config_defaults.test_deepinfra_voice_reverts_when_unset",
|
| 626 |
+
"eval.tests.test_config_defaults.test_deepinfra_wav_with_voice",
|
| 627 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[deepinfra---model=kokoro]",
|
| 628 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[deepinfra---output-format=wav]",
|
| 629 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[google---language-code=nl-NL]",
|
| 630 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[google---voice=en-GB-Wavenet-C]",
|
| 631 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[openai---model=tts-1-hd]",
|
| 632 |
+
"eval.tests.test_config_defaults.test_equals_syntax_override_applied[openai---voice=nova]",
|
| 633 |
+
"eval.tests.test_config_defaults.test_global_verbose_reports_length_and_payload_together",
|
| 634 |
+
"eval.tests.test_config_defaults.test_google_all_four_overrides_cjk_input",
|
| 635 |
+
"eval.tests.test_config_defaults.test_google_all_overrides_exact",
|
| 636 |
+
"eval.tests.test_config_defaults.test_google_audio_config_exact",
|
| 637 |
+
"eval.tests.test_config_defaults.test_google_control_char_input_text_roundtrip[\\x00]",
|
| 638 |
+
"eval.tests.test_config_defaults.test_google_control_char_input_text_roundtrip[a\\x00b\\x1f\\t]",
|
| 639 |
+
"eval.tests.test_config_defaults.test_google_control_char_input_text_roundtrip[tab\\there\\rand\\r]",
|
| 640 |
+
"eval.tests.test_config_defaults.test_google_default_language_code",
|
| 641 |
+
"eval.tests.test_config_defaults.test_google_default_payload_exact",
|
| 642 |
+
"eval.tests.test_config_defaults.test_google_default_voice_name",
|
| 643 |
+
"eval.tests.test_config_defaults.test_google_input_text_fidelity[e\\xcc\\x81-e\\u0301]",
|
| 644 |
+
"eval.tests.test_config_defaults.test_google_input_text_fidelity[hello-hello]",
|
| 645 |
+
"eval.tests.test_config_defaults.test_google_input_text_nested",
|
| 646 |
+
"eval.tests.test_config_defaults.test_google_language_code_override",
|
| 647 |
+
"eval.tests.test_config_defaults.test_google_language_override_keeps_default_voice_name",
|
| 648 |
+
"eval.tests.test_config_defaults.test_google_language_reverts_when_unset",
|
| 649 |
+
"eval.tests.test_config_defaults.test_google_model_override",
|
| 650 |
+
"eval.tests.test_config_defaults.test_google_model_override_preserves_defaults",
|
| 651 |
+
"eval.tests.test_config_defaults.test_google_output_format_override",
|
| 652 |
+
"eval.tests.test_config_defaults.test_google_output_format_override_preserves_defaults",
|
| 653 |
+
"eval.tests.test_config_defaults.test_google_unicode_snowman_nested_input",
|
| 654 |
+
"eval.tests.test_config_defaults.test_google_voice_is_nested_object_others_string",
|
| 655 |
+
"eval.tests.test_config_defaults.test_google_voice_override",
|
| 656 |
+
"eval.tests.test_config_defaults.test_google_voice_override_preserves_default_language",
|
| 657 |
+
"eval.tests.test_config_defaults.test_language_code_only_reaches_google_payload",
|
| 658 |
+
"eval.tests.test_config_defaults.test_openai_all_overrides_exact",
|
| 659 |
+
"eval.tests.test_config_defaults.test_openai_all_overrides_with_different_values",
|
| 660 |
+
"eval.tests.test_config_defaults.test_openai_control_char_input_roundtrip[\\x00]",
|
| 661 |
+
"eval.tests.test_config_defaults.test_openai_control_char_input_roundtrip[a\\x00b\\x1f\\t]",
|
| 662 |
+
"eval.tests.test_config_defaults.test_openai_control_char_input_roundtrip[tab\\there\\rand\\r]",
|
| 663 |
+
"eval.tests.test_config_defaults.test_openai_default_model_tts1",
|
| 664 |
+
"eval.tests.test_config_defaults.test_openai_default_payload_exact",
|
| 665 |
+
"eval.tests.test_config_defaults.test_openai_default_voice_alloy",
|
| 666 |
+
"eval.tests.test_config_defaults.test_openai_ignores_language_code_flag",
|
| 667 |
+
"eval.tests.test_config_defaults.test_openai_input_fidelity[\\xe6\\x97\\xa5\\xe6\\x9c\\xac\\xe8\\xaa\\x9e\\xe3\\x81\\xae\\xe3\\x83\\x86\\xe3\\x82\\xb9\\xe3\\x83\\x88-\\u65e5\\u672c\\u8a9e\\u306e\\u30c6\\u30b9\\u30c8]",
|
| 668 |
+
"eval.tests.test_config_defaults.test_openai_input_fidelity[a\\tb-a\\tb]",
|
| 669 |
+
"eval.tests.test_config_defaults.test_openai_input_fidelity[hello world-hello world]",
|
| 670 |
+
"eval.tests.test_config_defaults.test_openai_model_override",
|
| 671 |
+
"eval.tests.test_config_defaults.test_openai_model_reverts_when_unset",
|
| 672 |
+
"eval.tests.test_config_defaults.test_openai_negative_number_voice_via_equals",
|
| 673 |
+
"eval.tests.test_config_defaults.test_openai_no_default_output_format",
|
| 674 |
+
"eval.tests.test_config_defaults.test_openai_output_equals_default_model_tts1",
|
| 675 |
+
"eval.tests.test_config_defaults.test_openai_output_format_override",
|
| 676 |
+
"eval.tests.test_config_defaults.test_openai_unicode_snowman_input_field",
|
| 677 |
+
"eval.tests.test_config_defaults.test_openai_uses_input_keyname",
|
| 678 |
+
"eval.tests.test_config_defaults.test_openai_voice_override",
|
| 679 |
+
"eval.tests.test_config_defaults.test_openai_voice_override_preserves_default_model",
|
| 680 |
+
"eval.tests.test_config_defaults.test_openai_vs_deepinfra_text_field_name",
|
| 681 |
+
"eval.tests.test_config_defaults.test_openai_vs_deepinfra_voice_field_name",
|
| 682 |
+
"eval.tests.test_config_defaults.test_provider_payload_key_sets_are_distinct",
|
| 683 |
+
"eval.tests.test_error_paths.test_backtrace_suppressed_by_default",
|
| 684 |
+
"eval.tests.test_error_paths.test_backtrace_visible_when_enabled",
|
| 685 |
+
"eval.tests.test_error_paths.test_empty_stdin_still_panics",
|
| 686 |
+
"eval.tests.test_error_paths.test_full_backtrace_lists_frames",
|
| 687 |
+
"eval.tests.test_error_paths.test_longer_input_still_panics_with_matching_length",
|
| 688 |
+
"eval.tests.test_error_paths.test_no_audio_file_when_stdin_invalid_utf8",
|
| 689 |
+
"eval.tests.test_error_paths.test_no_audio_written_to_stdout_on_failure[deepinfra]",
|
| 690 |
+
"eval.tests.test_error_paths.test_no_audio_written_to_stdout_on_failure[google]",
|
| 691 |
+
"eval.tests.test_error_paths.test_no_audio_written_to_stdout_on_failure[openai]",
|
| 692 |
+
"eval.tests.test_error_paths.test_no_output_file_created_on_failure[deepinfra]",
|
| 693 |
+
"eval.tests.test_error_paths.test_no_output_file_created_on_failure[google]",
|
| 694 |
+
"eval.tests.test_error_paths.test_no_output_file_created_on_failure[openai]",
|
| 695 |
+
"eval.tests.test_error_paths.test_output_flag_does_not_obscure_panic",
|
| 696 |
+
"eval.tests.test_error_paths.test_panic_reports_unwrap_on_err_value[deepinfra]",
|
| 697 |
+
"eval.tests.test_error_paths.test_panic_reports_unwrap_on_err_value[google]",
|
| 698 |
+
"eval.tests.test_error_paths.test_panic_reports_unwrap_on_err_value[openai]",
|
| 699 |
+
"eval.tests.test_error_paths.test_rejected_request_panics_in_tts_module[deepinfra]",
|
| 700 |
+
"eval.tests.test_error_paths.test_rejected_request_panics_in_tts_module[google]",
|
| 701 |
+
"eval.tests.test_error_paths.test_rejected_request_panics_in_tts_module[openai]",
|
| 702 |
+
"eval.tests.test_error_paths.test_request_message_precedes_panic_in_stderr",
|
| 703 |
+
"eval.tests.test_error_paths.test_stdin_utf8_panic_is_in_main_not_tts",
|
| 704 |
+
"eval.tests.test_error_paths.test_verbose_payload_precedes_panic",
|
| 705 |
+
"eval.tests.test_error_paths.test_verbose_rejection_with_output_flag_leaves_no_file",
|
| 706 |
+
"eval.tests.test_key_loading.test_blanks_in_env_plus_file_counts_once",
|
| 707 |
+
"eval.tests.test_key_loading.test_comment_and_unknown_vars_ignored",
|
| 708 |
+
"eval.tests.test_key_loading.test_duplicate_same_key_deduplicated_to_one",
|
| 709 |
+
"eval.tests.test_key_loading.test_empty_valued_recognized_key_still_counts",
|
| 710 |
+
"eval.tests.test_key_loading.test_key_from_environment_variable_only[deepinfra]",
|
| 711 |
+
"eval.tests.test_key_loading.test_key_from_environment_variable_only[google]",
|
| 712 |
+
"eval.tests.test_key_loading.test_key_from_environment_variable_only[openai]",
|
| 713 |
+
"eval.tests.test_key_loading.test_key_loading_consume_all_stdin_first",
|
| 714 |
+
"eval.tests.test_key_loading.test_lowercase_provider_key_not_recognized",
|
| 715 |
+
"eval.tests.test_key_loading.test_multiple_keys_report_exact_count[providers0]",
|
| 716 |
+
"eval.tests.test_key_loading.test_multiple_keys_report_exact_count[providers1]",
|
| 717 |
+
"eval.tests.test_key_loading.test_multiple_keys_report_exact_count[providers2]",
|
| 718 |
+
"eval.tests.test_key_loading.test_multiple_keys_report_exact_count[providers3]",
|
| 719 |
+
"eval.tests.test_key_loading.test_no_stdout_on_key_failure",
|
| 720 |
+
"eval.tests.test_key_loading.test_other_key_not_treated_as_tts_provider",
|
| 721 |
+
"eval.tests.test_key_loading.test_other_plus_openai_reports_two",
|
| 722 |
+
"eval.tests.test_key_loading.test_provider_key_drives_request_message",
|
| 723 |
+
"eval.tests.test_key_loading.test_single_key_accepts_one_provider[deepinfra]",
|
| 724 |
+
"eval.tests.test_key_loading.test_single_key_accepts_one_provider[google]",
|
| 725 |
+
"eval.tests.test_key_loading.test_single_key_accepts_one_provider[openai]",
|
| 726 |
+
"eval.tests.test_key_loading.test_spaces_around_equals_not_recognized",
|
| 727 |
+
"eval.tests.test_key_loading.test_two_keys_name_count_two",
|
| 728 |
+
"eval.tests.test_key_loading.test_zero_known_keys_exact_message[None]",
|
| 729 |
+
"eval.tests.test_key_loading.test_zero_known_keys_exact_message[seed1]",
|
| 730 |
+
"eval.tests.test_key_loading.test_zero_known_keys_exact_message[seed2]",
|
| 731 |
+
"eval.tests.test_request_message.test_ascii_plus_emoji_byte_sum",
|
| 732 |
+
"eval.tests.test_request_message.test_ascii_stdin_length",
|
| 733 |
+
"eval.tests.test_request_message.test_empty_stdin_length_zero",
|
| 734 |
+
"eval.tests.test_request_message.test_four_byte_emoji_counts_four",
|
| 735 |
+
"eval.tests.test_request_message.test_invalid_utf8_only_after_valid_prefix_panics",
|
| 736 |
+
"eval.tests.test_request_message.test_invalid_utf8_stdin_panics_before_length_line",
|
| 737 |
+
"eval.tests.test_request_message.test_invalid_utf8_variants_always_panic[\\x80]",
|
| 738 |
+
"eval.tests.test_request_message.test_invalid_utf8_variants_always_panic[\\xc3]",
|
| 739 |
+
"eval.tests.test_request_message.test_invalid_utf8_variants_always_panic[\\xed\\xa0\\x80]",
|
| 740 |
+
"eval.tests.test_request_message.test_invalid_utf8_variants_always_panic[\\xff\\xfe]",
|
| 741 |
+
"eval.tests.test_request_message.test_length_ignores_all_flags",
|
| 742 |
+
"eval.tests.test_request_message.test_length_ignores_model_flag",
|
| 743 |
+
"eval.tests.test_request_message.test_length_ignores_output_flag",
|
| 744 |
+
"eval.tests.test_request_message.test_length_large_input_scales[100000]",
|
| 745 |
+
"eval.tests.test_request_message.test_length_large_input_scales[200000]",
|
| 746 |
+
"eval.tests.test_request_message.test_length_large_input_scales[50000]",
|
| 747 |
+
"eval.tests.test_request_message.test_length_line_precedes_payload_when_verbose",
|
| 748 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[12345-5]",
|
| 749 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[\\U0001f600-4]",
|
| 750 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[\\n-1]",
|
| 751 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[\\t-1]",
|
| 752 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[\\u4e2d\\u6587-6]",
|
| 753 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[\\xe9-2]",
|
| 754 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[a b c-5]",
|
| 755 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[a-1]",
|
| 756 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[a\\nb-3]",
|
| 757 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[a\\r\\nb-4]",
|
| 758 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[ab-2]",
|
| 759 |
+
"eval.tests.test_request_message.test_length_matches_input_bytes[abc-3]",
|
| 760 |
+
"eval.tests.test_request_message.test_length_message_carries_requesting_prefix",
|
| 761 |
+
"eval.tests.test_request_message.test_length_one_of_lines_in_stderr",
|
| 762 |
+
"eval.tests.test_request_message.test_length_reported_for_each_provider[deepinfra]",
|
| 763 |
+
"eval.tests.test_request_message.test_length_reported_for_each_provider[google]",
|
| 764 |
+
"eval.tests.test_request_message.test_length_reported_for_each_provider[openai]",
|
| 765 |
+
"eval.tests.test_request_message.test_length_scales_with_input_size[10000]",
|
| 766 |
+
"eval.tests.test_request_message.test_length_scales_with_input_size[1000]",
|
| 767 |
+
"eval.tests.test_request_message.test_length_scales_with_input_size[100]",
|
| 768 |
+
"eval.tests.test_request_message.test_length_scales_with_input_size[10]",
|
| 769 |
+
"eval.tests.test_request_message.test_length_scales_with_input_size[1]",
|
| 770 |
+
"eval.tests.test_request_message.test_null_and_control_bytes_counted",
|
| 771 |
+
"eval.tests.test_request_message.test_three_byte_cjk_counts_three",
|
| 772 |
+
"eval.tests.test_request_message.test_trailing_newline_included",
|
| 773 |
+
"eval.tests.test_request_message.test_two_byte_utf8_char_counts_two",
|
| 774 |
+
"eval.tests.test_tts_help.test_each_flag_value_reaches_key_loading",
|
| 775 |
+
"eval.tests.test_tts_help.test_empty_output_value_with_equals_parses",
|
| 776 |
+
"eval.tests.test_tts_help.test_empty_value_with_equals_parses",
|
| 777 |
+
"eval.tests.test_tts_help.test_equals_value_with_spaces_reaches_key_loading",
|
| 778 |
+
"eval.tests.test_tts_help.test_flag_value_looking_like_another_flag_is_missing_value",
|
| 779 |
+
"eval.tests.test_tts_help.test_flag_value_variety_parses[123]",
|
| 780 |
+
"eval.tests.test_tts_help.test_flag_value_variety_parses[a-b_c.d]",
|
| 781 |
+
"eval.tests.test_tts_help.test_flag_value_variety_parses[caf\\xe9]",
|
| 782 |
+
"eval.tests.test_tts_help.test_flag_value_variety_parses[hello world]",
|
| 783 |
+
"eval.tests.test_tts_help.test_flag_value_variety_parses[quo\"te]",
|
| 784 |
+
"eval.tests.test_tts_help.test_flag_value_with_equals_syntax[--language-code-en]",
|
| 785 |
+
"eval.tests.test_tts_help.test_flag_value_with_equals_syntax[--model-x]",
|
| 786 |
+
"eval.tests.test_tts_help.test_flag_value_with_equals_syntax[--output-format-mp3]",
|
| 787 |
+
"eval.tests.test_tts_help.test_flag_value_with_equals_syntax[--output-out.mp3]",
|
| 788 |
+
"eval.tests.test_tts_help.test_help_subcommand_for_tts",
|
| 789 |
+
"eval.tests.test_tts_help.test_help_subcommand_prints_top_help",
|
| 790 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[--language-code---language-code <LANGUAGE_CODE>]",
|
| 791 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[--model---model <MODEL>]",
|
| 792 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[--output---output <OUTPUT>]",
|
| 793 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[--output-format---output-format <OUTPUT_FORMAT>]",
|
| 794 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[--voice---voice <VOICE>]",
|
| 795 |
+
"eval.tests.test_tts_help.test_missing_value_exact_stderr[-o---output <OUTPUT>]",
|
| 796 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_across_flags[--language-code]",
|
| 797 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_across_flags[--model]",
|
| 798 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_across_flags[--output-format]",
|
| 799 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_across_flags[--output]",
|
| 800 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_across_flags[--voice]",
|
| 801 |
+
"eval.tests.test_tts_help.test_negative_number_value_rejected_as_flag",
|
| 802 |
+
"eval.tests.test_tts_help.test_negative_number_value_via_equals_syntax[--language-code]",
|
| 803 |
+
"eval.tests.test_tts_help.test_negative_number_value_via_equals_syntax[--model]",
|
| 804 |
+
"eval.tests.test_tts_help.test_negative_number_value_via_equals_syntax[--output-format]",
|
| 805 |
+
"eval.tests.test_tts_help.test_negative_number_value_via_equals_syntax[--output]",
|
| 806 |
+
"eval.tests.test_tts_help.test_negative_number_value_via_equals_syntax[--voice]",
|
| 807 |
+
"eval.tests.test_tts_help.test_no_subcommand_shows_compact_help_stderr",
|
| 808 |
+
"eval.tests.test_tts_help.test_prefixed_double_dash_cannot_start_value",
|
| 809 |
+
"eval.tests.test_tts_help.test_repeated_flag_rejected[--output---output <OUTPUT>]",
|
| 810 |
+
"eval.tests.test_tts_help.test_repeated_flag_rejected[--voice---voice <VOICE>]",
|
| 811 |
+
"eval.tests.test_tts_help.test_short_and_long_help_layouts_differ",
|
| 812 |
+
"eval.tests.test_tts_help.test_top_help_names_both_subcommands",
|
| 813 |
+
"eval.tests.test_tts_help.test_top_level_help_exact",
|
| 814 |
+
"eval.tests.test_tts_help.test_tts_long_help_exact",
|
| 815 |
+
"eval.tests.test_tts_help.test_tts_short_help_exact",
|
| 816 |
+
"eval.tests.test_tts_help.test_tts_with_no_flags_reaches_key_loading",
|
| 817 |
+
"eval.tests.test_tts_help.test_typo_close_to_existing_flag_suggests_it[--Output---output-Usage: executable tts --output <OUTPUT>]",
|
| 818 |
+
"eval.tests.test_tts_help.test_typo_close_to_existing_flag_suggests_it[--helpful---help-Usage: executable tts --help]",
|
| 819 |
+
"eval.tests.test_tts_help.test_typo_close_to_existing_flag_suggests_it[--voicex---voice-Usage: executable tts --voice <VOICE>]",
|
| 820 |
+
"eval.tests.test_tts_help.test_typo_hint_for_missing_short_dash",
|
| 821 |
+
"eval.tests.test_tts_help.test_typo_hint_on_tts_subcommand",
|
| 822 |
+
"eval.tests.test_tts_help.test_unexpected_longflag_exact_stderr[--VOICE]",
|
| 823 |
+
"eval.tests.test_tts_help.test_unexpected_longflag_exact_stderr[--definitely-not-a-flag]",
|
| 824 |
+
"eval.tests.test_tts_help.test_unexpected_longflag_exact_stderr[--does-not-exist]",
|
| 825 |
+
"eval.tests.test_tts_help.test_unexpected_longflag_exact_stderr[-z]",
|
| 826 |
+
"eval.tests.test_tts_help.test_unexpected_longflag_exact_stderr[-zz]",
|
| 827 |
+
"eval.tests.test_tts_help.test_unknown_subcommand_rejected",
|
| 828 |
+
"eval.tests.test_tts_help.test_verbose_before_subcommand_accepted",
|
| 829 |
+
"eval.tests.test_tts_help.test_verbose_before_subcommand_help_still_exact",
|
| 830 |
+
"eval.tests.test_tts_help.test_verbose_before_subcommand_short_help_still_exact",
|
| 831 |
+
"eval.tests.test_tts_help.test_verbose_flag_after_subcommand_rejected",
|
| 832 |
+
"eval.tests.test_tts_help.test_verbose_without_subcommand_errors",
|
| 833 |
+
"eval.tests.test_tts_help.test_version_flag_exact",
|
| 834 |
+
"eval.tests.test_tts_help.test_version_ignores_verbose_flag",
|
| 835 |
+
"eval.tests.test_tts_help.test_version_short_flag_exact"
|
| 836 |
+
]
|
| 837 |
+
},
|
| 838 |
+
"generated_upstream": {
|
| 839 |
+
"ignore_reason": "",
|
| 840 |
+
"ignored": false,
|
| 841 |
+
"ignored_tests": [],
|
| 842 |
+
"tests": [
|
| 843 |
+
"eval.tests.test_harvest.test_chat_missing_key_fails",
|
| 844 |
+
"eval.tests.test_harvest.test_chat_subcommand_help",
|
| 845 |
+
"eval.tests.test_harvest.test_help_lists_subcommands",
|
| 846 |
+
"eval.tests.test_harvest.test_tts_missing_key_fails",
|
| 847 |
+
"eval.tests.test_harvest.test_tts_subcommand_help",
|
| 848 |
+
"eval.tests.test_harvest.test_unexpected_subcommand_fails",
|
| 849 |
+
"eval.tests.test_harvest.test_version_reports_crate_version"
|
| 850 |
+
]
|
| 851 |
+
}
|
| 852 |
+
},
|
| 853 |
+
"commit": "a644a6ce6ebaf93ba5195deb60a125046af60628",
|
| 854 |
+
"data_source": "synthetic_programgym",
|
| 855 |
+
"difficulty": "easy",
|
| 856 |
+
"difficulty_score": 1.3163897510731957,
|
| 857 |
+
"eval_clean_hashes": [
|
| 858 |
+
"45f705817278818f19d66c76c7744a7240937ca7a7004a47a4511b3901697a90"
|
| 859 |
+
],
|
| 860 |
+
"input_record": {
|
| 861 |
+
"codeql_db_mb": 83.73,
|
| 862 |
+
"codeql_status": true,
|
| 863 |
+
"codeql_time": 37.94523408683017,
|
| 864 |
+
"commit": "a644a6ce6ebaf93ba5195deb60a125046af60628",
|
| 865 |
+
"commits": 115,
|
| 866 |
+
"contributors": 3,
|
| 867 |
+
"difficulty": "easy",
|
| 868 |
+
"difficulty_code_lines": 259,
|
| 869 |
+
"difficulty_has_tests": true,
|
| 870 |
+
"difficulty_product_code_lines": 259,
|
| 871 |
+
"difficulty_runtime_deps": 7,
|
| 872 |
+
"difficulty_score": 1.3163897510731957,
|
| 873 |
+
"difficulty_test_code_lines": 151,
|
| 874 |
+
"full_name": "transformrs/ata",
|
| 875 |
+
"github_stars": 285,
|
| 876 |
+
"input_codeql_db": "rust_codeql/transformrs__ata",
|
| 877 |
+
"language": "rs",
|
| 878 |
+
"pb_match": [
|
| 879 |
+
{
|
| 880 |
+
"pb_fullname": "BurntSushi/xsv",
|
| 881 |
+
"rank": 997,
|
| 882 |
+
"similarity": 0.45554977655410767
|
| 883 |
+
},
|
| 884 |
+
{
|
| 885 |
+
"pb_fullname": "ducaale/xh",
|
| 886 |
+
"rank": 61,
|
| 887 |
+
"similarity": 0.5609508752822876
|
| 888 |
+
},
|
| 889 |
+
{
|
| 890 |
+
"pb_fullname": "AmmarAbouZor/tui-journal",
|
| 891 |
+
"rank": 220,
|
| 892 |
+
"similarity": 0.5299843549728394
|
| 893 |
+
},
|
| 894 |
+
{
|
| 895 |
+
"pb_fullname": "pemistahl/grex",
|
| 896 |
+
"rank": 810,
|
| 897 |
+
"similarity": 0.4496332108974457
|
| 898 |
+
},
|
| 899 |
+
{
|
| 900 |
+
"pb_fullname": "Miserlou/Loop",
|
| 901 |
+
"rank": 245,
|
| 902 |
+
"similarity": 0.4836226999759674
|
| 903 |
+
},
|
| 904 |
+
{
|
| 905 |
+
"pb_fullname": "Drew-Alleman/DataSurgeon",
|
| 906 |
+
"rank": 526,
|
| 907 |
+
"similarity": 0.49721136689186096
|
| 908 |
+
},
|
| 909 |
+
{
|
| 910 |
+
"pb_fullname": "nachoparker/dutree",
|
| 911 |
+
"rank": 676,
|
| 912 |
+
"similarity": 0.47067803144454956
|
| 913 |
+
},
|
| 914 |
+
{
|
| 915 |
+
"pb_fullname": "Canop/rhit",
|
| 916 |
+
"rank": 562,
|
| 917 |
+
"similarity": 0.43750816583633423
|
| 918 |
+
},
|
| 919 |
+
{
|
| 920 |
+
"pb_fullname": "sharkdp/hexyl",
|
| 921 |
+
"rank": 280,
|
| 922 |
+
"similarity": 0.4744844436645508
|
| 923 |
+
},
|
| 924 |
+
{
|
| 925 |
+
"pb_fullname": "altdesktop/i3-style",
|
| 926 |
+
"rank": 543,
|
| 927 |
+
"similarity": 0.45047444105148315
|
| 928 |
+
},
|
| 929 |
+
{
|
| 930 |
+
"pb_fullname": "brocode/fblog",
|
| 931 |
+
"rank": 599,
|
| 932 |
+
"similarity": 0.45178622007369995
|
| 933 |
+
},
|
| 934 |
+
{
|
| 935 |
+
"pb_fullname": "svenstaro/miniserve",
|
| 936 |
+
"rank": 908,
|
| 937 |
+
"similarity": 0.47020256519317627
|
| 938 |
+
},
|
| 939 |
+
{
|
| 940 |
+
"pb_fullname": "sayanarijit/xplr",
|
| 941 |
+
"rank": 109,
|
| 942 |
+
"similarity": 0.6036720871925354
|
| 943 |
+
},
|
| 944 |
+
{
|
| 945 |
+
"pb_fullname": "alexpovel/srgn",
|
| 946 |
+
"rank": 808,
|
| 947 |
+
"similarity": 0.4721232056617737
|
| 948 |
+
},
|
| 949 |
+
{
|
| 950 |
+
"pb_fullname": "svenstaro/genact",
|
| 951 |
+
"rank": 214,
|
| 952 |
+
"similarity": 0.5590317249298096
|
| 953 |
+
},
|
| 954 |
+
{
|
| 955 |
+
"pb_fullname": "git-bahn/git-graph",
|
| 956 |
+
"rank": 174,
|
| 957 |
+
"similarity": 0.518837571144104
|
| 958 |
+
},
|
| 959 |
+
{
|
| 960 |
+
"pb_fullname": "dandavison/delta",
|
| 961 |
+
"rank": 435,
|
| 962 |
+
"similarity": 0.48830386996269226
|
| 963 |
+
},
|
| 964 |
+
{
|
| 965 |
+
"pb_fullname": "bootandy/dust",
|
| 966 |
+
"rank": 578,
|
| 967 |
+
"similarity": 0.48161065578460693
|
| 968 |
+
},
|
| 969 |
+
{
|
| 970 |
+
"pb_fullname": "sharkdp/hyperfine",
|
| 971 |
+
"rank": 483,
|
| 972 |
+
"similarity": 0.47324222326278687
|
| 973 |
+
},
|
| 974 |
+
{
|
| 975 |
+
"pb_fullname": "jhspetersson/fselect",
|
| 976 |
+
"rank": 782,
|
| 977 |
+
"similarity": 0.42531025409698486
|
| 978 |
+
},
|
| 979 |
+
{
|
| 980 |
+
"pb_fullname": "kaushiksrini/parqeye",
|
| 981 |
+
"rank": 124,
|
| 982 |
+
"similarity": 0.5303098559379578
|
| 983 |
+
},
|
| 984 |
+
{
|
| 985 |
+
"pb_fullname": "dalance/amber",
|
| 986 |
+
"rank": 354,
|
| 987 |
+
"similarity": 0.4991573691368103
|
| 988 |
+
},
|
| 989 |
+
{
|
| 990 |
+
"pb_fullname": "ajeetdsouza/zoxide",
|
| 991 |
+
"rank": 310,
|
| 992 |
+
"similarity": 0.5239932537078857
|
| 993 |
+
},
|
| 994 |
+
{
|
| 995 |
+
"pb_fullname": "orf/gping",
|
| 996 |
+
"rank": 196,
|
| 997 |
+
"similarity": 0.5029844045639038
|
| 998 |
+
},
|
| 999 |
+
{
|
| 1000 |
+
"pb_fullname": "stacked-git/stgit",
|
| 1001 |
+
"rank": 691,
|
| 1002 |
+
"similarity": 0.44943761825561523
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"pb_fullname": "rust-ethereum/ethabi",
|
| 1006 |
+
"rank": 435,
|
| 1007 |
+
"similarity": 0.5057862997055054
|
| 1008 |
+
},
|
| 1009 |
+
{
|
| 1010 |
+
"pb_fullname": "blacknon/hwatch",
|
| 1011 |
+
"rank": 245,
|
| 1012 |
+
"similarity": 0.5724261999130249
|
| 1013 |
+
},
|
| 1014 |
+
{
|
| 1015 |
+
"pb_fullname": "foriequal0/git-trim",
|
| 1016 |
+
"rank": 727,
|
| 1017 |
+
"similarity": 0.3792993724346161
|
| 1018 |
+
},
|
| 1019 |
+
{
|
| 1020 |
+
"pb_fullname": "sstadick/hck",
|
| 1021 |
+
"rank": 741,
|
| 1022 |
+
"similarity": 0.42908644676208496
|
| 1023 |
+
},
|
| 1024 |
+
{
|
| 1025 |
+
"pb_fullname": "oppiliappan/eva",
|
| 1026 |
+
"rank": 144,
|
| 1027 |
+
"similarity": 0.5370498895645142
|
| 1028 |
+
},
|
| 1029 |
+
{
|
| 1030 |
+
"pb_fullname": "tarka/xcp",
|
| 1031 |
+
"rank": 669,
|
| 1032 |
+
"similarity": 0.441922664642334
|
| 1033 |
+
},
|
| 1034 |
+
{
|
| 1035 |
+
"pb_fullname": "ogham/dog",
|
| 1036 |
+
"rank": 517,
|
| 1037 |
+
"similarity": 0.4256397485733032
|
| 1038 |
+
},
|
| 1039 |
+
{
|
| 1040 |
+
"pb_fullname": "WGUNDERWOOD/tex-fmt",
|
| 1041 |
+
"rank": 559,
|
| 1042 |
+
"similarity": 0.4522930383682251
|
| 1043 |
+
},
|
| 1044 |
+
{
|
| 1045 |
+
"pb_fullname": "Isona/dirble",
|
| 1046 |
+
"rank": 850,
|
| 1047 |
+
"similarity": 0.44552311301231384
|
| 1048 |
+
},
|
| 1049 |
+
{
|
| 1050 |
+
"pb_fullname": "o2sh/onefetch",
|
| 1051 |
+
"rank": 278,
|
| 1052 |
+
"similarity": 0.5158178806304932
|
| 1053 |
+
},
|
| 1054 |
+
{
|
| 1055 |
+
"pb_fullname": "sitkevij/hex",
|
| 1056 |
+
"rank": 517,
|
| 1057 |
+
"similarity": 0.4779749810695648
|
| 1058 |
+
},
|
| 1059 |
+
{
|
| 1060 |
+
"pb_fullname": "codesnap-rs/codesnap",
|
| 1061 |
+
"rank": 922,
|
| 1062 |
+
"similarity": 0.513557493686676
|
| 1063 |
+
},
|
| 1064 |
+
{
|
| 1065 |
+
"pb_fullname": "nuta/nsh",
|
| 1066 |
+
"rank": 82,
|
| 1067 |
+
"similarity": 0.6008120179176331
|
| 1068 |
+
},
|
| 1069 |
+
{
|
| 1070 |
+
"pb_fullname": "sirwart/ripsecrets",
|
| 1071 |
+
"rank": 593,
|
| 1072 |
+
"similarity": 0.4874705672264099
|
| 1073 |
+
},
|
| 1074 |
+
{
|
| 1075 |
+
"pb_fullname": "sharkdp/pastel",
|
| 1076 |
+
"rank": 817,
|
| 1077 |
+
"similarity": 0.4580230116844177
|
| 1078 |
+
},
|
| 1079 |
+
{
|
| 1080 |
+
"pb_fullname": "wfxr/code-minimap",
|
| 1081 |
+
"rank": 449,
|
| 1082 |
+
"similarity": 0.5343204140663147
|
| 1083 |
+
},
|
| 1084 |
+
{
|
| 1085 |
+
"pb_fullname": "eudoxia0/hashcards",
|
| 1086 |
+
"rank": 474,
|
| 1087 |
+
"similarity": 0.5246458053588867
|
| 1088 |
+
},
|
| 1089 |
+
{
|
| 1090 |
+
"pb_fullname": "riquito/tuc",
|
| 1091 |
+
"rank": 248,
|
| 1092 |
+
"similarity": 0.46220701932907104
|
| 1093 |
+
},
|
| 1094 |
+
{
|
| 1095 |
+
"pb_fullname": "Nukesor/pueue",
|
| 1096 |
+
"rank": 327,
|
| 1097 |
+
"similarity": 0.4733361601829529
|
| 1098 |
+
},
|
| 1099 |
+
{
|
| 1100 |
+
"pb_fullname": "simeg/eureka",
|
| 1101 |
+
"rank": 209,
|
| 1102 |
+
"similarity": 0.5408527851104736
|
| 1103 |
+
},
|
| 1104 |
+
{
|
| 1105 |
+
"pb_fullname": "Esubaalew/run",
|
| 1106 |
+
"rank": 76,
|
| 1107 |
+
"similarity": 0.6288180947303772
|
| 1108 |
+
},
|
| 1109 |
+
{
|
| 1110 |
+
"pb_fullname": "clog-tool/clog-cli",
|
| 1111 |
+
"rank": 286,
|
| 1112 |
+
"similarity": 0.47210514545440674
|
| 1113 |
+
},
|
| 1114 |
+
{
|
| 1115 |
+
"pb_fullname": "rhysd/kiro-editor",
|
| 1116 |
+
"rank": 246,
|
| 1117 |
+
"similarity": 0.5622583031654358
|
| 1118 |
+
},
|
| 1119 |
+
{
|
| 1120 |
+
"pb_fullname": "sigoden/argc",
|
| 1121 |
+
"rank": 313,
|
| 1122 |
+
"similarity": 0.48812317848205566
|
| 1123 |
+
},
|
| 1124 |
+
{
|
| 1125 |
+
"pb_fullname": "unhappychoice/gittype",
|
| 1126 |
+
"rank": 143,
|
| 1127 |
+
"similarity": 0.5904698371887207
|
| 1128 |
+
},
|
| 1129 |
+
{
|
| 1130 |
+
"pb_fullname": "hush-shell/hush",
|
| 1131 |
+
"rank": 188,
|
| 1132 |
+
"similarity": 0.5078017711639404
|
| 1133 |
+
},
|
| 1134 |
+
{
|
| 1135 |
+
"pb_fullname": "chmln/sd",
|
| 1136 |
+
"rank": 530,
|
| 1137 |
+
"similarity": 0.47555068135261536
|
| 1138 |
+
},
|
| 1139 |
+
{
|
| 1140 |
+
"pb_fullname": "rcoh/angle-grinder",
|
| 1141 |
+
"rank": 117,
|
| 1142 |
+
"similarity": 0.5353225469589233
|
| 1143 |
+
},
|
| 1144 |
+
{
|
| 1145 |
+
"pb_fullname": "kyoheiu/felix",
|
| 1146 |
+
"rank": 224,
|
| 1147 |
+
"similarity": 0.5715514421463013
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"pb_fullname": "Epistates/treemd",
|
| 1151 |
+
"rank": 256,
|
| 1152 |
+
"similarity": 0.5787619352340698
|
| 1153 |
+
},
|
| 1154 |
+
{
|
| 1155 |
+
"pb_fullname": "chmln/handlr",
|
| 1156 |
+
"rank": 762,
|
| 1157 |
+
"similarity": 0.479763001203537
|
| 1158 |
+
},
|
| 1159 |
+
{
|
| 1160 |
+
"pb_fullname": "elkowar/pipr",
|
| 1161 |
+
"rank": 37,
|
| 1162 |
+
"similarity": 0.6749917268753052
|
| 1163 |
+
},
|
| 1164 |
+
{
|
| 1165 |
+
"pb_fullname": "mgdm/htmlq",
|
| 1166 |
+
"rank": 357,
|
| 1167 |
+
"similarity": 0.47250238060951233
|
| 1168 |
+
},
|
| 1169 |
+
{
|
| 1170 |
+
"pb_fullname": "nikolassv/bartib",
|
| 1171 |
+
"rank": 748,
|
| 1172 |
+
"similarity": 0.429832398891449
|
| 1173 |
+
},
|
| 1174 |
+
{
|
| 1175 |
+
"pb_fullname": "shashwatah/jot",
|
| 1176 |
+
"rank": 238,
|
| 1177 |
+
"similarity": 0.5427443981170654
|
| 1178 |
+
},
|
| 1179 |
+
{
|
| 1180 |
+
"pb_fullname": "KSXGitHub/parallel-disk-usage",
|
| 1181 |
+
"rank": 923,
|
| 1182 |
+
"similarity": 0.44746485352516174
|
| 1183 |
+
},
|
| 1184 |
+
{
|
| 1185 |
+
"pb_fullname": "konradsz/igrep",
|
| 1186 |
+
"rank": 240,
|
| 1187 |
+
"similarity": 0.5296831727027893
|
| 1188 |
+
},
|
| 1189 |
+
{
|
| 1190 |
+
"pb_fullname": "ekzhang/bore",
|
| 1191 |
+
"rank": 242,
|
| 1192 |
+
"similarity": 0.513216495513916
|
| 1193 |
+
},
|
| 1194 |
+
{
|
| 1195 |
+
"pb_fullname": "hatoo/oha",
|
| 1196 |
+
"rank": 493,
|
| 1197 |
+
"similarity": 0.5217393636703491
|
| 1198 |
+
},
|
| 1199 |
+
{
|
| 1200 |
+
"pb_fullname": "ivanceras/svgbob",
|
| 1201 |
+
"rank": 314,
|
| 1202 |
+
"similarity": 0.5114807486534119
|
| 1203 |
+
},
|
| 1204 |
+
{
|
| 1205 |
+
"pb_fullname": "trasta298/keifu",
|
| 1206 |
+
"rank": 168,
|
| 1207 |
+
"similarity": 0.5511840581893921
|
| 1208 |
+
},
|
| 1209 |
+
{
|
| 1210 |
+
"pb_fullname": "ecumene/rust-sloth",
|
| 1211 |
+
"rank": 666,
|
| 1212 |
+
"similarity": 0.4678753614425659
|
| 1213 |
+
},
|
| 1214 |
+
{
|
| 1215 |
+
"pb_fullname": "Canop/broot",
|
| 1216 |
+
"rank": 115,
|
| 1217 |
+
"similarity": 0.5740038752555847
|
| 1218 |
+
},
|
| 1219 |
+
{
|
| 1220 |
+
"pb_fullname": "sharkdp/fd",
|
| 1221 |
+
"rank": 830,
|
| 1222 |
+
"similarity": 0.41948992013931274
|
| 1223 |
+
},
|
| 1224 |
+
{
|
| 1225 |
+
"pb_fullname": "pls-rs/pls",
|
| 1226 |
+
"rank": 484,
|
| 1227 |
+
"similarity": 0.4534699320793152
|
| 1228 |
+
},
|
| 1229 |
+
{
|
| 1230 |
+
"pb_fullname": "Byron/dua-cli",
|
| 1231 |
+
"rank": 393,
|
| 1232 |
+
"similarity": 0.4626261591911316
|
| 1233 |
+
},
|
| 1234 |
+
{
|
| 1235 |
+
"pb_fullname": "mookid/diffr",
|
| 1236 |
+
"rank": 764,
|
| 1237 |
+
"similarity": 0.4768749475479126
|
| 1238 |
+
},
|
| 1239 |
+
{
|
| 1240 |
+
"pb_fullname": "anordal/shellharden",
|
| 1241 |
+
"rank": 588,
|
| 1242 |
+
"similarity": 0.48081886768341064
|
| 1243 |
+
},
|
| 1244 |
+
{
|
| 1245 |
+
"pb_fullname": "pier-cli/pier",
|
| 1246 |
+
"rank": 303,
|
| 1247 |
+
"similarity": 0.5371586084365845
|
| 1248 |
+
},
|
| 1249 |
+
{
|
| 1250 |
+
"pb_fullname": "sharkdp/bat",
|
| 1251 |
+
"rank": 508,
|
| 1252 |
+
"similarity": 0.4990411400794983
|
| 1253 |
+
},
|
| 1254 |
+
{
|
| 1255 |
+
"pb_fullname": "jrnxf/thokr",
|
| 1256 |
+
"rank": 38,
|
| 1257 |
+
"similarity": 0.5928927659988403
|
| 1258 |
+
},
|
| 1259 |
+
{
|
| 1260 |
+
"pb_fullname": "wintermute-cell/ngrrram",
|
| 1261 |
+
"rank": 23,
|
| 1262 |
+
"similarity": 0.6385040283203125
|
| 1263 |
+
},
|
| 1264 |
+
{
|
| 1265 |
+
"pb_fullname": "XAMPPRocky/tokei",
|
| 1266 |
+
"rank": 551,
|
| 1267 |
+
"similarity": 0.43300366401672363
|
| 1268 |
+
},
|
| 1269 |
+
{
|
| 1270 |
+
"pb_fullname": "wfxr/csview",
|
| 1271 |
+
"rank": 96,
|
| 1272 |
+
"similarity": 0.5186554193496704
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"pb_fullname": "yassinebridi/serpl",
|
| 1276 |
+
"rank": 291,
|
| 1277 |
+
"similarity": 0.5755276679992676
|
| 1278 |
+
},
|
| 1279 |
+
{
|
| 1280 |
+
"pb_fullname": "YS-L/flamelens",
|
| 1281 |
+
"rank": 274,
|
| 1282 |
+
"similarity": 0.5193620324134827
|
| 1283 |
+
}
|
| 1284 |
+
],
|
| 1285 |
+
"repo_age": 3.53,
|
| 1286 |
+
"repo_path": "rust/transformrs__ata",
|
| 1287 |
+
"rust_channel": "stable",
|
| 1288 |
+
"rust_edition": "2021",
|
| 1289 |
+
"rust_release_date": "2021-10-21",
|
| 1290 |
+
"rust_version": "1.56.0",
|
| 1291 |
+
"rust_version_source": "edition",
|
| 1292 |
+
"source": "commit:a644a6ce6ebaf93ba5195deb60a125046af60628",
|
| 1293 |
+
"status": "done",
|
| 1294 |
+
"url": "https://github.com/transformrs/ata"
|
| 1295 |
+
},
|
| 1296 |
+
"instance_id": "transformrs__ata.a644a6c",
|
| 1297 |
+
"language": "rust",
|
| 1298 |
+
"module_iterations": [
|
| 1299 |
+
{
|
| 1300 |
+
"actual_iterations": 2,
|
| 1301 |
+
"branch_name": "generated_module_01",
|
| 1302 |
+
"iteration_limit": 5,
|
| 1303 |
+
"module_index": 1,
|
| 1304 |
+
"module_kind": "source",
|
| 1305 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"actual_iterations": 5,
|
| 1309 |
+
"branch_name": "generated_module_02",
|
| 1310 |
+
"iteration_limit": 5,
|
| 1311 |
+
"module_index": 2,
|
| 1312 |
+
"module_kind": "source",
|
| 1313 |
+
"termination_reason": "early_stopping"
|
| 1314 |
+
},
|
| 1315 |
+
{
|
| 1316 |
+
"actual_iterations": 5,
|
| 1317 |
+
"branch_name": "generated_module_03",
|
| 1318 |
+
"iteration_limit": 5,
|
| 1319 |
+
"module_index": 3,
|
| 1320 |
+
"module_kind": "source",
|
| 1321 |
+
"termination_reason": "max_iterations"
|
| 1322 |
+
},
|
| 1323 |
+
{
|
| 1324 |
+
"actual_iterations": 5,
|
| 1325 |
+
"branch_name": "generated_upstream",
|
| 1326 |
+
"iteration_limit": 5,
|
| 1327 |
+
"module_index": 4,
|
| 1328 |
+
"module_kind": "tests",
|
| 1329 |
+
"termination_reason": "early_stopping"
|
| 1330 |
+
}
|
| 1331 |
+
],
|
| 1332 |
+
"repository": "transformrs/ata"
|
| 1333 |
+
}
|
transformrs--ata.a644a6c/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
|
transformrs--ata.a644a6c/tests/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3665327a2fed282dac406a149f3567f857cac3316797ab6d6eeb6259fba5ddcf
|
| 3 |
+
size 1554
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/environment/download.sh
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Manually recovered and independently validated ProgramGym build contract.
|
| 3 |
+
set -euo pipefail
|
| 4 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF'
|
| 7 |
+
module github.com/trap-bytes/403jump
|
| 8 |
+
|
| 9 |
+
go 1.21.5
|
| 10 |
+
PB_MANUAL_GO_MOD_EOF
|
| 11 |
+
cd /workspace/.programgym_build_env/go-prefetch
|
| 12 |
+
PB_RECOVERY_GOROOT="$(go env GOROOT)"
|
| 13 |
+
mkdir -p /opt/programgym-go-toolchain
|
| 14 |
+
cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/
|
| 15 |
+
export GOROOT=/opt/programgym-go-toolchain
|
| 16 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 17 |
+
export GOTOOLCHAIN=local
|
| 18 |
+
go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all
|
trap-bytes--403jump.772eba8/environment/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57a94e1a63e49c3f0ae83d02ca2b03b0220c7f81a274eb77d8e7ef82693aeec9
|
| 3 |
+
size 8356905
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/environment/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a041f1541f182cef02667e614edc4f70c3115f0e7c08edc403a6e50a4e839758
|
| 3 |
+
size 1003
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/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/trap-bytes--403jump.772eba8"
|
| 25 |
+
description = "Synthetic ProgramGym cleanroom reconstruction task for trap-bytes/403jump"
|
| 26 |
+
authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
|
| 27 |
+
keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
|
| 28 |
+
|
| 29 |
+
[metadata]
|
| 30 |
+
source = "ProgramGym"
|
| 31 |
+
instance_id = "trap-bytes__403jump.772eba8"
|
| 32 |
+
repository = "trap-bytes/403jump"
|
| 33 |
+
commit = "772eba8f8b8f51f6736d539444fce5248df4ab08"
|
| 34 |
+
language = "go"
|
| 35 |
+
difficulty = "easy"
|
| 36 |
+
difficulty_score = 0.7520484478194387
|
| 37 |
+
test_branches = 4
|
| 38 |
+
test_count = 207
|
| 39 |
+
|
| 40 |
+
[agent]
|
| 41 |
+
timeout_sec = 14400
|
| 42 |
+
user = "agent"
|
| 43 |
+
network_mode = "allowlist"
|
| 44 |
+
allowed_hosts = ["api.anthropic.com", "api.openai.com"]
|
| 45 |
+
|
| 46 |
+
[verifier]
|
| 47 |
+
timeout_sec = 7200
|
| 48 |
+
user = "root"
|
| 49 |
+
environment_mode = "separate"
|
| 50 |
+
|
| 51 |
+
[verifier.env]
|
| 52 |
+
PROGRAMGYM_XDIST_WORKERS = "8"
|
| 53 |
+
|
| 54 |
+
[verifier.environment]
|
| 55 |
+
build_timeout_sec = 1800
|
| 56 |
+
cpus = 8
|
| 57 |
+
memory_mb = 16384
|
| 58 |
+
storage_mb = 30720
|
| 59 |
+
gpus = 0
|
| 60 |
+
workdir = "/workspace"
|
| 61 |
+
|
| 62 |
+
[environment]
|
| 63 |
+
network_mode = "public"
|
| 64 |
+
build_timeout_sec = 1800
|
| 65 |
+
cpus = 8
|
| 66 |
+
memory_mb = 16384
|
| 67 |
+
storage_mb = 30720
|
| 68 |
+
gpus = 0
|
| 69 |
+
workdir = "/workspace"
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/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:a283792a26db96e539af01174e6c7e30872913365bf62e21a2814c1cdfcc084b
|
| 3 |
+
size 6979
|
trap-bytes--403jump.772eba8/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:6cf6db12ef278a541eddbd10831c22f8d612d9f02e8e267a8f3ff51c7ec78ca7
|
| 3 |
+
size 6284
|
trap-bytes--403jump.772eba8/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:d988ce3f980d2225c43a842a8173531025c422647bacc1e128f838fb0e8b5459
|
| 3 |
+
size 9355
|
trap-bytes--403jump.772eba8/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:0aad0daa54464c7085e3d10ef2ec659bc7c6bd395f24a95d087b5dcf9b1bd25d
|
| 3 |
+
size 8754
|
trap-bytes--403jump.772eba8/tests/download.sh
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Manually recovered and independently validated ProgramGym build contract.
|
| 3 |
+
set -euo pipefail
|
| 4 |
+
mkdir -p /workspace/.programgym_build_env/go-prefetch
|
| 5 |
+
export GOTOOLCHAIN=auto
|
| 6 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF'
|
| 7 |
+
module github.com/trap-bytes/403jump
|
| 8 |
+
|
| 9 |
+
go 1.21.5
|
| 10 |
+
PB_MANUAL_GO_MOD_EOF
|
| 11 |
+
cd /workspace/.programgym_build_env/go-prefetch
|
| 12 |
+
PB_RECOVERY_GOROOT="$(go env GOROOT)"
|
| 13 |
+
mkdir -p /opt/programgym-go-toolchain
|
| 14 |
+
cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/
|
| 15 |
+
export GOROOT=/opt/programgym-go-toolchain
|
| 16 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 17 |
+
export GOTOOLCHAIN=local
|
| 18 |
+
go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all
|
trap-bytes--403jump.772eba8/tests/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57a94e1a63e49c3f0ae83d02ca2b03b0220c7f81a274eb77d8e7ef82693aeec9
|
| 3 |
+
size 8356905
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/tests/programgym_evaluator.py
ADDED
|
@@ -0,0 +1,1201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|
trap-bytes--403jump.772eba8/tests/programgym_task.json
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"branches": {
|
| 3 |
+
"generated_module_01": {
|
| 4 |
+
"ignore_reason": "",
|
| 5 |
+
"ignored": false,
|
| 6 |
+
"ignored_tests": [],
|
| 7 |
+
"tests": [
|
| 8 |
+
"eval.tests.test_cli_validation.test_bad_scheme_rejected",
|
| 9 |
+
"eval.tests.test_cli_validation.test_both_rejected_when_files_distinct_from_target",
|
| 10 |
+
"eval.tests.test_cli_validation.test_both_target_and_file_rejected",
|
| 11 |
+
"eval.tests.test_cli_validation.test_empty_file_fails_validation",
|
| 12 |
+
"eval.tests.test_cli_validation.test_empty_url_fails_validation",
|
| 13 |
+
"eval.tests.test_cli_validation.test_help_does_not_contact_server",
|
| 14 |
+
"eval.tests.test_cli_validation.test_help_flag_exits_before_target_validation",
|
| 15 |
+
"eval.tests.test_cli_validation.test_help_flag_prints_usage",
|
| 16 |
+
"eval.tests.test_cli_validation.test_invalid_header_format_flagged",
|
| 17 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[127.0.0.1:0]",
|
| 18 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[127.0.0.1:65536]",
|
| 19 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[127.0.0.1:abc]",
|
| 20 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[127.0.0.1]",
|
| 21 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[256.1.1.1:8080]",
|
| 22 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[localhost:8080]",
|
| 23 |
+
"eval.tests.test_cli_validation.test_invalid_proxy_rejected[notaproxy]",
|
| 24 |
+
"eval.tests.test_cli_validation.test_js_scheme_rejected",
|
| 25 |
+
"eval.tests.test_cli_validation.test_missing_target_does_not_dispatch",
|
| 26 |
+
"eval.tests.test_cli_validation.test_no_arguments_requires_target",
|
| 27 |
+
"eval.tests.test_cli_validation.test_no_scheme_ip_port_parse_error",
|
| 28 |
+
"eval.tests.test_cli_validation.test_no_scheme_ip_port_path_parse_error",
|
| 29 |
+
"eval.tests.test_cli_validation.test_scheme_error_before_dispatch",
|
| 30 |
+
"eval.tests.test_cli_validation.test_valid_proxy_acknowledged",
|
| 31 |
+
"eval.tests.test_cli_validation.test_valid_proxy_has_no_http_scheme_routing",
|
| 32 |
+
"eval.tests.test_dispatch.test_banner_always_printed",
|
| 33 |
+
"eval.tests.test_dispatch.test_bare_host_normalizes_to_root_path_fuzzing",
|
| 34 |
+
"eval.tests.test_dispatch.test_client_server_error_status_report_no_bypass[400-No bypass found]",
|
| 35 |
+
"eval.tests.test_dispatch.test_client_server_error_status_report_no_bypass[403-No bypass found]",
|
| 36 |
+
"eval.tests.test_dispatch.test_client_server_error_status_report_no_bypass[404-No bypass found]",
|
| 37 |
+
"eval.tests.test_dispatch.test_client_server_error_status_report_no_bypass[500-No bypass found]",
|
| 38 |
+
"eval.tests.test_dispatch.test_connection_refused_still_finishes",
|
| 39 |
+
"eval.tests.test_dispatch.test_default_timeout_used_and_bounded",
|
| 40 |
+
"eval.tests.test_dispatch.test_file_missing_reports_tail_error",
|
| 41 |
+
"eval.tests.test_dispatch.test_file_mixed_valid_and_invalid",
|
| 42 |
+
"eval.tests.test_dispatch.test_file_non_utf8_entries",
|
| 43 |
+
"eval.tests.test_dispatch.test_file_with_blank_lines_skips_empties",
|
| 44 |
+
"eval.tests.test_dispatch.test_file_with_invalid_entries_flagged",
|
| 45 |
+
"eval.tests.test_dispatch.test_headers_dispatched_to_server",
|
| 46 |
+
"eval.tests.test_dispatch.test_multiple_targets_from_file",
|
| 47 |
+
"eval.tests.test_dispatch.test_single_target_bypass_count_positive",
|
| 48 |
+
"eval.tests.test_dispatch.test_single_target_bypass_found",
|
| 49 |
+
"eval.tests.test_dispatch.test_single_target_dispatches_request",
|
| 50 |
+
"eval.tests.test_dispatch.test_single_target_no_bypass_found",
|
| 51 |
+
"eval.tests.test_dispatch.test_single_target_timeout_flag_accepted",
|
| 52 |
+
"eval.tests.test_dispatch.test_single_target_with_cookie",
|
| 53 |
+
"eval.tests.test_dispatch.test_single_target_with_header",
|
| 54 |
+
"eval.tests.test_dispatch.test_success_status_variants_report_bypass[101-Found -No bypass found]",
|
| 55 |
+
"eval.tests.test_dispatch.test_success_status_variants_report_bypass[200-Found -No bypass found]",
|
| 56 |
+
"eval.tests.test_dispatch.test_success_status_variants_report_bypass[204-Found -No bypass found]",
|
| 57 |
+
"eval.tests.test_dispatch.test_success_status_variants_report_bypass[250-Found -No bypass found]",
|
| 58 |
+
"eval.tests.test_dispatch.test_url_path_fuzzing_runs_with_path"
|
| 59 |
+
]
|
| 60 |
+
},
|
| 61 |
+
"generated_module_02": {
|
| 62 |
+
"ignore_reason": "",
|
| 63 |
+
"ignored": false,
|
| 64 |
+
"ignored_tests": [],
|
| 65 |
+
"tests": [
|
| 66 |
+
"eval.tests.test_httphandler.test_both_target_and_file_rejected",
|
| 67 |
+
"eval.tests.test_httphandler.test_bypass_via_header_reported",
|
| 68 |
+
"eval.tests.test_httphandler.test_bypass_via_path_fuzz_reported",
|
| 69 |
+
"eval.tests.test_httphandler.test_bypass_via_verb_method_reported",
|
| 70 |
+
"eval.tests.test_httphandler.test_cookie_argument_flows_to_requests",
|
| 71 |
+
"eval.tests.test_httphandler.test_custom_header_is_applied",
|
| 72 |
+
"eval.tests.test_httphandler.test_empty_file_reports_no_bypass",
|
| 73 |
+
"eval.tests.test_httphandler.test_file_missing_reports_error",
|
| 74 |
+
"eval.tests.test_httphandler.test_file_with_targets_processes_each",
|
| 75 |
+
"eval.tests.test_httphandler.test_file_with_unresolvable_entry_reports_error",
|
| 76 |
+
"eval.tests.test_httphandler.test_help_flag_lists_examples",
|
| 77 |
+
"eval.tests.test_httphandler.test_help_flag_prints_usage_and_succeeds",
|
| 78 |
+
"eval.tests.test_httphandler.test_invalid_header_format_reported",
|
| 79 |
+
"eval.tests.test_httphandler.test_invalid_proxy_bad_ip_rejected",
|
| 80 |
+
"eval.tests.test_httphandler.test_invalid_proxy_format_rejected",
|
| 81 |
+
"eval.tests.test_httphandler.test_invalid_proxy_non_numeric_port_rejected",
|
| 82 |
+
"eval.tests.test_httphandler.test_invalid_proxy_out_of_range_port_rejected",
|
| 83 |
+
"eval.tests.test_httphandler.test_invalid_proxy_zero_port_rejected",
|
| 84 |
+
"eval.tests.test_httphandler.test_invalid_url_scheme_rejected",
|
| 85 |
+
"eval.tests.test_httphandler.test_missing_scheme_defaults_to_https",
|
| 86 |
+
"eval.tests.test_httphandler.test_no_target_prints_require_target_error",
|
| 87 |
+
"eval.tests.test_httphandler.test_partial_bypass_through_prefix_server",
|
| 88 |
+
"eval.tests.test_httphandler.test_pathless_target_dispatches_to_root_path",
|
| 89 |
+
"eval.tests.test_httphandler.test_single_target_no_bypass_reports_no_bypass",
|
| 90 |
+
"eval.tests.test_httphandler.test_single_target_with_bypass_counts_found",
|
| 91 |
+
"eval.tests.test_httphandler.test_timeout_flag_accepted",
|
| 92 |
+
"eval.tests.test_httphandler.test_unresolvable_host_reported",
|
| 93 |
+
"eval.tests.test_httphandler.test_valid_proxy_is_used_for_transport"
|
| 94 |
+
]
|
| 95 |
+
},
|
| 96 |
+
"generated_module_03": {
|
| 97 |
+
"ignore_reason": "",
|
| 98 |
+
"ignored": false,
|
| 99 |
+
"ignored_tests": [],
|
| 100 |
+
"tests": [
|
| 101 |
+
"eval.tests.test_headers.test_headers_each_spoof_header_reaches_server",
|
| 102 |
+
"eval.tests.test_headers.test_headers_host_spoof_does_not_alter_wire_host",
|
| 103 |
+
"eval.tests.test_headers.test_headers_no_bypass_when_all_spoofed_requests_forbidden",
|
| 104 |
+
"eval.tests.test_headers.test_headers_timeout_is_skipped_and_loop_continues",
|
| 105 |
+
"eval.tests.test_headers.test_multiple_distinct_spoof_headers_each_count",
|
| 106 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[client-ip]",
|
| 107 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[cluster-client-ip]",
|
| 108 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[forwarded-for]",
|
| 109 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[true-client-ip]",
|
| 110 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-forwarded-for]",
|
| 111 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-forwarded]",
|
| 112 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-original-url]",
|
| 113 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-originating-ip]",
|
| 114 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-proxyuser-ip]",
|
| 115 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-remote-addr]",
|
| 116 |
+
"eval.tests.test_headers.test_single_spoof_header_bypass_is_reported[x-remote-ip]",
|
| 117 |
+
"eval.tests.test_path_fuzzing.test_path_all_fuzz_variants_are_probed",
|
| 118 |
+
"eval.tests.test_path_fuzzing.test_path_bypass_when_all_variants_unlocked_except_base",
|
| 119 |
+
"eval.tests.test_path_fuzzing.test_path_connection_error_stops_engine_with_no_bypass",
|
| 120 |
+
"eval.tests.test_path_fuzzing.test_path_engine_uses_encoded_and_uppercase_extension_variants",
|
| 121 |
+
"eval.tests.test_path_fuzzing.test_path_no_bypass_when_all_forbidden",
|
| 122 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[%2e/secret]",
|
| 123 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[%2f/secret]",
|
| 124 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[%ef%bc%8f/secret]",
|
| 125 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[*/secret]",
|
| 126 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[./secret/..]",
|
| 127 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[./secret]",
|
| 128 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[.;/secret]",
|
| 129 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[;///secret]",
|
| 130 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[;/secret]",
|
| 131 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[SECRET]",
|
| 132 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret.html]",
|
| 133 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret.json]",
|
| 134 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret/.]",
|
| 135 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret//]",
|
| 136 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret/]",
|
| 137 |
+
"eval.tests.test_path_fuzzing.test_path_single_variant_bypass_is_reported[secret?]",
|
| 138 |
+
"eval.tests.test_path_fuzzing.test_path_timeout_is_skipped_and_loop_continues",
|
| 139 |
+
"eval.tests.test_verbs.test_executable_env_must_be_exported_by_pipeline",
|
| 140 |
+
"eval.tests.test_verbs.test_verb_connection_error_halts_engine_with_no_bypass",
|
| 141 |
+
"eval.tests.test_verbs.test_verb_each_method_is_probed_with_a_request",
|
| 142 |
+
"eval.tests.test_verbs.test_verb_eight_non_get_methods_bypass_when_server_serves_them",
|
| 143 |
+
"eval.tests.test_verbs.test_verb_no_bypass_when_all_methods_forbidden",
|
| 144 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-delete]",
|
| 145 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-get]",
|
| 146 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-head]",
|
| 147 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-invented]",
|
| 148 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-options]",
|
| 149 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-patch]",
|
| 150 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-post]",
|
| 151 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-put]",
|
| 152 |
+
"eval.tests.test_verbs.test_verb_single_method_bypass_is_reported[verb-trace]",
|
| 153 |
+
"eval.tests.test_verbs.test_verb_timeout_is_skipped_and_processing_continues",
|
| 154 |
+
"eval.tests.test_verbs_cookie_header.test_verb_cookie_gated_bypass_requires_configured_cookie",
|
| 155 |
+
"eval.tests.test_verbs_cookie_header.test_verb_custom_header_absent_means_no_gated_bypass",
|
| 156 |
+
"eval.tests.test_verbs_cookie_header.test_verb_custom_header_name_and_value_are_trimmed",
|
| 157 |
+
"eval.tests.test_verbs_cookie_header.test_verb_engine_attaches_cookie_to_every_verb",
|
| 158 |
+
"eval.tests.test_verbs_cookie_header.test_verb_engine_attaches_cookie_to_request",
|
| 159 |
+
"eval.tests.test_verbs_cookie_header.test_verb_engine_attaches_custom_header",
|
| 160 |
+
"eval.tests.test_verbs_cookie_header.test_verb_invalid_custom_header_prints_error"
|
| 161 |
+
]
|
| 162 |
+
},
|
| 163 |
+
"generated_module_04": {
|
| 164 |
+
"ignore_reason": "",
|
| 165 |
+
"ignored": false,
|
| 166 |
+
"ignored_tests": [],
|
| 167 |
+
"tests": [
|
| 168 |
+
"eval.tests.test_banner_color_and_path.test_banner_color_codes_present_raw",
|
| 169 |
+
"eval.tests.test_banner_color_and_path.test_banner_rendered_in_help_and_normal_runs",
|
| 170 |
+
"eval.tests.test_banner_color_and_path.test_colorize_reset_code_wraps_result_messages",
|
| 171 |
+
"eval.tests.test_banner_color_and_path.test_hasp_path_absent_still_runs_verb_and_header_fuzzing",
|
| 172 |
+
"eval.tests.test_banner_color_and_path.test_hasp_path_present_triggers_path_fuzzing_requests",
|
| 173 |
+
"eval.tests.test_banner_color_and_path.test_path_fuzzing_uses_port_bearing_path_url",
|
| 174 |
+
"eval.tests.test_file_reading.test_processing_targets_from_file_announcement_path",
|
| 175 |
+
"eval.tests.test_file_reading.test_read_targets_directory_path_read_error",
|
| 176 |
+
"eval.tests.test_file_reading.test_read_targets_drops_invalid_entries_with_inline_error[broken_scheme]",
|
| 177 |
+
"eval.tests.test_file_reading.test_read_targets_drops_invalid_entries_with_inline_error[ftp_scheme]",
|
| 178 |
+
"eval.tests.test_file_reading.test_read_targets_drops_invalid_entries_with_inline_error[host_port_scheme]",
|
| 179 |
+
"eval.tests.test_file_reading.test_read_targets_drops_invalid_entries_with_inline_error[mailto_scheme]",
|
| 180 |
+
"eval.tests.test_file_reading.test_read_targets_missing_file_reports_error",
|
| 181 |
+
"eval.tests.test_file_reading.test_read_targets_missing_scheme_entry_https_promotion",
|
| 182 |
+
"eval.tests.test_file_reading.test_read_targets_mixed_file_keeps_valid_drops_invalid",
|
| 183 |
+
"eval.tests.test_file_reading.test_read_targets_processes_valid_entries[bare_ip_https_default]",
|
| 184 |
+
"eval.tests.test_file_reading.test_read_targets_processes_valid_entries[http_ip_port]",
|
| 185 |
+
"eval.tests.test_file_reading.test_read_targets_processes_valid_entries[http_localhost]",
|
| 186 |
+
"eval.tests.test_file_reading.test_read_targets_skips_blank_and_whitespace_lines",
|
| 187 |
+
"eval.tests.test_file_reading.test_read_targets_trims_whitespace_before_validation",
|
| 188 |
+
"eval.tests.test_flags_and_url_validation.test_help_flag_prints_examples",
|
| 189 |
+
"eval.tests.test_flags_and_url_validation.test_help_flag_prints_usage_without_target_error",
|
| 190 |
+
"eval.tests.test_flags_and_url_validation.test_single_target_run_terminates_with_no_bypass",
|
| 191 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_both_targets_rejected[both_head]",
|
| 192 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_both_targets_rejected[both_reversed_order]",
|
| 193 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_both_targets_rejected[both_scheme_and_file]",
|
| 194 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_no_target_rejected[empty_f]",
|
| 195 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_no_target_rejected[empty_t]",
|
| 196 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_no_target_rejected[no_args]",
|
| 197 |
+
"eval.tests.test_flags_and_url_validation.test_validateflags_no_target_rejected[proxy_only]",
|
| 198 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_colon_in_first_path_segment_parse_error",
|
| 199 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_dns_lookup_failure_reports_error",
|
| 200 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[bare_host_https_default]",
|
| 201 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[http_ip_port]",
|
| 202 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[http_ip_port_8080]",
|
| 203 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[http_no_port]",
|
| 204 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[https_no_port]",
|
| 205 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[https_port]",
|
| 206 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_normalization_sends_normalized_url[https_port_path]",
|
| 207 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[file_scheme]",
|
| 208 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[ftp_scheme]",
|
| 209 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[host_port_as_scheme]",
|
| 210 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[ip_port_as_scheme]",
|
| 211 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[mailto_scheme]",
|
| 212 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[missing_protocol_scheme]",
|
| 213 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_scheme_and_parse_errors[percent_parse_error]",
|
| 214 |
+
"eval.tests.test_flags_and_url_validation.test_validateurl_whitespace_padded_host_panics_on_reparse",
|
| 215 |
+
"eval.tests.test_proxy_validation.test_invalid_proxy_prevents_target_processing",
|
| 216 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_accepts_wellformed[any_ip_8080]",
|
| 217 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_accepts_wellformed[loopback_max_port]",
|
| 218 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_accepts_wellformed[loopback_port_1]",
|
| 219 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_accepts_wellformed[loopback_port_2]",
|
| 220 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[all_octets_out_of_range]",
|
| 221 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[alphabetical_ip]",
|
| 222 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[empty_ip]",
|
| 223 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[empty_port]",
|
| 224 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[extra_colon]",
|
| 225 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[leading_space_ip]",
|
| 226 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[malformed_dotted]",
|
| 227 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[no_colon_ip]",
|
| 228 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[no_colon_word]",
|
| 229 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[octet_out_of_range]",
|
| 230 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[port_negative]",
|
| 231 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[port_non_numeric]",
|
| 232 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[port_over_max]",
|
| 233 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[port_trailing_junk]",
|
| 234 |
+
"eval.tests.test_proxy_validation.test_isvalidproxy_rejects_malformed[port_zero]",
|
| 235 |
+
"eval.tests.test_proxy_validation.test_valid_proxy_reaches_path_fuzzing_and_no_bypass"
|
| 236 |
+
]
|
| 237 |
+
}
|
| 238 |
+
},
|
| 239 |
+
"commit": "772eba8f8b8f51f6736d539444fce5248df4ab08",
|
| 240 |
+
"data_source": "synthetic_programgym",
|
| 241 |
+
"difficulty": "easy",
|
| 242 |
+
"difficulty_score": 0.7520484478194387,
|
| 243 |
+
"eval_clean_hashes": [
|
| 244 |
+
"57a94e1a63e49c3f0ae83d02ca2b03b0220c7f81a274eb77d8e7ef82693aeec9"
|
| 245 |
+
],
|
| 246 |
+
"input_record": {
|
| 247 |
+
"commit": "772eba8f8b8f51f6736d539444fce5248df4ab08",
|
| 248 |
+
"commits": 23,
|
| 249 |
+
"contributors": 1,
|
| 250 |
+
"difficulty": "easy",
|
| 251 |
+
"difficulty_code_lines": 565,
|
| 252 |
+
"difficulty_has_tests": false,
|
| 253 |
+
"difficulty_product_code_lines": 565,
|
| 254 |
+
"difficulty_runtime_deps": 0,
|
| 255 |
+
"difficulty_score": 0.7520484478194387,
|
| 256 |
+
"difficulty_test_code_lines": 0,
|
| 257 |
+
"full_name": "trap-bytes/403jump",
|
| 258 |
+
"github_stars": 626,
|
| 259 |
+
"input_joern_zip": "go_joern/trap-bytes__403jump.zip",
|
| 260 |
+
"joern_status": true,
|
| 261 |
+
"joern_time": 10.359717995859683,
|
| 262 |
+
"language": "go",
|
| 263 |
+
"pb_match": [
|
| 264 |
+
{
|
| 265 |
+
"pb_fullname": "rs/curlie",
|
| 266 |
+
"rank": 797,
|
| 267 |
+
"similarity": 0.48328882455825806
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"pb_fullname": "astaxie/bat",
|
| 271 |
+
"rank": 402,
|
| 272 |
+
"similarity": 0.5462660789489746
|
| 273 |
+
},
|
| 274 |
+
{
|
| 275 |
+
"pb_fullname": "raviqqe/muffet",
|
| 276 |
+
"rank": 381,
|
| 277 |
+
"similarity": 0.4971325993537903
|
| 278 |
+
}
|
| 279 |
+
],
|
| 280 |
+
"repo_age": 2.53,
|
| 281 |
+
"repo_path": "go/trap-bytes__403jump",
|
| 282 |
+
"source": "commit:772eba8f8b8f51f6736d539444fce5248df4ab08",
|
| 283 |
+
"status": "done",
|
| 284 |
+
"url": "https://github.com/trap-bytes/403jump"
|
| 285 |
+
},
|
| 286 |
+
"instance_id": "trap-bytes__403jump.772eba8",
|
| 287 |
+
"language": "go",
|
| 288 |
+
"module_iterations": [
|
| 289 |
+
{
|
| 290 |
+
"actual_iterations": 2,
|
| 291 |
+
"branch_name": "generated_module_01",
|
| 292 |
+
"iteration_limit": 5,
|
| 293 |
+
"module_index": 1,
|
| 294 |
+
"module_kind": "source",
|
| 295 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 296 |
+
},
|
| 297 |
+
{
|
| 298 |
+
"actual_iterations": 3,
|
| 299 |
+
"branch_name": "generated_module_02",
|
| 300 |
+
"iteration_limit": 5,
|
| 301 |
+
"module_index": 2,
|
| 302 |
+
"module_kind": "source",
|
| 303 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"actual_iterations": 4,
|
| 307 |
+
"branch_name": "generated_module_03",
|
| 308 |
+
"iteration_limit": 5,
|
| 309 |
+
"module_index": 3,
|
| 310 |
+
"module_kind": "source",
|
| 311 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"actual_iterations": 3,
|
| 315 |
+
"branch_name": "generated_module_04",
|
| 316 |
+
"iteration_limit": 5,
|
| 317 |
+
"module_index": 4,
|
| 318 |
+
"module_kind": "source",
|
| 319 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 320 |
+
}
|
| 321 |
+
],
|
| 322 |
+
"repository": "trap-bytes/403jump"
|
| 323 |
+
}
|
trap-bytes--403jump.772eba8/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
|
trap-bytes--403jump.772eba8/tests/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a041f1541f182cef02667e614edc4f70c3115f0e7c08edc403a6e50a4e839758
|
| 3 |
+
size 1003
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/environment/download.sh
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/trap-bytes/gourlex
|
| 9 |
+
|
| 10 |
+
go 1.21.5
|
| 11 |
+
|
| 12 |
+
require golang.org/x/net v0.21.0 // indirect
|
| 13 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 14 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 15 |
+
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
| 16 |
+
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
| 17 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 18 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 19 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 20 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 21 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 22 |
+
return 1
|
| 23 |
+
else
|
| 24 |
+
exit 1
|
| 25 |
+
fi
|
| 26 |
+
fi
|
| 27 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 28 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 29 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 30 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 31 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 32 |
+
else
|
| 33 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 34 |
+
fi
|
| 35 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 36 |
+
export GOTOOLCHAIN=local
|
| 37 |
+
if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
|
| 38 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 39 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 40 |
+
return 1
|
| 41 |
+
else
|
| 42 |
+
exit 1
|
| 43 |
+
fi
|
| 44 |
+
fi
|
trap-bytes--gourlex.bd2143d/environment/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e14ca0a2afd10828a151227d4c3a5f4015ec87f48a9cb3930a74ea7e301321a4
|
| 3 |
+
size 8423233
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/environment/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0989c5c4863a711c6806edeaae8aaabb1f86a366845245ebd9380cb332aa943
|
| 3 |
+
size 869
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/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/trap-bytes--gourlex.bd2143d"
|
| 25 |
+
description = "Synthetic ProgramGym cleanroom reconstruction task for trap-bytes/gourlex"
|
| 26 |
+
authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
|
| 27 |
+
keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
|
| 28 |
+
|
| 29 |
+
[metadata]
|
| 30 |
+
source = "ProgramGym"
|
| 31 |
+
instance_id = "trap-bytes__gourlex.bd2143d"
|
| 32 |
+
repository = "trap-bytes/gourlex"
|
| 33 |
+
commit = "bd2143dd6b7b47f037e6d14ae1dfc79798099791"
|
| 34 |
+
language = "go"
|
| 35 |
+
difficulty = "easy"
|
| 36 |
+
difficulty_score = 0.7909884750888159
|
| 37 |
+
test_branches = 1
|
| 38 |
+
test_count = 65
|
| 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"
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/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:37730e732e8ff6af4f42bba52c88761dcfddddaf503b98009e2a1520575b9617
|
| 3 |
+
size 10038
|
trap-bytes--gourlex.bd2143d/tests/download.sh
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/trap-bytes/gourlex
|
| 9 |
+
|
| 10 |
+
go 1.21.5
|
| 11 |
+
|
| 12 |
+
require golang.org/x/net v0.21.0 // indirect
|
| 13 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 14 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 15 |
+
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
| 16 |
+
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
| 17 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 18 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 19 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 20 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 21 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 22 |
+
return 1
|
| 23 |
+
else
|
| 24 |
+
exit 1
|
| 25 |
+
fi
|
| 26 |
+
fi
|
| 27 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 28 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 29 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 30 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 31 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 32 |
+
else
|
| 33 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 34 |
+
fi
|
| 35 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 36 |
+
export GOTOOLCHAIN=local
|
| 37 |
+
if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then
|
| 38 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 39 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 40 |
+
return 1
|
| 41 |
+
else
|
| 42 |
+
exit 1
|
| 43 |
+
fi
|
| 44 |
+
fi
|
trap-bytes--gourlex.bd2143d/tests/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e14ca0a2afd10828a151227d4c3a5f4015ec87f48a9cb3930a74ea7e301321a4
|
| 3 |
+
size 8423233
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/tests/programgym_evaluator.py
ADDED
|
@@ -0,0 +1,1201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|
trap-bytes--gourlex.bd2143d/tests/programgym_task.json
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"branches": {
|
| 3 |
+
"generated_module_01": {
|
| 4 |
+
"ignore_reason": "",
|
| 5 |
+
"ignored": false,
|
| 6 |
+
"ignored_tests": [],
|
| 7 |
+
"tests": [
|
| 8 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_non_silent_default_prints_section_headers",
|
| 9 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_non_silent_pO_omits_urls_section",
|
| 10 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_non_silent_uO_omits_paths_section",
|
| 11 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_silent_default_hides_headers_and_banner",
|
| 12 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_silent_pO_prints_only_paths",
|
| 13 |
+
"eval.tests.test_extraction.TestOutputFormatModes.test_silent_uO_prints_only_urls",
|
| 14 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_cookie_header_sent",
|
| 15 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_custom_header_sent",
|
| 16 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_custom_header_split_on_first_colon",
|
| 17 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_default_user_agent_sent",
|
| 18 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_invalid_header_format_message",
|
| 19 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_no_cookie_header_when_flag_absent",
|
| 20 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_repeated_r_flag_keeps_last_header",
|
| 21 |
+
"eval.tests.test_extraction.TestRequestHeaders.test_trimmed_header_spaces",
|
| 22 |
+
"eval.tests.test_extraction.TestSilentVsLoudExtractingLine.test_non_silent_valid_fetch_prints_extracting_line",
|
| 23 |
+
"eval.tests.test_extraction.TestSilentVsLoudExtractingLine.test_silent_valid_fetch_suppresses_extracting_line",
|
| 24 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_no_extractable_links_yields_empty_output[empty]",
|
| 25 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_no_extractable_links_yields_empty_output[no_html_tags]",
|
| 26 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_no_extractable_links_yields_empty_output[whitespace_only]",
|
| 27 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_non_200_status_body_still_parsed[301]",
|
| 28 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_non_200_status_body_still_parsed[403]",
|
| 29 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_non_200_status_body_still_parsed[404]",
|
| 30 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_non_200_status_body_still_parsed[500]",
|
| 31 |
+
"eval.tests.test_extraction.TestSimpleAndEmptyResponses.test_single_href",
|
| 32 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_absolute_http_urls_are_urls",
|
| 33 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_bare_hash_href_is_skipped",
|
| 34 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_document_order_preserved",
|
| 35 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_fragment_href_is_a_path",
|
| 36 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_non_web_schemes_are_paths",
|
| 37 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_relative_values_are_paths",
|
| 38 |
+
"eval.tests.test_extraction.TestUrlPathClassification.test_script_and_link_href_parsed",
|
| 39 |
+
"eval.tests.test_extraction.TestUrlReconstruction.test_cookie_interior_preserved_surrounding_trimmed",
|
| 40 |
+
"eval.tests.test_extraction.TestUrlReconstruction.test_query_string_preserved_in_request",
|
| 41 |
+
"eval.tests.test_extraction.TestUrlReconstruction.test_subpath_preserved_in_request",
|
| 42 |
+
"eval.tests.test_help_args.TestHelp.test_dash_h_does_not_print_banner",
|
| 43 |
+
"eval.tests.test_help_args.TestHelp.test_dash_h_prints_custom_help",
|
| 44 |
+
"eval.tests.test_help_args.TestHelp.test_double_dash_help_same_as_flag_default",
|
| 45 |
+
"eval.tests.test_help_args.TestHelp.test_long_help_flag_uses_flag_default_usage",
|
| 46 |
+
"eval.tests.test_help_args.TestNoTarget.test_empty_target_treated_as_missing",
|
| 47 |
+
"eval.tests.test_help_args.TestNoTarget.test_no_arguments_prints_banner_then_prompt",
|
| 48 |
+
"eval.tests.test_help_args.TestNoTarget.test_silent_no_target_omits_banner",
|
| 49 |
+
"eval.tests.test_help_args.TestNoTarget.test_silent_with_help_still_prints_help",
|
| 50 |
+
"eval.tests.test_help_args.TestUrlPathFlagConflict.test_uO_and_pO_are_mutually_exclusive",
|
| 51 |
+
"eval.tests.test_help_args.TestUrlValidation.test_empty_host_lookup_error",
|
| 52 |
+
"eval.tests.test_help_args.TestUrlValidation.test_ftp_scheme_rejected",
|
| 53 |
+
"eval.tests.test_help_args.TestUrlValidation.test_non_http_schemes_rejected[data]",
|
| 54 |
+
"eval.tests.test_help_args.TestUrlValidation.test_non_http_schemes_rejected[file]",
|
| 55 |
+
"eval.tests.test_help_args.TestUrlValidation.test_non_http_schemes_rejected[javascript]",
|
| 56 |
+
"eval.tests.test_help_args.TestUrlValidation.test_non_http_schemes_rejected[mailto]",
|
| 57 |
+
"eval.tests.test_help_args.TestUrlValidation.test_non_http_schemes_rejected[ws]",
|
| 58 |
+
"eval.tests.test_help_args.TestUrlValidation.test_nonexistent_host_lookup_error",
|
| 59 |
+
"eval.tests.test_help_args.TestUrlValidation.test_reachable_ip_with_port_fails_fetch",
|
| 60 |
+
"eval.tests.test_help_args.TestUrlValidation.test_url_parse_error_reported",
|
| 61 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_blindly_two_part_non_digit",
|
| 62 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[host_not_ip]",
|
| 63 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[ip_out_of_range]",
|
| 64 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[ipv6_multiple_colons]",
|
| 65 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[leading_space]",
|
| 66 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[missing_port]",
|
| 67 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[non_ip_port_pair]",
|
| 68 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[port_non_numeric]",
|
| 69 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[port_overflow]",
|
| 70 |
+
"eval.tests.test_proxy.TestInvalidProxy.test_rejects_malformed_proxy[port_zero]",
|
| 71 |
+
"eval.tests.test_proxy.TestValidProxyTransport.test_valid_proxy_attempts_connection",
|
| 72 |
+
"eval.tests.test_proxy.TestValidProxyTransport.test_valid_proxy_non_silent_reports_usage"
|
| 73 |
+
]
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
"commit": "bd2143dd6b7b47f037e6d14ae1dfc79798099791",
|
| 77 |
+
"data_source": "synthetic_programgym",
|
| 78 |
+
"difficulty": "easy",
|
| 79 |
+
"difficulty_score": 0.7909884750888159,
|
| 80 |
+
"eval_clean_hashes": [
|
| 81 |
+
"e14ca0a2afd10828a151227d4c3a5f4015ec87f48a9cb3930a74ea7e301321a4"
|
| 82 |
+
],
|
| 83 |
+
"input_record": {
|
| 84 |
+
"commit": "bd2143dd6b7b47f037e6d14ae1dfc79798099791",
|
| 85 |
+
"commits": 1,
|
| 86 |
+
"contributors": 1,
|
| 87 |
+
"difficulty": "easy",
|
| 88 |
+
"difficulty_code_lines": 309,
|
| 89 |
+
"difficulty_has_tests": false,
|
| 90 |
+
"difficulty_product_code_lines": 309,
|
| 91 |
+
"difficulty_runtime_deps": 1,
|
| 92 |
+
"difficulty_score": 0.7909884750888159,
|
| 93 |
+
"difficulty_test_code_lines": 0,
|
| 94 |
+
"full_name": "trap-bytes/gourlex",
|
| 95 |
+
"github_stars": 257,
|
| 96 |
+
"input_joern_zip": "go_joern/trap-bytes__gourlex.zip",
|
| 97 |
+
"joern_status": true,
|
| 98 |
+
"joern_time": 15.513831872027367,
|
| 99 |
+
"language": "go",
|
| 100 |
+
"pb_match": [
|
| 101 |
+
{
|
| 102 |
+
"pb_fullname": "antonmedv/walk",
|
| 103 |
+
"rank": 752,
|
| 104 |
+
"similarity": 0.4647918939590454
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"pb_fullname": "mikefarah/yq",
|
| 108 |
+
"rank": 595,
|
| 109 |
+
"similarity": 0.5244033336639404
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"pb_fullname": "rs/curlie",
|
| 113 |
+
"rank": 156,
|
| 114 |
+
"similarity": 0.541191577911377
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"pb_fullname": "johnkerl/miller",
|
| 118 |
+
"rank": 910,
|
| 119 |
+
"similarity": 0.4590494632720947
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"pb_fullname": "direnv/direnv",
|
| 123 |
+
"rank": 567,
|
| 124 |
+
"similarity": 0.42421746253967285
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"pb_fullname": "JohannesKaufmann/html-to-markdown",
|
| 128 |
+
"rank": 238,
|
| 129 |
+
"similarity": 0.5141454339027405
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"pb_fullname": "alecthomas/chroma",
|
| 133 |
+
"rank": 715,
|
| 134 |
+
"similarity": 0.4663066864013672
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"pb_fullname": "multiprocessio/dsq",
|
| 138 |
+
"rank": 837,
|
| 139 |
+
"similarity": 0.4610535204410553
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"pb_fullname": "astaxie/bat",
|
| 143 |
+
"rank": 400,
|
| 144 |
+
"similarity": 0.5465945601463318
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"pb_fullname": "noborus/ov",
|
| 148 |
+
"rank": 737,
|
| 149 |
+
"similarity": 0.4959917664527893
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
"pb_fullname": "sibprogrammer/xq",
|
| 153 |
+
"rank": 2,
|
| 154 |
+
"similarity": 0.6404078006744385
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"pb_fullname": "raviqqe/muffet",
|
| 158 |
+
"rank": 13,
|
| 159 |
+
"similarity": 0.6440632939338684
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"pb_fullname": "eliukblau/pixterm",
|
| 163 |
+
"rank": 909,
|
| 164 |
+
"similarity": 0.48980802297592163
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"pb_fullname": "cheat/cheat",
|
| 168 |
+
"rank": 900,
|
| 169 |
+
"similarity": 0.48465585708618164
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"pb_fullname": "antonmedv/fx",
|
| 173 |
+
"rank": 741,
|
| 174 |
+
"similarity": 0.4781547784805298
|
| 175 |
+
},
|
| 176 |
+
{
|
| 177 |
+
"pb_fullname": "dundee/gdu",
|
| 178 |
+
"rank": 628,
|
| 179 |
+
"similarity": 0.4928773045539856
|
| 180 |
+
},
|
| 181 |
+
{
|
| 182 |
+
"pb_fullname": "tomnomnom/gron",
|
| 183 |
+
"rank": 101,
|
| 184 |
+
"similarity": 0.5448650121688843
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"pb_fullname": "junegunn/fzf",
|
| 188 |
+
"rank": 456,
|
| 189 |
+
"similarity": 0.4826734662055969
|
| 190 |
+
},
|
| 191 |
+
{
|
| 192 |
+
"pb_fullname": "zk-org/zk",
|
| 193 |
+
"rank": 775,
|
| 194 |
+
"similarity": 0.5266968011856079
|
| 195 |
+
}
|
| 196 |
+
],
|
| 197 |
+
"repo_age": 2.38,
|
| 198 |
+
"repo_path": "go/trap-bytes__gourlex",
|
| 199 |
+
"source": "commit:bd2143dd6b7b47f037e6d14ae1dfc79798099791",
|
| 200 |
+
"status": "done",
|
| 201 |
+
"url": "https://github.com/trap-bytes/gourlex"
|
| 202 |
+
},
|
| 203 |
+
"instance_id": "trap-bytes__gourlex.bd2143d",
|
| 204 |
+
"language": "go",
|
| 205 |
+
"module_iterations": [
|
| 206 |
+
{
|
| 207 |
+
"actual_iterations": 3,
|
| 208 |
+
"branch_name": "generated_module_01",
|
| 209 |
+
"iteration_limit": 5,
|
| 210 |
+
"module_index": 1,
|
| 211 |
+
"module_kind": "source",
|
| 212 |
+
"termination_reason": "module_coverage_threshold_reached"
|
| 213 |
+
}
|
| 214 |
+
],
|
| 215 |
+
"repository": "trap-bytes/gourlex"
|
| 216 |
+
}
|
trap-bytes--gourlex.bd2143d/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
|
trap-bytes--gourlex.bd2143d/tests/workspace.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0989c5c4863a711c6806edeaae8aaabb1f86a366845245ebd9380cb332aa943
|
| 3 |
+
size 869
|
trashhalo--imgcat.8ed8c30/environment/Dockerfile
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:24.04
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
|
| 4 |
+
ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
|
| 5 |
+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
| 6 |
+
ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
|
| 7 |
+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
| 8 |
+
ENV GOPROXY="https://proxy.golang.org,direct"
|
| 9 |
+
ENV GOSUMDB=sum.golang.google.cn
|
| 10 |
+
ENV GOTOOLCHAIN=auto
|
| 11 |
+
ENV UV_INSECURE_HOST=""
|
| 12 |
+
ENV UV_INDEX_URL="https://pypi.org/simple"
|
| 13 |
+
ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 14 |
+
ENV UV_CACHE_DIR=/workspace/.cache/uv
|
| 15 |
+
ENV npm_config_registry="https://registry.npmjs.org/"
|
| 16 |
+
ENV npm_config_strict_ssl=false
|
| 17 |
+
ENV npm_config_cache=/workspace/.cache/npm
|
| 18 |
+
ENV PIP_INDEX_URL="https://pypi.org/simple"
|
| 19 |
+
ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
|
| 20 |
+
ENV PIP_TRUSTED_HOST=""
|
| 21 |
+
ENV HOME=/workspace
|
| 22 |
+
ENV XDG_CACHE_HOME=/workspace/.cache
|
| 23 |
+
ENV PIP_CACHE_DIR=/workspace/.cache/pip
|
| 24 |
+
ENV PYTHONUSERBASE=/workspace/.local
|
| 25 |
+
ENV GOROOT=/usr/local/go
|
| 26 |
+
ENV GOPATH=/workspace/.go
|
| 27 |
+
ENV GOCACHE=/workspace/.cache/go-build
|
| 28 |
+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
| 29 |
+
ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
| 30 |
+
ENV PAGER=cat
|
| 31 |
+
ENV MANPAGER=cat
|
| 32 |
+
ENV LESS=-R
|
| 33 |
+
ENV TQDM_DISABLE=1
|
| 34 |
+
ENV VIRTUAL_ENV=/opt/programgym-venv
|
| 35 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
|
| 36 |
+
COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
|
| 37 |
+
RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
|
| 38 |
+
RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
|
| 39 |
+
WORKDIR /workspace
|
| 40 |
+
ADD workspace.tar.gz /workspace/
|
| 41 |
+
COPY executable /workspace/executable
|
| 42 |
+
COPY download.sh /workspace/download.sh
|
| 43 |
+
RUN chmod 755 /workspace/download.sh
|
| 44 |
+
COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
|
| 45 |
+
RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
|
| 46 |
+
&& /bin/bash /tmp/harbor_prepare_download_env.sh \
|
| 47 |
+
&& rm -f /workspace/download.sh \
|
| 48 |
+
&& rm -f /tmp/harbor_prepare_download_env.sh
|
| 49 |
+
ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
|
| 50 |
+
RUN chmod 111 /workspace/executable
|
| 51 |
+
WORKDIR /workspace
|
| 52 |
+
# programgym-runtime-workspace-cleanup: v1
|
| 53 |
+
RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
|
| 54 |
+
# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
|
| 55 |
+
# Keep tool/runtime state under /home/agent and reserve /workspace for the
|
| 56 |
+
# submission handed to the separate verifier. Keep the reference executable
|
| 57 |
+
# execute-only; the oracle temporarily restores owner read permission.
|
| 58 |
+
RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
|
| 59 |
+
RUN mkdir -p /home/agent \
|
| 60 |
+
&& chown -R agent:agent /home/agent /workspace \
|
| 61 |
+
&& chown agent:agent /workspace/executable \
|
| 62 |
+
&& chmod 111 /workspace/executable
|
| 63 |
+
ENV HOME=/home/agent
|
| 64 |
+
WORKDIR /workspace
|
trashhalo--imgcat.8ed8c30/environment/download.sh
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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/trashhalo/imgcat
|
| 9 |
+
|
| 10 |
+
go 1.14
|
| 11 |
+
|
| 12 |
+
require (
|
| 13 |
+
github.com/charmbracelet/bubbletea v0.20.0
|
| 14 |
+
github.com/disintegration/gift v1.2.1 // indirect
|
| 15 |
+
github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec
|
| 16 |
+
github.com/lucasb-eyer/go-colorful v1.2.0
|
| 17 |
+
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
|
| 18 |
+
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739
|
| 19 |
+
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
| 20 |
+
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44
|
| 21 |
+
github.com/srwiley/rasterx v0.0.0-20220128185129-2efea2b9ea41
|
| 22 |
+
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect
|
| 23 |
+
golang.org/x/net v0.0.0-20220513224357-95641704303c // indirect
|
| 24 |
+
golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a
|
| 25 |
+
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
|
| 26 |
+
)
|
| 27 |
+
PROGRAMGYM_GO_MOD_EOF
|
| 28 |
+
cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF'
|
| 29 |
+
github.com/charmbracelet/bubbletea v0.20.0 h1:/b8LEPgCbNr7WWZ2LuE/BV1/r4t5PyYJtDb+J3vpwxc=
|
| 30 |
+
github.com/charmbracelet/bubbletea v0.20.0/go.mod h1:zpkze1Rioo4rJELjRyGlm9T2YNou1Fm4LIJQSa5QMEM=
|
| 31 |
+
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
|
| 32 |
+
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
|
| 33 |
+
github.com/disintegration/gift v1.1.2/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI=
|
| 34 |
+
github.com/disintegration/gift v1.2.1 h1:Y005a1X4Z7Uc+0gLpSAsKhWi4qLtsdEcMIbbdvdZ6pc=
|
| 35 |
+
github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI=
|
| 36 |
+
github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec h1:YrB6aVr9touOt75I9O1SiancmR2GMg45U9UYf0gtgWg=
|
| 37 |
+
github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec/go.mod h1:K0KBFIr1gWu/C1Gp10nFAcAE4hsB7JxE6OgLijrJ8Sk=
|
| 38 |
+
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
| 39 |
+
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
| 40 |
+
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
| 41 |
+
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
| 42 |
+
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
| 43 |
+
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
| 44 |
+
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
| 45 |
+
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho=
|
| 46 |
+
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 h1:kMlmsLSbjkikxQJ1IPwaM+7LJ9ltFu/fi8CRzvSnQmA=
|
| 47 |
+
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho=
|
| 48 |
+
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
|
| 49 |
+
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
|
| 50 |
+
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 h1:QANkGiGr39l1EESqrE0gZw0/AJNYzIvoGLhIoVYtluI=
|
| 51 |
+
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=
|
| 52 |
+
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
| 53 |
+
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
| 54 |
+
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
| 55 |
+
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
| 56 |
+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
| 57 |
+
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44 h1:XPYXKIuH/n5zpUoEWk2jWV/SjEMNYmqDYmTgbjmhtaI=
|
| 58 |
+
github.com/srwiley/oksvg v0.0.0-20220128195007-1f435e4c2b44/go.mod h1:cNQ3dwVJtS5Hmnjxy6AgTPd0Inb3pW05ftPSX7NZO7Q=
|
| 59 |
+
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
| 60 |
+
github.com/srwiley/rasterx v0.0.0-20220128185129-2efea2b9ea41 h1:YR16ysw3I1bqwtEcYV9dpvhHEe7j55hIClkLoAqY31I=
|
| 61 |
+
github.com/srwiley/rasterx v0.0.0-20220128185129-2efea2b9ea41/go.mod h1:nXTWP6+gD5+LUJ8krVhhoeHjvHTutPxMYl5SvkcnJNE=
|
| 62 |
+
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
| 63 |
+
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 h1:LRtI4W37N+KFebI/qV0OFiLUv4GLOWeEW5hn/KEJvxE=
|
| 64 |
+
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
| 65 |
+
golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
| 66 |
+
golang.org/x/net v0.0.0-20220513224357-95641704303c h1:nF9mHSvoKBLkQNQhJZNsc66z2UzAMUbLGjC95CF3pU0=
|
| 67 |
+
golang.org/x/net v0.0.0-20220513224357-95641704303c/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
| 68 |
+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 69 |
+
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 70 |
+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 71 |
+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 72 |
+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 73 |
+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 74 |
+
golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXHCguynGhKjWVsIUt5cY=
|
| 75 |
+
golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 76 |
+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
| 77 |
+
golang.org/x/term v0.0.0-20210422114643-f5beecf764ed/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
| 78 |
+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 79 |
+
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 h1:EH1Deb8WZJ0xc0WK//leUHXcX9aLE5SymusoTmMZye8=
|
| 80 |
+
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
| 81 |
+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
| 82 |
+
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
| 83 |
+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
| 84 |
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 85 |
+
PROGRAMGYM_GO_SUM_EOF
|
| 86 |
+
PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
|
| 87 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
|
| 88 |
+
case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
|
| 89 |
+
*"|"*|*","*)
|
| 90 |
+
PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
|
| 91 |
+
PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
|
| 92 |
+
if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
|
| 93 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
|
| 94 |
+
fi
|
| 95 |
+
;;
|
| 96 |
+
esac
|
| 97 |
+
if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
|
| 98 |
+
PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
|
| 99 |
+
fi
|
| 100 |
+
cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
|
| 101 |
+
import os
|
| 102 |
+
import signal
|
| 103 |
+
import subprocess
|
| 104 |
+
import sys
|
| 105 |
+
import time
|
| 106 |
+
|
| 107 |
+
sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
|
| 108 |
+
if not command:
|
| 109 |
+
raise SystemExit(125)
|
| 110 |
+
environment = os.environ.copy()
|
| 111 |
+
environment["GOPROXY"] = proxy
|
| 112 |
+
process = subprocess.Popen(command, env=environment, start_new_session=True)
|
| 113 |
+
try:
|
| 114 |
+
returncode = process.wait(timeout=float(timeout_text))
|
| 115 |
+
except subprocess.TimeoutExpired:
|
| 116 |
+
with open(sentinel_path, "w", encoding="utf-8") as sentinel:
|
| 117 |
+
sentinel.write("expired\n")
|
| 118 |
+
try:
|
| 119 |
+
os.killpg(process.pid, signal.SIGTERM)
|
| 120 |
+
except ProcessLookupError:
|
| 121 |
+
pass
|
| 122 |
+
deadline = time.monotonic() + float(grace_text)
|
| 123 |
+
group_alive = True
|
| 124 |
+
while time.monotonic() < deadline:
|
| 125 |
+
process.poll()
|
| 126 |
+
try:
|
| 127 |
+
os.killpg(process.pid, 0)
|
| 128 |
+
except ProcessLookupError:
|
| 129 |
+
group_alive = False
|
| 130 |
+
break
|
| 131 |
+
time.sleep(0.05)
|
| 132 |
+
if group_alive:
|
| 133 |
+
try:
|
| 134 |
+
os.killpg(process.pid, signal.SIGKILL)
|
| 135 |
+
except ProcessLookupError:
|
| 136 |
+
pass
|
| 137 |
+
process.wait()
|
| 138 |
+
raise SystemExit(124)
|
| 139 |
+
if returncode < 0:
|
| 140 |
+
returncode = 128 - returncode
|
| 141 |
+
raise SystemExit(returncode)
|
| 142 |
+
PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
|
| 143 |
+
PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
|
| 144 |
+
if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
|
| 145 |
+
printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
|
| 146 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 147 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 148 |
+
return 1
|
| 149 |
+
else
|
| 150 |
+
exit 1
|
| 151 |
+
fi
|
| 152 |
+
fi
|
| 153 |
+
if ! command -v python3 >/dev/null 2>&1; then
|
| 154 |
+
printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
|
| 155 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 156 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 157 |
+
return 1
|
| 158 |
+
else
|
| 159 |
+
exit 1
|
| 160 |
+
fi
|
| 161 |
+
fi
|
| 162 |
+
_programgym_go_with_nexus_timeout() {
|
| 163 |
+
local programgym_go_rc
|
| 164 |
+
local programgym_go_timeout_sentinel
|
| 165 |
+
if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
|
| 166 |
+
return 1
|
| 167 |
+
fi
|
| 168 |
+
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
|
| 169 |
+
programgym_go_rc=0
|
| 170 |
+
else
|
| 171 |
+
programgym_go_rc=$?
|
| 172 |
+
fi
|
| 173 |
+
if [ ! -s "$programgym_go_timeout_sentinel" ]; then
|
| 174 |
+
rm -f "$programgym_go_timeout_sentinel"
|
| 175 |
+
return "$programgym_go_rc"
|
| 176 |
+
fi
|
| 177 |
+
rm -f "$programgym_go_timeout_sentinel"
|
| 178 |
+
if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
|
| 179 |
+
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
|
| 180 |
+
return "$programgym_go_rc"
|
| 181 |
+
fi
|
| 182 |
+
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
|
| 183 |
+
env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
|
| 184 |
+
}
|
| 185 |
+
PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
|
| 186 |
+
if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
|
| 187 |
+
printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
|
| 188 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 189 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 190 |
+
return 1
|
| 191 |
+
else
|
| 192 |
+
exit 1
|
| 193 |
+
fi
|
| 194 |
+
fi
|
| 195 |
+
if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
|
| 196 |
+
PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
|
| 197 |
+
mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 198 |
+
cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
|
| 199 |
+
export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
|
| 200 |
+
else
|
| 201 |
+
export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
|
| 202 |
+
fi
|
| 203 |
+
export PATH="$GOROOT/bin:$PATH"
|
| 204 |
+
export GOTOOLCHAIN=local
|
| 205 |
+
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
|
| 206 |
+
printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2
|
| 207 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 208 |
+
if [ "${BASH_SOURCE[0]}" != "$0" ]; then
|
| 209 |
+
return 1
|
| 210 |
+
else
|
| 211 |
+
exit 1
|
| 212 |
+
fi
|
| 213 |
+
fi
|
| 214 |
+
rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
|
| 215 |
+
unset -f _programgym_go_with_nexus_timeout
|
| 216 |
+
unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
|
| 217 |
+
unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
|
| 218 |
+
unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
|
| 219 |
+
unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
|
| 220 |
+
unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
|
trashhalo--imgcat.8ed8c30/environment/executable
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:22cdec236de2d3c8a788aadb76c72055c69db230ead5c32d12e0f68fd0649b90
|
| 3 |
+
size 11083480
|
trashhalo--imgcat.8ed8c30/environment/harbor_prepare_download_env.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
cd /workspace
|
| 4 |
+
set -a
|
| 5 |
+
source /workspace/download.sh
|
| 6 |
+
set +a
|
| 7 |
+
python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
|
| 8 |
+
import os
|
| 9 |
+
import shlex
|
| 10 |
+
|
| 11 |
+
ignored = {
|
| 12 |
+
"ALL_PROXY",
|
| 13 |
+
"HTTP_PROXY",
|
| 14 |
+
"HTTPS_PROXY",
|
| 15 |
+
"NO_PROXY",
|
| 16 |
+
"OLDPWD",
|
| 17 |
+
"PIP_PROXY",
|
| 18 |
+
"PWD",
|
| 19 |
+
"SHLVL",
|
| 20 |
+
"_",
|
| 21 |
+
"all_proxy",
|
| 22 |
+
"http_proxy",
|
| 23 |
+
"https_proxy",
|
| 24 |
+
"no_proxy",
|
| 25 |
+
"pip_proxy",
|
| 26 |
+
}
|
| 27 |
+
for key in sorted(os.environ):
|
| 28 |
+
if key in ignored or key.startswith("BASH_FUNC_"):
|
| 29 |
+
continue
|
| 30 |
+
value = os.environ[key]
|
| 31 |
+
if "\n" in value:
|
| 32 |
+
continue
|
| 33 |
+
print(f"export {key}={shlex.quote(value)}")
|
| 34 |
+
PY
|